code
stringlengths
1
199k
""" seqparse contains custom sequence parsers for extending screed's functionality to arbitrary sequence formats. An example 'hava' parser is included for API reference """ import os from createscreed import create_db from openscreed import ScreedDB import fastq import fasta import hava def read_fastq_sequences(filenam...
SORT_DIR_VALUES = ('asc', 'desc') DAYS = ( 'SUN','MON','TUE','WED','THU','FRI','SAT' ) ALERT_TEMPLATE = ( 'id', 'status', 'day', 'time', ) ALERT_SINGLE = ( 'alert_template_id', 'created_at', 'updated_at', ) NOTIFICATION = ( 'id','status', 'day', 'time', ) NOTIFICATION_ALERT = ( 'alert_single...
__author__ = 'bs' from pylab import * import cv2 class Filter: @staticmethod def gaussianBlur(image, n=3): return cv2.GaussianBlur(image, (n, n), 0) @staticmethod def blur(image, n=3): return cv2.blur(image, (n, n))
""" Simultaneous Multithreading (SMT) combiner ========================================== Combiner for Simultaneous Multithreading (SMT). It uses the results of the following parsers: :class:`insights.parsers.smt.CpuCoreOnline`, :class:`insights.parsers.smt.CpuSiblings`. """ from insights.core.plugins import combiner f...
import redis import copy from dHydra.core.Functions import * from dHydra.core.Controller import controller from dHydra.core.Controller import controller_get from dHydra.core.Controller import controller_post conn = get_vendor("DB").get_redis() @controller_get def get_worker_names( query_arguments, get_query_arg...
from mint.protos import dataset_pb2 from mint.utils import inputs_util import tensorflow as tf class InputsUtilTest(tf.test.TestCase): def test_get_modality_to_params(self): dataset_config = dataset_pb2.Dataset() dataset_config.window_type = dataset_pb2.Dataset.BEGINNING dataset_config.input_length_sec = ...
"""Functions for interacting with the search.proto. """ from ..search import search_pb2 def create_choice_pb(sequence, source_enum, control_enum, cluster_num=-1, mutation_step=0, seed_sequence=None, ...
from quark_runtime import * def call_main(): import sys; main(_List(sys.argv[1:])) def main(args): if (True): _println(u"Hi!"); b = (1) > (0); if (b): _println(u"Hey!"); c = False; if (not (c)): _println(u"Ho!"); count = 0; while (True): if ((count) > (3)): ...
from __future__ import absolute_import, division, print_function from cryptography.hazmat.backends import _backend_import_fallback def test_backend_import_fallback_empty_backends(): backends = _backend_import_fallback([]) assert len(backends) >= 1 def test_backend_import_fallback_existing_backends(): backen...
"""Common helper logging functions""" import json from typing import Optional, Union from google.api_core.exceptions import GoogleAPIError from google.cloud import bigquery from google.cloud.exceptions import ClientError def log_bigquery_job(job: Union[bigquery.LoadJob, bigquery.QueryJob], table: b...
from oslo.config import cfg from neutron.api.v2 import attributes from neutron.common import constants as l3_const from neutron.common import exceptions as n_exc from neutron.common import utils as n_utils from neutron.db import l3_attrs_db from neutron.db import l3_db from neutron.db import l3_dvrscheduler_db as l3_dv...
import unittest from eve.defaults import build_defaults, resolve_default_values class TestBuildDefaults(unittest.TestCase): def test_schemaless_dict(self): schema = { "address": { 'type': 'dict' } } self.assertEqual({}, build_defaults(schema)) def ...
import json class User(object): ''' This provides default implementations for the methods that Flask-Login expects user objects to have. ''' def __init__(self, redis_client, user_id): self.user_id = user_id user_info = redis_client.get("user:%s" %(user_id)) self.user_info = j...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_mezzanine_advanced_admin.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
""" Volume driver for HP 3PAR Storage array. This driver requires 3.1.3 firmware on the 3PAR array, using the 3.x version of the hp3parclient. You will need to install the python hp3parclient. sudo pip install --upgrade "hp3parclient>=3.0" Set the following in the cinder.conf file to enable the 3PAR Fibre Channel Drive...
"""Controller Unit Tests. Units tests for testing BIG-IP resource management. """ from __future__ import absolute_import import unittest import json from mock import Mock, patch from f5_cccl.utils.mgmt import ManagementRoot from f5_cccl.utils.mgmt import mgmt_root from f5_cccl.utils.network import apply_network_fdb_con...
from django.conf.urls.defaults import * urlpatterns = patterns('', # url(r'^$', 'views.index', name='index'), )
from unittest.mock import Mock from twisted.internet import defer from synapse.api.constants import EduTypes, EventTypes from synapse.events import EventBase from synapse.federation.units import Transaction from synapse.handlers.presence import UserPresenceState from synapse.rest import admin from synapse.rest.client i...
import os import socket import datetime import pprint import sys POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir)) if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'upscale', '__init__.py')): sys....
import signal import sys import time import praw from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import auth import controllers import eventloop import settings import yamsdaq_eventloop loopHandlers = [eventloop.loop] if settings.STOCK_EXCHANGE_ENABLED: loopHandlers.append(yamsdaq_event...
def init(job): from JumpScale.baselib.atyourservice81.AtYourServiceBuild import ensure_container ensure_container(job.service, root=False) def install(job): from JumpScale.baselib.atyourservice81.AtYourServiceBuild import build def build_func(cuisine): cuisine.systemservices.g8oscore.build(start...
from __future__ import print_function, division import bluetooth import math import numpy as np from threading import Thread def get_array_index(index, dimensions=(4,16)): x, y = dimensions row = math.floor(index / x) column = index - row*x if(row > y): raise ValueError("Value given was outside ...
import time from rediscluster import StrictRedisCluster from random import Random import threading import sys import pycurl def random_str(randomlength=64): str = '' chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789' length = len(chars) - 1 random = Random() for i in range(rand...
import arcpy import sys, os from xml.dom import minidom from string import ascii_letters, digits scriptPath = os.path.dirname(__file__) sys.path.append(os.path.join(scriptPath, 'Base')) import Base class Solutions(Base.Base): processInfo = None userInfo = None config = '' m_base = None def __init__(...
from django.conf.urls import patterns, include, url from django.conf import settings urlpatterns = patterns('events.views', #url(r'^medicines/', include('medicines.urls')), url(r'^$','Eventlist',name='Eventlist'), )
from horizon import views from openstack_dashboard.dashboards.metering.common.usage import NandyUsage from openstack_dashboard.dashboards.project.overview.views \ import ProjectUsageCsvRenderer from openstack_dashboard.usage import ProjectUsageTable from openstack_dashboard.usage import UsageView class ProjectOverv...
"""Helpers that help with state related things.""" import asyncio import json import logging from collections import defaultdict from homeassistant.loader import bind_hass import homeassistant.util.dt as dt_util from homeassistant.components.media_player import ( ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, ATTR...
from oslo_log import log as logging from nova import block_device from nova.cells import opts as cells_opts from nova.cells import rpcapi as cells_rpcapi from nova import db from nova import exception from nova.i18n import _, _LW from nova import objects from nova.objects import base from nova.objects import fields LOG...
""" Tools to generate data sources. """ import numpy as np import pandas as pd from zipline.gens.utils import hash_args from zipline.sources.data_source import DataSource from zipline.finance.trading import with_environment class DataFrameSource(DataSource): """ Data source that yields from a pandas DataFrame. ...
from abc import ABCMeta, abstractmethod class Algorithm(object): __meta__ = ABCMeta def __init__(self, data, cache_size): self.data = data self.cache_size = cache_size @abstractmethod def compute(self): pass
import datetime import testing_config # Must be imported before the module under test. import flask from unittest import mock import werkzeug.exceptions # Flask HTTP stuff. from api import comments_api from internals import models test_app = flask.Flask(__name__) NOW = datetime.datetime.now() class CommentsAPITest(te...
from model.contact import Contact import re class ContactHelper: def __init__(self, app): self.app = app def open_new_contact_page(self): wd = self.app.wd wd.find_element_by_link_text("add new").click() def creating_the_contact(self, contact): wd = self.app.wd self.op...
import pytest import sys from .test_base_class import TestBaseClass from aerospike import exception as e from .as_status_codes import AerospikeStatus from aerospike_helpers import cdt_ctx from aerospike_helpers.expressions import * from aerospike_helpers.operations import map_operations from aerospike_helpers.operation...
from tornado import gen from tornado.httpclient import AsyncHTTPClient from tornado.testing import AsyncHTTPTestCase from tornado.web import Application, RequestHandler from tornado_mock.httpclient import get_response_stub, patch_http_client, set_stub class TestHandler(RequestHandler): @gen.coroutine def get(se...
from cmd3.shell import command from cmd3.generate import generate_command class shell_generate: # Not needed as we moved this to cmd3 # # def activate_shell_generate(self): # self.register_command_topic('cmd3', 'command') @command def do_generate(self, args, arguments): """ ::...
""" Stakeholder engagement API This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers. OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git...
from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields import django.contrib.gis.db.models.fields import multigtfs.models.fields.seconds class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name...
from django.conf.urls import include, url from django.contrib import admin from django.conf import settings import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^cmdb/', include('cmdb.urls')), url(r'^navi/', include('navi.urls')), url(r'^admin/', admin.site.urls), url(r'^setup/'...
"""Offer MQTT listening automation rules.""" import json import voluptuous as vol from homeassistant.components import mqtt from homeassistant.const import CONF_PAYLOAD, CONF_PLATFORM from homeassistant.core import callback import homeassistant.helpers.config_validation as cv CONF_ENCODING = "encoding" CONF_QOS = "qos"...
"""Tests for the extraction tool object.""" import argparse import unittest from plaso.cli import extract_analyze_tool from plaso.lib import errors from tests.cli import test_lib class ExtractionAndAnalysisToolTest(test_lib.CLIToolTestCase): """Tests for the extraction and analysis tool object.""" _STORAGE_FILENAME...
from six.moves.urllib.parse import quote import os import time import functools import inspect import itertools import operator from copy import deepcopy from sys import exc_info from swift import gettext_ as _ from eventlet import sleep from eventlet.timeout import Timeout import six from swift.common.wsgi import make...
try: from StringIO import StringIO except ImportError as e: from io import StringIO import sys import unittest from pybuilder.core import init, task, description, use_plugin from pybuilder.errors import BuildFailedException from pybuilder.utils import discover_modules_matching, render_report from pybuilder.ci_s...
from cloudbaseinit.openstack.common import cfg from cloudbaseinit.utils import classloader opts = [ cfg.ListOpt( 'plugins', default=[ 'cloudbaseinit.plugins.windows.sethostname.SetHostNamePlugin', 'cloudbaseinit.plugins.windows.createuser.CreateUserPlugin', 'cloud...
"""Trains a generator on CIFAR data.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import data_provider import networks tfgan = tf.contrib.gan flags = tf.flags flags.DEFINE_integer('batch_size', 32, 'The number of images in each b...
import ujson from django.http import HttpResponse from django.test import override_settings from mock import patch from typing import Any, Dict from zerver.lib.initial_password import initial_password from zerver.lib.sessions import get_session_dict_user from zerver.lib.test_classes import ZulipTestCase from zerver.lib...
import unittest import pyluxcore class TestProperties(unittest.TestCase): def test_Properties_SetPrefix(self): props = pyluxcore.Properties() props.Set(pyluxcore.Property("test1.prop1", "aa")) props2 = pyluxcore.Properties() props2.Set(pyluxcore.Property("aa.prop1", "bb")) props2.Set(pyluxcore.Property("bb.p...
""" A regional forwarding rule which has an 'EXTERNAL' load balancing schema. """ from vm_network_migration.modules.forwarding_rule_modules.regional_forwarding_rule import RegionalForwardingRule class ExternalRegionalForwardingRule(RegionalForwardingRule): def __init__(self, compute, project, forwarding_rule_name, ...
import jax.numpy as jnp def _is_batched(arg): return jnp.ndim(arg) > 0 def vindex(tensor, args): """ Vectorized advanced indexing with broadcasting semantics. See also the convenience wrapper :class:`Vindex`. This is useful for writing indexing code that is compatible with batching and enumerati...
import logging from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User __author__ = 'jorgealegre' DATE_CHUNKS_PER_DAY = 'per_day' DATE_CHUNKS_PER_MONTH = 'per_month' DATE_CHUNKS_CHOICE = ( (DATE_CHUNKS_PER_DAY, _(u'Per Day')), (DATE_CHUNKS...
from __future__ import unicode_literals import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("studies", "0062_study_shared_preview")] operations = [ migrations.AlterField( model_name...
"""Unit tests for core identity behavior.""" import itertools import os import uuid import mock from oslo_config import fixture as config_fixture import keystone.conf from keystone import exception from keystone import identity from keystone.tests import unit from keystone.tests.unit.ksfixtures import database CONF = k...
import json import time from heat.engine import environment from heat.common import exception from heat.common import template_format from heat.common import urlfetch from heat.engine import clients from heat.engine import resource from heat.engine import parser from heat.engine import parameters from heat.engine impor...
"""Common features of B |eacute| zier shapes. .. |eacute| unicode:: U+000E9 .. LATIN SMALL LETTER E WITH ACUTE :trim: """ import numpy as np class Base: """Base shape object. Args: nodes (Sequence[Sequence[numbers.Number]]): The control points for the shape. Must be convertible to a 2D Nu...
import os import sys basePath = os.path.dirname(os.path.realpath(__file__)) modulePath = basePath + "/python_modules/lib/python" print "modulePath " + modulePath sys.path.append( modulePath ) import defcon import mutatorMath import mutatorMath.ufo.document as udoc import mutatorMath.objects.location as mmlocation if __...
import random from typing import Dict, Set import pandas as pd import pytest from sqlalchemy import column, Float, String from superset import db from superset.connectors.sqla.models import SqlaTable, SqlMetric from superset.models.slice import Slice from superset.utils.core import get_example_database, get_example_def...
import setuptools def get_version(): with open('kthresher.py') as f: for line in f: if line.startswith('__version__'): return eval(line.split('=')[-1]) setuptools.setup( name='kthresher', version=get_version(), description=('Purge Unused Kernels.'), long_descripti...
from flask import Flask app = Flask(__name__) @app.route('/index') def index(): return 'Hello world, from flask. At last! ;)' if __name__ == '__main__': app.run()
"""sklearn cross-support (deprecated).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np import six from tensorflow.python.util.compat import collections_abc def _pprint(d): return ', '.join(['%s=%s' % (key, str(value)) for key...
from helper import unittest, PillowTestCase, hopper from PIL.Image import (FLIP_LEFT_RIGHT, FLIP_TOP_BOTTOM, ROTATE_90, ROTATE_180, ROTATE_270, TRANSPOSE) class TestImageTranspose(PillowTestCase): hopper = { 'L': hopper('L').crop((0, 0, 121, 127)).copy(), 'RGB': hopper('RGB').crop((0, 0, 121, 12...
"""Main implementation of Neural Query Language. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import logging from nql import io from nql import symbol import numpy as np import scipy.sparse import tensorflow.compat.v2 as tf class Error(Except...
from django.conf.urls import patterns, url from django.conf import settings from django.conf.urls.static import static import views urlpatterns = patterns('', # Access pages url(r'^$', views.index, name='index'), url(r'^register/$', views.register, na...
"""Script proceses data files to create nodes for EPA NPL Superfund sites About this script: This script processes data from two files namely: - ./data/superfund_sites_with_status.csv This file lists all superfund sites on the NPL with a note on the site's status on the NPL. This file also provides the location of th...
import json import tangelo import datawake.util.db.datawake_mysql as db import datawake.util.session.helper as session_helper from datawake.util.validate.parameters import required_parameters @session_helper.is_in_session @session_helper.has_team @session_helper.has_trail @required_parameters([ 'feature_type', 'feature...
''' This is the main Registration script that calls the underlying Registration functional tests located in REG_Suite001. This test method (main()) is called through ctest, but can be launched direct via python with proper arguments. The resultdir argument is location where test results will be placed. The namespace ar...
"""Various implementations of a Count custom PTransform. These example show the different ways you can write custom PTransforms. """ from __future__ import absolute_import import argparse import logging import apache_beam as beam from apache_beam.io import ReadFromText from apache_beam.io import WriteToText from apache...
import random class Mixed_rand_generator: def __init__(self): self.number = generate() def generate(): str1 = '123456789' # Щепотка строчных букв str2 = 'qwertyuiopasdfghjklzxcvbnm' # Щепотка прописных букв. Готовится преобразованием str2 в верхний регистр. str3 = str2.upper() # prin...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from thrift.Thrift import TType def fix_spec(all_structs) -> None: for s in all_structs: spec = s.thrift_spec for t in spec: if t is None: ...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.jvm.artifact import Artifact from pants.backend.jvm.ossrh_publication_metadata import (Developer, License, ...
import json import RPi.GPIO as GPIO import time import logging import sys class Door(): def __init__(self, switch_pin, contact_pin, open_contact_pin, name, logging_handler = None, pulse_time = .2, lockable = False): self.stompClient = None self.dbLogger = None if logging_handler == None: ...
"""OrderedSequence.py Classes for sequences of items subject to insertions and deletions, with fast comparisons of the positions of two items in a sequence. D. Eppstein, November 2003. """ import sys from Sequence import Sequence class SimpleOrderedSequence(Sequence): """Maintain a sequence of items subject to inse...
import copy from tempest.lib.services.network import log_resource_client from tempest.tests.lib import fake_auth_provider from tempest.tests.lib.services import base class TestLogResourceClient(base.BaseServiceTest): FAKE_LOGS = { "logs": [ { "name": "security group log1", ...
"""This example gets all active creative wrappers. """ from googleads import ad_manager def main(client): # Initialize appropriate service. creative_wrapper_service = client.GetService( 'CreativeWrapperService', version='v201805') # Create a statement to select creative wrappers. statement = (ad_manager.S...
from . import cli # noqa from .version import __version__ # noqa
import os import sys from setuptools import setup, find_packages import build this_file = os.path.dirname(__file__) setup( name="pytorch_fft", version="0.15", description="A PyTorch wrapper for CUDA FFTs", url="https://github.com/locuslab/pytorch_fft", author="Eric Wong", author_email="ericwong@...
import logging import requests.exceptions import time from . import docker_client, pull_image from . import DockerConfig, DOCKER_COMPUTE_LISTENER from cattle import Config from cattle.compute import BaseComputeDriver from cattle.agent.handler import KindBasedMixin from cattle.type_manager import get_type_list from catt...
import ctypes from ctypes import * ncnn = ctypes.CDLL("./libncnn.so") ncnn.ncnn_version.restype = ctypes.c_char_p pStr = ncnn.ncnn_version() print("hello py!" + str(pStr, encoding="utf8")) test = ctypes.CDLL("./libtest.so") buffer = "\x01\x01\x02" print(buffer) mydata = bytearray([65, 66, 67, 68, 69, 70, 71]) print(myd...
"""Environment's execution runtime.""" import collections import copy import enum from dm_control.mujoco.wrapper import mjbindings from dm_control.viewer import util import numpy as np mjlib = mjbindings.mjlib _SIMULATION_STEP_INTERVAL = 0.001 _DEFAULT_MAX_SIM_STEP = 1./5. def _get_default_action(action_spec): """Gen...
from six import text_type as unicode from contextlib import contextmanager from robot.errors import DataError from robot.variables import GLOBAL_VARIABLES class ExecutionContexts(object): def __init__(self): self._contexts = [] @property def current(self): return self._contexts[-1] if self._...
import sys __author__ = 'Dirk Dittert' if __name__ == '__main__': print u"""\ coretemp-isa-0000 Adapter: ISA adapter Core 0: +43.0°C (high = +82.0°C, crit = +100.0°C) Core 1: +44.0°C (high = +82.0°C, crit = +100.0°C) Core 2: +45.0°C (high = +82.0°C, crit = +100.0°C) Core 3: +46.0°C (high...
import logging.config from motorway.grouping import HashRingGrouper, SendToAllGrouper from motorway.pipeline import Pipeline from examples.ramps import WordRamp from examples.intersections import SentenceSplitIntersection, WordCountIntersection, AggregateIntersection, \ AggregateConsumerIntersection logging.config....
import pytest import mock from rest_framework import serializers from awx.api.versioning import reverse from awx.main.utils.encryption import decrypt_field from awx.conf import fields from awx.conf.registry import settings_registry from awx.conf.models import Setting @pytest.fixture def dummy_setting(): class conte...
from email import message_from_string from contextlib import closing from cStringIO import StringIO from nose.tools import eq_, ok_, assert_false, assert_raises, assert_less from flanker.mime.create import multipart, text from flanker.mime.message.scanner import scan from flanker.mime.message.errors import EncodingErro...
"""Grouping dataset transformations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.data.ops import dataset_ops from tensorflow.python.data.util import nest from tensorflow.python.data.util import structure from t...
"""inittial migration Revision ID: 97ef88134b63 Revises: None Create Date: 2016-06-25 17:06:36.092076 """ revision = '97ef88134b63' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_table('roles', sa.Colum...
from login import * from loginutils import * from newlogin import * __all__ = ( 'login', 'isloggedin', 'logout', 'createuser', 'checklogin', 'displaylogin' ) __version__ = '0.6.2' """ CHANGELOG ========= 2005/09/09 ---------- Changed module name to logintools. Changed license to the BSD lice...
import importlib import logging import os import re import sys import sysconfig import traceback from contextlib import closing from types import CoroutineType from typing import Any, Iterable, NamedTuple, Tuple, Type, cast import cffi import pkg_resources from pants.base.project_tree import Dir, File, Link from pants....
"""Base classes for our unit tests. Allows overriding of CONF for use of fakes, and some black magic for inline callbacks. """ import logging import os import shutil import uuid import fixtures import mock from oslo_concurrency import lockutils from oslo_config import cfg from oslo_config import fixture as config_fixtu...
import time import smbus import math from SDL_BM017CS.Adafruit_I2C import Adafruit_I2C class ColorSensors: i2c = None mutexe_i2cs = [] # i2C Addresses __ADDR_Mutex0 = 0x70 # register of the first mutex __ADDR_Mutex1 = 0x71 # register of the first mutex __ADDR_Mutex2 = 0x72 # register of the firs...
import hashlib import logging from django.conf import settings from django.contrib.auth import models from keystoneclient import exceptions as keystone_exceptions from openstack_auth import utils LOG = logging.getLogger(__name__) def set_session_from_user(request, user): request.session['token'] = user.token re...
import os os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0' import sys import argparse import numpy as np import cv2 import math import datetime import random import json import pandas as pd from Queue import Queue from threading import Thread import mxnet as mx import mxnet.ndarray as nd from easydict import EasyDict a...
version = "0.7.1-dev"
'''Generic Python DB API v2.0 Commands for the Unsync Tool.''' import unsync import petl @unsync.command() @unsync.option('--connection-name', type=str, help='The name of the connection to use for this query. This needs to be a DB-APIv2.0 compiant connection.') @unsync.option('--table', type=str, help='The name of the ...
"""Mc3 module.""" import cmd2 from linebot.models import ( MessageEvent, TextMessage, TextSendMessage, SourceUser, SourceGroup, SourceRoom, TemplateSendMessage, ConfirmTemplate, MessageTemplateAction, ButtonsTemplate, URITemplateAction, PostbackTemplateAction, CarouselTemplate, CarouselColumn, Postb...
from abc import ABCMeta, abstractmethod from functools import partial from typing import ( # noqa: F401 (SPARK-34943) Any, Callable, Generic, List, Optional, ) from pyspark.sql import Window from pyspark.sql import functions as F from pyspark.pandas.missing.window import ( MissingPandasLikeRoll...
import caffe from examples.coco.retrieval_experiment import * from pyspark.sql import SQLContext from pyspark import SparkConf,SparkContext from pyspark.sql.types import * from itertools import izip_longest import json import argparse def predict_caption(list_of_images, model, imagenet, lstmnet, vocab): out_iterator ...
""" SQLAlchemy models for qonos data """ from sqlalchemy import Column, Integer, String, Index from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import ForeignKey, DateTime, Text from sqlalchemy.orm import relationship, backref, object_mapper from sqlalchemy import UniqueConstraint from qonos.comm...
from connector import channel from google3.cloud.graphite.mmv2.services.google.sql import ssl_cert_pb2 from google3.cloud.graphite.mmv2.services.google.sql import ssl_cert_pb2_grpc from typing import List class SslCert(object): def __init__( self, cert_serial_number: str = None, cert: str = ...
'''DiscretizedLinear Reward-Inaction Variable Structure Stochastic Automaton.''' from random import uniform import helpers as h import numpy as np class DLRI(object): def __init__(self, num_actions): self.p = np.array(h.make_dp(num_actions)) self.best = 2 * num_actions # Best time-cost. def ...
import random import unittest from mock import patch from mock import MagicMock as Mock import pyos.cloudnetworks from pyos.cloudnetworks import CloudNetwork from pyos.cloudnetworks import CloudNetworkManager from pyos.cloudnetworks import CloudNetworkClient from pyos.cloudnetworks import _get_server_networks import py...
from urllib import urlencode from django.contrib.gis.geos import Point from molly.maps.osm import fit_to_map from molly.maps.models import GeneratedMap class Map(object): """ An object which represents a Map. This should be added to a context and then passed to @C{render_map} in your template to get the app...