code stringlengths 1 199k |
|---|
"""Tests for saving/loading function for keras Model."""
import os
import shutil
from absl.testing import parameterized
import numpy as np
from tensorflow.python import keras
from tensorflow.python import tf2
from tensorflow.python.client import session
from tensorflow.python.eager import context
from tensorflow.python... |
import os
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
def size(file_path):
return os.path.getsize(file_path)
def remove(file_path):
os.remove(file_path)
def exists(file_path):
return os.path.exists(file_path)
def is_file(file_path):
return os.path.isfile(file_path)
def is_dir(dir_path):
r... |
import nova.conf
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import integrated_helpers
CONF = nova.conf.CONF
class RebuildVolumeBackedSameImage(integrated_helpers._IntegratedTestBase,
integrated_helpers.InstanceHelperMixin):
"""Tests the regression ... |
"""Tests for letsencrypt.client."""
import os
import shutil
import tempfile
import unittest
import OpenSSL
import mock
from acme import jose
from letsencrypt import account
from letsencrypt import errors
from letsencrypt import le_util
from letsencrypt.tests import test_util
KEY = test_util.load_vector("rsa512_key.pem"... |
"""ACL checks for endpoints exposed by auth_service."""
from components import auth
from components.auth.ui import acl
def has_access(identity=None):
"""Returns True if current caller can access groups and other auth data."""
return acl.has_access(identity)
def is_trusted_service(identity=None):
"""Returns True i... |
"""Support for manipulating tensors.
See the @{$python/array_ops} guide.
@@string_to_number
@@to_double
@@to_float
@@to_bfloat16
@@to_int32
@@to_int64
@@cast
@@bitcast
@@saturate_cast
@@broadcast_dynamic_shape
@@broadcast_static_shape
@@shape
@@shape_n
@@size
@@rank
@@reshape
@@squeeze
@@expand_dims
@@meshgrid
@@slice
... |
__version__ = "3.9.0" |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... |
import json
from tempfile import NamedTemporaryFile
from typing import Optional
from unittest import TestCase, mock
from airflow.providers.google.marketing_platform.operators.display_video import (
GoogleDisplayVideo360CreateReportOperator,
GoogleDisplayVideo360CreateSDFDownloadTaskOperator,
GoogleDisplayVi... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from twitter.common.collections import OrderedSet
from pants.backend.jvm.subsystems.shader import Shader
from pants.backend.jvm.targets.jar_dependency import ... |
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class BaseInstanceIntrospection(object):
"""Generic utility class for introspecting an instance.
:param conf:
The configuration object used by argus.
:param remote_client:
A client which can be used by argus.
This needs to be an i... |
"""Support for Twente Milieu."""
from __future__ import annotations
import asyncio
from datetime import timedelta
from twentemilieu import TwenteMilieu
import voluptuous as vol
from homeassistant.components.twentemilieu.const import (
CONF_HOUSE_LETTER,
CONF_HOUSE_NUMBER,
CONF_POST_CODE,
DATA_UPDATE,
... |
import os
from django.conf import settings
FAKE_PEP_REPO = os.path.join(settings.BASE, 'peps/tests/peps/')
FAKE_PEP_ARTIFACT = os.path.join(settings.BASE, 'peps/tests/peps.tar.gz') |
"""The tests for the StatsD feeder."""
from unittest import mock
from unittest.mock import MagicMock, patch
import pytest
import voluptuous as vol
import homeassistant.components.statsd as statsd
from homeassistant.const import EVENT_STATE_CHANGED, STATE_OFF, STATE_ON
import homeassistant.core as ha
from homeassistant.... |
"""Tests for Smart Containers Docker API Client.
Testing for Smart Containers Client.
This module extends the docker-py package to provide the ability to add
metadata to docker containers. It is meant to be a drop-in replacement the
docker-py package Client module. Existing methods that change the state of a
conainer ... |
from gppylib.mainUtils import *
from optparse import Option, OptionGroup, OptionParser, OptionValueError, SUPPRESS_USAGE
import os, sys, getopt, socket, io, signal, copy
from gppylib import gparray, gplog, pgconf, userinput, utils, heapchecksum
from gppylib.commands.base import Command
from gppylib.util import gp_utils... |
import datetime
import time
from typing import Any
from django.core.management.base import CommandParser
from zerver.lib.management import ZulipBaseCommand
from zerver.models import Message, Recipient, Stream
class Command(ZulipBaseCommand):
help = "Dump messages from public streams of a realm"
def add_argument... |
from pyspark.rdd import RDD
from pyspark.sql import DataFrame
from sparktk.frame.pyframe import PythonFrame
from sparktk.frame.schema import schema_to_python, schema_to_scala, schema_is_coercible
from sparktk import dtypes
import logging
logger = logging.getLogger('sparktk')
from sparktk.propobj import PropertiesObject... |
import urllib
from oslo.config import cfg
from nova import exception
from nova import utils
CONF = cfg.CONF
class SecurityGroupBase(object):
def parse_cidr(self, cidr):
if cidr:
try:
cidr = urllib.unquote(cidr).decode()
except Exception as e:
self.rais... |
import os
import sys
if __name__ == "__main__":
os.environ["DJANGO_SETTINGS_MODULE"] = "lino_book.projects.mldbc.settings"
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) |
"""
Flask-ZODB
----------
.. image:: http://packages.python.org/Flask-ZODB/_static/flask-zodb.png
Transparent and scalable persistence of Python objects for Flask
applications. Use it as your database or as a complement to another
database - for example PostgreSQL where you need to perform rich queries
and ZODB where ... |
from __future__ import print_function
import itertools
import os
import xml.etree.ElementTree as ET
import xml.dom.minidom
import numpy
from director.thirdparty import transformations
from naming import *
from conversions import *
models_path = os.path.expanduser('~/.gazebo/models/')
catkin_ws_path = os.path.expanduser... |
import json
import optparse
import os
import sys
def parse_args():
parse = optparse.OptionParser()
parse.add_option('--build_dir', default=os.getcwd())
parse.add_option('-o', '--output_json',
help='Output JSON information into a specified file')
return parse.parse_args()
def main():
options... |
class TestConfig:
def __init__(self):
# Where the testsuite root is
self.top = ''
# Directories below which to look for test description files (foo.T)
self.rootdirs = []
# Run these tests only (run all tests if empty)
self.only = []
# Accept new output which d... |
from __future__ import unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
F, Q, Avg, Count,... |
import math
import operator as op
import random
import array
import functools
try:
# Python 2
from itertools import izip_longest
except ImportError:
# Python 3
from itertools import zip_longest as izip_longest
from ..functions import static_key_order
from .solver_registry import register_solver
from .ut... |
"""
raven.utils
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import hashlib
import hmac
try:
import pkg_resources
except ImportError:
pkg_resources = None
import sys
def varmap(func, var, context=None, name=None):
... |
"""
Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting).
"""
import warnings
import numpy as np
from sklearn import datasets
from sklearn.base import clone
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.ensemble.gradi... |
"""Declarative container provider copying with ``@copy()`` decorator."""
from dependency_injector import containers, providers
class Service:
def __init__(self, dependency: str):
self.dependency = dependency
class Base(containers.DeclarativeContainer):
dependency = providers.Dependency(instance_of=str, ... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contacts', '0001_initial'),
('orgs', '0008_org_timezone'),
]
operations = [
migrations.CreateModel(
name='Answer',
fields... |
from genshi.builder import tag
from trac.core import Component, implements
from trac.perm import IPermissionRequestor
from trac.ticket.api import ITicketActionController
from trac.ticket.default_workflow import ConfigurableTicketWorkflow
revision = "$Rev$"
url = "$URL$"
class CodeReviewActionController(Component):
... |
from readthedocs.builds.models import Version
from django.core.management.base import BaseCommand
from readthedocs.projects.tasks import update_docs
class Command(BaseCommand):
"""Custom management command to rebuild documentation for all projects on
the site. Invoked via ``./manage.py update_repos``.
"""
... |
from __future__ import with_statement
import cherrypy
import webbrowser
import sqlite3
import datetime
import socket
import os, sys, subprocess, re
import urllib
from threading import Lock
from sickbeard import providers, metadata
from providers import ezrss, tvtorrents, torrentleech, btn, nzbsrus, newznab, womble, nzb... |
'''
Image
=====
Core classes for loading images and converting them to a
:class:`~kivy.graphics.texture.Texture`. The raw image data can be keep in
memory for further access.
In-memory image loading
-----------------------
.. versionadded:: 1.9.0
Official support for in-memory loading. Not all the providers support... |
"""Routines for IPv4 and IPv6 addresses, subnets and ranges."""
import sys as _sys
from netaddr.core import AddrFormatError, AddrConversionError, num_bits, \
DictDotLookup, NOHOST, N, INET_PTON, P, ZEROFILL, Z
from netaddr.strategy import ipv4 as _ipv4, ipv6 as _ipv6
from netaddr.compat import _sys_maxint, _iter_ra... |
""" Bluegiga BGAPI/BGLib demo: Bluegiga "Cable Replacement Profile" collector
Changelog:
2014-07-05 - Fix indication subscription to use 2-byte value
2013-07-22 - Initial release
============================================
Bluegiga BGLib Python interface library test cable replacement collector app
2014-07-05 ... |
from atestframe import *
from common import *
class TestCommon(unittest.TestCase):
def test_get_csv_fields(self):
""" test that quoted and unquoted fields are being recognized """
fields = get_csv_fields(u'something,"good",to "eat","like a ""hot""",dog',u',')
self.assertEqual(fields[0],u'som... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.forms.models import model_to_dict
from explorer.tests.factories import SimpleQueryFactory, QueryLogFactory
from explorer.models import Query, QueryLog
from explorer.views import user_can... |
"""unittest cases for dicom.charset module"""
import unittest
import dicom
import os.path
from pkg_resources import Requirement, resource_filename
testcharset_dir = resource_filename(Requirement.parse("pydicom"),
"dicom/testcharsetfiles")
latin1_file = os.path.join(te... |
"""The oceanoptics spectrometers use two different communication protocols.
One is called 'OBP protocol' # OceanBinaryProtocol
the other one 'OOI protocol' # ??? OceanOpticsInterface ??? maybe
The only spectrometers using the OBP protocol via USB are: STS, Ventana and QEPro
"""
import usb.core
import usb.util
import ... |
import datetime
import json
import utif
import re
cached_urls = {}
cached_urls_age = {}
record_urls = None
def clear_cached_urls():
"""
Called when all the url's ought to be discarded.
This is currently done at every command start to reclaim any
memory resources.
Also issued when any update or delet... |
'''OpenGL extension SGIX.texture_add_env
This module customises the behaviour of the
OpenGL.raw.GL.SGIX.texture_add_env to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/SGIX/texture_add_env.txt
'''
from OpenGL import platform, consta... |
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class libgsf(test.test):
"""
Autotest module for testing basic functionality
of libgsf
@author Athira Rajeev>
"""
version = 1
nfail = 0
path = ''
def initialize(self):
... |
specification = {}
specification = {
-2: # submodel id
[
"constant",
"urbansim.gridcell.travel_time_to_CBD",
"urbansim.gridcell.ln_residential_units_within_walking_distance",\
]
} |
"""
Created on Sun Jun 1 15:35:13 2014
@author: subhasis ray
"""
import moose
def make_nmda(path):
nmda = moose.MarkovChannel(path)
return nmda |
"""Self-tests for (some of) Cryptodome.Util.number"""
from Cryptodome.Util.py3compat import *
import unittest
class MyError(Exception):
"""Dummy exception used for tests"""
class MiscTests(unittest.TestCase):
def setUp(self):
global number, math
from Cryptodome.Util import number
import ... |
from namespaces import STYLENS
from element import Element
def StyleElement(name, **args):
e = Element(name=name, **args)
if not args.has_key('displayname'):
e.addAttrNS(STYLENS,'display-name', name)
return e
def BackgroundImage(**args):
return Element(qname = (STYLENS,'background-image'), **arg... |
__author__ = "Danelle Cline"
__copyright__ = "Copyright 2012, MBARI"
__license__ = "GPL"
__maintainer__ = "Danelle Cline"
__email__ = "dcline at mbari.org"
__status__ = "Development"
__doc__ = '''
This loader loads water sample data from the Southern California Coastal Ocean Observing System (SCCOS)
Harmful Algal Bloom... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
DOCUMENTATION = '''
---
module: nxos_snapshot
version_added: "2.2"
short_description: Manage snapshots of the running states of selected features.
description:
- Create snapshots of the ... |
import os.path, types
import codecs
from six.moves.configparser import ConfigParser
from jinja2 import Environment, FileSystemLoader
from xml.sax.saxutils import unescape
import pycbc.results
from pycbc.results import unescape_table
from pycbc.results.metadata import save_html_with_metadata
from pycbc.workflow.core imp... |
ENTITY = 'config'
GRP_SEARCH_FIELD_DEFAULT = 'cn,description'
USR_SEARCH_FIELD_DEFAULT = 'uid,givenname,sn,telephonenumber,ou,title'
DATA = {
'mod': [
('textbox', 'ipasearchrecordslimit', '200'),
('textbox', 'ipasearchtimelimit', '3'),
],
}
DATA2 = {
'mod': [
('textbox', 'ipasearchre... |
def main():
startApplication("fatcrm")
# load methods
import campaignsHandling
import accountsHandling
import opportunitiesHandling
import mainWindowHandling
# create a campaign
# data to be registered
name = "TestCampaign"
status = "In Queue"
detailsList = [name, status, "1/... |
__version__ = "1.0.8" |
import obelisk
import sys
from twisted.internet import reactor
def main(txhash):
c = obelisk.ObeliskOfLightClient("tcp://localhost:9091")
txhash = txhash.decode("hex")
def cb_txpool(ec, result):
if ec:
c.fetch_transaction(txhash, cb_chain)
else:
print "From Txpool:"
... |
import re
import datetime
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.http import Http404
from django.template import RequestContext
from django.views.generic import TemplateView, DetailView, ListView
from pombola.hansard.models import Sitting, Entry
from pombola.core.mod... |
from setuptools import setup
with open('jujupy-description.rst') as f:
long_description = f.read()
setup(
name='jujupy',
version='0.9.0',
description='A library for driving the Juju client.',
long_description=long_description,
packages=['jujupy'],
install_requires=[
'python-dateutil ... |
import os
import os.path
import sys
import ConfigParser
import debug
dirs = []
if sys.platform != "win32" and sys.platform != "win64":
dirs.append("/usr/share/diamond")
dirs.append("/etc/diamond")
dirs.append(os.path.join(os.path.expanduser('~'), ".diamond"))
if "DIAMOND_CONFIG_PATH" in os.environ:
dirs += revers... |
import re, sys
import struct
from base64 import b64encode
from hashlib import sha1
if sys.version_info[0] < 3 :
from SocketServer import ThreadingMixIn, TCPServer, StreamRequestHandler
else:
from socketserver import ThreadingMixIn, TCPServer, StreamRequestHandler
'''
+-+-+-+-+-------+-+-------------+-----------------... |
from ryu.ofproto import oxm_fields
from struct import calcsize
OFPP_MAX = 0xffffff00 # Maximum number of physical and logical
# switch ports.
OFPP_IN_PORT = 0xfffffff8 # Send the packet out the input port. This
# reserved port must be explicitly used in
... |
"""
13. Adding hooks before/after saving and deleting
To execute arbitrary code around ``save()`` and ``delete()``, just subclass
the methods.
"""
from django.db import models
class Person(models.Model):
first_name = models.CharField(maxlength=20)
last_name = models.CharField(maxlength=20)
def __str__(self)... |
import sys
import time
import unittest
from winlogbeat import WriteReadTest
if sys.platform.startswith("win"):
import win32security
"""
Contains tests for reading from the Event Logging API (pre MS Vista).
"""
@unittest.skipUnless(sys.platform.startswith("win"), "requires Windows")
class Test(WriteReadTest):
@c... |
import os
import re
BROWSER = os.environ.get('BROWSER', 'firefox')
CHROME_EXECUTABLE_PATH = \
os.environ.get('CHROME_EXECUTABLE_PATH', '/usr/bin/google-chrome')
NAILGUN_FOLDER = os.environ.get('NAILGUN_FOLDER')
FOLDER_SCREEN_EXPECTED = os.environ.get(
'FOLDER_SCREEN_EXPECTED', '/home/nfedotov/testscreens/expect... |
"""Tests for exporter.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import tensorflow as tf
from tensorflow.contrib.session_bundle import constants
from tensorflow.contrib.session_bundle import exporter
from tensorflow.contrib.session_... |
"""
Defines data types and models required specifically for IPv4 support.
"""
import logging
from ryu.lib.packet.bgp import IPAddrPrefix
from ryu.lib.packet.bgp import RF_IPv4_UC
from ryu.services.protocols.bgp.info_base.base import Path
from ryu.services.protocols.bgp.info_base.base import Table
from ryu.services.pro... |
def foo(a):
if a == 5:
# a is 5
print 'no'
foo(5) |
import mock
import os
import shutil
from oslo.config import cfg
import six.moves.builtins as __builtin__
from ironic.common import exception
from ironic.common import image_service
from ironic.common import images
from ironic.common import utils
from ironic.openstack.common import imageutils
from ironic.openstack.commo... |
import os
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_true
from proboscis.asserts import assert_raises
from proboscis import before_class
from proboscis.decorators import time_out
from proboscis import test
from trove.common.utils import poll_until
from trove im... |
import os
import fcntl
import struct
import mmap
import logging
from ctypes import cast, POINTER, c_uint8, c_uint32, c_uint16, c_uint64,\
addressof, byref
DIAG_DRV_PATH = "/dev/hda"
CMD_OPEN_DEVICE = 0x47
CMD_ALLOC_MEMORY = 0x3A
CMD_FREE_MEMORY = 0x3B
CMD_OPEN_DEVICE_LEN = 40
class HdaBar:
""" ... |
from __future__ import print_function
import collections
import json
import re
import sys
description = ''
primitiveTypes = ['integer', 'number', 'boolean', 'string', 'object',
'any', 'array', 'binary']
def assignType(item, type, is_array=False, map_binary_to_string=False):
if is_array:
it... |
from doubleop import DoubleOp
from doublec import DoubleC
from theano.gof import local_optimizer
from theano.tensor.opt import register_specialize
@register_specialize
@local_optimizer([DoubleOp])
def local_scalmul_double_v1(node):
if not (isinstance(node.op, DoubleOp)
and node.inputs[0].ndim == 1):
... |
import numpy as np
from climin.initialize import sparsify_columns
def test_sparsify_columns():
pars = np.ones((8, 10))
sparsify_columns(pars, 3)
assert (pars.sum(axis=0) == [3] * 10).all(), 'sparsify_columns did not work' |
DEPS = [
'build',
'checkout',
'recipe_engine/context',
'recipe_engine/file',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/step',
'run',
'vars',
]
def RunSteps(api):
api.vars.setup()
checkout_root = ap... |
from __future__ import unicode_literals
from django.test import TestCase
from .models import Author, Article, SystemInfo, Forum, Post, Comment
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Keys shou... |
from httplib import FORBIDDEN, OK
from importlib import import_module
import md5
import time
import uuid
from api import APIBaseHandler
from routes import route
@route(r"/api/v2/accesskeys[\/]?")
class AccessKeysV2Handler(APIBaseHandler):
def initialize(self):
self.accesskeyrequired = False
self._t... |
import os.path
import re
import sys
from m5.util import code_formatter
from m5.util.grammar import Grammar, ParseError
import slicc.ast as ast
import slicc.util as util
from slicc.symbols import SymbolTable
class SLICC(Grammar):
def __init__(self, filename, base_dir, verbose=False, traceback=False, **kwargs):
... |
'''
Copyright (C) 2013 Travis DeWolf
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 the hope tha... |
from django.apps import AppConfig
class AnnotatorConfig(AppConfig):
name = 'annotator' |
from msrest.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.parameter_grouping_operations import ParameterGroupingOperations
from . import models
class AutoRestParameterGroupingTestServiceConfigurati... |
class List:
'''Represents one List'''
@staticmethod
def fromDict(dict):
try:
l = List(
dict['title'],
id = dict['id'],
revision = int(dict['revision']),
inbox = dict['inbox'] != 0 # if 0 then False
)
... |
'''
Copyright (C) 2014 Peter Urbanec
All Right Reserved
License: Proprietary / Commercial - contact enigma.licensing (at) urbanec.net
'''
from enigma import eEPGCache
from boxbranding import getMachineBrand, getMachineName
from Components.config import config, ConfigSubsection, ConfigNumber, ConfigText, \
ConfigPas... |
from dasbus.server.interface import dbus_interface
from dasbus.typing import * # pylint: disable=wildcard-import
from pyanaconda.modules.common.constants.interfaces import DEVICE_TREE_RESIZABLE
from pyanaconda.modules.storage.devicetree.devicetree_interface import DeviceTreeInterface
__all__ = ["ResizableDeviceTreeInt... |
from __future__ import absolute_import
import re
from PyQt4.QtGui import QColor
from ninja_ide import resources
from ninja_ide.core import settings
from PyQt4.Qsci import (QsciLexerBash, QsciLexerBatch,
QsciLexerCMake, QsciLexerCPP, QsciLexerCSS,
QsciLexerCSharp,
... |
from bs4 import BeautifulSoup
from couchpotato.core.helpers.encoding import tryUrlencode, toSafeString
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.torrent.base import TorrentProvider
import traceback
log = CPLog(__name__)
class IPTorrent... |
from django.conf import settings
from django.core.management.base import NoArgsCommand, CommandError
from shutil import rmtree
import os
from dbgettext.registry import registry
from dbgettext.parser import parsed_gettext
def recursive_getattr(obj, attr, default=None, separator='__'):
""" Allows getattr(obj, 'relate... |
"""Tests for the lms module itself."""
import logging
import mimetypes
from django.conf import settings # lint-amnesty, pylint: disable=unused-import
from django.test import TestCase
log = logging.getLogger(__name__)
class LmsModuleTests(TestCase):
"""
Tests for lms module itself.
"""
def test_new_mime... |
"""
Twisted integration for Urwid.
This module allows you to serve Urwid applications remotely over ssh.
The idea is that the server listens as an SSH server, and each connection is
routed by Twisted to urwid, and the urwid UI is routed back to the console.
The concept was a bit of a head-bender for me, but really we a... |
from spack import *
class PyFaststructure(PythonPackage):
"""FastStructure is a fast algorithm for inferring population structure
from large SNP genotype data."""
homepage = "https://github.com/rajanil/fastStructure"
url = "https://github.com/rajanil/fastStructure/archive/v1.0.tar.gz"
versio... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
xpath_text,
determine_ext,
float_or_none,
ExtractorError,
)
class DreiSatIE(InfoExtractor):
IE_NAME = '3sat'
_GEO_COUNTRIES = ['DE']
_VALID_URL = r'... |
"""Support for interface with a Panasonic Viera TV."""
import logging
from panasonic_viera import RemoteControl
import voluptuous as vol
import wakeonlan
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
from homeassistant.components.media_player.const import (
MEDIA_TYPE_URL,
... |
import math
import uuid
from oslo_config import cfg
from oslo_log import log
import tooz.coordination
from designate.i18n import _LI
from designate.i18n import _LW
from designate.i18n import _LE
LOG = log.getLogger(__name__)
OPTS = [
cfg.StrOpt('backend_url',
default=None,
help='The ba... |
"""Primitives for dealing with datastore indexes.
Example index.yaml file:
------------------------
indexes:
- kind: Cat
ancestor: no
properties:
- name: name
- name: age
direction: desc
- kind: Cat
properties:
- name: name
direction: ascending
- name: whiskers
direction: descending
- kind: St... |
"""Classes and methods related to model_fn."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import six
from tensorflow.python.estimator.export.export_output import ExportOutput
from tensorflow.python.framework import ops
from tensorflow.... |
import unittest
import sys
import pytest
try:
import Crypto
Crypto
crypto = True
except ImportError:
crypto = False
from libcloud.common.types import InvalidCredsError
from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import xmlrpclib
from libcloud.utils.py3 import next
from libcloud.comput... |
from fontTools import ttLib
superclass = ttLib.getTableClass("hmtx")
class table__v_m_t_x(superclass):
headerTag = 'vhea'
advanceName = 'height'
sideBearingName = 'tsb'
numberOfMetricsName = 'numberOfVMetrics' |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
from osf.utils.migrations import disable_auto_now_fields
def migrate_user_guid_array_to_m2m(state, schema):
from osf.models import OSFUser as FindableOSFUser
AddableOSFUser = state.get_model('osf', ... |
from __future__ import unicode_literals
from collections import OrderedDict
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.db.models import Manager
from django.db.models.query import QuerySet
from django.utils import six
from django.utils.encoding import (
python_2_unicode_c... |
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_almost_equal, assert_equal)
from nose.tools import assert_raises
from pystruct.models import EdgeFeatureGraphCRF
from pystruct.inference.linear_programming import lp_general_graph
from pystruct... |
import numpy as np
from astropy import units as u
from astropy.utils import ShapedLikeNDArray
__all__ = ['Attribute', 'TimeAttribute', 'QuantityAttribute',
'EarthLocationAttribute', 'CoordinateAttribute',
'CartesianRepresentationAttribute',
'DifferentialAttribute']
class Attribute:
... |
"""Class that holds state for instantiating StorageUri objects.
The StorageUri func defined in this class uses that state
(bucket_storage_uri_class and debug) needed plus gsutil default flag values to
instantiate this frequently constructed object with just one param for most
cases.
"""
from __future__ import absolute_... |
import unittest
import os.path
from IECore import *
from IECoreGL import *
init( False )
class TestToGLTexureConverter( unittest.TestCase ) :
def testFromImage( self ) :
""" Test conversion from an ImagePrimitive """
i = EXRImageReader( os.path.dirname( __file__ ) + "/images/colorBarsWithAlphaF512x512.exr" ).read(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.