code
stringlengths
1
199k
"""Test of Dojo combo box presentation.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(PauseAction(5000)) sequence.append(KeyComboAction("Tab")) sequence.append(KeyComboAction("Tab")) sequence.append(utils.StartRecordingAction()) sequence.append(KeyComboAction("Tab")) sequenc...
import __builtin__ import etcd from etcd import Client import importlib import inspect import maps from mock import MagicMock from mock import patch import os import pkgutil import pytest import yaml from tendrl.commons import objects import tendrl.commons.objects.node_context as node from tendrl.commons import TendrlN...
from spack import * class Scons(PythonPackage): """SCons is a software construction tool""" homepage = "http://scons.org" url = "https://pypi.io/packages/source/s/scons/scons-2.5.1.tar.gz" version('2.5.1', '3eac81e5e8206304a9b4683c57665aa4') version('2.5.0', 'bda5530a70a41a7831d83c8b191c021e') ...
import sys from paravistest import datadir, pictureext, get_picture_dir from presentations import CreatePrsForFile, PrsTypeEnum import pvserver as paravis picturedir = get_picture_dir("StreamLines/F7") myParavis = paravis.myParavis file = datadir + "occ4050.med" print " --------------------------------- " print "file ...
from __future__ import absolute_import import re from collections import OrderedDict from uuid import uuid4 from warnings import warn from numpy import object as np_object from numpy import array, inf, isinf from six import string_types from cobra.core import Metabolite, Model, Reaction from cobra.util import create_st...
from nose.tools import assert_equal from nose import SkipTest from Goulib.tests import * from Goulib.interval import * class TestInInterval: def test_in_interval(self): assert_equal(in_interval([1,2], 1),True) assert_equal(in_interval([2,1], 1),True) #interval might be unordered assert_equal...
''' Created on Feb 26, 2015 @author: Akshat ''' import pandas as pd import matplotlib.pyplot as plt import matplotlib.gridspec as mgrid import ntpath class PrbLogAgg: ''' classdocs ''' dataFrame = {} csv = [] def __init__(self, output_directory, csvFilePath): self.output_directory = outp...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "downloadmusic.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
"""Contain the socket handler for players""" from game import Game from websocket import WebSocketHandler from zone import Zone import errcode class AdminWs(WebSocketHandler): """The socket handler for websocket""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.call...
"""pypozyx.definitions.bitmasks - contains all bitmasks used in Pozyx functionality, such as interrupt flags.""" POZYX_ST_RESULT_ACC = 0x01 POZYX_ST_RESULT_MAGN = 0x02 POZYX_ST_RESULT_GYR = 0x04 POZYX_ST_RESULT_MCU = 0x08 POZYX_ST_RESULT_PRES = 0x10 POZYX_ST_RESULT_UWB = 0x20 POZYX_INT_STATUS_ERR = 0x01 POZYX_INT_STATU...
""" Tests for CANtact interfaces """ import unittest import can from can.interfaces import cantact class CantactTest(unittest.TestCase): def test_bus_creation(self): bus = can.Bus(channel=0, bustype="cantact", _testing=True) self.assertIsInstance(bus, cantact.CantactBus) cantact.MockInterfac...
from django import forms class StagiaireForms(forms.Form): _choix = ( (1, 'Stagiaire'), (2, 'Classe'),) choisir = forms.ChoiceField(choices =_choix, widget = forms.RadioSelect, required = True, initial = '1', label = '') chercher = forms.CharField(max_length=100, required=False, label = '') def __init__(self, *args...
import sys, os sys.path.append(os.path.abspath('../examples')) from basic_blog import settings from django.core.management import setup_environ setup_environ(settings) extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] templates_path = ['_templates'] source_suffix = '.txt' source_encoding = 'utf-8' master_do...
import os import os.path import sys import gtk import gobject from ecell.ui.model_editor.Utils import * from ecell.ui.model_editor.Constants import * from ecell.ui.model_editor.ModelEditor import * from ecell.ui.model_editor.ViewComponent import * class BadNestedList( Exception ): def __init__( self, badString ): ...
/*Owner & Copyrights: Vance King Saxbe. A.*/from GoldSaxEngineChinaMarkets import goldsaxenginechinamarkets goldsaxenginechinamarkets.start() /*email to provide support at vancekingsaxbe@powerdominionenterprise.com, businessaffairs@powerdominionenterprise.com, For donations please write to fundraising@powerdominionente...
""" Created on 21.06.17 @author: clonker """ from __future__ import print_function from contextlib import closing import numpy as np import readdy._internal.readdybinding.api.top as top import readdy._internal.readdybinding.common.io as io import readdy._internal.readdybinding.common as common from readdy._internal.rea...
"""Main matchbox module.""" from matchbox.box import MatchBox from matchbox.index import MatchIndex __version__ = "1.1.1" __all__ = ("MatchBox", "MatchIndex")
import pandas as pd import os from flutype.data_management.fill_master import Master import numpy as np def print_full(x): pd.set_option('display.max_rows', len(x)) print(x) pd.reset_option('display.max_rows') def extract_peptide_batch(ma): gal_lig_fix = ma.read_gal_ligand("170725_N13", index=False) ...
from __future__ import print_function, absolute_import, division from builtins import str import sys import unittest import re import os dirname = os.path.dirname(__file__) sys.path.insert(0, os.path.join(dirname, '..', '..', '..')) import uuid from SpiffWorkflow.serializer.dict import DictionarySerializer from .baseTe...
from .quaternion import Quaternion from .transform import Transform def retrieveRosResource(path): import os ros_package_paths = os.environ["ROS_PACKAGE_PATH"].split(':') if path.startswith("package://"): relpath = path[len("package://"):] for dir in ros_package_paths: abspath = ...
"""Manage the Glances ports list (Ports plugin).""" from glances.compat import range from glances.logger import logger from glances.globals import BSD if not BSD: try: import netifaces netifaces_tag = True except ImportError: netifaces_tag = False else: netifaces_tag = False class Gl...
from __future__ import division from __future__ import print_function from mpop.satellites import GeostationaryFactory from mpop.imageo.geo_image import GeoImage from pycoast import ContourWriterAGG from pydecorate import DecoratorAGG from mpop.channel import Channel, GenericChannel import aggdraw from numpy import whe...
from django.contrib import admin from testing.unusual_fields.models import UnusualModel class UnusualModelAdmin(admin.ModelAdmin): pass class ResourceAdmin(admin.ModelAdmin): pass admin.site.register(UnusualModel, UnusualModelAdmin)
""" Common definitions/constants used throughout the manager. """ from typing import Final from ai.backend.common.types import SlotName, SlotTypes INTRINSIC_SLOTS: Final = { SlotName('cpu'): SlotTypes('count'), SlotName('mem'): SlotTypes('bytes'), }
import os import sys import shutil import tempfile if os.name != 'nt': print 'Windows only!' sys.exit(1) if not len(sys.argv) == 3: print 'USAGE: %s PortablePythonDir output-dir' % sys.argv[0] print ' Example: D:\yCanta>..\PortablePython\Python-Portable.exe windows-build.py d:\PortablePython d:\output' sys.e...
"""Ninja build configurator for foundation library""" import sys import os import copy sys.path.insert(0, os.path.join('build', 'ninja')) import generator generator = generator.Generator(project = 'rpmalloc', variables = {'bundleidentifier': 'com.rampantpixels.rpmalloc.$(binname)', 'nowarning': True}) target = generato...
import unittest import json from bitmovin import Bitmovin, Response, SFTPInput from bitmovin.errors import BitmovinApiError from tests.bitmovin import BitmovinTestCase class SFTPInputTests(BitmovinTestCase): @classmethod def setUpClass(cls): super().setUpClass() @classmethod def tearDownClass(cl...
import mcl.status ERR_SUCCESS = mcl.status.MCL_SUCCESS ERR_INVALID_PARAM = mcl.status.framework.ERR_START ERR_MARSHAL_FAILED = mcl.status.framework.ERR_START + 1 ERR_GET_FULL_PATH_FAILED = mcl.status.framework.ERR_START + 2 ERR_CALLBACK_FAILED = mcl.status.framework.ERR_START + 3 ERR_ENUM_FAILED = mcl.status.framework....
from kivy.uix.stacklayout import StackLayout from kivy.uix.behaviors import DragBehavior from kivy.uix.modalview import ModalView from kivy.core.window import Window from kivy.uix.button import Button from kivy.uix.label import Label from kivy.lang import Builder from kivy.clock import Clock from kivy.uix.stencilview i...
import os from distutils.core import setup from distutils.command.install import INSTALL_SCHEMES from horizon import version from openstack_dashboard.openstack.common import setup as os_common_setup requires = os_common_setup.parse_requirements() depend_links = os_common_setup.parse_dependency_links() tests_require = o...
try: import numpypy as np except: import numpy as np try: import cPickle as pickle except ImportError: import pickle def TDMAsolver(a, b, c, d): ''' TDMA solver, a b c d can be NumPy array type or Python list type. refer to http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm ''' ...
import setuptools requirements = [ "requests", # no lower bound "packaging>=14.0, !=15.0, <22.0.0", # too complex for tool "wheel<0.36.0", "click==7.0.0", ] setuptools.setup( name="invalid-package", version="0.0.1", author="Example Author", author_email="author@example.com", descri...
"""Controller module for attenuators. Sample Config: .. code-block:: python "Attenuator": [ { "address": "192.168.1.12", "port": 23, "model": "minicircuits", "paths": ["AP1-2G", "AP1-5G", "AP2-2G", "AP2-5G"] }, { "address": "192.168...
"""Various generic utility functions and classes. Utilities are mainly for internal usage, but external libraries and tools may find some of them useful. Utilities are generally stable, but absolute backwards compatibility between major versions is not guaranteed. All utilities are exposed via the :mod:`robot.utils` pa...
__author__ = 'himanshu' class TrayIcon(Exception): pass
__author__ = 'Ganesh' from setuptools import setup version = '0.3' setup( name='cloudify-aws', version=version, author='ran', author_email='ganeshpandi.g@cloudenablers.com', packages=['cloudify_aws'], license='LICENSE', description='the cloudify amazon provider', package_data={'cloudify_...
from __future__ import absolute_import import os import socket import random import string import time import uuid import pytest from . import unittest from kafka import SimpleClient, create_message from kafka.client_async import KafkaClient from kafka.errors import ( LeaderNotAvailableError, KafkaTimeoutError, Inv...
""" Repository Management """ import datetime import fnmatch import hashlib import os import os.path import re default_root = "/mcs/globus.org/ftppub/gt6" default_api_root = "/mcs/globus.org/api" default_releases = ["unstable", "testing", "stable"] public_key = """-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1....
import time import unittest from http import HTTPStatus from testing.common import BaseTestCase, TestAppProcess from fedlearner_webconsole.proto import workflow_definition_pb2 from fedlearner_webconsole.db import db from fedlearner_webconsole.workflow.models import Workflow from fedlearner_webconsole.job.models import ...
from __future__ import division, print_function import finufft from finufft import interface import numpy as np import pytest __all__ = [ "test_nufft1d1", "test_nufft1d2", "test_nufft1d3", ] def test_nufft1d1(seed=42, iflag=1): np.random.seed(seed) ms = int(1e3) n = int(2e3) tol = 1.0e-9 x = np....
""" This module handles parsing the AWS Billing Reports (stored on S3 in .zip or just plain .csv format) and creating metrics to be sent to the WF proxy. """ import ConfigParser import datetime import io import os import sys import time import traceback import zipfile import logging.config import dateutil from wavefron...
from ducktape.mark import parametrize from ducktape.utils.util import wait_until from kafkatest.services.zookeeper import ZookeeperService from kafkatest.services.kafka import KafkaService from kafkatest.services.verifiable_producer import VerifiableProducer from kafkatest.services.console_consumer import ConsoleConsum...
import uuid from touchdown.core.resource import Resource from touchdown.core.plan import Plan, Present from touchdown.core import argument, serializers from ..account import BaseAccount from ..common import SimpleDescribe, SimpleApply, SimpleDestroy, RefreshMetadata from ..s3 import Bucket from .. import route53 from ....
import urllib import urllib2 import re import json class Spider: def __init__(self): self.url = 'http://brand.efu.com.cn/' self.user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36' self.headers = { 'User-Agent' : self.user_agent } def...
from typing import List import networkx as nx import pyisemail from fuzzywuzzy import fuzz from recordclass import recordclass import pandas as pd import saapy.util as su from .lexeme import cleanup_proper_name def connect_actors(actor_frame, connectivity_sets, connectivity_column): """ :param actor_frame: ...
import re import json import inflection from os.path import exists, isfile from requests import RequestException from mycroft.util.json_helper import load_commented_json, merge_dict from mycroft.util.log import LOG from .locations import (DEFAULT_CONFIG, SYSTEM_CONFIG, USER_CONFIG, WEB_CONFIG_CA...
import json import datetime from django.core.files.base import ContentFile from django.core.exceptions import ValidationError from django.utils.timezone import utc from ..models import AgentProfile from ..exceptions import IDNotFoundError, ParamError from ..utils import etag class AgentProfileManager(): def __init_...
"""Monkey-patching to add multiprocessing support for coverage.py""" import multiprocessing import multiprocessing.process import os from coverage import env from coverage.misc import contract PATCHED_MARKER = "_coverage$patched" if env.PYVERSION >= (3, 4): OriginalProcess = multiprocessing.process.BaseProcess else...
from inspect import isgenerator from .testcase import DatatableViewTestCase from .test_app import models from ..exceptions import ColumnError from ..datatables import Datatable, ValuesDatatable from ..views import DatatableJSONResponseMixin, DatatableView from .. import columns class DatatableTests(DatatableViewTestCas...
import os import platform import mxnet as mx import numpy as np from mxnet import nd from mxnet.gluon import nn from mxnet.base import MXNetError from mxnet.test_utils import download, is_cd_run, assert_almost_equal, default_context import pytest base_path = os.path.join(os.path.dirname(__file__), "../../..") def check...
import sys sys.path.insert(1, "../../") import h2o, tests def headers(): headers = h2o.import_file(h2o.locate("smalldata/airlines/allyears2k_headers_only.csv")) headers_and = h2o.import_file(h2o.locate("smalldata/airlines/allyears2k.zip")) headers_and.setNames(headers.names) print headers.names prin...
"""Tests for struct2tensor.ops.struct2tensor_ops.""" import itertools from absl.testing import absltest from absl.testing import parameterized import numpy as np from struct2tensor.ops import struct2tensor_ops from struct2tensor.test import test_extension_pb2 from struct2tensor.test import test_map_pb2 from struct2tens...
from collections import OrderedDict import functools import re from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core...
import urllib.request import urllib.error import re import os import taobaotool import time class Spider: def __init__(self): self.siteUrl = 'http://mm.taobao.com/json/request_top_list.htm' self.tool = taobaotool.Tool() def getPage(self, pageIndex): url = self.siteUrl + '?page=' + str(pa...
__author__ = 'bharathramh' EMAIL_VERIFICATION_EXPIRATION_DAYS = 1 FORGOT_PASSWORD_EXPIRATION_DAYS = 1
""" test. """ import torndb import unittest from ..views import case class PrimesTestCase(unittest.TestCase): """Tests for `primes.py`.""" def test_is_five_prime(self): """""" self.assertTrue(case.is_prime(2), msg='断言出错') class WidgetTestCase(unittest.TestCase): def setUp(self): ...
import argparse import sys import logging import os import csv class ReadItem: def __init__(self, sequence, totalCount): self.Sequence = sequence self.TotalCount = totalCount self.SampleMap = {} class AnnotationItem: def __init__(self, sequence, totalCount, category, counts): self.Sequence = sequenc...
from unittest import mock from oslo_messaging.rpc import client from oslo_serialization import jsonutils from webob import exc from murano.api.v1 import static_actions from murano.common import policy import murano.tests.unit.api.base as tb @mock.patch.object(policy, 'check') class TestStaticActionsApi(tb.ControllerTes...
import logging import datetime import mediacloud.api import re from server import mc from server.auth import is_user_logged_in from server.util.csv import SOURCE_LIST_CSV_METADATA_PROPS logger = logging.getLogger(__name__) TOPIC_MEDIA_INFO_PROPS = ['media_id', 'name', 'url'] TOPIC_MEDIA_PROPS = ['story_count', 'media_i...
from __future__ import unicode_literals from django.db import migrations, models import sorl.thumbnail.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='WebpageSnapshot', fields=[ ('id', models.AutoFi...
__author__ = "shikun" import pickle import os from common import operateFile from common.variable import Constants def write_pickle(dict_data, path="data.pickle"): read = read_pickle(path) result = [] if len(read) > 0: read.append(dict_data) result = read else: result.append(dict...
import itertools import re import mock # noqa import pytest from awx.main.models import (AdHocCommand, Credential, CredentialType, Job, JobTemplate, Inventory, InventorySource, Project, WorkflowJobNode) from awx.main.utils import decrypt_field from awx.api.versi...
__author__ = "UShareSoft" from texttable import Texttable from ussclicore.argumentParser import ArgumentParser, ArgumentParserError from ussclicore.cmd import Cmd, CoreGlobal from uforgecli.utils import org_utils from ussclicore.utils import printer from ussclicore.utils import generics_utils from uforgecli.utils.uforg...
from __future__ import absolute_import from .base import AuthenticationMixinBase from . import GrantFailed try: from urllib.parse import urlencode except ImportError: from urllib import urlencode try: basestring except NameError: basestring = str class AuthorizationCodeMixin(AuthenticationMixinBase): ...
""" Wavefront REST API Documentation <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST API ...
""" Searches Intel's ARK site and returns data about various processors. TOTALLY UNOFFICIAL. ;) """ from bs4 import BeautifulSoup import click import requests from terminaltables import AsciiTable USER_AGENT = ("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like" "Gecko) Chrome/47.0.2526.111 ...
from __future__ import absolute_import from tests.shape.shape_base import * import analysis.shape.constraints class FirstExampleBase(TestConstraintBase): def shapeSetUp(self): x, self.xSlot, self.xExpr = self.makeLocalObjs('x') y, self.ySlot, self.yExpr = self.makeLocalObjs('y') z, self.zSlot, self.zExpr = se...
""" Generic interchange document structures. """ STYLE_TYPE_INT = 'int' STYLE_TYPE_FLOAT = 'float' STYLE_TYPE_CDATA = 'cdata' STYLE_TYPE_BOOLEAN = 'boolean' STYLE_TYPES = ( STYLE_TYPE_INT, STYLE_TYPE_FLOAT, STYLE_TYPE_CDATA, STYLE_TYPE_BOOLEAN ) class Style(object): def __init__(self, types): ...
from neutron_lib.api.definitions import port from neutron_lib.tests.unit.api.definitions import base class PortDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = port extension_attributes = ()
from mininet.node import Node def convert_port_name_to_number(oshi, port): p = oshi.cmd("ovs-ofctl dump-ports-desc br-%s | grep %s |awk -F '(' '{print $1}'| cut -d ' ' -f 2" %(oshi.name, port )) return str(int(p)) def configure_standalone_sw(switches): print "*** Configuring L2 Switches" root = Node( 'root', inName...
from .tensor import * from .math import *
import sys import click from globus_cli.termio import FORMAT_SILENT, formatted_print from ..services.transfer import CustomTransferClient def transfer_task_wait_with_io( transfer_client: CustomTransferClient, meow, heartbeat, polling_interval, timeout, task_id, timeout_exit_code, ) -> None: ...
""" :author: yoram@ignissoft.com """ import getpass from random import randint from stcrestclient import stchttp class StcRestWrapper(object): def __init__(self, logger, server, port=80, user_name=getpass.getuser(), session_name=None): """ Init STC REST client. :param server: STC REST API server add...
"""Predicates structure for the BigML local AnomalyTree This module defines an auxiliary Predicates structure that is used in the AnomalyTree to save the node's predicates info. """ from bigml.predicate import Predicate class Predicates(): """A list of predicates to be evaluated in an anomaly tree's node. """ ...
"""Implementation of the WebSocket protocol. `WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional communication between the browser and server. WebSockets are supported in the current versions of all major browsers, although older versions that do not support WebSockets are still in use (refer to...
from kafka.tools.protocol.responses import BaseResponse class DescribeAclsV0Response(BaseResponse): schema = [ {'name': 'throttle_time_ms', 'type': 'int32'}, {'name': 'error_code', 'type': 'int16'}, {'name': 'error_message', 'type': 'string'}, {'name': 'resources', 'type': '...
from collections import namedtuple from cytomine.models._utilities.pattern_matching import resolve_pattern class TestPatternMatching: def get_fake_type(self): return namedtuple("fakeobj", ["lst", "atomstr", "atomfloat"]) def test_no_iterable_pattern(self): fake = self.get_fake_type()(lst=1, atom...
import hashlib import re from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING import pandas as pd from sqlalchemy import literal_column from sqlalchemy.sql.expression import ColumnClause from superset.db_engine_specs.base import BaseEngineSpec from superset.utils import core ...
import numpy as np import pdb from random import sample from time import time import heapq import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt import sys, os from eft_calculator import EFT_calculator, Water import tools def load_coordinates(name): lines = open('test.dat/random/'+name).readl...
from optparse import OptionParser import sys from os.path import expanduser, abspath import sunburnt import dist_job_mgr.client as djm QUERY_TERM="datablox" def run_query(addresses): master = addresses[0] si = sunburnt.SolrInterface("http://%s:8983/solr" % master) resp = si.query(QUERY_TERM).execute() a...
"""Contains code for loading and preprocessing the MNIST data.""" import os import tensorflow as tf slim = tf.contrib.slim dataset_data_provider = slim.dataset_data_provider dataset = slim.dataset queues = slim.queues gfile = tf.gfile import demosaic_utils def make_demosaic(image, height, width, BURST_LENGTH, to_shift,...
""" 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 ...
"""Render Vendordata as stored in configured file.""" import errno from oslo_config import cfg from oslo_log import log as logging from oslo_serialization import jsonutils from jacket.api.compute.metadata import base from jacket.i18n import _LW file_opt = cfg.StrOpt('vendordata_jsonfile_path', hel...
import collections import mui4py.mui4py_mod as mui4py_mod from mui4py.config import get_default_config from mui4py.types import map_type, get_float_type_str, get_int_type_str, get_io_type_str import re import numpy as np class CppClass(object): def __init__(self, config=None, args=(), kwargs={}): self._cpp_...
from rest_framework import serializers from accesslog.models import AccessLog, DaySummary, MonthSummary class SourceSerializer(serializers.Serializer): source = serializers.CharField(max_length=200) total = serializers.IntegerField() time_min = serializers.DateTimeField() time_max = serializers.DateTime...
import time import unittest2 from gcloud import _helpers from gcloud import pubsub from gcloud.pubsub.subscription import Subscription from gcloud.pubsub.topic import Topic _helpers._PROJECT_ENV_VAR_NAME = 'GCLOUD_TESTS_PROJECT_ID' pubsub.set_defaults() class TestPubsub(unittest2.TestCase): def setUp(self): ...
"""In charge of collecting data from drivers and push it to the publisher.""" import os import msgpack import nanomsg from oslo_log import log from watcher_metering.agent.manager import MetricManager LOG = log.getLogger(__name__) class Agent(MetricManager): def __init__(self, conf, driver_names, use_nanoconfig_serv...
''' Created on 2016年9月16日 @author: Administrator ''' import calendar def getYear(year): return calendar.calendar(year) def getMonth(year, month): return calendar.month(year, month) def getMonthRange(year, month): return calendar.monthrange(year, month) def getMonthYear(year, month): return calendar.mont...
from numpy.testing import assert_approx_equal, assert_allclose, assert_array_equal from UliEngineering.SignalProcessing.Utils import * from parameterized import parameterized import concurrent.futures import numpy as np import datetime import unittest unstairMethods = [ ("left",), ("middle",), ("right",), ...
""" Module for managing Windows Updates using the Windows Update Agent. List updates on the system using the following functions: - :py:func:`win_wua.available <salt.modules.win_wua.available>` - :py:func:`win_wua.list <salt.modules.win_wua.list_>` This is an easy way to find additional information about updates availa...
""" Get WHOIS information for a given host. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.whois/ """ from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassist...
from solution import Solution from solution import TreeNode def constructOne(s): if s == '#': return None else: return TreeNode(int(s)) def createTree(tree): q = [] root = constructOne(tree[0]); q.append(root); idx = 1; while q: tn = q.pop(0) if not tn: ...
''' HMMPowerSupplyMap ''' from Products.DataCollector.plugins.CollectorPlugin import ( SnmpPlugin, GetTableMap, GetMap ) from DeviceDefine import HMMSTATUS, HMMPRESENCE, HMMPOWERMODE, HMMLOCATION class HMMPowerSupplyMap(SnmpPlugin): ''' HMMPowerSupplyMap ''' relname = 'hmmpowerSupplys' modna...
import abc import typing import pkg_resources import google.auth # type: ignore from google.api_core import gapic_v1 from google.auth import credentials as ga_credentials # type: ignore from google.ads.googleads.v9.resources.types import geo_target_constant from google.ads.googleads.v9.services.types import geo_targe...
"""Test for using the Aggregate API.""" import os import apache_beam as beam from apache_beam.testing import util import tensorflow as tf from tensorflow_model_analysis import constants from tensorflow_model_analysis.eval_saved_model import testutil from tensorflow_model_analysis.eval_saved_model.example_trainers impor...
"""Misc helper functions. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import logging as log import tensorflow as tf def optimistic_restorer(save_file, vars_all=None): """Restores the variables which are present in save_file. Args: sa...
import logging import math import pytest import tvm from tvm import relay import numpy as np from tvm.runtime.vm import VirtualMachine from tvm.relay.op.contrib.cutlass import partition_for_cutlass from tvm.contrib.cutlass import ( tune_cutlass_kernels, build_cutlass_kernels, build_cutlass_kernels_vm, ) log...
import ast import bisect import token import tokenize import io import six from six.moves import xrange # pylint: disable=redefined-builtin from .line_numbers import LineNumbers from .util import Token, match_token, is_non_coding_token from .mark_tokens import MarkTokens class ASTTokens(object): """ ASTTokens ...
""" Support for Yamaha Receivers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.yamaha/ """ import logging import requests import voluptuous as vol from homeassistant.components.media_player import ( DOMAIN, MEDIA_PLAYER_SCHEMA, MEDIA_TY...
__author__ = 'Sulantha' import logging class PipelineLogger: logFunctions={'info':logging.info, 'debug':logging.debug, 'warning':logging.warning, 'error':logging.error, 'critical':logging.critical, 'exception':logging.exception} @...