code stringlengths 1 199k |
|---|
from ftw import ruleset, testrunner, http, errors
import pytest
import re
import random
import threading
def test_logcontains(ruleset, test):
runner = testrunner.TestRunner()
for stage in test.stages:
runner.run_stage(stage)
def test_search1():
runner = testrunner.TestRunner()
x = ruleset.Input(... |
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
import math
import scipy.special as sps
mean = 0
variance = 1
sigma = math.sqrt(variance)
def drawSampleNormal(sampleSize):
samples = np.random.normal(mean, sigma, sampleSize)
count, bins, ignored = plt.hist(samples, 80, normed=Tr... |
from django.contrib import admin
from widgy.admin import WidgyAdmin
from widgy.contrib.page_builder.models import Callout
admin.site.register(Callout, WidgyAdmin) |
import psycopg2
import select
import logger
import adm
import re
import threading
from wh import xlt, modPath
from Crypto.PublicKey._slowmath import rsa_construct
sqlKeywords=[]
moreKeywords=['serial', 'bigserial']
colKeywords=[]
def getSqlKeywords():
global colKeywords
global sqlKeywords
if not sqlKeywords:
... |
"""Tests for lite.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
import numpy as np
from tensorflow.contrib.lite.python import lite
from tensorflow.contrib.lite.python import lite_constants
from tensorflow.contrib.lite.python... |
from sqlite3 import connect
class DB:
def __init__(self,path="people.db"):
self.conn = connect(path)
self.c = self.conn.cursor()
def getList(self):
self.c.execute('SELECT * FROM people')
return self.c.fetchall()
def close(self):
self.conn.close()
class Date:
def __init__(self, y, m, d):
self.y = int(y)
... |
import os
import time
import const
import pickle
'''
Simulator class that manage the needed loop to make a
Qlearn agent to train as long as the epsilon decay
is bigger than the tolerance
'''
class Simulator(object):
# Set up environment variables
const.MAX_FLIPS = 4
const.NUM_LOOK = 3
def __init__(self,... |
from hazelcast.serialization.bits import *
from hazelcast.protocol.builtin import FixSizedTypesCodec
from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer
from hazelcast.protocol.builtin import StringCodec
from hazelcast.protocol.builtin import DataCodec
_REQUEST_MESS... |
import unittest
import mock
from pumphouse.tasks import base
class Tenant(base.Resource):
@base.task
def create(self):
self.data = self.env.cloud.keystone.tenants.create(self.data)
@base.task
def delete(self):
self.env.cloud.keystone.tenants.delete(self.data["id"])
class Server(base.Reso... |
import serial
from threading import Thread
from menu import Menu
from time import sleep
import settings as s
import pygame
from pygame import *
ser = serial.Serial('/dev/ttyACM0', 9600, timeout=.025)
current_mark = None
def worker():
global current_mark
while True:
read_serial = ser.readline().strip()
if len(read... |
import datetime
import uuid
import mock
from keystone.common import dependency
from keystone import config
from keystone.contrib.revoke import model
from keystone import exception
from keystone.openstack.common import timeutils
from keystone import tests
from keystone.tests import test_backend_sql
CONF = config.CONF
de... |
import logging
import os
from datetime import datetime, timedelta
from django.core.management.base import NoArgsCommand
from django.utils.translation import ugettext as _
from desktop.lib.paths import get_apps_root
from hbased.ttypes import AlreadyExists
from hbase.api import HbaseApi
LOG = logging.getLogger(__name__)
... |
response.title = settings.title
response.subtitle = settings.subtitle
response.meta.author = '%(author)s <%(author_email)s>' % settings
response.meta.keywords = settings.keywords
response.meta.description = settings.description
response.menu = [
(T('Index'),URL('default','index')==URL(),URL('default','index'),[]),
... |
from .fixtures import * # noqa, pylint: disable=wildcard-import |
import os, sys, subprocess, shutil, time, signal, string, platform, re, glob, hashlib, imp, inspect
import run, avd, prereq, zipfile, tempfile, fnmatch, codecs, traceback, simplejson
from mako.template import Template
from os.path import splitext
from compiler import Compiler
from os.path import join, splitext, split, ... |
def testFunction(request):
return "PASS"
import os
print(os.environ["FOO"]) |
import cv2
import sys
import argparse
import numpy as np
import os
import multiprocessing
import tensorflow as tf
from tensorpack import *
from tensorpack.dataflow import dataset
from tensorpack.tfutils import optimizer, gradproc
from tensorpack.tfutils.symbolic_functions import *
from tensorpack.tfutils.summary import... |
"""Tests for relational_layers.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from disentanglement_lib.evaluation.abstract_reasoning import relational_layers
import numpy as np
import tensorflow.compat.v1 as tf
def _create_positional_encoding_matrices... |
import logging
from ast import literal_eval
from threading import Thread
from ovirtscheduler import utils
class PythonMethodRunner(Thread):
def __init__(self, path, module, cls, method, args, request_id=''):
super(PythonMethodRunner, self).__init__(group=None)
logger = logging.getLogger()
se... |
__author__ = 'Chao'
import numpy as np
from sklearn import svm, cross_validation
from sklearn.ensemble import RandomForestClassifier
from sklearn.neighbors import KNeighborsClassifier
activity_label = {'1': 'WALKING',
'2': 'WALKING_UPSTAIRS',
'3': 'WALKING_DOWNSTAIRS',
... |
import argparse
import subprocess
from pyparsing import LineEnd, LineStart, Literal, Optional, Word, alphanums, hexnums
argparser = argparse.ArgumentParser()
argparser.add_argument('objdump')
argparser.add_argument('elf')
args = argparser.parse_args()
contents = subprocess.check_output([args.objdump, '-t', args.elf]).d... |
"""
Define a set of scopes to be used by COS Internal OAuth implementation, specifically tailored to work with APIv2.
List of scopes, nomenclature, and rationale can be found in the relevant "Login as OSF- phase 2" proposal document
"""
from collections import namedtuple
from website import settings
class scope(namedtu... |
import contextlib
import math
import numpy as np
import os
import time
import unittest
import paddle
import paddle.dataset.conll05 as conll05
import paddle.fluid as fluid
word_dict, verb_dict, label_dict = conll05.get_dict()
word_dict_len = len(word_dict)
label_dict_len = len(label_dict)
pred_dict_len = len(verb_dict)
... |
from warehouse import tasks
from warehouse.integrations.github import utils
@tasks.task(ignore_result=True, acks_late=True)
def analyze_disclosure_task(request, disclosure_record, origin):
utils.analyze_disclosure(
request=request,
disclosure_record=disclosure_record,
origin=origin,
) |
import pytest
@pytest.mark.parametrize(
"method,path",
[
('get_html', '/'),
('get_html', '/parameters/GB020'),
('get_json', '/parameters/GB020.geojson'),
('get_json', '/parameters/GB020.geojson?domainelement=GB020-1'),
('get_html', '/languages/nene1249'),
('get_ht... |
"""MySensors platform that offers a Climate (MySensors-HVAC) component."""
from homeassistant.components import mysensors
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, DOMAIN, HVAC_MODE_AUTO,
HVAC_MODE... |
import os
from airflow.hooks.S3_hook import S3Hook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
class S3ToFileSystem(BaseOperator):
@apply_defaults
def __init__(
self,
s3_bucket,
s3_key,
download_file_location,
... |
import logging
from concurrent.futures import CancelledError
import asyncio
from aiohttp import web
from aioredis import create_redis
from etc.ice_fetcher import get_current_song
from config.settings import STREAM_HOST, STREAM_PORT
server_logger = logging.getLogger('aiohttp.server')
async def push_current_track(request... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("peering", "0003_auto_20170903_1235")]
operations = [
migrations.AlterField(
model_name="autonomoussystem",
name="ipv4_as_set",
field=models.CharField(blank=True, max_leng... |
from subprocess import check_call
def test_shellstreaming_help():
check_call(["shellstreaming", "--help"]) |
"""CTC (Connectionist Temporal Classification) Operations."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
from tensorflow.python.framework import sparse_tensor
from tensorflow.python.ops import array_ops
from te... |
"""Fake Wings component"""
from threading import Thread
import time
import GPIOSim.RPi.in_mem as GPIO
from tuxeatpi.components.wings import Wings
from tuxeatpi.fake_components.base import push_switch
class FakeWings(Wings):
"""Fake wings class"""
def __init__(self, pins, event_queue, logger):
self.move_... |
import standard_play
import play
import behavior
import robocup
import tactics.line_up
import tactics.defense
import main
class DefendPenalty(play.Play):
def __init__(self):
super().__init__(continuous=True)
self.add_transition(behavior.Behavior.State.start,
behavior.Beha... |
import numpy as np
from typing import Any, List, Tuple
from ray.rllib.models.torch.misc import Reshape
from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
from ray.rllib.utils.framework import try_import_torch
from ray.rllib.utils.framework import TensorType
torch, nn = try_import_torch()
if torch:
from t... |
from f5.bigip.resource import UnnamedResource
from f5.sdk_exception import UnsupportedOperation
class Login_Enforcement(UnnamedResource):
"""BIG-IP® ASM Login Enforcement resource."""
def __init__(self, policy):
super(Login_Enforcement, self).__init__(policy)
self._meta_data['required_json_kind'... |
"""
============================
Base RPC Handler for Tornado
============================
This is a basic server implementation, designed for use within the
Tornado framework. The classes in this library should not be used
directly, but rather though the XML or JSON RPC implementations.
You can use the utility functio... |
import pytest
import mock
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from crum import impersonate
import datetime
from rest_framework.exceptions import PermissionDenied
from django.utils import timezone
from awx.api.versioning import reverse
from awx.api.views import RelatedJobsP... |
from flask import Flask
app = Flask('keyhub') |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from collections import defaultdict
from pants.backend.jvm.targets.java_library import JavaLibrary
from pants.backend.jvm.tasks.classpath_products import Clas... |
from google.cloud import datacatalog_v1
def sample_list_policy_tags():
# Create a client
client = datacatalog_v1.PolicyTagManagerClient()
# Initialize request argument(s)
request = datacatalog_v1.ListPolicyTagsRequest(
parent="parent_value",
)
# Make the request
page_result = client.... |
"""Contains the logic for `aq update machine`."""
import re
from aquilon.exceptions_ import ArgumentError
from aquilon.aqdb.model import (Chassis, ChassisSlot, Model, Machine,
Resource, BundleResource, Share, Filesystem)
from aquilon.aqdb.types import CpuType
from aquilon.worker.broker i... |
import ConfigParser
import time
import datetime
import requests
import fileinput
import sys
import os
import codecs
import json
import getWarranty
reload(sys)
sys.setdefaultencoding( "utf-8" )
def getConfig():
"""
将通用的一些数据读取放在一个函数里。不再每个函数里去写一遍了。
"""
global cmdbpath
global idccontactinfoJson,ipranges... |
from __future__ import annotations
from typing import DefaultDict, Sequence
from unittest import mock
import pytest
from pants.engine.fs import EMPTY_DIGEST
from pants.jvm.resolve.common import Coordinate, Coordinates
from pants.jvm.resolve.coursier_fetch import CoursierLockfileEntry, CoursierResolvedLockfile
from pant... |
from webdav.acp.Acl import ACL
from webdav.acp.Ace import ACE
from webdav.acp.GrantDeny import GrantDeny
from webdav.acp.Privilege import Privilege
from webdav.acp.Principal import Principal
__version__ = "$LastChangedRevision: 2 $" |
import pygame
import time
import scripts
"""
Score class
Handles all the score area
package: ianna
"""
class IannaScore():
def __init__ (self, buffer, screen, game_entities):
self.score_image = pygame.image.load('artwork/marcador.png').convert()
self.font = pygame.image.load('artwork/font.png').convert()
self.c... |
import os
from setuptools import find_packages, setup
name = 'pyfluent'
version = '0.2.1'
readme = os.path.join(os.path.dirname(__file__), 'README.rst')
long_description = open(readme).read()
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'License :: OSI Approved ::... |
""" Testing predictions with missing splits
"""
from bigmler.tests.world import (world, common_setup_module,
common_teardown_module, teardown_class)
import bigmler.tests.basic_tst_prediction_steps as test_pred
def setup_module():
"""Setup for the module
"""
common_setup_modu... |
from django.contrib import admin
from learning_logs.models import Topic, Entry
admin.site.register(Topic)
admin.site.register(Entry) |
"""System Info IDs - used in 'getInfo()' and 'getStat()' calls"""
SI_TYPE_VENDOR = 0
SI_TYPE_RADIO = 1
SI_TYPE_CPU = 2
SI_TYPE_PLATFORM = 3
SI_TYPE_BUILD = 4
SI_TYPE_VERSION_MAJOR = 5
SI_TYPE_VERSION_MINOR = 6
SI_TYPE_VERSION_BUILD ... |
import sys
if sys.version_info >= (3, 8):
from functools import singledispatchmethod
else:
from functools import singledispatch, update_wrapper
def singledispatchmethod(func):
dispatcher = singledispatch(func)
def wrapper(*args, **kw):
return dispatcher.dispatch(args[1].__class__... |
class DestinationNotFoundException(Exception):
pass
class InvalidDateFormat(Exception):
pass |
"""Tests for `mvn_from_bijector.py`."""
from typing import Tuple
from absl.testing import absltest
from absl.testing import parameterized
import chex
from distrax._src.bijectors import bijector
from distrax._src.bijectors.diag_affine import DiagAffine
from distrax._src.bijectors.triangular_affine import TriangularAffin... |
import base64
import os
import re
import bpy
import gpu
LAMP_TYPES = [
gpu.GPU_DYNAMIC_LAMP_DYNVEC,
gpu.GPU_DYNAMIC_LAMP_DYNCO,
gpu.GPU_DYNAMIC_LAMP_DYNIMAT,
gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT,
gpu.GPU_DYNAMIC_LAMP_DYNENERGY,
gpu.GPU_DYNAMIC_LAMP_DYNENERGY,
gpu.GPU_DYNAMIC_LAMP_DYNCOL,
gpu.... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ownmusicweb.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is ... |
"""Longformer modules."""
from flax import nn
import jax.numpy as jnp
from lra_benchmarks.models.layers import common_layers
from lra_benchmarks.models.longformer import longformer_attention
class LongformerBlock(nn.Module):
"""Longformer Layer."""
def apply(self,
inputs,
qkv_dim,
... |
"""Create a dataset of SequenceExamples from NoteSequence protos.
This script will extract melodies and chords from NoteSequence protos and save
them to TensorFlow's SequenceExample protos for input to the improv RNN models.
"""
import os
from magenta.models.improv_rnn import improv_rnn_config_flags
from magenta.models... |
from tests.approvals_config import configure_approvaltests
import pytest
@pytest.fixture(scope="session", autouse=True)
def set_default_reporter_for_all_tests():
configure_approvaltests() |
from setuptools import setup, find_packages
with open("requirements.txt") as reqs:
install_requires = reqs.readlines()
setup(
name="abbr",
version="0.0.1",
url="https://github.com/adlermedrado/abbr",
author="Adler Brediks Medrado",
author_email="abbr@adlermedrado.com.br",
license="Apache-2.0... |
from bzt.modules.functional import FunctionalAggregator, FunctionalAggregatorListener, FunctionalSample
from tests import BZTestCase
from tests.mocks import MockFunctionalReader
class MockListener(FunctionalAggregatorListener):
def __init__(self):
self.results = []
def aggregated_results(self, result, c... |
import logging
import os
import sys
import threading
from contextlib import contextmanager
from dataclasses import dataclass
from setproctitle import setproctitle as set_process_title
from pants.base.build_environment import get_buildroot
from pants.base.exception_sink import ExceptionSink, SignalHandler
from pants.bas... |
r = float(input("Digite um raio"))
area = (3.14*r*r)
print ('Sua área é', area) |
"""
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... |
__author__ = 'tyler'
import urllib2
import scrapy
from scrapy import log
import demjson
'''class AutoSpider(scrapy.Spider):
name = "sse"
allowed_domains = ["query.sse.com.cn"]
preurl='http://data.eastmoney.com/stock';
start_urls = [
'http://query.sse.com.cn/infodisplay/showTradePublicFile.do?jso... |
"""Test Thin Plate Spline transformer in alg/gdal_tps.cpp.
Rewrite of:
https://trac.osgeo.org/gdal/browser/trunk/autotest/alg/tps.py
"""
import unittest
from osgeo import gdal
from osgeo import osr
from autotest2.gcore import gcore_util
class TransformGeolocTest(unittest.TestCase):
def testGroundControlPoints(self):
... |
import datetime
import six
try:
from django.contrib.sites.requests import RequestSite
except ImportError: # Django < 1.9
from django.contrib.sites.models import RequestSite
from django.core.exceptions import ObjectDoesNotExist
from django.core.serializers.json import DjangoJSONEncoder
from django.forms.models ... |
import datetime
import os
import subprocess
import sys
import warnings
from typing import Optional, Union
import click
from ruamel.yaml import YAML
from ruamel.yaml.compat import StringIO
from great_expectations import exceptions as ge_exceptions
from great_expectations.checkpoint import Checkpoint, LegacyCheckpoint
fr... |
import tensorflow as tf
import os
from sys import platform as _platform
import collections
import random
import numpy as np
import warnings
from six.moves import xrange
from tensorflow.python.platform import gfile
import re
def generate_skip_gram_batch(data, batch_size, num_skips, skip_window, data_index=0):
"""Gen... |
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import logging.config
from flask import Flask, Blueprint
from werkzeug.contrib.fixers import ProxyFix
from ceep_api import settings
from ceep_api.api import restplus
from ceep_api.api.endpoints.adbmonitors import ns as adbmonitors_names... |
import os
currentPath = os.path.dirname(__file__)
print "currentPath: " + currentPath
geodatabasePath = os.path.normpath(os.path.join(os.path.join(currentPath, r"../../../data_management/data/Geonames")))
print "geodatabasePath: " + geodatabasePath
toolboxesPath = os.path.normpath(os.path.join(currentPath, r"../../../d... |
from __future__ import print_function
from __future__ import division
from django.core.management.base import BaseCommand
from query.models import Video, Face, LabelSet, Frame
from scannerpy import ProtobufGenerator, Config
import os
import cv2
import math
import numpy as np
import tensorflow as tf
import align.detect_... |
resource_id = "celery-1"
_install_script = """
[ { "id": "celery-1",
"key": {"name": "Celery", "version": "2.3"},
"config_port": {
"password": "engage_129",
"username": "engage_celery",
"vhost": "engage_celery_vhost"
},
"input_ports": {
"broker": {
"BROKER_HOST": "${host... |
"""BigQuery API IAM policy definitions
For all allowed roles and permissions, see:
https://cloud.google.com/bigquery/docs/access-control
"""
BIGQUERY_DATA_EDITOR_ROLE = "roles/bigquery.dataEditor"
"""When applied to a table or view, this role provides permissions to
read and update data and metadata for the table or vi... |
"""Tests for consumer_tracking_pipeline_visitor."""
from __future__ import absolute_import
import logging
import unittest
import apache_beam as beam
from apache_beam import pvalue
from apache_beam.pipeline import Pipeline
from apache_beam.pvalue import AsList
from apache_beam.runners.direct import DirectRunner
from apa... |
from google.cloud import dialogflow_v2
async def sample_batch_create_entities():
# Create a client
client = dialogflow_v2.EntityTypesAsyncClient()
# Initialize request argument(s)
entities = dialogflow_v2.Entity()
entities.value = "value_value"
entities.synonyms = ['synonyms_value_1', 'synonyms_... |
from . elasticfactor import ElasticFactor
from ... environment import cfg
from elasticsearch import Elasticsearch
def run(node):
id_a, id_b = node.get('id_a', '63166071_1'), node.get('id_b', '63166071_2')
es = Elasticsearch()
data_a = es.get(index="factor_state2016", doc_type='factor_network', id=id_a... |
import unittest
import copy
import gc
import rpy2.rinterface as rinterface
rinterface.initr()
class SexpTestCase(unittest.TestCase):
def testNew_invalid(self):
x = "a"
self.assertRaises(ValueError, rinterface.Sexp, x)
def testNew(self):
sexp = rinterface.baseenv.get("letters")
se... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('turnos', '0004_auto_20160519_0134'),
]
operations = [
migrations.RenameField('Turno', 'asistio', 'no_asistio'),
migrations.RenameField('Turno', 'aviso', ... |
__author__ = 'LiGe'
import networkx as nx
import matplotlib.pyplot as plot
from file_to_graph import file_to_mat
def build_graph(mat):
G=nx.DiGraph()#创建空图
for i in range(0,mat.shape[0]):
G.add_node(i)#创造节点
for i in range(0,mat.shape[0]):
for j in range(0,mat.shape[1]):
if mat[i,j... |
import os
import re
import cmd
import sys
import time
import util
host = sys.argv[1]
cmd.run ("virsh shutdown %s"%(host))
while util.vm_is_running(host):
time.sleep(1) |
import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True) |
"""Method Manager
Provide the end user interface for method (geophysical) dependent
modelling and inversion as well as data and model visualization.
"""
import numpy as np
import pygimli as pg
from pygimli.utils import prettyFloat as pf
def fit(funct, data, err=None, **kwargs):
"""Generic function fitter.
Fit d... |
import ConfigParser
import logging
class ConfigManager(object):
_config_dict = None
@staticmethod
def create(filename):
parse_file = ParseIniFile(filename)
parse_file.init()
parse_file.getvalue()
parse_file.close()
ConfigManager._config_dict = parse_file.ini_dict
... |
class Error(Exception):
def __init__(self, msg):
self.msg = msg |
friendlyName = "Query String Parser"
description = "Extracts the query string from a URL and prints each field and value."
artifactTypes = ("url", "cache") # Artifacts that this plugin processes
remoteLookups = 0 # if this plugin will query online sources/databases
browser = "all" # browsers that the plugin applies ... |
from django.db.models import Q
from links.models import Post
from comments.models import ThreadedComment as comments
from django.utils import timezone
from datetime import datetime, timedelta
from django.contrib import messages
KARMA_LOW = 100
KARMA_MEDIUM = 1000
KARMA_HIGH = 5000
INTERVAL_LOW = 3600
INTERVAL_MEDIUM = ... |
from core.serializers import ProjectSerializer
from rest_framework import generics
from core.models import Project
class ProjectList(generics.ListCreateAPIView):
queryset = Project.objects.all()
serializer_class = ProjectSerializer
class ProjectDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Proje... |
"""This contains the unit tests for treadmill.utils.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import os
import shutil
import signal
import stat
import tempfile
import time
import unittest
import str... |
'''
Created on 15.02.2015
@author: diesel
'''
import datetime
from indexdata import IndexData, IndexHistory
import indexdatabase
def _selectTrue( idxData ):
return True
class FetchData():
'''
classdocs
'''
def __init__(self, indexName):
'''
Constructor
'''
self.indexN... |
import sys, argparse
class MyParser(argparse.ArgumentParser):
def error(self, message):
'''Wraps error and prints in a shorter way'''
sys.stderr.write('error: %s\n' % message)
#self.print_help()
sys.exit(2) |
import unittest
from transformers import MobileBertConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device
from ..test_configuration_common import ConfigTester
from ..test_modeling_comm... |
from setuptools import setup
setup(
name='Earo',
version='0.1.0',
url='https://github.com/Everley1993/Laky-Earo',
license='Apache',
author='Everley',
author_email='463785757@qq.com',
description='A microframework based on EDA for business logic development.',
packages=['earo'],
packa... |
from gevent import monkey
monkey.patch_all()
from pysandesh.sandesh_base import sandesh_global
from sandesh_common.vns.ttypes import Module
from nodemgr.common.event_manager import EventManager, EventManagerTypeInfo
class ConfigEventManager(EventManager):
def __init__(self, config, unit_names):
type_info = ... |
"""
h2o -- module for using H2O services.
:copyright: (c) 2016 H2O.ai
:license: Apache License Version 2.0 (see LICENSE for details)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import os
import warnings
import webbrowser
import types
from h2o.backend import H2... |
import json
import re
import subprocess
from django.conf import settings
default_app_config = "peering.apps.PeeringConfig"
def call_irr_as_set_resolver(irr_as_set, address_family=6):
"""
Call a subprocess to expand the given AS-SET for an IP version.
"""
prefixes = []
if not irr_as_set:
retu... |
class Solution(object):
def constructRectangle(self, area):
"""
:type area: int
:rtype: List[int]
"""
ans = None
W = 1
while W * W <= area:
if area % W == 0:
ans = [area / W, W]
W += 1
return ans |
"""
Wavefront REST API
<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 documentation ... |
__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py rel_2.3.5:3329:275e75118ad4 2015/06/20 11:18:26 bdbaddog"
__doc__ = """Module for Visual C/C++ detection and configuration.
"""
import SCons.compat
import os
import platform
from string import digits as string_digits
import SCons.Warnings
import common
debug = common... |
from flask import render_template, flash, request, redirect, url_for
from flask_login import login_required
from kernel import agileCalendar
from kernel.DataBoard import Data
from kernel.NM_Aggregates import WorkBacklog, DevBacklog, RiskBacklog
from kconfig import coordinationBookByName
from . import coordination
__aut... |
"""Tests for custom landing pages."""
from __future__ import absolute_import # pylint: disable=import-only-modules
from __future__ import unicode_literals # pylint: disable=import-only-modules
from core.tests import test_utils
import feconf
class FractionLandingRedirectPageTest(test_utils.GenericTestBase):
"""Tes... |
import pytest
from tests.functional.services.api.images import (
add_image,
delete_image_by_id,
get_image_id,
wait_for_image_to_analyze,
)
from tests.functional.services.utils.http_utils import get_api_conf
@pytest.fixture(scope="package")
def add_image_with_teardown_package_scope(request):
def _add... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.