code stringlengths 1 199k |
|---|
"""Controlles a bunch of remotes."""
import asyncio
import functools
import logging
import os
import pathlib
import signal
import sys
import traceback
from implant import commands, connect, core, testing
log = logging.getLogger(__name__)
PLUGINS_ENTRY_POINT_GROUP = 'implant.plugins'
def parse_command(line):
"""Pars... |
from argparse import ArgumentParser
from os import environ
from sys import argv
from requests import put
def read_file(file_path): # pragma: no cover
with open(file_path, 'rb') as f:
return f.read()
def upload(file_path, repository, repository_path, url, username, password):
url = f'{url}/repository/{r... |
from ghizmo.commands import lib
def tags(config, args):
"""
List all tags.
"""
return config.repo.tags()
def show_tags(config, args):
"""
Show info for tags supplied on stdin.
"""
for item in lib.input_json_lines():
yield config.repo.tag(item)
def _delete_ref(repo, ref_name, force, dry_run):
ref =... |
import doctest
from maiden import config
def load_tests(loader, tests, ignore):
tests.addTests(doctest.DocTestSuite(config))
return tests |
"""
This module holds models related to benefits features and configurations
"""
from django import forms
from django.db import models
from django.db.models import UniqueConstraint
from django.urls import reverse
from polymorphic.models import PolymorphicModel
from sponsors.models.assets import ImgAsset, TextAsset, Fil... |
import random
TIMES = 10
SIZE = 10
RANGE = 10
def qs1 (al):
""" Algo quicksort for a list
"""
if not al:
return []
return (qs1([x for x in al if x < al[0]])
+ [x for x in al if x == al[0]]
+ qs1([x for x in al if x > al[0]]))
def qs2 (array):
""" another longer version"""
... |
"""
This module provides general http handler functions for processing http responses from TSDB services.
"""
import http.client
import json
from baidubce import utils
from baidubce.exception import BceClientError
from baidubce.exception import BceServerError
from baidubce.utils import Expando
def parse_json(http_respo... |
import cPickle
point_table = {}
point_table[( 4, 4)] = 400.
point_table[( 3, 4)] = 270.
point_table[( 2, 4)] = 170.
point_table[( 1, 4)] = 100.
point_table[( 0, 4)] = 0.
point_table[(-1, 4)] = 0.
point_table[(-2, 4)] = 0.
point_table[(-3, 4)] = 0.
point_table[(-4, 4)] = 0.
point_table[( 4, 3)] = 240.
point_table[( 3, 3... |
import sys
import os
import subprocess
import filter_remapped_reads
import util
def write_sam_header(f):
f.write("@HD VN:1.0 SO:coordinate\n")
f.write("@SQ SN:chr22 LN:51304566\n")
f.write('@PG ID:bowtie2 PN:bowtie2 VN:2.2.6 CL:"/iblm/netapp/home/gmcvicker/anaconda2/bin/bowtie2-align-s --wrapper basic-0 -x ... |
"""Contains function for calculating BERT embeddings"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import json
import re
import torch
from torch.utils.data import TensorDataset, DataLoader, SequentialSampler
from torch.utils.data.distr... |
"""Report the various flap limits applied in the system."""
import collections
import math
import os
import makani
from makani.avionics.bootloader import system_config
from makani.avionics.firmware.params import codec
from makani.avionics.network import network_config
from makani.config import mconfig
from makani.contr... |
import json
import logging
import pathlib
import subprocess
import time
from typing import List
import sys
from http import client
from plumbum import cli
from acceptance.common import base
from acceptance.common import docker
from acceptance.common import scion
from python.lib import scion_addr
import toml
logger = lo... |
import awx.main.utils.polymorphic
import awx.main.fields
from django.db import migrations, models
import django.db.models.deletion
from awx.main.migrations._rbac import (
rebuild_role_parentage, rebuild_role_hierarchy,
migrate_ujt_organization, migrate_ujt_organization_backward,
restore_inventory_admins, re... |
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line() |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials... |
import itertools
import logging
from collections import defaultdict
from dataclasses import dataclass
from typing import Iterable, Optional, Tuple
from pants.backend.python.target_types import PythonRequirementsField, PythonSources
from pants.backend.python.typecheck.mypy.skip_field import SkipMyPyField
from pants.back... |
import os
import posixpath
import random
import string
import logging
import tempfile
import time
from .extract_images import ExtractImages
logger = logging.getLogger(__name__)
class ExtractImagesToS3(ExtractImages):
'''
This KnowledgePostProcessor subclass extracts images from posts to S3. It
is designed t... |
"""
Chance (Random) Scheduler implementation
"""
import random
from oslo.config import cfg
from nova import exception
from nova.scheduler import driver
CONF = cfg.CONF
CONF.import_opt('compute_topic', 'nova.compute.rpcapi')
class ChanceScheduler(driver.Scheduler):
"""Implements Scheduler as a random node selector."... |
import base64
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
def view_or_basicauth(view, request, test_func, realm = "", *args, **kwargs):
"""
This is a helper function used by both 'logged_in_or_basicauth' and
'has_perm_or_basicauth' that does the nitty of determin... |
import re
UNKNOWN = "unknown"
PLATFORM_ASR9K_P = 'asr9k_p'
PLATFORM_ASR9K_PX = "asr9k_px"
PLATFORM_CRS_P = "crs_p"
PLATFORM_CRS_PX = "crs_px"
PLATFORM_NCS6K = "ncs6k"
PLATFORM_NCS6K_SYSADMIN = "ncs6k_sysadmin"
PLATFORM_TYPE_UNKNOWN = -1
PLATFORM_TYPE_ASR9K_PX_SMU = 0
PLATFORM_TYPE_ASR9K_PX_SP = 1
PLATFORM_TYPE_ASR9K_P... |
"""Classes and methods to manage all aspects of student assessments."""
__author__ = 'pgbovine@google.com (Philip Guo)'
import datetime
import logging
from models import courses
from models import models
from models import review
from models import student_work
from models import transforms
from models import utils
fro... |
import mock
from oslo.config import cfg
from neutron.agent.common import config as a_cfg
from neutron.tests import base
from neutron.tests.unit import test_api_v2
import neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas as fwaas
_uuid = test_api_v2._uuid
FAKE_SRC_PREFIX = '10.0.0.0/24'
FAKE_DST_PREFIX = '20.... |
"""Dataloader for object detection."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
from typing import Collection, Dict, List, Optional, Tuple, TypeVar, Union
import tensorflow as tf
from tensorflow_examples.lite.model_maker.core.api.api_util im... |
from . import families
from .glm import glm, linear_component, plot_posterior_predictive |
from google.cloud import dialogflow_v2beta1
async def sample_list_suggestions():
# Create a client
client = dialogflow_v2beta1.ParticipantsAsyncClient()
# Initialize request argument(s)
request = dialogflow_v2beta1.ListSuggestionsRequest(
)
# Make the request
page_result = client.list_sugges... |
from __future__ import unicode_literals
import logging
import os
from mopidy import config, ext
__version__ = '0.3.0'
logger = logging.getLogger(__name__)
class Extension(ext.Extension):
dist_name = 'Mopidy-Webhooks'
ext_name = 'webhooks'
version = __version__
def get_default_config(self):
conf_... |
'''update load balancer amphora relationship
Revision ID: 4c094013699a
Revises: 35dee79d5865
Create Date: 2014-09-15 14:42:44.875448
'''
revision = '4c094013699a'
down_revision = '35dee79d5865'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column(
u'amphora',
sa.Column(u'load_... |
"""Unit test for directory watcher (inotify).
"""
import errno
import os
import shutil
import tempfile
import select
import unittest
import tests.treadmill_test_deps # pylint: disable=W0611
import mock
from treadmill import idirwatch
class DirWatcherTest(unittest.TestCase):
"""Tests for teadmill.idirwatch."""
... |
from webfs import WebFSStat
import stat
def Test_Basic():
fields = ('st_mode', 'st_ino', 'st_dev', 'st_nlink', 'st_uid', 'st_gid',
'st_size', 'st_atime', 'st_mtime', 'st_ctime')
st = WebFSStat()
print st.__dict__.keys()
for field in fields:
assert field in st.__dict__.keys(), 'fiel... |
import os
import shutil
import logging
from getpass import getuser
from dls_ade import vcs_git, Server
from dls_ade.exceptions import (RemoteRepoError, VerificationError,
ArgumentError)
class ModuleCreator(object):
"""Abstract base class for the management of the creation of new modu... |
from awxkit.api.resources import resources
from . import base
from . import page
class Setting(base.Base):
pass
page.register_page([resources.setting,
resources.settings_all,
resources.settings_authentication,
resources.settings_changed,
... |
import json
import apiai
CLIENT_ACCESS_TOKEN = 'api key'
def nlu(mytext):
ai = apiai.ApiAI(CLIENT_ACCESS_TOKEN)
request = ai.text_request()
request.lang = 'en' # optional, default value equal 'en'
# request.session_id = "<SESSION ID, UBIQUE FOR EACH USER>"
request.query = mytext
response = requ... |
import argparse
import logging
import os
import sys
from mpi4py import MPI
from pandayoda.yodacore import Yoda
from pandayoda.yodaexe import Droid
import logging
logging.basicConfig(level=logging.DEBUG)
def main(globalWorkDir, localWorkDir):
comm = MPI.COMM_WORLD
mpirank = comm.Get_rank()
# Create separate ... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import itertools
import os
import subprocess
from collections import OrderedDict
from hashlib import sha1
from twitter.common.collections import OrderedSet
from pants.b... |
"""
Copyright 2010 cloudControl UG (haftungsbeschraenkt)
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 applicab... |
from etcd import EtcdKeyNotFound, EtcdAlreadyExist, EtcdCompareFailed
from netaddr import IPAddress, IPNetwork
import socket
import logging
import random
from pycalico.datastore_datatypes import IPPool
from pycalico.datastore import DatastoreClient
from pycalico.datastore import (IPAM_HOST_AFFINITY_PATH,
... |
import click
from aim import config as aim_cfg
from aim import context
from aim.db import api
from aim.tools.cli.groups import aimcli
@aimcli.aim.group(name='config')
@click.pass_context
def config(ctx):
aim_ctx = context.AimContext(store=api.get_store(expire_on_commit=True))
ctx.obj['manager'] = aim_cfg.Config... |
from .api_gateway_event import * |
import unittest
from os import path
from API.directoryscanner import find_runs_in_directory
path_to_module = path.abspath(path.dirname(__file__))
class TestDirectoryScanner(unittest.TestCase):
def test_sample_names_spaces(self):
runs = find_runs_in_directory(path.join(path_to_module, "sample-names-with-spac... |
"""Messages are written to stdout instead of the normal stderr.
"""
import logging
from themelog import init_log
logger = logging.getLogger()
init_log(stdout=True)
logger.debug('This is a debug message')
logger.info('This is a info message')
logger.warning('This is a warning message')
logger.error('This is a error mess... |
__all__ = [
'ZerigoDNSDriver'
]
import copy
import base64
from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import b
from xml.etree import ElementTree as ET
from libcloud.utils.misc import merge_valid_keys, get_new_obj
from libcloud.utils.xml import findtext, findall
from libcloud.common.base import Xm... |
import logging
from django.contrib.auth.models import User
from nose.plugins.attrib import attr
from nose.tools import assert_equal, assert_true, assert_not_equal
from hadoop import cluster, pseudo_hdfs4
from hadoop.conf import HDFS_CLUSTERS, MR_CLUSTERS, YARN_CLUSTERS
from desktop.lib.test_utils import clear_sys_cache... |
from sys import argv
script, filename = argv
print "We're going to erase %r." % filename
print "If you don't want that, hit CTRL-C (^C)."
print "If you do want that, hit RETURN."
raw_input("?")
print "Opening the file..."
target = open(filename,'w')
print "Truncating the file. Goodbye!"
target.truncate()
print "Now I'm... |
import proto # type: ignore
from google.cloud.aiplatform_v1.types import entity_type as gca_entity_type
from google.cloud.aiplatform_v1.types import feature as gca_feature
from google.cloud.aiplatform_v1.types import feature_selector as gca_feature_selector
from google.cloud.aiplatform_v1.types import featurestore as ... |
__author__ = 'Ostico <ostico@gmail.com>'
import unittest
import os
os.environ['DEBUG'] = "1"
os.environ['DEBUG_VERBOSE'] = "0"
import pyorient
class CommandTestCase(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(CommandTestCase, self).__init__(*args, **kwargs)
self.client = None
... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import os
from django_nyt import VERSION
from setuptools import setup, find_packages
def get_path(fname):
return os.path.join(os.path.dirname(os.path.abspath(__file__)), fname)
def read(fname):
r... |
import datetime
import decimal
import hashlib
import logging
import operator
import re
import sys
import threading
import uuid
from collections import deque
from collections import namedtuple
try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
from copy import deepcopy
from functools... |
import logging
import re
import netaddr
from oslo.config import cfg
from akanda.rug.openstack.common import jsonutils
LOG = logging.getLogger(__name__)
DEFAULT_AS = 64512
OPTIONS = [
cfg.StrOpt('provider_rules_path'),
cfg.IntOpt('asn', default=DEFAULT_AS),
cfg.IntOpt('neighbor_asn', default=DEFAULT_AS),
]
c... |
import os
from setuptools import find_packages
from setuptools import setup
version = '1.0'
install_requires = [
]
tests_require = install_requires + ['Sphinx', 'docutils',
'virtualenv', 'nose', 'coverage']
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.p... |
"""Classification training"""
import os, sys
sys.path.append('../')
sys.path.append('../models/')
sys.path.append('../util/')
import time
import json
import importlib
import argparse
import tensorflow as tf
import numpy as np
from input_data import Data
def optimization(learning_rate, loss):
"""Defines the optimiza... |
"""
Volume manager manages creating, attaching, detaching, and persistent storage.
Persistent storage volumes keep their state independent of instances. You can
attach to an instance, terminate the instance, spawn a new instance (even
one from a different image) and re-attach the volume with the same data
intact.
**Re... |
import logging
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
import six
from c7n_azure import constants
from c7n_azure.actions.logic_app import LogicAppAction
from azure.mgmt.resourcegraph.models import QueryRequest
from c7n_azure.actions.notify import Notify
fro... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'TopShops'
db.create_table(u'catalog_topshops', (
(u'id', self.gf('django.db.models.fields.AutoField')(prima... |
from operator import and_
from functools import reduce
from django import forms
from django.db.models import Q
from django.utils.six import PY3
from django.utils.translation import ugettext_lazy as _
from api.dc.domain.views import dc_domain
from api.dns.domain.views import dns_domain
from api.dns.record.views import d... |
"""
MailMojo API
v1 of the MailMojo API # noqa: E501
OpenAPI spec version: 1.1.0
Contact: hjelp@mailmojo.no
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import mailmojo_sdk
from mailmojo_sdk.api.page_api import PageApi ... |
from logging import CRITICAL, getLevelName
from functools import wraps
from django.utils.decorators import available_attrs
from celery import states
from celery.utils.log import get_task_logger
from api.decorators import catch_exception
from api.task.utils import task_log
logger = get_task_logger(__name__)
class Detail... |
import proboscis
from trove.tests.api import backups
from trove.tests.api import configurations
from trove.tests.api import databases
from trove.tests.api import datastores
from trove.tests.api import flavors
from trove.tests.api import instances
from trove.tests.api import instances_actions
from trove.tests.api.mgmt i... |
import jinja2
import os
MESSAGE_FILL = '`'
AUTO_GEN_MESSAGE = """
``````````````````````````````````````````````````````
``````````````````````````````````````````````````````
````````______________________________________ ``````
```````/ /\ `````
``````/ ... |
"""Additional form validators
"""
from __future__ import absolute_import
import re
from StringIO import StringIO
from PIL import Image
from wtforms import ValidationError
from wtforms import validators
email_re = re.compile(
r"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*"
r"@(?:[a-z0-9](?:[a-... |
from django.contrib import admin |
import unittest2
from pyxl import html
from pyxl.base import PyxlException, x_base
from pyxl.element import x_element
class PyxlTests(unittest2.TestCase):
def test_basics(self):
self.assertEqual(<div />.to_string(), '<div></div>')
self.assertEqual(<img src="blah" />.to_string(), '<img src="blah" />'... |
"""A simple example of Google Analytics batched user permissions."""
import json
from apiclient.errors import HttpError
from apiclient.http import BatchHttpRequest
def call_back(request_id, response, exception):
"""Handle batched request responses."""
print request_id
if exception is not None:
if isinstance(e... |
from sys import maxsize
class Contact:
def __init__(self, Firstname=None, Middlename=None, Lastname=None, Nickname=None, Title=None, Company=None, Address=None, Home=None, Mobile=None, Work=None,
Fax=None, Email=None, Email2=None, Email3=None, Homepage=None, Bday=None, Bmonth=None, Byear=None... |
from setuptools import setup
setup(name='mock_labels', version='0.0.1', packages=['mock_labels']) |
import json
from unit.http import TestHTTP
from unit.option import option
http = TestHTTP()
def check_chroot():
available = option.available
resp = http.put(
url='/config',
sock_type='unix',
addr=option.temp_dir + '/control.unit.sock',
body=json.dumps(
{
... |
from hybrid_a_star_python_interface import *
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib import animation
import numpy as np
import time
import math
def HybridAStarPlan(visualize_flag):
# initialze object
HybridAStar = HybridAStarPlanner()
# parameter(except max, min... |
import os
import subprocess
SSH_OPTIONS = ['-o', 'StrictHostKeyChecking=no', '-o', 'PreferredAuthentications=publickey', '-o', 'PubkeyAuthentication=yes']
def rsync_get_file(uri_from, uri_to, user, host, port, key):
cmd = [
'rsync',
'-e',
'ssh -i {} -p {} {}'.format(key, port, ' '.join(SSH_O... |
from .operations import upload_blueprint # NOQA
from .operations import delete # NOQA
from .operations import create # NOQA
from .operations import execute_start # NOQA
from .operations import refresh # NOQA |
"""App Engine data model (schema) definition for Quiz."""
import base64
import logging
import md5
import operator
import os
import re
import time
from google.appengine.ext import db
from google.appengine.api import memcache
class QuizBaseModel(db.Model):
"""Base class for quiz models."""
class QuizTrunkModel(QuizBase... |
"""Tests for normalization layers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
from tensorflow.python import keras
from tensorflow.python.eager import def_function
from tensorflow.python.eager i... |
import numpy as np
from openfermioncirq.experiments.hfvqe.gradient_hf import (rhf_func_generator,
rhf_minimization)
from openfermioncirq.experiments.hfvqe.molecular_example import make_h6_1_3
def test_rhf_func_gen():
rhf_objective, molecule, parameters, _, _ = make_h6_1_3()
ansatz... |
import collections
import contextlib
import copy
import uuid
import mock
import mox
from neutronclient.common import exceptions
from neutronclient.v2_0 import client
from oslo.config import cfg
import six
from nova.compute import flavors
from nova import context
from nova import exception
from nova.network import model... |
import pytest
import copy
import json
from awx.main.utils.common import (
model_instance_diff,
model_to_dict,
)
@pytest.mark.django_db
def test_model_to_dict_user(alice):
username = copy.copy(alice.username)
password = copy.copy(alice.password)
output_dict = model_to_dict(alice)
assert output_di... |
from mldb import mldb, MldbUnitTest, ResponseException
class MLDB2107ScalarFormatTest(MldbUnitTest): # noqa
@classmethod
def setUpClass(cls):
ds = mldb.create_dataset({'id' : 'ds', 'type' : 'sparse.mutable'})
ds.record_row('row0', [['x', 'A', 0]])
ds.record_row('row1', [['x', 'B', 0]])
... |
import copy
import six
from eclcli.common import command
from eclcli.common import utils
class ListLicense(command.Lister):
def get_parser(self, prog_name):
parser = super(ListLicense, self).get_parser(prog_name)
parser.add_argument(
"--license-type",
help="License type name ... |
'''
使用paramiko模块远程管理服务器
通过key登录
'''
import paramiko
private_key_path = 'D:\workspace\Python-oldboy\day07\zhangyage_pass'
key = paramiko.RSAKey.from_private_key_file(private_key_path,'12345678') #private_key_path是秘钥文件的位置,'12345678'是秘钥的口令
ssh = paramiko.SSHClient() #实例化一个客户端
ssh.set_missing_host_key_policy(paramiko... |
import textwrap
from textwrap import dedent
from pants.engine.internals.native_engine import FileDigest
from pants.jvm.resolve.common import ArtifactRequirement, Coordinate, Coordinates
from pants.jvm.resolve.coursier_fetch import CoursierLockfileEntry, CoursierResolvedLockfile
from pants.jvm.resolve.coursier_test_util... |
from dataclasses import dataclass
from typing import Tuple
from pants.backend.python.lint.docformatter.skip_field import SkipDocformatterField
from pants.backend.python.lint.docformatter.subsystem import Docformatter
from pants.backend.python.lint.python_fmt import PythonFmtRequest
from pants.backend.python.target_type... |
from google.cloud import spanner_admin_database_v1
async def sample_create_database():
# Create a client
client = spanner_admin_database_v1.DatabaseAdminAsyncClient()
# Initialize request argument(s)
request = spanner_admin_database_v1.CreateDatabaseRequest(
parent="parent_value",
create... |
from ..broker import Broker
class BasicServicesBroker(Broker):
controller = "basic_services"
def authenticate(self, **kwargs):
"""Authenticates the user with NetMRI.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True... |
import functools
from framework.auth import Auth
from website.archiver import (
StatResult, AggregateStatResult,
ARCHIVER_NETWORK_ERROR,
ARCHIVER_SIZE_EXCEEDED,
ARCHIVER_FILE_NOT_FOUND,
ARCHIVER_FORCED_FAILURE,
)
from website import (
mails,
settings
)
from osf.utils.sanitize import unescape... |
from django.conf.urls import url
from vitrage_dashboard.entities import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
] |
"""Densely Connected Convolutional Networks.
Reference [
Densely Connected Convolutional Networks](https://arxiv.org/abs/1608.06993)
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import tensorflow as tf
from tensorflow_examples.models.densen... |
import fnmatch
import glob
import gzip
import json
import os
import shlex
import sys
import tarfile
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import jinja2
import prettytable
import s... |
import torch
from torch import autograd, nn
batch_size = 1
seq_len = 7
input_size = 6
hidden_size = 4
example = [3, 2, 0, 0, 4, 5, 1, 1]
embedding = nn.Embedding(input_size, hidden_size)
rnn = torch.nn.RNN(
input_size=hidden_size,
hidden_size=hidden_size,
num_layers=1,
nonlinearity='tanh'
)
input = auto... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... |
from backend import photos, boards
p = photos()
print p.get(1)
b = boards()
print p.all(1)
print b.get(1) |
import os
import getpass
from quantrocket.houston import houston
from quantrocket.cli.utils.output import json_to_cli
def get_credentials(gateway):
"""
Returns username and trading mode (paper/live) for IB Gateway.
Parameters
----------
gateway : str, required
name of IB Gateway service to g... |
from __future__ import absolute_import, division, print_function, unicode_literals
from h2o.estimators.estimator_base import H2OEstimator
from h2o.exceptions import H2OValueError
from h2o.frame import H2OFrame
from h2o.utils.typechecks import assert_is_type, Enum, numeric
import h2o
class H2OXGBoostEstimator(H2OEstimat... |
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers_async # type: ignore
from google.api_core import operations_v1 # type: ignore
from google.auth import credentials as ga_credentia... |
from neutron_lib.api.definitions import constants as api_const
from neutron_lib.api.definitions import l3 as l3_apidef
from neutron_lib.api.definitions import network as net_def
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_l... |
'''
====================================================================================
Copyright 2013, 2014 Windy Darian (大地无敌), Studio "Sekai no Kagami"
(世界之镜制作组) of Seven Ocean Game Arts (七海游戏文化社
, 北京航空航天大学学生七海游戏文化社) @ http://sogarts.com
Licensed under the Apache License, Version 2.0 (the "License");
... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0008_auto_20151124_1135'),
]
operations = [
migrations.AddField(
model_name='service',
name='short_name',
fie... |
import base64
from xdrlib import Packer, Unpacker
from ..type_checked import type_checked
from .allow_trust_op import AllowTrustOp
from .begin_sponsoring_future_reserves_op import BeginSponsoringFutureReservesOp
from .bump_sequence_op import BumpSequenceOp
from .change_trust_op import ChangeTrustOp
from .claim_claimabl... |
"""
Support for displaying the current CPU speed.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.cpuspeed/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_... |
"""Unit tests."""
import pytest
from google.cloud import language_v1beta2
from google.cloud.language_v1beta2.proto import language_service_pb2
class MultiCallableStub(object):
"""Stub for the grpc.UnaryUnaryMultiCallable interface."""
def __init__(self, method, channel_stub):
self.method = method
... |
import copy
import mock
import six
from heat.common import exception
from heat.common import grouputils
from heat.common import template_format
from heat.engine.resources.openstack.heat import resource_group
from heat.engine import rsrc_defn
from heat.engine import scheduler
from heat.engine import stack as stackm
from... |
from panda3d.core import *
from panda3d.direct import *
from toontown.toonbase.ToonBaseGlobal import *
from direct.gui.DirectGui import *
from panda3d.core import *
from panda3d.direct import *
from direct.gui.DirectScrolledList import *
from direct.distributed.ClockDelta import *
from toontown.toontowngui import TTDia... |
from clinicalsearch.models import ClinicalTrial
import csv
with open('clinicalsearch/trials_ranked.csv', 'rU') as csvfile:
reader = csv.reader(csvfile, delimiter=',')
for row in reader:
print row
t = ClinicalTrial(id=row[0], sponsor=row[1], published=(row[2]=="TRUE"), state=row[3], url=row[4], ongoing=(row[5]=="T... |
from oslo import messaging
from neutron.common import constants
from neutron.common import rpc
from neutron.common import topics
from neutron.common import utils
from neutron import manager
from neutron.openstack.common import log as logging
LOG = logging.getLogger(__name__)
class MeteringAgentNotifyAPI(object):
""... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.