gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... | |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
########################################################################
# Author: J. Kelly Flanagan
# Copyright (c) 2015
#
# myDoorbellVolume.py reads the downloaded configuration file and sets
# the mixers volume to the values from the configuration
#
# This program is intended to be started each minute by cron and e... | |
#! /usr/bin/env python
'''Image/Video utilities'''
try:
import cv2
opencvAvailable = True
except ImportError:
print('OpenCV library could not be loaded (video replay functions will not be available)') # TODO change to logging module
opencvAvailable = False
try:
import skimage
skimageAvailable =... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from tes... | |
# Copyright 2012, Intel, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of c... | |
"""
Form Widget classes specific to the Django admin site.
"""
import copy
import json
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.models.deletion import CASCADE
from django.urls import reverse
from django.urls.exceptions import NoReverseM... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
from test import support
import random
import unittest
from functools import cmp_to_key
verbose = support.verbose
nerrors = 0
def check(tag, expected, raw, compare=None):
global nerrors
if verbose:
print(" checking", tag)
orig = raw[:] # save input in case of error
if compare:
... | |
"""
This file is part of The Cannon analysis project.
Copyright 2014 Melissa Ness.
# urls
- http://iopscience.iop.org/1538-3881/146/5/133/suppdata/aj485195t4_mrt.txt for calibration stars
- http://data.sdss3.org/irSpectrumDetail?locid=4330&commiss=0&apogeeid=2M17411636-2903150&show_aspcap=True object explorer
- http... | |
# -*- coding: utf-8 -*-
from urlparse import urlparse
from nose.tools import * # flake8: noqa
from framework.auth.core import Auth
from website.models import NodeLog
from website.views import find_dashboard
from website.util import permissions
from website.util.sanitize import strip_html
from api.base.settings.defa... | |
'''
LICENSING
-------------------------------------------------
loopa: Arduino-esque event loop app framework, and other utilities.
Copyright (C) 2016 Muterra, Inc.
Contributors
------------
Nick Badger
badg@muterra.io | badg@nickbadger.com | nickbadger.com
This library is free softwa... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 15 16:51:46 2017
@author: mkonrad
"""
import pytest
from hypothesis import given
import hypothesis.strategies as st
import numpy as np
from scipy.stats import chisquare
from pdftabextract.clustering import (find_clusters_1d_break_dist, zip_clusters_and_values, calc_clu... | |
# -*- coding: utf-8 -*-
from os.path import dirname, relpath, join
from nose.plugins.skip import SkipTest
from nose.tools import assert_true, assert_equals, assert_is_instance, \
assert_raises_regexp, with_setup
from diylisp.interpreter import interpret, interpret_file
from diylisp.types import Environment, Stri... | |
# util/langhelpers.py
# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Routines to help with the creation, loading and introspection of
modules, class... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
from django.core.urlresolvers import reverse_lazy
import os,sys
from os.path import dirname, join, exists
import logging.config
LOGFILE_BASE = 'wsgi'
#print os.environ
if 'django_mode' in os.environ:
#if 'mod_wsgi.process_group' in os.environ:
LOGFILE_BASE = 'wsgi'
else:
print "running debug server"
... | |
# stdlib
from datetime import datetime
import os.path
import re
import socket
import ssl
import time
import warnings
from urlparse import urlparse
# 3rd party
import requests
import tornado
from requests.adapters import HTTPAdapter
from requests.packages import urllib3
from requests.packages.urllib3.util import ssl_
... | |
import sys
from numpy.testing import *
from numpy.core import *
# Guess the UCS length for this python interpreter
if len(buffer(u'u')) == 4:
ucs4 = True
else:
ucs4 = False
# Value that can be represented in UCS2 interpreters
ucs2_value = u'\uFFFF'
# Value that cannot be represented in UCS2 interpreters (but ... | |
# Copyright (C) 2014 - The MITRE Corporation
# For license information, see the LICENSE.txt file
#: Namespace map of namespaces libtaxii knows about
NS_MAP = {
'taxii': 'http://taxii.mitre.org/messages/taxii_xml_binding-1',
'taxii_11': 'http://taxii.mitre.org/messages/taxii_xml_binding-1.1',
'tdq': 'http:/... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import pytest
from musixmatch import Musixmatch
from . import results
class TestMusixmatch:
@classmethod
def setup_class(cls):
cls.musixmatch = Musixmatch("test")
cls.url = "http://api.musixmatch.com/ws/1.1/"
def test_get_url(self):
assert (
self.musixmatch._get_url(... | |
# Copyright 2014-2015 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | |
import jsonschema
import pytest
from ..schemapi import (UndefinedType, SchemaBase, Undefined, _FromDict,
SchemaValidationError)
# Make tests inherit from _TestSchema, so that when we test from_dict it won't
# try to use SchemaBase objects defined elsewhere as wrappers.
class _TestSchema(Schem... | |
# -*- coding: utf-8 -*-
"""
sphinx.util.jsdump
~~~~~~~~~~~~~~~~~~
This module implements a simple JavaScript serializer.
Uses the basestring encode function from simplejson by Bob Ippolito.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.... | |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | |
#!/usr/bin/env python
"""Unittest for grr frontend server."""
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import,g-bad-import-order
from grr.lib import communicator
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import fl... | |
from __future__ import division
from collections import defaultdict
import numpy
from scipy import ndimage
DISTANCE = numpy.sqrt([
2., 1., 2.,
1., 1., 1.,
2., 1., 2.
])
DIR_MAP = dict(zip(range(9), [32, 64, 128, 16, -1, 1, 8, 4, 2]))
FLOWS_IN = numpy.array([2, 4, 8, 1, numpy.nan, 16, 128, 64, 32])
def ... | |
import unittest
import functools
import numpy
from operator import mul
import chainer
from chainer.backends import cuda
import chainer.functions as F
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import conv
@... | |
"""
PyScript standard functions.
Functions are declared as ... functions. Methods are written as methods
(using this), but declared as functions, and then "apply()-ed" to the
instance of interest. Declaring methods on Object is a bad idea (breaks
Bokeh, jquery).
"""
import re
# Functions not covered by this lib:
# ... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""Client implementation for talking to the geard daemon."""
import json
from zope.interface import Interface, implementer
from characteristic import attributes
from twisted.internet.defer import succeed, fail
from twisted.internet.task import deferLater... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Cloudscaling Group, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LI... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | |
# Copyright 2014-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
# Copyright 2015 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | |
"""Config flow for Apple TV integration."""
from ipaddress import ip_address
import logging
from random import randrange
from pyatv import exceptions, pair, scan
from pyatv.const import Protocol
from pyatv.convert import protocol_str
import voluptuous as vol
from homeassistant import config_entries
from homeassistant... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2013 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.... | |
##########################################################################
#
# Copyright (c) 2020, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | |
#!/usr/bin/env python2.5
#
# Copyright 2010 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | |
# Copyright 2011,2012 James McCauley
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
import collections
import os
import sys
import numpy
try:
from PIL import Image
available = True
except ImportError as e:
available = False
_import_error = e
import chainer
from chainer.dataset.convert import concat_examples
from chainer.dataset import download
from chainer import function
from chaine... | |
#This will be for creating new characters
#imports
import os.path
class NewCharacter(object):
def __init__(
self, c_p, s_p, e_p, g_p, p_p,\
paralyzation_poison_death_magic,\
rod_staff_wand,\
petrification_polymorph,\
breath_weapon, spell,\
... | |
#!/usr/bin/env python
"""
EvoLife Cellular Automaton implementation using CUDA.
Rules are:
- Each living cell has its own birth/sustain ruleset and an energy level;
- Cell is loosing all energy if number of neighbours is not in its sustain rule;
- Cell is born with max energy if there are exactly N neighbours with N i... | |
import numpy as np
#import networkx as nx
from random import choice, random
#import math
import pandas as pd
import vincent
get_ipython().run_cell_magic(u'html', u'', u'<div id="d3-example"></div>\n<style>\n.node {stroke: #fff; stroke-width: 1.5px;}\nmarker {stroke: #999;}\n.link {stroke: #999; stroke-opacity: .3;}\... | |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, copy, os, pickle, warnings
from twisted.trial import unittest, util
from twisted.application import service, internet, app
from twisted.persisted import sob
from twisted.python import log, usage
from twisted.python.util impo... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# h... | |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | |
#!/usr/bin/python
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
#
# GNU Zebra is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
#
# GN... | |
from random import uniform
import numpy as np
import theano
from theano import config
import theano.tensor as tensor
from theano.tensor.signal import downsample
from collections import OrderedDict, defaultdict
def randi(N):
""" get random integer in range [0, N) """
return int(uniform(0, N))
def merge_init_struct... | |
import logging
import os
from pprint import pformat
from typing import Union, List
import pandas as pd
import yaml
from ludwig.backend import Backend, initialize_backend
from ludwig.constants import HYPEROPT, TRAINING, VALIDATION, TEST, COMBINED, \
LOSS, TYPE, RAY
from ludwig.features.feature_registries import ou... | |
import collections
import logging
import numpy as np
from typing import Any, List, Dict, Tuple, TYPE_CHECKING, Union
from ray.rllib.env.base_env import _DUMMY_AGENT_ID
from ray.rllib.evaluation.collectors.sample_collector import _SampleCollector
from ray.rllib.evaluation.episode import MultiAgentEpisode
from ray.rllib... | |
#! /usr/bin/env python
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
import re
import pandas as pd
#Table of elements with mcnp libraries
# Symbol Z Mass mcnp
_ELEMENTINFO = """H 1 1.00... | |
from __future__ import print_function
import tornado.web
from tornado import gen
import shlex # for calling spamc
from tornado.gen import Task, coroutine
import tornado.process
import tornado.web
import json
class MainHandler(tornado.web.RequestHandler):
def prepare(self):
self.PREDEFINED_HEADERS = {
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from base64 import b64encode
from mutagen.flac import FLAC, Picture
from mutagen.id3 import (
APIC, ID3, MCDI, TALB, TCOM, TCON, TDRC, TIT2, TLEN, TPE1, TPE2, TPOS, TPUB, TRCK, UFID
)
from mutagentools.flac import to_json_dict
from mutagentools.flac.convert import (
... | |
import itertools
import logging
import urlparse
import requests
from harvester.ext.crawler.base import CrawlerPluginBase
from harvester.utils import to_ordinal, report_progress
from . import DEFAULT_CLASSES
logger = logging.getLogger(__name__)
def safe_iter(iterable):
while True:
try:
yield... | |
from django.forms import models as model_forms
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseRedirect
from django.views.generic.base import TemplateResponseMixin, View
from django.views.generic.detail import (SingleObjectMixin,
SingleObjectTemplateRe... | |
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
# Copyright 2017 Xiaomi, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
import asyncio
import logging
from asyncio.coroutines import iscoroutine, coroutine
from functools import partial
import aiohttp
from again.utils import unique_hex
from retrial.retrial.retry import retry
from .exceptions import ClientNotFoundError, ClientDisconnected
from .packet import ControlPacket, MessagePacket
f... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python
#
# Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | |
# -*- coding: utf-8 -*-
"""Compound ZIP parser plugin for OpenXML files."""
from __future__ import unicode_literals
import re
import zipfile
from xml.parsers import expat
from defusedxml import ElementTree
from dfdatetime import time_elements as dfdatetime_time_elements
from plaso.containers import events
from pla... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import re
import stat
import optparse
import shutil
import imp
import codecs
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
from glob import glob
import atexit
# We have some ... | |
#! /usr/bin/python
# Copyright (c) 2007-8, Playful Invention Company
# Copyright (c) 2008-14, Walter Bender
# Copyright (c) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwa... | |
#!/usr/bin/env python
# encoding: utf-8
import numpy as np
import cv2
import sys, os
import argparse
import copy
from importlib import import_module
import DeepFried2 as df
from lbtoolbox.util import flipany, printnow
from training_utils import dotrain, dostats, dopred
from df_extras import BiternionCriterion
from c... | |
from django.utils.translation import ugettext_lazy as _
PERMISSIONS = (
(
'access_community',
_('Access Community'),
()
),
(
'viewupcoming_community',
_('View Upcoming Meeting'),
('access_community',)
),
(
'viewupcoming_draft',
_('View... | |
#!/usr/bin/python
import random
# TODO:
# Q: What quantity of middle bandwidth do you need to kill guards?
# A: Intuitively, you need the disable rate % of bandwidth, but you
# might have some edge cases to exploit with min_circs.
PATH_BIAS_PCT = 70
# XXX: Min_circs only actives the "notice" level logs
PATH_BIAS_MI... | |
#! /usr/bin/env python
############################################################
# Program is part of PySAR v1.0 #
# Copyright(c) 2013, Heresh Fattahi #
# Author: Heresh Fattahi #
#####################################################... | |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | |
# -*- coding: utf-8 -*-
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
# -*- coding: utf-8 -*-
""" Sahana Optical Character Recognision Utility (s3ocr)
@author: Suryajith Chillara <suryajith1987[at]gmail.com>
@author: Shiv Deepak <idlecool[at]gmail.com>
@copyright: 2009-2011 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, ... | |
# Copyright (c) 2011, Shutterstock Images LLC.
# All rights reserved.
#
# This file is subject to the MIT License (see the LICENSE file).
import datetime
import json
import os
import txmongo
import validictory
from twisted.internet import defer
from twisted.python import log
from oplog import utils
PARSE_ERROR = -327... | |
# Copyright 2015 Mirantis, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | |
import unittest
import numpy
import chainerx
from chainerx_tests import array_utils
from chainerx_tests import dtype_utils
class IgnoreNumpyFloatingPointError(object):
def __enter__(self):
self.old_settings = numpy.seterr(all='ignore')
def __exit__(self, *args):
numpy.seterr(**self.old_se... | |
# -*- coding: utf-8 -*-
import sys
import curses
import logging
from argparse import ArgumentParser, SUPPRESS as SUPPRESS
from os import path, getenv, environ
from sys import platform, version_info
from contextlib import contextmanager
from platform import system
from .radio import PyRadio
from .config import PyRadioC... | |
# Copyright (C) 2011 discretelogics
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in... | |
"""
Tests for the transport-agnostic engine module.
"""
import unittest
from coilmq.engine import StompEngine
from coilmq.util.frames import Frame, ReceiptFrame
from tests.mock import (MockAuthenticator, MockConnection, MockQueueManager, MockTopicManager)
__authors__ = ['"Hans Lellelid" <hans@xmpl.org>']
__copyright_... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | |
import sys, random, string, uuid, pickle, zlib, base64
from Bio.Range import GenomicRange, ranges_to_coverage, merge_ranges
from Bio.Sequence import rc
import Bio.Graph
class Transcript:
def __init__(self):
self._exons = []
self._junctions = []
self._direction = None
self._transcript_name = None
... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""Code to wrap some GLOO API calls."""
import numpy
import asyncio
try:
import pygloo
except ImportError:
raise ImportError("Can not import pygloo."
"Please run 'pip install pygloo' to install pygloo.")
import ray
from ray.util.collective.types import ReduceOp, torch_available
from ray.u... | |
#!/usr/bin/python
# Copyright 2015 Coron
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | |
import weakref
from abc import ABCMeta, abstractmethod
from datetime import datetime
import six
from corehq.util.pagination import PaginationEventHandler, TooManyRetries
class BulkProcessingFailed(Exception):
pass
DOCS_SKIPPED_WARNING = """
WARNING {} documents were not processed due to concurrent mod... | |
"""This module implements tools for integrating rational functions."""
from ..core import Dummy, I, Integer, Lambda, Symbol, symbols, sympify
from ..domains import ZZ
from ..functions import atan, log
from ..polys import Poly, RootSum, cancel, resultant, roots
from ..simplify import collect
from ..solvers import solve... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
"""
SoftLayer.tests.CLI.modules.dns_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import json
import os.path
import mock
from SoftLayer.CLI.dns import zone_import
from SoftLayer.CLI import exceptions
from SoftLayer import testing
class DnsTests(testing.Te... | |
# -*- coding: utf-8 -*-
"""
The heart and soul of Trigger, NetDevices is an abstract interface to network
device metadata and ACL associations.
Parses :setting:`NETDEVICES_SOURCE` and makes available a dictionary of
`~trigger.netdevices.NetDevice` objects, which is keyed by the FQDN of every
network device.
Other in... | |
#!/usr/bin/env python
#
# restrict_long_contigs.py
#
# USAGE: restrict_long_contigs.py [options] <input_directory> \
# <output_directory>
#
# Options:
# -h, --help show this help message and exit
# -l MINLEN, --minlen=MINLEN
# Minimum length o... | |
from abc import ABC, abstractmethod
from typing import *
from datetime import timedelta
from enum import Enum
from durationpy import from_str
from couchbase.options import QueryBaseOptions, enum_value
from couchbase_core.mapper import identity
from .n1ql import *
from couchbase_core.n1ql import N1QLRequest
from couch... | |
"""Tests for go.vumitools.middleware"""
import time
from twisted.internet.defer import inlineCallbacks, returnValue
from zope.interface import implements
from vumi.transports.failures import FailureMessage
from vumi.message import TransportUserMessage
from vumi.middleware.tagger import TaggingMiddleware
from vumi.te... | |
# pylint: disable=g-bad-file-header
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.