code
stringlengths
1
199k
from oslo_utils import uuidutils from oslo_middleware import base class CorrelationId(base.ConfigurableMiddleware): "Middleware that attaches a correlation id to WSGI request" def process_request(self, req): correlation_id = (req.headers.get("X_CORRELATION_ID") or uuidutils.gen...
""" EFILTER test suite. """ __author__ = "Adam Sindelar <adamsh@google.com>" from efilter import api from efilter import ast from efilter import errors from efilter import query as q from efilter.protocols import reducer from efilter.protocols import repeated from efilter.transforms import solve from efilter_tests impo...
from sklearn.calibration import CalibratedClassifierCV from dama.clf.wrappers import SKL, SKLP from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import ExtraTreesClassifier from sklearn.linear_model import LogisticRegression as LReg from sklearn.linear_model import SGDClassifier as SGDClassif fr...
from model.info_contact import Infos def test_main_page(app, db): db_main_page_contacts = db.get_contact_list(True) app_main_page_contacts = app.contact.get_contact_list() assert sorted(db_main_page_contacts, key=Infos.id_or_max) == sorted(app_main_page_contacts, key=Infos.id_or_max)
from ..user.models import User from ..demo.models import DemoParent, DemoChild
from collections import OrderedDict import warnings import numpy as np from common import AbstractWritableDataStore import xray from xray.conventions import encode_cf_variable from xray.utils import FrozenOrderedDict, NDArrayMixin, as_array_or_item from xray import indexing class NetCDF4ArrayWrapper(NDArrayMixin): ...
""" Cisco_IOS_XR_mpls_oam_cfg This module contains a collection of YANG definitions for Cisco IOS\-XR mpls\-oam package configuration. This module contains definitions for the following management objects\: mpls\-oam\: MPLS LSP verification configuration Copyright (c) 2013\-2015 by Cisco Systems, Inc. All rights rese...
import sys import models import model_utils import math import numpy as np import video_level_models import tensorflow as tf import utils import tensorflow.contrib.slim as slim from tensorflow import flags FLAGS = flags.FLAGS class LstmMultiAttentionModel(models.BaseModel): def create_model(self, model_input, vocab_s...
import unittest import threading import json import uuid import time import pika from influxdb.influxdb08 import InfluxDBClient from amqp_influxdb import (InfluxDBPublisher, AMQPTopicConsumer) influx_database = 'influx' amqp_exchange = 'exchange' routing_key = 'routing_key' class Test(unittes...
import os import urllib2 import datetime from lxml import etree from django.conf import settings from virtenviro.shop.models import Currency def update_currency(): current_date = datetime.datetime.now() url = 'http://www.cbr.ru/scripts/XML_daily.asp?date_req=%s/%s/%s' % (current_date.day, ...
from djangoappengine.settings_base import * ADMINS = ( ) MANAGERS = ADMINS DATABASES['default'] = {'ENGINE': 'dbindexer', 'TARGET': DATABASES['default']} AUTOLOAD_SITECONF = 'indexes' ALLOWED_HOSTS = [".ntulifeguardapp.appspot.com"] TIME_ZONE = 'Asia/Taipei' LANGUAGE_CODE = 'zh-tw' SITE_ID = 1 USE_I18N = True USE_L10N ...
"""Schedule for conv2d_nchw with auto fusion""" import tvm from .. import tag from .. import generic @generic.schedule_conv2d_nchw.register(["opengl"]) def schedule_conv2d_nchw(outs): """Schedule for conv2d_nchw. Parameters ---------- outs: Array of Tensor The computation graph description of co...
import google.api_core.grpc_helpers from google.cloud.tasks_v2beta2.proto import cloudtasks_pb2_grpc class CloudTasksGrpcTransport(object): """gRPC transport class providing stubs for google.cloud.tasks.v2beta2 CloudTasks API. The transport provides access to the raw gRPC stubs, which can be used to tak...
from django.contrib.auth.models import AnonymousUser from .models import * from django.test import TestCase from django.db import transaction import reversion TEST_USER_NAME_CREATOR = 'test project creator' TEST_USER_NAME_NOT_MEMBER = 'user is not a member' TEST_PROJECT_PUBLIC_NAME = 'test project name public' TEST_PRO...
""" Preprocessing script before distillation. """ import argparse import logging import pickle import random import time import numpy as np from transformers import BertTokenizer, GPT2Tokenizer, RobertaTokenizer logging.basicConfig( format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y ...
""" Stanford Parser Client Example """ __author__ = "Melroy van den Berg <melroy@melroy.org>" __version__ = "0.1" import sys import Pyro4 PYRO_NAME = "PYRONAME:stanford.server" wordList = ['Hello', ',', 'my', 'name', 'is', 'Melroy'] try: # Connect to the Stanford Server server=Pyro4.Proxy(PYRO_NAME) # Sent the reque...
import os import sys os.system("time python nettacker.py --help") os.system("time python nettacker.py --help -L fa") os.system("time python nettacker.py --version") if os.system("time python nettacker.py -i 127.0.0.1 -u user1,user2 -p " "pass1,pass2 -m all -g 21,25,80,443 -t 10000000 -T 0.1 -v 5 --method-a...
from configparser import ConfigParser parser = ConfigParser() parser.read('multisection.ini') for section_name in parser: print('Section:', section_name) section = parser[section_name] print(' Options:', list(section.keys())) for name in section: print(' {} = {}'.format(name, section[name])) ...
from __future__ import unicode_literals from builtins import str from past.builtins import basestring import hashlib import sys if sys.version_info.major == 2: # noinspection PyUnresolvedReferences,PyShadowingBuiltins str = str try: from collections.abc import Iterable except ImportError: from collectio...
''' Document Localization using Recursive CNN Maintainer : Khurram Javed Email : kjaved@ualberta.ca ''' import argparse import time import numpy as np import torch from PIL import Image import dataprocessor import evaluation from utils import utils parser = argparse.ArgumentParser(description='iCarl2.0') parser.add_a...
import factory from datetime import date from django.contrib.auth.models import Group, User from login.models import PasswordResetAudit TEST_PASSWORD = 'letmein' class GroupFactory(factory.django.DjangoModelFactory): class Meta: model = Group @factory.sequence def name(n): return 'group_{}'....
import numpy as np import matplotlib.pyplot as plt Freq=np.array([40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360,370,380,390,400]) Db=np.array([70,72.7,77,81.1,85.4,90.1,95.6,101.7,102.6,101.1,99.6,99.4,99.1,100.2,101.6,103.2,105.6,107.5,110...
import abc import itertools import random from neutron_lib import constants as const from oslo_serialization import jsonutils from neutron.common import constants from neutron.extensions import dns as dns_ext from neutron.objects import common_types from neutron.tests import base as test_base from neutron.tests import ...
from geopy.geocoders import Nominatim from geopy.geocoders import GoogleV3 from geopy.distance import vincenty from geopy.exc import GeocoderServiceError import key import logging from geoLocation import GeoLocation GEOLOCATOR_1 = Nominatim() GEOLOCATOR_2 = GoogleV3(key.GOOGLE_API_KEY) def getLocationFromAddress(locati...
from google.cloud.workflows import executions_v1 def sample_get_execution(): # Create a client client = executions_v1.ExecutionsClient() # Initialize request argument(s) request = executions_v1.GetExecutionRequest( name="name_value", ) # Make the request response = client.get_executi...
import numpy as np class ion_datacube(): # a class for holding a datacube from an MSI dataset and producing ion images def __init__(self, step_size=[]): # define mandatory parameters (todo- validator to check all present) self.xic = [] # 'xtracted ion chromatogram (2d array of intensities(vector of ti...
from django.conf.urls import url from django.contrib.auth.decorators import login_required from .views import * urlpatterns = [ # Asignaturas url(r'^asignaturas/', login_required(asignatura_list), name='asignaturaList'), url(r'^nueva-asignatura/', login_required(asignatura_create), name='asignaturaCreate'), url(r'^...
import dnf from artifact_registry._vendor.google.auth import compute_engine, default from artifact_registry._vendor.google.auth.exceptions import DefaultCredentialsError, RefreshError from artifact_registry._vendor.google.auth.transport import requests from artifact_registry._vendor.google.oauth2 import service_account...
"""Correctness tests for tf.keras DNN model using DistributionStrategy.""" import tensorflow.compat.v2 as tf import numpy as np import keras from keras import backend from keras.testing_infra import test_utils from keras.distribute import keras_correctness_test_base from keras.distribute import strategy_combinations fr...
import mock from six.moves import http_client import sys from cinder import context from cinder import exception from cinder.objects import volume as obj_volume from cinder import test from cinder.tests.unit import fake_constants as fake from cinder.volume.drivers import nimble from cinder.volume import volume_types NI...
from django.conf import settings from contextlib import contextmanager import pika import json @contextmanager def rabbit_connection(): connection = pika.BlockingConnection(pika.ConnectionParameters(**settings.RABBIT)) try: yield connection.channel() except Exception as e: connection.close()...
from ..remote import RemoteModel from infoblox_netmri.utils.utils import check_api_availability class SubnetMemberRemote(RemoteModel): """ Members of subnets. | ``DataSourceID:`` The internal NetMRI identifier for the collector NetMRI that collected this data record. | ``attribute type:`` number |...
import json import logging import logging.handlers import os import os.path import sys import timeit from subprocess import call, Popen, PIPE LABEL_GREEN='\033[0;32m' LABEL_RED='\033[0;31m' LABEL_COLOR='\033[0;33m' LABEL_NO_COLOR='\033[0m' STARS="**********************************************************************" D...
from re import sub, VERBOSE from anki.template.furigana import kanji from aqt import mw from util import getFilters, getSrcDstMappingForFilters def containsKanji(text): """ Checks whether text contains kanji. Adapted from https://github.com/larsyencken/cjktools/blob/master/cjktools/scripts.py @param tex...
import numpy as np import matplotlib.pyplot as plt from scipy.stats import beta def plot(a, b, trial, ctr): x = np.linspace(0, 1, 200) y = beta.pdf(x, a, b) mean = float(a) / (a + b) plt.plot(x, y) plt.title("Distributions after %s trials, true rate = %.1f, mean = %.2f" % (trial, ctr, mean)) plt.show() true...
import heapq class Solution(object): def kSmallestPairs(self, nums1, nums2, k): """ :type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[List[int]] """ l1, l2 = len(nums1), len(nums2) if l1 * l2 <= k: return sorted([[n1, ...
from ajenti.api import * from ajenti.plugins import * info = PluginInfo( title='OpenVPN', icon='globe', dependencies=[ PluginDependency('main'), PluginDependency('services'), BinaryDependency('openvpn'), ], ) def init(): import backend import main
import argparse import os from cnrclient.commands.push import PushCmd from cnrclient.commands.inspect import InspectCmd from cnrclient.commands.pull import PullCmd from cnrclient.commands.version import VersionCmd from cnrclient.commands.show import ShowCmd from cnrclient.commands.login import LoginCmd from cnrclient.c...
import base64 import logging import os import random import socket import string import tornado.ioloop import tornado.web beakerx = {} logging.getLogger('tornado.access').disabled = True def basic_auth(f): def auth(username, password): return username == "beakerx" and password == os.environ["BEAKERX_AUTOTRA...
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.output_reporting import FuelFactors log = logging.getLogger(__name__) class TestFuelFactors(unittest.TestCase): def setUp(self): self.fd, self.path = tempfile.mkstemp(...
from django.utils.translation import ugettext_lazy as _ from horizon import tables class SubscribedPlansTable(tables.DataTable): #id = tables.Column('plan_id', verbose_name=_('Id')) name = tables.Column('name', verbose_name=_('Name'), \ link="horizon:project:customer_subscribed_plans:user_sub_plan_detai...
"""Writer for Debian packaging (dpkg) files.""" from __future__ import unicode_literals import io import os from l2tdevtools.dependency_writers import interface class DPKGCompatWriter(interface.DependencyFileWriter): """Dpkg compat file writer.""" PATH = os.path.join('config', 'dpkg', 'compat') _FILE_CONTENT = '9...
import collections import datetime import uuid from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import importutils import six from clictest.common import exception from clictest.common import timeutils from clictest.i18n import _, _LE, _LI, _LW LOG = loggin...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ProjectUpdate.start_args' db.add_column(u'main_projectupdate', 'start_args', ...
import os import sys import numpy as np import unittest import contextlib import paddle import paddle.fluid as fluid file_dir = os.path.dirname(os.path.abspath(__file__)) fluid.load_op_library(os.path.join(file_dir, 'librelu2_op.so')) from paddle.fluid.layer_helper import LayerHelper def relu2(x, name=None): helper...
"""Tests for tensorflow.ops.reverse_sequence_op.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.python.platform import numpy as np import tensorflow as tf from tensorflow.python.kernel_tests import gradient_checker as gc class ReverseSeq...
from math import sqrt inf = float("inf") def length(v1, v2): da, db = (v1[0] - v2[0]), (v1[1] - v2[1]) return sqrt(da * da + db * db) def do_it(points, index): if len(points) == 1 : return 0 , points p0, j, shortest = points.pop(index), 0, inf for i in xrange(0, len(points)): d = length(p0, ...
from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() from builtins import object import configparser from jnpr.space import rest from jnpr.space import async class TestAsync(object): def setup_class(self): # Extract Space URL, userid, password from c...
""" .. module: lemur.users.schemas :platform: unix :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Kevin Glisson <kglisson@netflix.com> """ from marshmallow import fields from lemur.common.schema import LemurInputSchema, LemurOutpu...
import re import requests from bs4 import BeautifulSoup def getHTMLText(url): try: r = requests.get(url) r.raise_for_status() r.encoding = r.apparent_encoding return r.text except: return "" def getStockList(lst, stockURL): html = getHTMLText(stockURL) soup = Beau...
import time from typing import List from unittest.mock import patch from bs4 import BeautifulSoup from zerver.lib.realm_icon import get_realm_icon_url from zerver.lib.test_classes import ZulipTestCase from zerver.middleware import is_slow_query, write_log_line from zerver.models import get_realm class SlowQueryTest(Zul...
__author__ = "Simone Campagna" __all__ = [ 'Config' 'get_config' ] import os import shlex from collections import OrderedDict from .. import py23 from .. import conf from . import log from . import environment from ..units import Memory from ..errors import RubikError from ..cubes.dtypes import DEFAULT_DATA_T...
from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^$', 'geekr.views.index'), (r'^scoreboard$', 'geekr.views.scoreboard'), (r'^(?P<nick>[\w\_\.]+)$', 'geekr.views.score'), (r'^(?P<nick>[\w\_\.]+)/verbose', 'geekr.views.verbose'), (r'^(?P<nick>[\w\_\.]+)/by_voter', 'geekr.views.ver...
import logging import testtools import zuul.source class TestGerritSource(testtools.TestCase): log = logging.getLogger("zuul.test_source") def test_source_name(self): self.assertEqual('gerrit', zuul.source.gerrit.GerritSource.name)
from ehive.runnable.IGFBaseJobFactory import IGFBaseJobFactory class ProjectFastqdirFactory(IGFBaseJobFactory): ''' A job factory for all the fastq dir for a project ''' def param_defaults(self): params_dict=super(ProjectFastqdirFactory,self).param_defaults() return params_dict def run(self): try:...
from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='shared.proto',...
import os import subprocess from ros_buildfarm.common import get_os_package_name def _get_source_tag( rosdistro_name, pkg_name, pkg_version, os_name, os_code_name): assert os_name in ['fedora', 'rhel'] return 'rpm/%s-%s_%s' % ( get_os_package_name(rosdistro_name, pkg_name), pkg_version, ...
from cairis.core.ARM import * from cairis.core.Goal import Goal from cairis.core.GoalEnvironmentProperties import GoalEnvironmentProperties from cairis.core.GoalParameters import GoalParameters from cairis.daemon.CairisHTTPError import CairisHTTPError, ObjectNotFoundHTTPError, MalformedJSONHTTPError, ARMHTTPError, Miss...
"""Library functions for creating dataset.""" import collections import copy import numpy as np def _dedup_mixes(mixes): # Retain only mixes with unique lists of examples. mixes_unique_examples = [tuple(sorted(mix)) for mix in mixes if len(set(mix)) == len(mix)] # Retain only unique mix...
import time import consul import health_heck.config def get_status(user_name, project_name, service_name): c = consul.Consul(health_heck.config.consul_url) v = c.kv.get('nap_services/%s/%s/%s' % (user_name, project_name, service_name)) print(v) # ('20083369', {u'LockIndex': 0, u'ModifyIndex': 20083369, ...
""" 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 ...
import os.path import urllib2 from bs4 import BeautifulSoup def determineType(url, phoneno, direction): if "/comments/" in url: return commentThread(url, phoneno, direction) else: return subreddit(url) def commentThread(url, phoneno, direction): user_agent = 'Mozilla/5.0 (Windows NT 10.0; Wi...
"""Workflow Logic the Identity service.""" from oslo_config import cfg from oslo_log import log from keystone.common import controller from keystone.common import dependency from keystone import exception from keystone.i18n import _, _LW CONF = cfg.CONF LOG = log.getLogger(__name__) @dependency.requires('assignment_api...
from oslo_config import cfg secret = True opts = [ cfg.StrOpt('admin_user', help="User's name"), cfg.StrOpt('admin_password', secret=True, help="User's password"), cfg.StrOpt('nova_password', secret=secret, help="Nova user password")...
import re import nltk.data from nltk.stem import WordNetLemmatizer def split_sentences(text, decorate=False): sent_tokenizer = nltk.data.load('tokenizers/punkt/english.pickle') sentences = sent_tokenizer.sentences_from_text(text, realign_boundaries=True) if decorate: sentences = [sent + ' <SE>' for ...
from neutron_lib.api.definitions import subnet as subnet_def from neutron_lib import constants ALIAS = 'subnet-service-types' IS_SHIM_EXTENSION = False IS_STANDARD_ATTR_EXTENSION = False NAME = 'Subnet service types' API_PREFIX = '' DESCRIPTION = "Provides ability to set the subnet service_types field" UPDATED_TIMESTAM...
import datetime import flask import flask_appconfig import flask_bootstrap from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.dialects.mysql import LONGTEXT from sqlalchemy import func from sqlalchemy import desc db = SQLAlchemy() class Paste(db.Model): id = db.Column(db.Integer, primary_key=True) tag ...
from twisted.internet.protocol import DatagramProtocol from twisted.internet import reactor import datetime import socket import time import sys import thread import os.path lib_path = os.path.abspath('../utils') sys.path.append(lib_path) from myParser import * from myCrypto import * from myDriver import * from myCamDr...
from __future__ import absolute_import, division, print_function import functools import warnings import numpy as np import pandas as pd from . import computation, groupby, indexing, ops, resample, rolling, utils from ..plot.plot import _PlotMethods from .accessors import DatetimeAccessor from .alignment import align, ...
import copy import six import uuid from oslo_config import cfg from oslo_log import log as logging from oslo_utils import timeutils from heat.common import exception from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties from heat.engine ...
"""Test class for Ironic BaseConductorManager.""" import collections from unittest import mock import uuid import eventlet import futurist from futurist import periodics from ironic_lib import mdns from oslo_config import cfg from oslo_db import exception as db_exception from oslo_utils import uuidutils from ironic.com...
def export_to_hbase(self, table_name, key_column_name=None, family_name="familyColumn"): """ Write current frame to HBase table. Table must exist in HBase. Parameters ---------- :param table_name: (str) The name of the HBase table that will contain the exported frame :param key_column_name: ...
from hazelcast.protocol.builtin import FixSizedTypesCodec from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer, RESPONSE_HEADER_SIZE from hazelcast.protocol.builtin import StringCodec _REQUEST_MESSAGE_TYPE = 76544 _RESPONSE_MESSAGE_TYPE = 76545 _REQUEST_INITIAL_FRAME...
"""Dialogflow API Beta Detect Intent Python sample with sentiment analysis. Examples: python detect_intent_with_sentiment_analysis.py -h python detect_intent_with_sentiment_analysis.py --project-id PROJECT_ID \ --session-id SESSION_ID \ "hello" "book a meeting room" "Mountain View" """ import argparse import uu...
""" WSGI config for cfbets project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_M...
BOT_NAME = 't66ySpider' SPIDER_MODULES = ['t66ySpider.spiders'] NEWSPIDER_MODULE = 't66ySpider.spiders'
"""Module containing the view for GSoC project details page. """ from google.appengine.ext import db from django.utils.translation import ugettext from soc.logic.exceptions import BadRequest from soc.views.helper.access_checker import isSet from soc.views.template import Template from soc.views.toggle_button import Tog...
"""This example illustrates how to run a report. Tags: reports.run """ __author__ = ('api.jimper@gmail.com (Jonathon Imperiosi)') import argparse import sys from apiclient import sample_tools from oauth2client import client argparser = argparse.ArgumentParser(add_help=False) argparser.add_argument( 'profile_id', ty...
""" Implements operations on volumes residing on VMware datastores. """ from oslo_log import log as logging from oslo_utils import units from oslo_vmware import exceptions from oslo_vmware import pbm from oslo_vmware import vim_util import six from six.moves import urllib from cinder.i18n import _, _LE, _LI from cinder...
import unittest from fabric.api import local from lib import base from lib.gobgp import * from lib.quagga import * import sys import os import time import nose from noseplugin import OptionParser, parser_option from itertools import combinations def get_mac_mobility_sequence(pattr): for ecs in [p['value'] for p in ...
import suml.yuml2dot import suml.common import sys def print_ascii(nodes): # import drawer # drawer.print_ascii() spec = "" for node in nodes: node_name = node['name'] for edge, next_node in node['next'].iteritems(): spec += "[" + node_name + "]" + "-" + edge + " >" + "[" + n...
import asyncio async def coroutine(): print('in coroutine') return 'result' event_loop = asyncio.get_event_loop() try: return_value = event_loop.run_until_complete( coroutine() ) print('it returned: {!r}'.format(return_value)) finally: event_loop.close()
from pylons import config, cache import sqlalchemy.exc import ckan.logic as logic import ckan.lib.maintain as maintain import ckan.lib.search as search import ckan.lib.base as base import ckan.model as model import ckan.lib.helpers as h from ckan.common import _, g, c CACHE_PARAMETERS = ['__cache', '__no_cache__'] dirt...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys from thrift.protocol.TProtocol import * from struct import pack, unpack __all__ = [ "TCompactProtocol", "TCompactProtocolFactory", "TCompactProtocol...
import urllib.parse import markdown_strings as md from dataclasses import dataclass from typing import Any, Dict, Optional, Sequence, Tuple from .benchmark_definition import BenchmarkResults from .benchmark_thresholds import BENCHMARK_THRESHOLDS, ThresholdUnit PERFBOARD_SERIES_PREFIX = "https://perf.iree.dev/serie?IREE...
"""Tests for v1 version of dnn_linear_combined.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import tempfile from absl.testing import parameterized import numpy as np import six import tensorflow as tf from tensorflow.core.example impor...
"""Update the raw data used as the main source of information. """ import gzip import os import shutil import sys import requests import hashlib from .datapaths import here raw_data_folder_path = os.path.join(here, 'raw') ban_url = 'https://adresse.data.gouv.fr/data/ban/export-api-gestion/latest/ban/{}' ban_dpt_gz_file...
ZULIP_VERSION = "1.5.1+git" PROVISION_VERSION = '4.5'
VERSION = "2.6" from flask import Flask, jsonify import boto.utils import boto3 import os import threading, time import requests import sys from pprint import pprint TWITTER_VARIABLES = ['TWITTER_CONSUMER_KEY', 'TWITTER_CONSUMER_SECRET', 'TWITTER_ACCESS_TOKEN', 'TWITTER_ACCESS_SECRET'] firehose = boto3.client('firehose...
import json import logging import ochopod import pykka import uuid from flask import Flask, request from kazoo.exceptions import ConnectionClosedError, NodeExistsError from kazoo.client import KazooClient, KazooState from kazoo.recipe.lock import LockTimeout from ochopod.core.fsm import shutdown, spin_lock, Aborted, FS...
import pytest from coredb.api.runs.serializers import RunDetailSerializer, RunStatusSerializer from coredb.factories.runs import RunFactory from coredb.managers.statuses import new_run_status, new_run_stop_status from coredb.models.runs import Run from polyaxon.lifecycle import V1StatusCondition, V1Statuses from polyax...
from airflow.utils import import_module_attrs as _import_module_attrs _import_module_attrs(globals(), { 'check_operator': [ 'CheckOperator', 'ValueCheckOperator', 'IntervalCheckOperator', ], }) _operators = { 'bash_operator': ['BashOperator'], 'python_operator': [ 'Python...
""" Copyright [1999-2018] EMBL-European Bioinformatics Institute 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...
def usd_trade_size_scaling(x, power=.5, factor=.1): return (x ** power) * factor
from common import * # NOQA import yaml from netaddr import IPNetwork, IPAddress def _create_stack(client): env = client.create_environment(name=random_str()) env = client.wait_success(env) assert env.state == "active" return env def _create_stack_long_name(client, lname): env = client.create_envir...
import unittest import cothread from annotypes import json_encode from tornado import gen from tornado.httpclient import AsyncHTTPClient, HTTPRequest from malcolm.core import Process, Queue from malcolm.modules.demo.blocks import hello_block from malcolm.modules.web.blocks import web_server_block from malcolm.modules.w...
from __future__ import absolute_import from pex.enum import Enum from pex.typing import TYPE_CHECKING if TYPE_CHECKING: from typing import Union class InheritPath(Enum["InheritPath.Value"]): class Value(Enum.Value): pass FALSE = Value("false") PREFER = Value("prefer") FALLBACK = Value("fallb...
import contextlib import StringIO import unittest import mock import mox from oslo.config import cfg from cinder.db import api as db_api from cinder import exception from cinder.volume import configuration as conf from cinder.volume import driver as parent_driver from cinder.volume.drivers.xenapi import lib from cinder...
from __future__ import absolute_import, division, print_function, unicode_literals from datetime import datetime from dateutil import parser, tz as tzutil import json import fnmatch import itertools import logging import os import time import jmespath import six from c7n.cwe import CloudWatchEvents from c7n.ctx import ...
from __future__ import absolute_import from __future__ import print_function import unittest from weave_wdm_next_test_service_base import weave_wdm_next_test_service_base class test_weave_wdm_next_service_mutual_subscribe_25(weave_wdm_next_test_service_base): def test_weave_wdm_next_service_mutual_subscribe_25(self...