gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 applicable la... | |
# Lint as: python3
"""Tests for improve_nas.
Copyright 2019 The AdaNet 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
https://www.apache.org/licenses/LICENSE-2.0... | |
import unittest
from pylayers.gis.layout import *
L1 = Layout('defstr.lay')
class TestLayout(unittest.TestCase):
def test_add_fnod(self):
L = Layout('defstr.lay')
L.add_fnod(p=(10,10))
self.assertEqual(L.Np,13)
def test_add_furniture(self):
L = Layout('defstr.lay')
L.ad... | |
from __future__ import absolute_import, division, print_function
import hashlib
import linecache
from operator import itemgetter
from . import _config
from ._compat import PY2, iteritems, isclass, iterkeys, metadata_proxy
from .exceptions import (
DefaultAlreadySetError,
FrozenInstanceError,
NotAnAttrsCl... | |
# 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... | |
from types import FunctionType
from mock import patch, Mock, ANY, call, sentinel
from nose.tools import assert_raises, assert_equal, assert_true, assert_false
from zabby.tests import (assert_is_instance, ensure_removed,
ensure_contains_only_formatted_lines,
assert_less... | |
import sys
import time
from django.conf import settings
from django.db.backends.creation import BaseDatabaseCreation
from django.db.utils import DatabaseError
from django.utils.six.moves import input
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
class DatabaseCreation(BaseDatabaseCreation):
# Thi... | |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import inspect
import logging
import re
import unittest
from py_utils import cloud_storage
from telemetry.internal.browser import browser_finder
from teleme... | |
# -*- encoding:utf-8 -*-
import numpy as np
class Optimizer(object):
def __init__(self, lr=1e-3, decay=0., grad_clip=-1, lr_min=0., lr_max=np.inf):
self.lr = lr
self.decay = decay
self.clip = grad_clip
self.lr_min = lr_min
self.lr_max = lr_max
self.iterations = 0
... | |
#! /usr/bin/env python
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness h... | |
#
# 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... | |
from unittest import TestCase
import queue
from ddsc.core.parallel import WaitingTaskList, Task, TaskRunner, TaskExecutor
from mock import patch, Mock
def no_op():
pass
class NoOpTask(object):
def __init__(self):
self.func = no_op
class TestWaitingTaskList(TestCase):
def task_ids(self, tasks):... | |
#########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 source code must retain the above copyrigh... | |
#!/usr/bin/env python
"""
runtests.py [OPTIONS] [-- ARGS]
Run tests, building the project first.
Examples::
$ python runtests.py
$ python runtests.py -s {SAMPLE_SUBMODULE}
$ python runtests.py -t {SAMPLE_TEST}
$ python runtests.py --ipython
$ python runtests.py --python somescript.py
$ python... | |
# 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... | |
import sys, imp, marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion, LooseVersion
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building or installing a distribution"""
... | |
import collections
import datetime
import inspect
import os
import shutil
import time
import types
import uuid
import jinja2
from nile.common import log as logging
from nile.common import loopingcall
from nile.common import importutils
from nile.common import timeutils
from passlib import utils as passlib_utils
import ... | |
#
# Copyright 2015 LinkedIn Corp. 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 ... | |
# Copyright 2014 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 ... | |
from django.views.generic.list import ListView
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from dja... | |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import random
import unittest
from pymatgen.core.composition import Composition
from pymatgen.core.ion import Ion
from pymatgen.core.periodic_table import Element
class IonTest(unittest.TestCase):
def setUp(self):
... | |
"""Various tests that determine whether updating capabilities for
multiple ActorSystems in a Convention are working correctly. These
tests run somewhat slowly because they must allow time for
coordination of effects an hysteresis of same between the multiple
systems (which should not be an issue under normal operation... | |
#from builtins import range
from collections import namedtuple
from datetime import datetime
import csv
import math
import time
import tensorflow.python.platform
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_integer('batch_size', 128,
"""Batch size.""")
tf.app.fla... | |
# -*- coding: utf-8 -*-
"""
Dynamic DynamoDB
Auto provisioning functionality for Amazon Web Service DynamoDB tables.
APACHE LICENSE 2.0
Copyright 2013-2014 Sebastian Dahlgren
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
from awx.main.models import Organization, Inventory, InventorySource, Project
@pytest.fixture
def base_inventory():
org = Organization.objects.create(name='test-org')
inv = Inventory.objects.create(name='te... | |
#!/usr/bin/env python
import saml2
from saml2 import create_class_from_xml_string, class_name, make_vals, md
from saml2.saml import NameID, Issuer, SubjectLocality, AuthnContextClassRef
from saml2.saml import SubjectConfirmationData, SubjectConfirmation
from saml2.saml import Attribute
from py.test import raises
imp... | |
"""
Read data from ECMWF MACC Reanalysis.
"""
import threading
import pandas as pd
try:
import netCDF4
except ImportError:
class netCDF4:
@staticmethod
def Dataset(*a, **kw):
raise ImportError(
'Reading ECMWF data requires netCDF4 to be installed.')
try:
from e... | |
#!/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... | |
import asyncio
import unittest
from unittest import mock
import sys
from psycopg2.extensions import TRANSACTION_STATUS_INTRANS
import aiopg
from aiopg.connection import Connection, TIMEOUT
from aiopg.pool import Pool
class TestPool(unittest.TestCase):
def setUp(self):
self.loop = asyncio.new_event_loop... | |
# -----------------------------------------------------------------------------
# A module that builds core objects, i.e. stacks and laminates
# Stack() : an dict of the order laminate layers.
# Laminate() : pandas objects including laminate dimensions and calculations
# flake8 constructs.py --ignore=E265,E501,N802,H80... | |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
__author__ = 'Vinayak Marali'
__author__ = 'Pavan Prabhakar Bhat'
"""
CSCI-603: Lab 2 (week 2)
Section 03
Author: Pavan Prbahakar Bhat ([email protected])
Vinayak Marali ([email protected])
This is a program that draws a forest with trees and a house.
"""
# Imports required by the program
import turtle
import ra... | |
#A place for code to be called from C-code
# that implements more complicated stuff.
import re
import sys
#from _mx_datetime_parser import *
if (sys.byteorder == 'little'):
_nbo = '<'
else:
_nbo = '>'
def _makenames_list(adict):
from multiarray import dtype
allfields = []
fnames = adict.keys()
... | |
from atila import Atila
import time, math
import json
from services import route_guide_pb2
app = Atila (__name__)
app.debug = True
app.use_reloader = True
def get_feature (feature_db, point):
for feature in feature_db:
if feature.location == point:
return feature
return None
def get_distance(start, end):
co... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2010 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 app... | |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Team. 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... | |
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
from __future__ import absolute_import
import os
import tct
import sys
from tct import deepget, logstamp_finegrained
params = tct.readjson(sys.argv[1])
facts = tct.readjson(params['factsfile'])
milestones = tct.readjson(params['milestonesfi... | |
#!/usr/bin/env python3
#
# Copyright (c) 2017 Weitian LI <[email protected]>
# MIT License
#
"""
Make/simulate the X-ray photon list from the object's image and
spectral models.
The simulated X-ray photon list will be used to simulate the
Suzaku event observation by ``xissim`` tool.
This script is intended to repla... | |
"""Config flow to configure Philips Hue."""
import asyncio
import json
import os
from aiohue.discovery import discover_nupnp
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client
from .bridge imp... | |
# Electrum - Lightweight Bitcoin Client
# Copyright (c) 2011-2016 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rig... | |
# -*- coding: utf-8 -*-
# TODO: This thing is a beast! Refactor.
import cmd
import os
import sys
import time
import traceback
from typing import Optional, List, Iterator, Tuple, Dict
from pyramids.categorization import Category
from pyramids.model import Model
from pyramids.rules.parse_rule import ParseRule
try:
... | |
import sys
from cps.base import BaseClient
import base64
class Client(BaseClient):
def info(self, service_id):
service = BaseClient.info(self, service_id)
print 'persistent:', service['persistent']
print 'osd_volume_size:', service['osd_volume_size']
nodes = self.callmanager(se... | |
# Copyright The PyTorch Lightning team.
#
# 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 i... | |
"""
PHYLIP wrapper for python
author: Matt Rasmussen
date: 2/4/2007
The following programs should be in your PATH
dnaml -- Maximum likelihood (nucleotide)
proml -- Maximum likelihood (peptide)
dnapars -- Parsimony (nucleotide)
protpars -- Parsimony (peptide)
nei... | |
from __future__ import division, print_function, absolute_import
import tensorflow as tf
import functools
import numpy as np
from selfsup import extra
from selfsup.moving_averages import ExponentialMovingAverageExtended
from selfsup.util import DummyDict
from selfsup import ops, caffe
import sys
def conv(input, kern... | |
"""
A "smart compression" replacement for savez, assuming data is quantised.
The quantum is found, and the data replaced by a product of and integer
sequence and quantum with offset. delta encoding is optional and often
saves space. The efficiency is better than bz2 of ascii data for
individual channels, a... | |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you... | |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | |
import os
import tempfile
from OpenSSL.crypto import dump_certificate, load_certificate, FILETYPE_PEM
from OpenSSL.SSL import Error as SSLError
from OpenSSL.version import __version__ as pyopenssl_version
from twisted.internet import reactor
from twisted.internet.ssl import DefaultOpenSSLContextFactory
from twisted.p... | |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. The... | |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | |
# Copyright 2011 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 applicable law or agreed to in wr... | |
"""AuthZ Adapter implementations of grading managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . import... | |
from collections import namedtuple
import heapq as hq
import logging
import numpy
from operator import attrgetter
import pandas as pd
from py_entitymatching.utils.validation_helper import validate_object_type
import py_entitymatching as em
import py_entitymatching.catalog.catalog_manager as cm
logger = logging.getLog... | |
# Copyright (c) 2012 NetApp, Inc.
# Copyright (c) 2016 Red Hat, 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... | |
from __future__ import absolute_import, division, print_function
import unittest
import os
import tempfile
import json
from dynd import nd
import datashape
from collections import Iterator
from datashape.discovery import discover
from blaze.data import JSON, JSON_Streaming
from blaze.utils import filetext, raises
fro... | |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
import gevent
import uuid
import time
sys.path.append("../config/common/tests")
from testtools.matchers import Equals, Contains, Not
from test_utils import *
import test_common
import test_case
from vnc_api.vnc_api import *
from vnc_api.g... | |
# Copyright (C) 2014 Narf Industries <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, m... | |
# Copyright 2014: 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 b... | |
#! /usr/bin/env python
import dbus
import dbus.service
import dbus.mainloop.glib
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
import yaml
import os
import turk
from turk import get_config
import urllib, urllib2
import logging
from twisted.internet import glib2reactor
glib2reactor.install()
import warnings
w... | |
import argparse, json, os, time
from parcellearning import jkgat
from parcellearning.utilities import gnnio
from parcellearning.utilities.early_stop import EarlyStopping
from parcellearning.utilities.batch import partition_graphs
from parcellearning.utilities.load import load_schema, load_model
from shutil import cop... | |
# coding: utf-8
'''
------------------------------------------------------------------------------
Copyright 2016-2017 Esri
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.or... | |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | |
import numpy as np
########################################################
# Common functions for phonon workflows #
# (should be placed in the same directory of workflow) #
# Used for workflows: gruneisen, qha #
########################################################
def get_phonon... | |
from unittest import TestCase
import unittest
import active_subspaces.subspaces as ss
import active_subspaces.domains as dom
import helper
import numpy as np
import pdb
class TestDomains(TestCase):
writeData = False
def test_unbounded_active_variable_domain(self):
data = helper.load_test_npz('test_spe... | |
"""
TODO:
- Feature: Clicking on a point in the parameter space plots the integral curve with that initial condition
so that the parameter space can be explored interactively.
- Feature: Link the x axes for all the plots in 1D embedding domain.
-
"""
import glob
import heisenberg.library.util
import matplotlib... | |
# -*- coding: utf-8 -*-
import logging
import os
import os.path
import shutil
import stat
import core.provider.property as property
import core.utils as utils
PRECONDITION_FAILED = 17
NOT_FOUND = 2
class StorageProvider():
path = None
CHUNK_SIZE = 16384 # 16KB buffer
propertyProvider = None # P... | |
import re
import os
import six
class Compiler(object):
RE_INTERPOLATE = re.compile(r'(\\)?([#!]){(.*?)}')
RE_ASSIGNMENT = re.compile(r'^(\s*var\s+)(\w+) *= *([^;]+)')
doctypes = {
'5': '<!DOCTYPE html>'
, 'xml': '<?xml version="1.0" encoding="utf-8" ?>'
, 'default': '<!DOCTYPE html PUBL... | |
import os
import json
import pyodbc
import psycopg2
import psycopg2.extras
from psycopg2.pool import ThreadedConnectionPool
import datetime
from concurrent.futures import ThreadPoolExecutor, wait
import multiprocessing
import sys
import hashlib
from utils import *
THREADNUM = 16
class IntWriter:
def __init__(self... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | |
"""Provides global signal dispatching services."""
__author__ = "Patrick K. O'Brien <[email protected]>"
__cvsid__ = "$Id: dispatcher.py 39667 2006-06-11 00:13:05Z RD $"
__revision__ = "$Revision: 39667 $"[11:-2]
import exceptions
import types
import weakref
class DispatcherError(exceptions.Exception):
def __... | |
from ..libmp.backend import xrange
from .calculus import defun
#----------------------------------------------------------------------------#
# Polynomials #
#----------------------------------------------------------------------------#
# XXX: extra preci... | |
import json
import os.path
import random
import re
import uuid
import zipfile
from django import forms
from django.conf import settings
from django.core.cache import cache
from django.db.models import Q
from django.forms import ValidationError
from django.utils.translation import ugettext
import six
import waffle
fr... | |
'''
Builder
======
Class used for the registering and application of rules for specific widgets.
'''
import codecs
import sys
import types
from os import environ
from os.path import join
from copy import copy
from types import CodeType
from functools import partial
from kivy.factory import Factory
from kivy.lang.pars... | |
import sys
import time
import copy as cp
import asyncio
import hashlib
from unittest import mock
import celery
import pytest
from waterbutler import tasks # noqa
from waterbutler.core import remote_logging
from waterbutler.core import utils as core_utils
from waterbutler.core.path import WaterButlerPath
import test... | |
# -*- coding: utf-8 -*-
# Author: Tamas Marton
import sys
import time
import kivy
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.tabbedpanel import TabbedPanel
from kivy.logger import Logger
from kivy.properties import ObjectProperty, ListProperty
from kivy.app import App
from kivy.uix.screenmanager import Sc... | |
"""
General tests for all estimators in sklearn.
"""
# Authors: Andreas Mueller <[email protected]>
# Gael Varoquaux [email protected]
# License: BSD 3 clause
from __future__ import print_function
import os
import warnings
import sys
import traceback
import inspect
import pickle
import pkg... | |
#!/usr/bin/env python
"""
Modelica AST definitions
"""
from __future__ import print_function, absolute_import, division, print_function, unicode_literals
import copy
import json
from enum import Enum
from typing import List, Union, Dict
from collections import OrderedDict
class ClassNotFoundError(Exception):
pas... | |
# 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 ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of the bapsflib package, a Python toolkit for the
# BaPSF group at UCLA.
#
# http://plasma.physics.ucla.edu/
#
# Copyright 2017-2018 Erik T. Everson and contributors
#
# License: Standard 3-clause BSD; see "LICENSES/LICENSE.txt" for full
# license t... | |
import aiohttp
import asyncio
import socket
import unittest
from aiohttp import web
class TestWebSocketClientFunctional(unittest.TestCase):
def setUp(self):
self.loop = asyncio.new_event_loop()
asyncio.set_event_loop(None)
def tearDown(self):
if self.handler:
self.loop.ru... | |
# Copyright 2019 The gRPC 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 applicable law or agreed to in writ... | |
"""
Support for KNX/IP covers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.knx/
"""
import voluptuous as vol
from homeassistant.components.cover import (
ATTR_POSITION, ATTR_TILT_POSITION, PLATFORM_SCHEMA, SUPPORT_CLOSE,
SUPPORT_OPEN, ... | |
# 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 ... | |
# -*- test-case-name: automat._test.test_methodical -*-
import collections
from functools import wraps
from itertools import count
try:
# Python 3
from inspect import getfullargspec as getArgsSpec
except ImportError:
# Python 2
from inspect import getargspec as getArgsSpec
import attr
import six
fro... | |
# Copyright 2012 Anton Beloglazov
#
# 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 writ... | |
"""Support for Template lights."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_WHITE_VALUE,
ENTITY_ID_FORMAT,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
SUPPORT_WHITE_VALUE,
... | |
# -*- coding: utf-8 -*-
#
# 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
#... | |
import asyncio
from binascii import hexlify
from itertools import chain
import typing
import logging
from lbry.dht import constants
from lbry.dht.error import RemoteException, TransportNotConnected
from lbry.dht.protocol.distance import Distance
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from lbry.dht.pro... | |
import os
import sys
import traceback
import warnings
from os.path import join
import boto
import nibabel
import numpy as np
import pandas as pd
from boto.s3.key import Key
from nilearn.datasets.utils import _fetch_file
from sklearn.datasets.base import Bunch
TASK_LIST = ['EMOTION', 'WM', 'MOTOR', 'RELATIONAL',
... | |
#!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import os
import sys
import errno
import subprocess
import time
import argparse
import re
import json
from pprint import pprint
sys.path.insert(0, os.path.realpath('/usr/lib/python2.7/site-packages'))
sys.path.insert(
0,
os.... | |
#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 thi... | |
# Copyright (c) 2014, Oracle and/or its affiliates. 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
#
# ... | |
#!/usr/bin/env python
# Copyright (c) 2009 Six Apart Ltd.
# 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 source code must retain the above copyright notice,
# this lis... | |
# -*- coding: UTF-8 -*-
import numpy as np
#import caid.cad_geometry as cg
from caid.cad_geometry import line, square
from caid.utils.extraction import splineRefMat
DIM_1D = 1
DIM_2D = 2
# ...
def test1D1():
spl = splineRefMat(DIM_1D)
list_r = list(np.random.random(20))
for r in list_r:
nx = 7
... | |
"""
================================================
:mod:`replacers` -- Survivor replacement methods
================================================
This module provides pre-defined replacers for evolutionary computations.
All replacer functions have the following arguments:
- *... | |
"""Configuration for ACLs."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file e... | |
# Copyright 2013 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 applicable law or ... | |
"""Code heatmap module."""
import inspect
import fnmatch
import os
import runpy
import sys
import time
from collections import defaultdict
from collections import deque
from vprof import base_profiler
_STDLIB_PATHS = [
os.path.abspath(path) for path in sys.path
if os.path.isdir(path) and path.startswith(sys.p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.