text
stringlengths
4
1.02M
meta
dict
__all__ = ( 'MageError', 'InstallError', 'FlagValidationError', 'MissingRequirements', 'PluginError', 'ParamProcessingError', 'ParamValidationError', 'NetworkError', 'ScriptRuntimeError', ) class MageError(Exception): """Default Exception class for Mage installer.""" def...
{ "content_hash": "5fe10fdc10dcdb15e5d9d7d222cacd52", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 69, "avg_line_length": 20.493333333333332, "alnum_prop": 0.682498373454782, "repo_name": "jiasir/mage", "id": "1948922a59a3369ff2876c6c9f2a1d94397f990e", "size": "1562", ...
from __future__ import print_function, unicode_literals, division, absolute_import import filecmp import os import shutil import sys import tempfile import unittest import dxpy import dxpy_testutil as testutil def setUpTempProjects(thing): thing.old_workspace_id = dxpy.WORKSPACE_ID thing.proj_id = dxpy.api....
{ "content_hash": "0f665e14f9e6e058087f442ed76d4167", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 117, "avg_line_length": 37.24761904761905, "alnum_prop": 0.6578880081820506, "repo_name": "dnanexus/dx-toolkit", "id": "7a63cacd9254e62cbf971386fc38552a0b466135", "size": ...
from gwt.gmaps.Map import ( Map, MapCanvasProjection, MapOptions, MapPanes, MapTypeControlOptions, MapTypeControlStyle, MapTypeId, NavigationControlOptions, NavigationControlStyle, ScaleControlOptions, ScaleControlStyle, createListenerMethods, dictToJs, )
{ "content_hash": "0e4d0d86bcc34226646f1d595e5e9b25", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 29, "avg_line_length": 20.533333333333335, "alnum_prop": 0.7175324675324676, "repo_name": "anandology/pyjamas", "id": "846daf44b9c7c5349cc0552cda37c472c4791100", "size": "3...
import requests import unittest import json protocol = "http" #host = "tactile-petal-92303.appspot.com" host = "localhost:8080" def genUrl(URI): return "%s://%s/%s" %(protocol, host, URI) class CreateUserIDTest(unittest.TestCase): """Create User test case""" # preparing to test def setUp(self)...
{ "content_hash": "d3601f8714491d4b949fc343787324e5", "timestamp": "", "source": "github", "line_count": 577, "max_line_length": 173, "avg_line_length": 39.70883882149047, "alnum_prop": 0.6051414106145251, "repo_name": "SIDM-GDT/laughing-sansa", "id": "f72984b4463dbea778d747a2fe0ae2e029e5fd52", "siz...
import collections class SymbolTable(collections.MutableMapping): def __init__(self): """Initialize the symbol table to a stack with global scope""" self.stack = [] self.push() return def push(self): """Pushes and returns an empty dictionary onto the symbol table""" ...
{ "content_hash": "729337e25c53971477f2d6e7e7495f61", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 82, "avg_line_length": 28.723684210526315, "alnum_prop": 0.5478699038021072, "repo_name": "patmiller/SAP", "id": "a887adf86027a37665d29fa34faf4cad391809a4", "size": "2183",...
''' Python DB API 2.0 driver compliance unit test suite. This software is Public Domain and may be used without restrictions. "Now we have booze and barflies entering the discussion, plus rumours of DBAs on drugs... and I won't tell you what flashes through my mind each time I read the subject line with...
{ "content_hash": "4479e34b9a281f0fbbe72de7eb9bd18f", "timestamp": "", "source": "github", "line_count": 840, "max_line_length": 129, "avg_line_length": 37.60595238095238, "alnum_prop": 0.544809902181139, "repo_name": "youngwookim/python-phoenixdb", "id": "93cdac66aa46311f74fa08690b6e4cc9af544ef8", ...
"""Unit tests for the standardise.StandardiseMetadata plugin.""" import unittest from datetime import datetime import iris import numpy as np from iris.coords import AuxCoord from iris.tests import IrisTest from improver.standardise import StandardiseMetadata from improver.synthetic_data.set_up_test_cubes import set...
{ "content_hash": "58213cbbd8b055980af7bf63b3273dcb", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 88, "avg_line_length": 41.53061224489796, "alnum_prop": 0.6286650286650287, "repo_name": "fionaRust/improver", "id": "073077b375e442c6677130c44e42397585970cc5", "size": "7...
import pymongo import uvloop import asyncio import os os.environ['MODE'] = 'PRO' from pprint import pprint from urllib.parse import parse_qs, urlparse from owllook.database.mongodb import MotorBase from owllook.fetcher.function import get_time # mongo MONGODB_SERVER = "localhost" MONGODB_PORT = 27017 MONGODB_USERNAM...
{ "content_hash": "62014be2901b062a5025581d47e8940a", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 101, "avg_line_length": 34.01162790697674, "alnum_prop": 0.5422222222222223, "repo_name": "zhiyue/owllook", "id": "f0b844c511af854631f566747b1b9a70be6e5cfb", "size": "2967"...
""" WSGI config for todolist 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETT...
{ "content_hash": "93f88772bd32ab1dcc35665a4fbeb7c8", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.5625, "alnum_prop": 0.7709923664122137, "repo_name": "mannyrivera2010/todolist-py3-drf", "id": "0d1c784d9d8b8f29db7f81be393eac0be3f6c3b5", "size":...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('communities', '0010_auto_20150607_1148'), ('users', '0003_auto_20150607_1606'), ] operations = [ migrations.AddField( model_name...
{ "content_hash": "5478096d101359fd379475e1197c28c5", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 146, "avg_line_length": 27.894736842105264, "alnum_prop": 0.6283018867924528, "repo_name": "nonZero/OpenCommunity", "id": "da973b5a00c5e73397d58d76289b733866d227ec", "size"...
import wolo.log as log import wolo.task as task import wolo.parameters as parameters def test_func(x): return "this is a test" example_log = [] example_log.append(log.TaskLog(index=[0], task_class="0", last_run_success=True)) sublog1 = [] sublog1.append(log.TaskLog(index=[1, "p0", 0], task_class="1_0_0", last_run...
{ "content_hash": "94ee7e90798afb6a15a50e839ca4a75e", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 190, "avg_line_length": 58.526315789473685, "alnum_prop": 0.5818345323741008, "repo_name": "AKuederle/python-WoLo", "id": "dca5980c88de9f57aad78788cb59a30f52168706", "size"...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['BoxCox'] , ['Lag1Trend'] , ['Seasonal_Minute'] , ['MLP'] );
{ "content_hash": "4af9558578faeea1b95e2d6ebb49be6f", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 82, "avg_line_length": 38.75, "alnum_prop": 0.7032258064516129, "repo_name": "antoinecarme/pyaf", "id": "e36db48d19074ab5fe2a15d9ae6999249787bc71", "size": "155", "binary"...
from . import event
{ "content_hash": "bea3109162c4cf4119c1182f875c6c55", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 19, "avg_line_length": 21, "alnum_prop": 0.7142857142857143, "repo_name": "ktan2020/jpype", "id": "9850447da7d7b8a00abe7622d5888bdca9e6d2ab", "size": "798", "binary": fals...
"""New implementation of Visual Studio project generation.""" import hashlib import os import random import gyp.common try: cmp except NameError: def cmp(x, y): return (x > y) - (x < y) # Initialize random number generator random.seed() # GUIDs for project types ENTRY_TYPE_GUIDS = { 'project': '{8BC9CE...
{ "content_hash": "e0c793f4833148adda7d3e73f4d06fb0", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 80, "avg_line_length": 35.26646706586826, "alnum_prop": 0.6128703625095508, "repo_name": "enclose-io/compiler", "id": "76c4b95c0c3e824046d911320fdf1109c952f512", "size": "...
from eclcli.common import command from eclcli.common import utils from ..networkclient.common import utils as to_obj class ListColoSpace(command.Lister): def get_parser(self, prog_name): parser = super(ListColoSpace, self).get_parser(prog_name) return parser def take_action(self, parsed_args)...
{ "content_hash": "e3b5ab1b0157b42e9fc0b47cc7f362ad", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 89, "avg_line_length": 29.76923076923077, "alnum_prop": 0.5910852713178295, "repo_name": "anythingrandom/eclcli", "id": "2a79eb0806e65a23a4c5a874f562606ee785e1e9", "size": ...
import mcpi.minecraft as minecraft import mcpi.block as block import time import math import threading # We need to "wrap up" our code into something called a class # Classes are a very powerful way of re using code # and hiding away code we are not directly interested in # They are a bit like a blueprint, or cooking ...
{ "content_hash": "3dd7facada744b57a1cedfedf5f08c3d", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 115, "avg_line_length": 36.46268656716418, "alnum_prop": 0.5906672124437168, "repo_name": "joedeller/pymine", "id": "b469f8f1af728187979ebba127c70939a483e351", "size": "86...
import unittest import os import tempfile import numpy as np from numpy import ma from numpy.testing import assert_array_equal from netCDF4 import Dataset, __netcdf4libversion__ # Test use of vector of missing values. class VectorMissingValues(unittest.TestCase): def setUp(self): self.testfile = tempfi...
{ "content_hash": "688063e208ddc9587960727ef0412a61", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 84, "avg_line_length": 26.671641791044777, "alnum_prop": 0.570229434806939, "repo_name": "Unidata/netcdf4-python", "id": "3d8dba4db144ad61e706c53cb37708df8030c455", "size":...
from telemetry.core.platform import proc_supporting_platform_backend from telemetry.core.platform import ps_util class CrosPlatformBackend( proc_supporting_platform_backend.ProcSupportingPlatformBackend): def __init__(self, cri): super(CrosPlatformBackend, self).__init__() self._cri = cri def StartR...
{ "content_hash": "b0eb6fbe15322b7a5fff8974476f9318", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 76, "avg_line_length": 28.923076923076923, "alnum_prop": 0.7154255319148937, "repo_name": "patrickm/chromium.src", "id": "81f5b002bd804bf9d76d5e9c2ca19760fc95f151", "size":...
from django.utils.translation import get_language from django.views.generic import DetailView, ListView from parler.views import TranslatableSlugMixin from .models import Article class BaseArticleMixin: # Only show published articles. def get_queryset(self): return super().get_queryset().filter(pub...
{ "content_hash": "40def5e1e7f890fca450006ef34de2b9", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 82, "avg_line_length": 29.464285714285715, "alnum_prop": 0.7442424242424243, "repo_name": "django-parler/django-parler", "id": "9bac1389de59fc4f7d4effacd6f6513504ae2652", "...
from enum import Enum class NotFoundException(Exception): pass class TooManyResultsException(Exception): pass class VirtualMachineGeneration(str, Enum): GEN1 = "Microsoft:Hyper-V:SubType:1" GEN2 = "Microsoft:Hyper-V:SubType:2" class VirtualMachineState(int, Enum): UNDEFINED = -1 RUNNING = 0 STOPPE...
{ "content_hash": "b95d1d9c019cc55633c1705f4f4bf010", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 42, "avg_line_length": 14.75, "alnum_prop": 0.6997578692493946, "repo_name": "crashtua/hvapi", "id": "458d2e4d369680265952a93ada9f63aecceb4dfa", "size": "1552", "binary":...
from __future__ import absolute_import import wrapt import opentracing import types from ..log import logger from ..singletons import tracer from ..util.traceutils import get_active_tracer try: import pika def _extract_broker_tags(span, conn): span.set_tag("address", "%s:%d" % (conn.params.host, co...
{ "content_hash": "8291cb5ef3383acc0c8b513906dc0666", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 109, "avg_line_length": 38.3563829787234, "alnum_prop": 0.549022327000416, "repo_name": "instana/python-sensor", "id": "845ff9fee148199470818e6f482d0be71d18a268", "size": ...
import sys import os project = 'python-neutronclient' # -- General configuration --------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx....
{ "content_hash": "18e15fdef1d1c8e4ac43add643529a4b", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 78, "avg_line_length": 30.509090909090908, "alnum_prop": 0.6853396901072706, "repo_name": "metacloud/python-neutronclient", "id": "1d6023e2dbdf330eee21c2fb19f25639e0ada5df", ...
"""Auto-generated file, do not edit by hand. UA metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_UA = PhoneMetadata(id='UA', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2}', possible_number_pattern='\\d{...
{ "content_hash": "cb60ca81cda8dec8973c3899619313e1", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 151, "avg_line_length": 68.16666666666667, "alnum_prop": 0.726161369193154, "repo_name": "vicky2135/lucious", "id": "c61eb96df02fc12b30bf115590491f9138dbe6e1", "size": "818...
import mock import os.path from neutron.agent.linux import external_process as ep from neutron.common import utils as common_utils from neutron.tests import base from neutron.tests import tools TEST_UUID = 'test-uuid' TEST_SERVICE = 'testsvc' TEST_PID = 1234 class BaseTestProcessMonitor(base.BaseTestCase): de...
{ "content_hash": "f5d2578623687235d66d8d015aed545e", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 79, "avg_line_length": 42.368, "alnum_prop": 0.5879909365558912, "repo_name": "apporc/neutron", "id": "e5ff67211c19a7f104f986c84e32c14d0624a826", "size": "11219", "binar...
"""add_policy Revision ID: 532e9e1f0f3a Revises: initial_db Create Date: 2014-12-18 14:52:20.402861 """ from __future__ import print_function from __future__ import division from __future__ import absolute_import # revision identifiers, used by Alembic. revision = '532e9e1f0f3a' down_revision = 'initial_db' from al...
{ "content_hash": "ae6af6bd2185e4372cfde16253cc5f32", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 75, "avg_line_length": 35.05128205128205, "alnum_prop": 0.5618141916605706, "repo_name": "ramineni/my_congress", "id": "e96e585c1f300651684f2f064f59007fd5cc8a89", "size": "...
import time import http.server import os HOST_NAME = '0.0.0.0' # Host name of the http server # Gets the port number from $PORT0 environment variable PORT_NUMBER = int(os.environ['PORT0']) class MyHandler(http.server.BaseHTTPRequestHandler): def do_GET(s): """Respond to a GET request.""" s.send_...
{ "content_hash": "3f44f309316166579fd700acec4d5cd2", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 92, "avg_line_length": 34.43333333333333, "alnum_prop": 0.6321393998063891, "repo_name": "madanadit/universe", "id": "8f6a4f7b6fe0e9cd328f24ed22f20cf71f5e4305", "size": "10...
import gtk import webkit view = webkit.WebView() sw = gtk.ScrolledWindow() sw.add(view) win = gtk.Window(gtk.WINDOW_TOPLEVEL) win.resize(800,600) win.add(sw) win.show_all() view.open("http://localhost:5000/") gtk.main()
{ "content_hash": "fccba2b7dfa907129d1a3d20e968c8e4", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 37, "avg_line_length": 14.933333333333334, "alnum_prop": 0.7142857142857143, "repo_name": "jlegendary/SimpleCV", "id": "bcdcf9d3e592f6179fca57e1fad63261248f42d1", "size": "...
from django.contrib.auth.models import User from models import ShiftEvent from datetime import date, datetime, timedelta from django.core.cache import cache from django.db.models import Q import os.path, time from django.utils.timezone import get_default_timezone from django.conf import settings def get_last_update_ti...
{ "content_hash": "e1211cf718179f8aefeef3f25988be7b", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 123, "avg_line_length": 41.691489361702125, "alnum_prop": 0.673896402143404, "repo_name": "swiharta/radres", "id": "c0bd3fd901739bccb914289b8bf50a9fa0a54443", "size": "3919...
'''Trains a LSTM on the IMDB sentiment classification task. The dataset is actually too small for LSTM to be of any advantage compared to simpler, much faster methods such as TF-IDF + LogReg. Notes: - RNNs are tricky. Choice of batch size is important, choice of loss and optimizer is critical, etc. Some configuratio...
{ "content_hash": "d241f38a3622e96660698055d08486cc", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 94, "avg_line_length": 34.91525423728814, "alnum_prop": 0.7271844660194174, "repo_name": "relh/keras", "id": "6c9dcff95e980d226fd929b496f1aefd0eb8d11c", "size": "2060", "...
""" test_digimesh.py By James Saunders, 2016 [email protected] Tests the XBee DigiMesh implementation class for API compliance """ import unittest from xbee.thread.digimesh import DigiMesh class TestDigiMesh(unittest.TestCase): """ Tests DigiMesh-specific features More tests will need adding in ...
{ "content_hash": "94dd0fc1f9f58b2d569b79033f17cea8", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 63, "avg_line_length": 26.242424242424242, "alnum_prop": 0.5715935334872979, "repo_name": "nioinnovation/python-xbee", "id": "21979aaa1a20f50cce3bed90ec05f1fdb220d468", "si...
"""Sign and send a heartbeat message to a remote service.""" import argparse import sys from infra.tools.heartbeat import heartbeat def parse_options(): # Gather user options. parser = argparse.ArgumentParser() parser.add_argument('-u', '--urls', help='URLs to send heartbeat.', action='append', default...
{ "content_hash": "4ff8fea617836a55164a6881f5f13fc4", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 77, "avg_line_length": 30.875, "alnum_prop": 0.6700404858299596, "repo_name": "nicko96/Chrome-Infra", "id": "27c37712ca312037dd06ef1dc73a0efff097fbef", "size": "1575", "b...
"""Support for Big Ass Fans fan.""" from __future__ import annotations import math from typing import Any from aiobafi6 import OffOnAuto from homeassistant import config_entries from homeassistant.components.fan import ( DIRECTION_FORWARD, DIRECTION_REVERSE, FanEntity, FanEntityFeature, ) from homeas...
{ "content_hash": "64c1d864a90d06c6b829b574690ad8a9", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 86, "avg_line_length": 34.670103092783506, "alnum_prop": 0.6520963425512935, "repo_name": "w1ll1am23/home-assistant", "id": "360926363a57b6b627bd2b76280dd8f5b0ce1e06", "siz...
import os from subprocess import Popen, PIPE from rpyc.lib import safe_import from rpyc.lib.compat import BYTES_LITERAL signal = safe_import("signal") # modified from the stdlib pipes module for windows _safechars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@%_-+=:,./' _funnychars = '"`$\\' def s...
{ "content_hash": "335f150218a4ffdbf4223677d7558a5f", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 103, "avg_line_length": 37.47080291970803, "alnum_prop": 0.5740722703808318, "repo_name": "bkillenit/AbletonAPI", "id": "f8cc11aa4035d0b41d803fd792aebf83b82f60f4", "size":...
from __future__ import absolute_import from __future__ import print_function from tornado import gen, ioloop from tchannel import TChannel, Response, thrift tchannel = TChannel('thrift-server', hostport='localhost:54497') service = thrift.load('tests/data/idls/ThriftTest.thrift') @tchannel.thrift.register(service.T...
{ "content_hash": "97cd9de7a5c5be37b280bf865e8d8bf0", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 64, "avg_line_length": 23.8, "alnum_prop": 0.7394957983193278, "repo_name": "uber/tchannel-python", "id": "c0cdf1218804d5b30e8c1c1299e838ed692feb89", "size": "1698", "bin...
from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver from datasciencebox.core.logger import getLogger logger = getLogger() class Driver(object): @classmethod def new(cls, settings): logger.debug('Creating new driver') cloud = settings['CLOUD'].lower()...
{ "content_hash": "3fb8374e143e106f29719f68884d2108", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 76, "avg_line_length": 34.04, "alnum_prop": 0.5969447708578144, "repo_name": "danielfrg/datasciencebox", "id": "99dcd8335ad58bd310d40c1d2be789339fbbf45d", "size": "1702", ...
from tests.isolated_testcase import IsolatedTestCase class CoalaLowercaseTest(IsolatedTestCase): def test_coala_lowercase(self): self.assertCommand('what is Coala?', 'coala is always written with a lower case c') def test_cep(self): self.assertCommand('what is a CE...
{ "content_hash": "c25a8ce3f76e3ba3a652150b127d2240", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 73, "avg_line_length": 33.083333333333336, "alnum_prop": 0.6246851385390428, "repo_name": "coala/corobo", "id": "cd9fa14e65f7a4d8fb2e785ebfe6ffa6d6f5873e", "size": "397", ...
import pytest import unittest from modules.sfp_voipbl import sfp_voipbl from sflib import SpiderFoot @pytest.mark.usefixtures class TestModuleVoipbl(unittest.TestCase): def test_opts(self): module = sfp_voipbl() self.assertEqual(len(module.opts), len(module.optdescs)) def test_setup(self): ...
{ "content_hash": "61ed6bc824ac0fb03cbbd91102821d64", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 64, "avg_line_length": 27.653846153846153, "alnum_prop": 0.6884561891515995, "repo_name": "smicallef/spiderfoot", "id": "96549b009a7df41f62f19c2aff90cad7e0ac2744", "size": ...
from hazelcast.serialization.bits import * 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 from hazelcast.protocol.builtin import D...
{ "content_hash": "c8ecafae7c086c0f571ec43c55624ec6", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 127, "avg_line_length": 40.77777777777778, "alnum_prop": 0.7920072661217076, "repo_name": "hazelcast/hazelcast-python-client", "id": "782800e4e0f2137ac050b3b6a76987d85d832f11...
"""Define fixtures available for all tests.""" import json import time import pytest from homeassistant.components.flo.const import DOMAIN as FLO_DOMAIN from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, CONTENT_TYPE_JSON from .common import TEST_EMAIL_ADDRESS, TEST_PASSWORD, TEST_TOKEN, TEST_USER_ID fro...
{ "content_hash": "a92561c80af56fb2c097d5c65a8defb9", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 83, "avg_line_length": 35.74626865671642, "alnum_prop": 0.6081419624217119, "repo_name": "partofthething/home-assistant", "id": "907feb855698a31a938b36e142958865159942cc", ...
from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('liveblog', '0003_auto_20160825_1459'), ] operations = [ migrations.AlterField( model_name='liveblogentr...
{ "content_hash": "33eece8ecd90cbe2fa045b0af033e48a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 88, "avg_line_length": 26.916666666666668, "alnum_prop": 0.6114551083591331, "repo_name": "theonion/django-bulbs", "id": "80ca7cde65af1acbf52fa745cff4db43d4400040", "size":...
import numpy as np from common.numpy_fast import clip, interp from selfdrive.config import Conversions as CV class LongCtrlState: #*** this function handles the long control state transitions # long_control_state labels: off = 0 # Off pid = 1 # moving and tracking targets, with PID control running ...
{ "content_hash": "c0cb9a68402af2858814db8103188e6d", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 128, "avg_line_length": 38.1673640167364, "alnum_prop": 0.6342907257180442, "repo_name": "BrevanJ04/Comma-Test-0.2.9", "id": "d6e1c8e8197a3078e20b2f08a43a79fb6423d256", "s...
""" Built-in, globally-available admin actions. """ from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.utils import get_deleted_objects, model_ngettext from django.core.exceptions import PermissionDenied from django.db import router from django.template.response impo...
{ "content_hash": "c9cd17be6572b85d479b2341d0f341ab", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 95, "avg_line_length": 37.47126436781609, "alnum_prop": 0.6858895705521473, "repo_name": "auready/django", "id": "5630d1c94cade4136c211dce383868b623eadb7b", "size": "3260",...
from __future__ import absolute_import from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg \ as FigureCanvas from traitsui.basic_editor_factory import BasicEditorFactory from traitsui.qt4.editor import Editor # noinspection PyUnresolvedReferences from mpl_toolkits.mplot3d import Axes3D class MPLFigu...
{ "content_hash": "ce988b46674a9f7b926bd32c5ffe0eff", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 66, "avg_line_length": 24.15625, "alnum_prop": 0.6778783958602846, "repo_name": "UManPychron/pychron", "id": "7070788b65f7e5f019093650450b0c7acfed2450", "size": "1708", "...
""" Django settings for project project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build path...
{ "content_hash": "c857de37de8c16490027b8fcbef9f2be", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 91, "avg_line_length": 27.789473684210527, "alnum_prop": 0.7012987012987013, "repo_name": "o5k/django-rest-framework-seed", "id": "40b878b8284727068dbc30c3ca01284208eb5fbb",...
import sys import os import os.path from jinja2 import Template from configparser import ConfigParser import io if __name__ == "__main__": if len(sys.argv) != 3: print("Usage: <program> <deploy_cfg_template_file> <file_with_properties>") print("Properties from <file_with_properties> will be applied...
{ "content_hash": "0ce2df785be7e367b23c48c8ad8081c5", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 103, "avg_line_length": 46.75, "alnum_prop": 0.5775401069518716, "repo_name": "briehl/narrative-test", "id": "a630d598a61fcc24c6911d229588969186768589", "size": "2057", "...
import os import pickle import warnings from copy import deepcopy from pynq.devicetree import DeviceTreeSegment, get_dtbo_base_name from .hwh_parser import HWH, get_hwh_name class DeviceMeta(type): """Metaclass for all types of Device It is responsible for enumerating the devices in the system and sele...
{ "content_hash": "7ed17efa2f7ff9fbf5ba13bc2a955bff", "timestamp": "", "source": "github", "line_count": 446, "max_line_length": 84, "avg_line_length": 34.05156950672646, "alnum_prop": 0.5612695068150392, "repo_name": "schelleg/PYNQ", "id": "5ce427b80d1d17c33794619eae5b6194f7245e50", "size": "15268"...
from __future__ import unicode_literals, print_function, division, absolute_import import unittest from neo.rawio.elanrawio import ElanRawIO from neo.test.rawiotest.common_rawio_test import BaseTestRawIO class TestElanRawIO(BaseTestRawIO, unittest.TestCase, ): rawioclass = ElanRawIO entities_to_test = ['Fi...
{ "content_hash": "27e2466b0d730d11601262fc2c58044f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 82, "avg_line_length": 24.095238095238095, "alnum_prop": 0.6739130434782609, "repo_name": "rgerkin/python-neo", "id": "c0336b30164970a904b4ca2bd7333cb8ced699b0", "size": "5...
def checkio(expression): ''' purpose of this func: test if every forward bracket has closed properly in the FILO manner use dictionary to pair the open bracket and close bracket together use linkedlist to stored expected closing bracket for every open bracket, add ''' backwardbrackets = [']','}',')']; br...
{ "content_hash": "a9aa7066a49c4d1f49e3f5f06068122c", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 80, "avg_line_length": 29.680851063829788, "alnum_prop": 0.6028673835125448, "repo_name": "dramaticlly/Python4Interview", "id": "d2647a27ec0ef85b3f83cef198248602f1e4ff7f", ...
from __future__ import unicode_literals from future.builtins import str from future.utils import with_metaclass from json import loads try: from urllib.request import urlopen from urllib.parse import urlencode except ImportError: from urllib import urlopen, urlencode from django.contrib.contenttypes.field...
{ "content_hash": "b55e89604dd42056e062cee0c4d9c6de", "timestamp": "", "source": "github", "line_count": 523, "max_line_length": 78, "avg_line_length": 36.01147227533461, "alnum_prop": 0.6122438143782521, "repo_name": "damnfine/mezzanine", "id": "aab68541fcdd68cc7e665e1c904697ea48035ec2", "size": "1...
from __future__ import with_statement # This isn't required in Python 2.6 import neuroptikon import wx.glcanvas from pydispatch import dispatcher import osg, osgDB, osgGA, osgManipulator, osgText, osgViewer from math import log, pi import os.path, platform, sys, cPickle try: import xml.etree.cElementTree as Elemen...
{ "content_hash": "a97c2e0c87f66ef8aeeac835e9f56da5", "timestamp": "", "source": "github", "line_count": 2993, "max_line_length": 375, "avg_line_length": 47.75609756097561, "alnum_prop": 0.606034953195181, "repo_name": "JaneliaSciComp/Neuroptikon", "id": "8b3fd4fbf3bbadaed26918c71b9d7c3a8099377a", "...
from __future__ import unicode_literals from django.core.validators import MaxLengthValidator from django_postgres_pgpfields.proxy import EncryptedProxyField def remove_validators(validators, validator_class): """Exclude `validator_class` instances from `validators` list.""" return [v for v in validators if...
{ "content_hash": "1af9b4ee31f4a292abad498bf50f4535", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 84, "avg_line_length": 35.784615384615385, "alnum_prop": 0.6693895098882201, "repo_name": "coldmind/django-postgres-pgpfields", "id": "a154e74ba587fd69bc8f9674e7f026206ac9787...
import binascii import hashlib import hmac from disqusapi import compat from disqusapi.compat import urllib_parse as urlparse def build_interfaces_by_method(interfaces): """ Create new dictionary from INTERFACES hashed by method then the endpoints name. For use when using the disqusapi by the method i...
{ "content_hash": "f7d12be0ddd4464ff7a91026b67e3bd1", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 91, "avg_line_length": 27.77358490566038, "alnum_prop": 0.59375, "repo_name": "disqus/disqus-python", "id": "76bb9346e162ddacdb26d7c3031022d59c03f4fe", "size": "2944", "...
from . import TranslationRotation
{ "content_hash": "086bdee570d6667055b59501108db32c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 34, "avg_line_length": 34, "alnum_prop": 0.8529411764705882, "repo_name": "kastman/occiput", "id": "080e9c3ecc511f7b30d860d5266c8b884a882dd3", "size": "188", "binary": fal...
""" Helper functions for scrapy project dupCheck(): Delete duplicate entries. Called after each reactor.run() in crimelog.py """ import sys sys.path.insert(0, '/home/amirkurtovic/crimeline') import os os.environ['DJANGO_SETTINGS_MODULE'] = 'crimeline.settings' from storylist.models import Story from scrapy.cont...
{ "content_hash": "b9b691b52c72e7ca52a8f29a8a07d3cb", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 102, "avg_line_length": 27.5, "alnum_prop": 0.746969696969697, "repo_name": "akurtovic/STL-Crimelog", "id": "ba07ec87ddc6c5ebd5b75ba897590c8bbd8e8dd9", "size": "660", "bi...
"""Model script to test TF-TensorRT integration.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np from tensorflow.python.compiler.tensorrt.test import tf_trt_integration_test_base as trt_test from tensorflow.python.framework ...
{ "content_hash": "0f1afa608d72341dba76787d4f1c8f17", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 93, "avg_line_length": 33.32203389830509, "alnum_prop": 0.6536113936927772, "repo_name": "frreiss/tensorflow-fred", "id": "7dc76363d5a1a70add921f23281f4cb580926b10", "size"...
"""Unit tests for `evaluation.py`.""" from absl.testing import absltest from clrs._src import evaluation from clrs._src import probing from clrs._src import specs import jax import jax.numpy as jnp import numpy as np class EvaluationTest(absltest.TestCase): def test_reduce_permutations(self): b = 8 n = 1...
{ "content_hash": "8ecd8322bf63875b91cd46b1aecafa0a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 70, "avg_line_length": 34.175, "alnum_prop": 0.6100950987564009, "repo_name": "deepmind/clrs", "id": "4f83ac399a583ded5ca9f77b717175106846fac1", "size": "2064", "binary":...
import tensorflow as tf import numpy as np from neupy.utils import tensorflow_session from neupy.core.properties import BoundedProperty, ProperFractionProperty from .base import BaseOptimizer __all__ = ('RPROP', 'IRPROPPlus') class RPROP(BaseOptimizer): """ Resilient backpropagation (RPROP) is an optimizat...
{ "content_hash": "889417067f42fc623e06b48a2204434b", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 79, "avg_line_length": 31.5, "alnum_prop": 0.5778732545649838, "repo_name": "itdxer/neupy", "id": "ee7cbb9400a908ceaf381c36db898e0213cf68b2", "size": "8379", "binary": f...
"""Test cases for Zinnia's views""" from datetime import date from django.test import TestCase from django.utils import timezone from django.contrib.sites.models import Site from django.test.utils import override_settings from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.signals import u...
{ "content_hash": "14b86c6457d8bb6db523b9b062954011", "timestamp": "", "source": "github", "line_count": 797, "max_line_length": 79, "avg_line_length": 47.27352572145546, "alnum_prop": 0.607028160416169, "repo_name": "Maplecroft/django-blog-zinnia", "id": "5b2d4047a8014f397c9edfa4bf8189efd036979b", ...
import setpath import functions def ifthenelse(*args): """ .. function:: ifthenelse(condition, x, y) Returns *x* if *condition* is true, else returns *y*. .. templateforparams Parameters: :condition: exception type :x: exception value :y: traceback object :retu...
{ "content_hash": "ae688ac34536ec72f8b89c3322f9062c", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 88, "avg_line_length": 23.39622641509434, "alnum_prop": 0.5879032258064516, "repo_name": "XristosMallios/cache", "id": "cfca0ecf3cf661e3ab7598b33fd192750b0f63e7", "size": "...
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "811dbdd94abb6adf6892b9fa04c854c5", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 188, "avg_line_length": 38.786127167630056, "alnum_prop": 0.5864381520119225, "repo_name": "arenadata/ambari", "id": "dc615aeaff882d4fdcff1d3c47d1f5c1ec76a01c", "size": "6...
from .._baseManager import BaseManager from .PluginHandlers import PluginDescription, _Plugin from .RunnableClass import MAINFILENAME, MAINCLASSNAME, Runnable from sys import version_info from os import path from shutil import rmtree from tempfile import mkdtemp if version_info[0] == 2: import imp def unpack...
{ "content_hash": "fae81b633961f69b8994e6c0af80f2ca", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 114, "avg_line_length": 38.48091603053435, "alnum_prop": 0.6141638563777029, "repo_name": "jr-garcia/Engendro3D", "id": "5b82b2b0ddda34aebcf4ea8197122d9d4ff9c6c5", "size":...
import math import torch from torch._six import inf from torch.distributions import constraints from torch.distributions.transforms import AbsTransform from torch.distributions.normal import Normal from torch.distributions.transformed_distribution import TransformedDistribution class HalfNormal(TransformedDistributi...
{ "content_hash": "4d924cb77eaf2c74a7cfa4cfbf77f3e2", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 80, "avg_line_length": 29.75, "alnum_prop": 0.6355042016806722, "repo_name": "ryfeus/lambda-packs", "id": "00d0015231c2e6f5784311939a631cc2e89e2bb0", "size": "1904", "bin...
""" Base classes and methods used by all kernels """ __author__ = 'lejlot' import numpy as np from abc import abstractmethod, ABCMeta class Kernel(object): """ Base, abstract kernel class """ __metaclass__ = ABCMeta def __call__(self, data_1, data_2): return self._compute(data_1, data_2)...
{ "content_hash": "6e90130759686d94ad39c98ba07398f1", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 92, "avg_line_length": 26.875, "alnum_prop": 0.5704651162790698, "repo_name": "gmum/pykernels", "id": "d45ba126bf12a6017e3a7fb953244d20e4019af3", "size": "4300", "binary...
""" A module of deep feature selection based on stacked restricted Boltzman machine (deep belief net). This module applies a deep structure with many hidden layers. Thus, greedy layer-wise pretraining and supervised funetuning are used in optimization. Copyright (c) 2008-2013, Theano Development Team All rights reser...
{ "content_hash": "7702f9ecf3da3d11fc09b86b87f23c1f", "timestamp": "", "source": "github", "line_count": 506, "max_line_length": 144, "avg_line_length": 45.547430830039524, "alnum_prop": 0.5947845706599557, "repo_name": "yifeng-li/DECRES", "id": "e6487b73c8e05cf9793f9cae94e120e9f496a33a", "size": "2...
from django.db import models from perfil.models import Persona from especialidad import Especialidad class Profesional(Persona): especialidades = models.ManyToManyField(Especialidad) @classmethod def create(cls, profesional_id=0): profesional = None if profesion...
{ "content_hash": "f247f75879bca6454ddb97b20abd29db", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 77, "avg_line_length": 26.8, "alnum_prop": 0.5932835820895522, "repo_name": "yo-alan/TrabajoFinalIntegrador", "id": "93fa0b89401cf6cfddc6d74996cc4f10ad8f4ba9", "size": "828...
"""Component builders test for software construction tookit (LARGE test).""" import sys import TestFramework def TestSConstruct(scons_globals): """Test SConstruct file. Args: scons_globals: Global variables dict from the SConscript file. """ # Get globals from SCons Environment = scons_globals['Envir...
{ "content_hash": "8e3acdd73e67e3b109c985f45359f171", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 80, "avg_line_length": 28.408163265306122, "alnum_prop": 0.6102729885057471, "repo_name": "nguyentran/openviber", "id": "e6dbb2f7fe83434e9ea36a99b4f1721eaa6e9383", "size": ...
from proto import arp_responder def launch(): arp_responder.launch()
{ "content_hash": "7dda6c804c2f3aa2bfde00105d3e466e", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 31, "avg_line_length": 18.5, "alnum_prop": 0.7297297297297297, "repo_name": "anrl/gini3", "id": "5be8152e16d136144f3d5bb477c50594bf36d044", "size": "94", "binary": false, ...
from flask import render_template, request def object_list(template_name, query, paginate_by=20, **context): page = request.args.get('page') if page and page.isdigit(): page = int(page) else: page = 1 object_list = query.paginate(page, paginate_by) return render_template(template_na...
{ "content_hash": "a740aa48a70a3e507d2509d09908649c", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 66, "avg_line_length": 30.416666666666668, "alnum_prop": 0.6657534246575343, "repo_name": "abacuspix/NFV_project", "id": "a018e7f6354ec0562801805d7dc58ef7689fcd01", "size":...
from Axon.Component import component from Axon.Ipc import producerFinished, shutdownMicroprocess import time from AlignTSPackets import AlignTSPackets class ExtractPCR(component): Inboxes = { "inbox" : "Individual tranport stream packets", "control" : "Shutdown signalling", } O...
{ "content_hash": "6e620ec837e70c5ddb4a07445026c0a2", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 98, "avg_line_length": 34.29457364341085, "alnum_prop": 0.4588607594936709, "repo_name": "sparkslabs/kamaelia", "id": "170ebb4fd95849849742f668ba0cfc19bd2774c8", "size": "...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os.path import os import pandas as pd from .exceptions import (DatasetNotFound, InitException, NotFound, WrongParameter) def _list_filenames(data_dir, dir_pattern...
{ "content_hash": "7a00bc0fe6a0ec5cf8fe7e0b22f3fe96", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 98, "avg_line_length": 33.71382636655949, "alnum_prop": 0.554411063423939, "repo_name": "kcompher/FreeDiscovUI", "id": "4ac920546ad8b11fd346d2f95ab93ed896b5d68e", "size": ...
import time import random from six.moves import filter from dpark.utils.log import get_logger PURGE_ELAPSED = 60 * 5 FAILED_TIMES = 2 logger = get_logger(__name__) class HostStatus: def __init__(self, hostname, purge_elapsed=PURGE_ELAPSED): self.hostname = hostname self.failed_log = [] se...
{ "content_hash": "9444631945ea5f718a9e06cf9528d046", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 88, "avg_line_length": 37.91875, "alnum_prop": 0.5801879017636393, "repo_name": "douban/dpark", "id": "1be697631c1623a9f1e5edac20555bd087b0af37", "size": "6067", "binary...
"""Render the blog indexes.""" from __future__ import unicode_literals from collections import defaultdict import os try: from urlparse import urljoin except ImportError: from urllib.parse import urljoin # NOQA from nikola.plugin_categories import Task from nikola import utils class Indexes(Task): """...
{ "content_hash": "8f05173d89620dc3726f53ba207e30cf", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 191, "avg_line_length": 53.23504273504273, "alnum_prop": 0.49120976157983465, "repo_name": "jjconti/nikola", "id": "616670f5f53488a716f5dbf8a028e9db6f2cd625", "size": "135...
""" Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string "23" Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]. Note: Although the above answer is in lexicogr...
{ "content_hash": "a4afacef8f46fd4e77269eb47910ab42", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 98, "avg_line_length": 32.40816326530612, "alnum_prop": 0.5, "repo_name": "cyandterry/Python-Study", "id": "12f5be5839d3525f49e368234d945030fc6188cc", "size": "1588", "bi...
from __future__ import print_function import argparse import numpy as np import mdtraj as md import multiprocessing as mp import AdaptivePELE.analysis.trajectory_processing as tp try: basestring except NameError: basestring = str def parseArguments(): desc = "Program that filters the trajectories outside ...
{ "content_hash": "1ccf3d54eac6c5d75544c71576ef2288", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 187, "avg_line_length": 49.17171717171717, "alnum_prop": 0.6454396055875102, "repo_name": "AdaptivePELE/AdaptivePELE", "id": "f374375a339f858350da6753da5b101479de3f77", "si...
__source__ = 'https://leetcode.com/problems/random-point-in-non-overlapping-rectangles/' # Time: O(N) # Space: O(N) # # Description: Leetcode # 497. Random Point in Non-overlapping Rectangles # # Given a list of non-overlapping axis-aligned rectangles rects, # write a function pick which randomly and uniformily picks ...
{ "content_hash": "ae9827a9077fb64ce5b2d7bdd2f05b1a", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 117, "avg_line_length": 30.574074074074073, "alnum_prop": 0.5941853422168383, "repo_name": "JulyKikuAkita/PythonPrac", "id": "81ea31410669c1492102b488c3ca3a49cdf3bf5b", "s...
from __future__ import absolute_import, print_function import os.path from unittest.case import expectedFailure from commoncode.testcase import FileBasedTesting from cluecode_assert_utils import check_detection """ This test suite is based a rather large subset of Android ICS, providing a rather diversified sample o...
{ "content_hash": "9ac4b4ebb83359e7a0f4eb56f0868bec", "timestamp": "", "source": "github", "line_count": 19458, "max_line_length": 224, "avg_line_length": 41.70372083461815, "alnum_prop": 0.6139886699586307, "repo_name": "yashdsaraf/scancode-toolkit", "id": "c3565c2e0cd296a689836768a905b7ea342eb6c4", ...
from django.conf import settings from django.utils.translation import ugettext_lazy as _ import horizon class AdminFloatingIps(horizon.Panel): name = _("Floating IPs") slug = 'floating_ips' permissions = ('openstack.services.network', ) policy_rules = (("network", "context_is_admin"),) @staticme...
{ "content_hash": "060e960e28275b71d6f931049440a1ad", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 75, "avg_line_length": 30.125, "alnum_prop": 0.6887966804979253, "repo_name": "noironetworks/horizon", "id": "589457ca073f605428a49136f9bd34de7f68bc5e", "size": "1118", "...
""" <Program> transition_canonical_to_onepercentmanyevents.py <Purpose> The purpose of this program is to transition nodes from the canonical state to the onepercentmanyevents state by bypassing through the movingtoonepercentmanyevents state. <Started> August 13, 2009 <Author> Monzur Muhammad monzum@cs...
{ "content_hash": "554ee76e44dafc3f6f69bb56d98dc849", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 137, "avg_line_length": 38.89138576779026, "alnum_prop": 0.6974191063174114, "repo_name": "sburnett/seattle", "id": "81c495bd50e69622bcde131a31817f3b86aabbf1", "size": "10...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
{ "content_hash": "37ac1d10af521bd6a060ee6056c32adb", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 86, "avg_line_length": 38.52272727272727, "alnum_prop": 0.7368731563421829, "repo_name": "lude-ma/python-ivi", "id": "b816cebda81680c6865820995791ff5164d55515", "size": "16...
"""This API defines FeatureColumn abstraction. To distinguish the concept of a feature family and a specific binary feature within a family, we refer to a feature family like "country" as a feature column. For example "country:US" is a feature which is in "country" feature column and has a feature value ("US"). Suppo...
{ "content_hash": "c8205adbf7e82b6577ed5b5cab905473", "timestamp": "", "source": "github", "line_count": 2138, "max_line_length": 82, "avg_line_length": 39.97848456501403, "alnum_prop": 0.6412827292510003, "repo_name": "naturali/tensorflow", "id": "924d8c4e9e057485b1f138c403f292ca585c5a57", "size": ...
from rest_framework import serializers from news.models import News from ads.models import Ads from skiclubs.models import Skiclubs from pages.models import Pages from rankings.models import Races from widgets.models import Widgets from angulation.models import Covers from blogs.models import ( Bloggers, BlogPo...
{ "content_hash": "a2d53c3212f8cf17df65b7ec6d96af37", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 79, "avg_line_length": 24.518987341772153, "alnum_prop": 0.6277749096541043, "repo_name": "Tooskich/python_core", "id": "c7b4c286858c8db5336799a38c3925fd7e1f4a6b", "size": ...
import logging import re # http://developer.android.com/reference/android/test/InstrumentationTestRunner.html STATUS_CODE_START = 1 STATUS_CODE_OK = 0 STATUS_CODE_ERROR = -1 STATUS_CODE_FAILURE = -2 # http://developer.android.com/reference/android/app/Activity.html RESULT_CODE_OK = -1 RESULT_CODE_CANCELED = 0 _INSTR...
{ "content_hash": "58030d41afd7f3190df232603b074ec5", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 84, "avg_line_length": 30.75, "alnum_prop": 0.6376811594202898, "repo_name": "Teamxrtc/webrtc-streaming-node", "id": "c27a2ead2b913212ffe8c91a06df9078c3f9bdb2", "size": "29...
""" Answer extraction for QA """ from operator import itemgetter from collections import defaultdict import importlib import string import logging as log import nltk from ner import SocketNER from inquire import config question_types = { 'DESC': 'description', 'ENTY': 'entity', 'ABBR': 'abbreviation', ...
{ "content_hash": "6c349734fcfada127911394381c8f316", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 93, "avg_line_length": 38.780141843971634, "alnum_prop": 0.6228968544257498, "repo_name": "jcelliott/inquire", "id": "cec98b34138e9cfa7dceddc99c2688cd734db5fb", "size": "5...
import yaml from yaml import * import logging import os.path import functools log = logging.getLogger(__name__) class ExtLoaderMeta(type): def __new__(metacls, __name__, __bases__, __dict__): """Add include constructer to class.""" # register the include constructor on the class cls = ...
{ "content_hash": "e8526e04fd157a34590fcd48abb6f2b9", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 69, "avg_line_length": 25.473684210526315, "alnum_prop": 0.5757575757575758, "repo_name": "deisi/SFG2D", "id": "a29775e81e65c7135c52dde46dce8d0c93066e5c", "size": "1452", ...
from django import forms from datetime import timedelta from kitabu.search.reservations import SingleSubjectManagerReservationSearch from lanes.models import LaneReservation from spa.forms import SearchForm, PeriodForm class PoolReservationsSearchForm(SearchForm, PeriodForm): def search(self, subject_manager):...
{ "content_hash": "a3fc535a824a5a66d254bbfadd59c693", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 89, "avg_line_length": 36.666666666666664, "alnum_prop": 0.7236363636363636, "repo_name": "mbad/kitabu", "id": "77b70279279f2a6051397e70ae70e613b6547557", "size": "1100", ...
from croplands_api import celery from flask import current_app import StringIO import requests from PIL import Image as Img import boto from boto.s3.key import Key from bs4 import BeautifulSoup from pyproj import Proj, transform as _transform from croplands_api.models import Image, db, Location import datetime from cro...
{ "content_hash": "b6a2e6862ce7e81766399da423172a31", "timestamp": "", "source": "github", "line_count": 343, "max_line_length": 111, "avg_line_length": 36.137026239067055, "alnum_prop": 0.6106494554255748, "repo_name": "justinwp/croplands", "id": "a2475b2e7eb6d4b23d18773b011514f30d0e5b91", "size": ...
''' Splits a compiler outputted program into the asm module and the surrounding shell. This can be useful if you want to process the shell in some manner (e.g. minifiy it) in ways that would be harmful to asm.js code. ''' import sys import shared from asm_module import AsmModule try: me, infile, out_shell, out_asm ...
{ "content_hash": "5921cafa3f3813103a5b3620f980c333", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 92, "avg_line_length": 26.678571428571427, "alnum_prop": 0.714859437751004, "repo_name": "slightperturbation/Cobalt", "id": "39eaca00840585eeafb60267fa79fb87ebda1dcb", "siz...
import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, Resourc...
{ "content_hash": "21c5fc2ed095e9a22e2ab0ad081a3527", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 145, "avg_line_length": 46.03378378378378, "alnum_prop": 0.6440628210773521, "repo_name": "Azure/azure-sdk-for-python", "id": "8129ea7b351317d0a9fdab4dc4b4e6afe9d07a87", "...
"""Treadmill Cloud REST api. """ import flask import flask_restplus as restplus from flask_restplus import fields # Disable E0611: No 'name' in module from treadmill import webutils # pylint: disable=E0611 def handle_api_error(func): def wrapper(*args, **kwargs): try: return func(*args, **k...
{ "content_hash": "fcc1169f0b4d88e2ca5e46580f72c5f1", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 77, "avg_line_length": 31.815573770491802, "alnum_prop": 0.5231225041865258, "repo_name": "bretttegart/treadmill", "id": "3b1988be8860d79c8cf6823a3ccb2c49607ccfd7", "size"...
"""Contains the logic for `aq add sandbox`.""" import os from aquilon.exceptions_ import AuthorizationException, ArgumentError from aquilon.aqdb.model import Sandbox, Branch from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611 from aquilon.worker.commands.get import CommandGet from aquilon.worker....
{ "content_hash": "0165e30ae66a5985f1cd14c0c0d9183a", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 78, "avg_line_length": 43.69117647058823, "alnum_prop": 0.6428811847862672, "repo_name": "quattor/aquilon", "id": "953ee621857c12386f8fbd2b301795fda78dd67d", "size": "3679"...
'''Functions for working with lbl files lbl files are represented as a numpy rec array with fields: name (a unicode string), start, stop. For events with no explicit stop, stop = start. typical use: abcd_intervals = find_seq(read(this/is/a_lbl_file.lbl), 'abcd') ''' from __future__ import unicode_literals, print_func...
{ "content_hash": "07f7eabfb7f3aec03727ea0ef54c174e", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 82, "avg_line_length": 33.28947368421053, "alnum_prop": 0.5513833992094862, "repo_name": "kylerbrown/lbl", "id": "72d03ccdde4c534b8c3805489fc6a8b058aa374c", "size": "2530",...
"""Copyright 2022 Google LLC 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 agreed to in writing, software dist...
{ "content_hash": "558e5c1dfd71d9959b199b8d6d8ac64b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 72, "avg_line_length": 29.580645161290324, "alnum_prop": 0.732824427480916, "repo_name": "gsuitedevs/python-samples", "id": "2e2f308027584d9a278c4b146bd677c6f0070e2d", "siz...
from coherence.backend import BackendStore # The data itself is stored in BackendItems. They are also the first things we # are going to create. from coherence.backend import BackendItem # To make the data 'renderable' we need to define the DIDLite-Class of the Media # we are providing. For that we have a bunch of he...
{ "content_hash": "664a7a4d2f8fa7dd4b83216ba0a4011c", "timestamp": "", "source": "github", "line_count": 499, "max_line_length": 123, "avg_line_length": 33.38276553106213, "alnum_prop": 0.7118501620842839, "repo_name": "palfrey/coherence", "id": "de738ad7902a8299c7fa691736511f6fe8f30fd7", "size": "1...
import copy from oslo_log import log as logging import six import webob.exc from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import exception from nova.i18n import _LE ALIAS = 'extensions' LOG = logging.getLogger(__name__) authorize = extensions.os_compute_authorizer(ALIAS) # ...
{ "content_hash": "d16171369879193218d1a604a4652e09", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 78, "avg_line_length": 38.11489361702127, "alnum_prop": 0.5770905437088311, "repo_name": "watonyweng/nova", "id": "069aaf52d68b856eaabcff375bf2a2c198d5703c", "size": "9559...
"""Test bitcoind with different proxy configuration. Test plan: - Start bitcoind's with different proxy configurations - Use addnode to initiate connections - Verify that proxies are connected to, and the right connection command is given - Proxy configurations to test on bitcoind side: - `-proxy` (proxy everythin...
{ "content_hash": "7852ab1bcb060c07c021656410a947a5", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 121, "avg_line_length": 41.228070175438596, "alnum_prop": 0.6164893617021276, "repo_name": "rnicoll/dogecoin", "id": "05b658ed8720fcf1e4ee5dbdfc1f81557e27afb3", "size": "9...
""" Created on 2017 Author : Edouard Cuvelier Affiliation : Université catholique de Louvain - ICTEAM - UCL Crypto Group Address : Place du Levant 3, 1348 Louvain-la-Neuve, BELGIUM email : [email protected] """ import tools.fingexp as fingexp from Crypto.Random.random import randint from random import sa...
{ "content_hash": "85bd43aeee1c9277008281fe3a857a42", "timestamp": "", "source": "github", "line_count": 1115, "max_line_length": 484, "avg_line_length": 36.718385650224214, "alnum_prop": 0.5296646393590777, "repo_name": "ecuvelier/P3MVEOS", "id": "9d68161a4120fc2ccbcb623c954b105ee481a378", "size": ...
"""PYPOWER solves power flow and Optimal Power Flow (OPF) problems. """
{ "content_hash": "b914e7803705a250baf78a014c56971a", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 67, "avg_line_length": 36, "alnum_prop": 0.7222222222222222, "repo_name": "praba230890/PYPOWER", "id": "8c3c4c2beb381bc4a6b033d4cb9e84364367e226", "size": "229", "binary":...
""" This module contains all the data structures for music service plugins """ from __future__ import unicode_literals from .xml import XML, ns_tag, NAMESPACES from .exceptions import DIDLMetadataError from .utils import camel_to_underscore def get_ms_item(xml, service, parent_id): """Return the music service ...
{ "content_hash": "56ab88138f5a3ba33be53afe7aa861b3", "timestamp": "", "source": "github", "line_count": 543, "max_line_length": 79, "avg_line_length": 38.17495395948435, "alnum_prop": 0.5832891118722563, "repo_name": "intfrr/SoCo", "id": "ef8e9839c76c7ad64610ce5c13c05ccf8f82d2ef", "size": "20867", ...
"""FR-specific Form helpers""" from __future__ import unicode_literals import re from datetime import date from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import CharField, RegexField, Select from django.utils.encoding import force_text from django.uti...
{ "content_hash": "d2a91fd02d2ea4bd9f78068c7eaabb45", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 117, "avg_line_length": 35.44827586206897, "alnum_prop": 0.6035992217898832, "repo_name": "jieter/django-localflavor", "id": "82168f2a67365589a14e32709586e844dc80a1dc", "s...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('customer', '0005_company_po_box'), ] operations = [ migrations.AddField( model_name='company', name='region', fi...
{ "content_hash": "440a4f77905ac9fd7bf9d2477acbf29a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 62, "avg_line_length": 21.444444444444443, "alnum_prop": 0.5906735751295337, "repo_name": "dgriff67/django-tech-test", "id": "cea2344bdbb1b7162238911c7713f3399cd72d35", "si...