text
stringlengths
4
1.02M
meta
dict
""" The Plaid API The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from plaid.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, ModelNormal...
{ "content_hash": "cfec61e05338b43785c71a0a0dd272c0", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 169, "avg_line_length": 39.83068783068783, "alnum_prop": 0.5661530286928799, "repo_name": "plaid/plaid-python", "id": "9217ef322284ebcd5bf2af4f3987099bbf807d52", "size": "...
import cPickle as pickle import numpy as np import os import random class StanfordSentiment: def __init__(self, path=None, tablesize = 1000000): if not path: path = "utils/datasets/stanfordSentimentTreebank" self.path = path self.tablesize = tablesize def tokens(self): ...
{ "content_hash": "e5bf7d8d206257b4c20c5f8109146553", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 103, "avg_line_length": 30.8, "alnum_prop": 0.526636628677445, "repo_name": "kabrapratik28/Stanford_courses", "id": "4ae128d3ce9c38a87db687118bde999ebdfaf530", "size": "75...
from __future__ import absolute_import from django.db import models from django.utils import timezone from sentry.db.models import Model, NodeField, FlexibleForeignKey, sane_repr from sentry.db.models.manager import BaseManager from sentry.utils.canonical import CanonicalKeyView def ref_func(x): return x.projec...
{ "content_hash": "654b3839ee7b57698fca0c4dcae224e0", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 89, "avg_line_length": 27.4375, "alnum_prop": 0.6993166287015945, "repo_name": "beeftornado/sentry", "id": "e197a6998fa90d5f4209cfabdc5bf0cedaab90a6", "size": "878", "bin...
"""Test Zeroconf component setup process.""" import pytest from zeroconf import InterfaceChoice, ServiceInfo, ServiceStateChange from homeassistant.components import zeroconf from homeassistant.components.zeroconf import CONF_DEFAULT_INTERFACE from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant...
{ "content_hash": "f583788283af4947ec73b57ff831a7c0", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 88, "avg_line_length": 38.95798319327731, "alnum_prop": 0.6769844693701467, "repo_name": "robbiet480/home-assistant", "id": "45b1d9b1171df4f706bd6b83aa0aec4d063d172d", "si...
""" This script fills the contents of doc/user_guide/API.rst based on the updated Altair schema. """ from os.path import abspath, dirname, join import sys import types # Import Altair from head ROOT_DIR = abspath(join(dirname(__file__), "..")) sys.path.insert(0, ROOT_DIR) import altair as alt # noqa: E402 API_FILENA...
{ "content_hash": "5d920d5695fcfd49d5100dde1d16bbce", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 85, "avg_line_length": 24.24576271186441, "alnum_prop": 0.6399860188745194, "repo_name": "jakevdp/altair", "id": "a70c3aa734a665fdc03486ce017d719505105ee6", "size": "2861"...
from recipe_engine import recipe_api class IsolateApi(recipe_api.RecipeApi): """APIs for interacting with isolates.""" def __init__(self, **kwargs): super(IsolateApi, self).__init__(**kwargs) self._isolate_server = 'https://isolateserver.appspot.com' self._isolated_tests = {} @property def isola...
{ "content_hash": "b7dd1817964957bb2b0217c55192fa7a", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 80, "avg_line_length": 39.624454148471614, "alnum_prop": 0.6454705752700022, "repo_name": "eunchong/build", "id": "69d7836af3337924e7e345d65defb86790140fc8", "size": "9237...
from neutron.common import constants from neutron import context from neutron.plugins.ml2.drivers.l2pop import db as l2pop_db from neutron.tests.common import helpers from neutron.tests.unit import testlib_api class TestL2PopulationDBTestCase(testlib_api.SqlTestCase): def setUp(self): super(TestL2Populati...
{ "content_hash": "629933d5ca0d515d9537d707371b6aa4", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 72, "avg_line_length": 40.67857142857143, "alnum_prop": 0.6962247585601404, "repo_name": "glove747/liberty-neutron", "id": "e4bf6dc59e2c880cb9d5d76b5ff7e6859d6feef5", "size...
import functools import flask from flask import request from umr.zeeguu_server import ZEEGUU_LOGIN def with_session(view): """ Decorator checks whether a session is available either in - as a cookie - as a GET or POST parameter If it is, it sets the sessionID field on the request object whic...
{ "content_hash": "0aaf4355388c4a5abc0219c417021220", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 72, "avg_line_length": 28.357142857142858, "alnum_prop": 0.6662468513853904, "repo_name": "mircealungu/Unified-Multilanguage-Reader", "id": "4e67f136aecaa152dc56ccfda83993913...
"""docstring """ __revision__ = '0.1' global_read_user_interceptor = None global_access_secret_key = None global_login_page = None
{ "content_hash": "f30cf28d1397efd9a7d201f4545cce1b", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 35, "avg_line_length": 16.625, "alnum_prop": 0.6917293233082706, "repo_name": "YuelianINC/django_render", "id": "77df751efc28955cd654508ce12856a53d8545b1", "size": "221", ...
import os import sys sys.path.insert(0, os.path.abspath('../..')) # -- 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...
{ "content_hash": "41e16de566a09bf9eee3e91b6833c4a6", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 79, "avg_line_length": 30.950819672131146, "alnum_prop": 0.6721398305084746, "repo_name": "nikolas-hermanns/flash-test", "id": "92a221c52cf11655bc6d8d707456dfeb0be22b99", "...
"""SCons.Tool.latex Tool-specific initialization for LaTeX. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Per...
{ "content_hash": "d7b4eaa774cd9efdb6919f3ac9933b42", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 89, "avg_line_length": 35.64473684210526, "alnum_prop": 0.7279438907345884, "repo_name": "amyvmiwei/chromium", "id": "63b093ff3c14817e2844a3887e706fbe73796b4f", "size": "27...
from setuptools import setup, find_packages import os try: reqs = open(os.path.join(os.path.dirname(__file__), 'requirements.txt')).read() except (IOError, OSError): reqs = '' setup( name='django-navbar', version=__import__('navbar').__version__, description='Reusable django application managing n...
{ "content_hash": "8dc1b26dd752712ecc7d1b57d68d24ba", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 83, "avg_line_length": 33.13333333333333, "alnum_prop": 0.6378269617706237, "repo_name": "coordt/django-navbar", "id": "881673c26ed52bb0dc5c7f3840a9a40093d662a2", "size": "...
from django.conf import settings from dimagi.utils.modules import to_function import copy from dimagi.utils.couch.database import get_db def _extract_domains(doc): if "domain" in doc and doc["domain"]: return [doc["domain"]] elif "domains" in doc and doc["domains"]: return doc["domains"] re...
{ "content_hash": "93c03a552697be9887ac91691838ffb8", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 114, "avg_line_length": 39.98989898989899, "alnum_prop": 0.6150543066430917, "repo_name": "SEL-Columbia/commcare-hq", "id": "015b57b24c99083d6153f8566e194b7428ba6073", "siz...
import array import six.moves.cPickle as pickle import json from collections import defaultdict from gzip import GzipFile from os.path import getmtime import struct from time import time import os from io import BufferedReader from hashlib import md5 from itertools import chain from tempfile import NamedTemporaryFile i...
{ "content_hash": "93cc3f6a8dc2d75a21893def1e190edb", "timestamp": "", "source": "github", "line_count": 496, "max_line_length": 79, "avg_line_length": 40.25, "alnum_prop": 0.5418753756762172, "repo_name": "matthewoliver/swift", "id": "fc63f041ee9318a0c19803a0e1c0b55474fba657", "size": "20559", "b...
"""empty message Revision ID: 4fb92f3ede9e Revises: 2b269c4557de Create Date: 2014-03-14 12:12:41.912515 """ # revision identifiers, used by Alembic. revision = '4fb92f3ede9e' down_revision = '2b269c4557de' from alembic import op from datetime import datetime import sqlalchemy as sa from sqlalchemy.dialects import ...
{ "content_hash": "7e8b8529d0ceca02cd9b9960609c2a88", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 63, "avg_line_length": 31.30263157894737, "alnum_prop": 0.5977301387137453, "repo_name": "4bic/grano", "id": "4ed7944c533a28079bff55e52b97819cafdef499", "size": "2379", "...
"""Module for constructing <colgroup> tag.""" from __future__ import absolute_import from ...lib.utils import validate_attribute_values from ...templates.html.tags import colgroup ATTRIBUTES = { 'align': { 'description': 'Aligns the content in a column group', 'values': ['left', 'right', 'center'...
{ "content_hash": "01a8ea80192bcb4cb87565bdbf78e093", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 79, "avg_line_length": 37.09345794392523, "alnum_prop": 0.5399344923154447, "repo_name": "bharadwajyarlagadda/korona", "id": "aa66c02a9cff2650e6dacff336ead02506a3dcd6", "s...
import paddle.v2 as paddle import os import gzip from paddle.v2.reader.creator import cloud_reader import paddle.v2.dataset.uci_housing as uci_housing etcd_ip = os.getenv("ETCD_IP") etcd_endpoint = "http://" + etcd_ip + ":" + "2379" trainer_id = int(os.getenv("PADDLE_INIT_TRAINER_ID")) def main(): # init pad...
{ "content_hash": "f20c8f93d8c5f14a9c8f7e89888feefb", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 79, "avg_line_length": 33.04054054054054, "alnum_prop": 0.5435582822085889, "repo_name": "PaddlePaddle/cloud", "id": "ed5e53aefd6da37002800e2f31ad27429d75b494", "size": "30...
import requests from bs4 import BeautifulSoup as mksoup BASE = "https://www.iblocklist.com" def get_value_from(url): soup = mksoup(requests.get(BASE + url).text) return str(soup.find_all("input")[-1]).split("\"")[-2] soup = mksoup(requests.get("https://www.iblocklist.com/lists.php").text) links = {} for ro...
{ "content_hash": "db9c30f067711d86c31cecaa44c6e632", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 72, "avg_line_length": 25.217391304347824, "alnum_prop": 0.6362068965517241, "repo_name": "susman/Ultimate-Blocklist", "id": "072c3875410b1f4b9951179bf1f777301e849b4f", "si...
# # Parse tree nodes # from __future__ import absolute_import import cython cython.declare(sys=object, os=object, copy=object, Builtin=object, error=object, warning=object, Naming=object, PyrexTypes=object, py_object_type=object, ModuleScope=object, LocalScope=object, ClosureScope=obje...
{ "content_hash": "8bfb82ea41a7b0d685aed1c664415f30", "timestamp": "", "source": "github", "line_count": 8851, "max_line_length": 145, "avg_line_length": 40.44616427522314, "alnum_prop": 0.5664224319741668, "repo_name": "encukou/cython", "id": "5b32a2b3d708129d2414b62d0197aa8b23ce1e4d", "size": "357...
import sys import yaml def main(): # various smoke tests on an installed PyYAML with extension if not getattr(yaml, '_yaml', None): raise Exception('C extension is not available at `yaml._yaml`') print('embedded libyaml version is {0}'.format(yaml._yaml.get_version_string())) for loader, dum...
{ "content_hash": "1b2a905ba905279cdc5c364321729e5c", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 85, "avg_line_length": 33.81818181818182, "alnum_prop": 0.6424731182795699, "repo_name": "yaml/pyyaml", "id": "7d799cea22152bbded142b85366f717a0524f943", "size": "744", "...
from django.conf import settings as _settings def settings(request): values = {} for v in _settings.VIEW_SETTINGS: try: values[v] = getattr(_settings, v) except AttributeError: # no SETTINGS in Django settings pass return {'settings': values} def base_template(req...
{ "content_hash": "3db9626a44580f82e7eb105bdb1bfbcc", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 73, "avg_line_length": 25.677419354838708, "alnum_prop": 0.6256281407035176, "repo_name": "ff0000/generator-red-django", "id": "e11e1f39f3b4ff11c3d4baa2c1475f3459591092", "...
import socket from oslo_config import cfg from oslo_log import log as oslo_logging from cloudbaseinit.osutils import factory as osutils_factory from cloudbaseinit.plugins.common import base from cloudbaseinit.utils import dhcp opts = [ cfg.BoolOpt('ntp_use_dhcp_config', default=False, help='Confi...
{ "content_hash": "90f379e48238c28adf49580e2b5c39b8", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 79, "avg_line_length": 33.171875, "alnum_prop": 0.6081017428167688, "repo_name": "cmin764/cloudbase-init", "id": "0a8b894dc830709cb63b81bc47ad735df87d79f6", "size": "2739",...
import pytest from supriya import servertools @pytest.fixture(scope='function') def server(request): def server_teardown(): server.quit() server = servertools.Server().boot() request.addfinalizer(server_teardown) return server def test_Bus_set_01(server): control_bus = servertools.Bus.c...
{ "content_hash": "89bd565c4f7579de059af8d3e5d0a9b6", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 43, "avg_line_length": 22.419354838709676, "alnum_prop": 0.6661870503597123, "repo_name": "andrewyoung1991/supriya", "id": "06d663d519a2d4199ad63c3c9cb20c0e9e422ab2", "size...
import grpc from google.cloud.vision_v1p1beta1.proto import image_annotator_pb2 as google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_image__annotator__pb2 class ImageAnnotatorStub(object): """Service that performs Google Cloud Vision API detection tasks over client images, such as face, landmark, logo, label,...
{ "content_hash": "3891f882833960d924a6451cc76a5ec9", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 151, "avg_line_length": 44.755102040816325, "alnum_prop": 0.7555859553123575, "repo_name": "jonparrott/google-cloud-python", "id": "277708bd6e3be22ef9dab49a5a788cc8022678fc",...
import numpy as np import pandas as pd import xarray as xr import datetime import os def get_mjo(months=None, years=None, reload_data=False): '''MJO index from http://www.bom.gov.au/climate/mjo/graphics/rmm.74toRealtime.txt''' module_dir, fname = os.path.split(__file__) data_file = os.path.join(mod...
{ "content_hash": "b88d93aad32466b84c02cebcfb9e83ee", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 78, "avg_line_length": 34.12698412698413, "alnum_prop": 0.5693023255813954, "repo_name": "wy2136/climate_index", "id": "de61c146a639dc2256ffbbd90f4f9d7571e7720b", "size": "...
__all__ = ("FlashPolicyProtocol", "FlashPolicyFactory",) import re from twisted.python import log from twisted.internet import reactor from twisted.application.internet import TCPServer from twisted.internet.protocol import Protocol, Factory class FlashPolicyProtocol(Protocol): """ Flash Playe...
{ "content_hash": "6df2725dc9c229fb84b92bb3fdfa3f72", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 139, "avg_line_length": 31.573033707865168, "alnum_prop": 0.6576512455516014, "repo_name": "normanmaurer/autobahntestsuite-maven-plugin", "id": "5f6ca5ac45195bf0f2ccd8453a815...
from neutron.api.rpc.handlers import dvr_rpc from neutron.common import constants as n_const from neutron.common import utils as n_utils from neutron.openstack.common import log as logging from neutron.plugins.openvswitch.common import constants LOG = logging.getLogger(__name__) # A class to represent a DVR-hosted ...
{ "content_hash": "b790ea4622ba3c709cb097e2b10a8175", "timestamp": "", "source": "github", "line_count": 702, "max_line_length": 79, "avg_line_length": 44.396011396011396, "alnum_prop": 0.49903741256497464, "repo_name": "cboling/SDNdbg", "id": "3d89fe0b199f3631550c6adb34a6bf805c3373cf", "size": "318...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('web', '0003_remove_question_order'), ] operations = [ migrations.AlterOrderWithRespectTo( name='question', order_with_respec...
{ "content_hash": "07aae07586973294d29bfa042c0b1fd5", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 50, "avg_line_length": 23.61904761904762, "alnum_prop": 0.6048387096774194, "repo_name": "otoyo/satisfactory-mobile", "id": "165435effce7f5db21c9edbb3518a5e7a3550b69", "siz...
"""A helper request handler for request handlers that receive data.""" import logging from dashboard import request_handler from dashboard import utils class PostDataHandler(request_handler.RequestHandler): """Helper class to handle common functionality for dealing with slaves.""" def post(self): """Checks...
{ "content_hash": "8da5adcb1edbb16ca441d4a84ec29096", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 77, "avg_line_length": 35.095238095238095, "alnum_prop": 0.7008141112618724, "repo_name": "scottmcmaster/catapult", "id": "486045a59d95996469f51c84486f426531593696", "size"...
import telnetlib import time import socket import sys TELNET_PORT = 23 TELNET_TIMEOUT = 6 def send_command(remote_conn, cmd): cmd = cmd.rstrip() remote_conn.write(cmd + '\n') time.sleep(1) return remote_conn.read_very_eager() def login(remote_conn, username, password): output = remote_conn.read_...
{ "content_hash": "cc72a716fd2d86b0ca814686a79cd1b2", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 69, "avg_line_length": 23.5, "alnum_prop": 0.6560283687943262, "repo_name": "cdieken/python_class", "id": "9d68ca956452e0e61831deeb2467f0bd9c7226a4", "size": "1171", "bin...
import datetime import json import re import yaml from django import template from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.template.defaultfilters import date from django.utils.html import escape, strip_tags from django.utils.safestring import mark_safe from m...
{ "content_hash": "036bcc59d0b9ea590331f2e6b631469b", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 92, "avg_line_length": 25.714285714285715, "alnum_prop": 0.633033033033033, "repo_name": "respawner/peering-manager", "id": "c3278a9114f79779debd9e216e655a2f5e47c723", "si...
from unittest import TestCase import numpy as np import pytest from diffprivlib.validation import clip_to_norm class TestClipToNorm(TestCase): def test_incorrect_parameterisation(self): with self.assertRaises(TypeError): clip_to_norm([1, 2, 3], 1) with self.assertRaises(ValueError): ...
{ "content_hash": "1b3a98ea23555d061b8f5d67607fd9ed", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 97, "avg_line_length": 31.072727272727274, "alnum_prop": 0.5915740198946753, "repo_name": "IBM/differential-privacy-library", "id": "c309df0e1e09960c40977511ea69342406b9c93d"...
def parse_environment(raw_environment): environment = {} for line in raw_environment.split('\n'): line = line.strip() if not line: continue if line.startswith('#'): continue try: key, value = line.split(':', 1) except ValueError: ...
{ "content_hash": "c172983425454ba918a1f4460fd33cf8", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 72, "avg_line_length": 26.705882352941178, "alnum_prop": 0.5572687224669604, "repo_name": "mhahn/stacker", "id": "bce73e9ec0d06c8b95b4477eba117ab6e049d3b7", "size": "456", ...
__author__ = 'Daniel Dittenhafer' __version__ = '0.1' __date__ = '2015-03-23' import pandas as pd import gviz_data_table as gv import numpy import os from datetime import datetime def ToGvizDataTable(dataframe): table = gv.Table() dt = dataframe.dtypes # Loop to add the columns from the dataframe to the...
{ "content_hash": "25f393eb2d42427f39850e8e4e686e8c", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 195, "avg_line_length": 33, "alnum_prop": 0.5971479500891266, "repo_name": "dwdii/PanGviz", "id": "1766c94cc33901350be21b7d247cf13214eae410", "size": "3366", "binary": f...
class Output(object): """Represents a generic output for a solver""" def __init__(self, output=None, errors=None): self._output = output # Variable in which results are stored self._errors = errors # The errors thrown by the solver def get_errors(self): """Get error strin...
{ "content_hash": "e5033d32719e093f8bac0fcf249bce26", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 87, "avg_line_length": 29.53846153846154, "alnum_prop": 0.5807291666666666, "repo_name": "SimoneLucia/EmbASP-Python", "id": "11549abc24e35eab43aa3384d4ba7b8a1187d681", "siz...
"""Tests mnist batchnormalization used as learned scale factor.""" # to run, THRESHOLD=0.05 WITH_BN=1 EPOCHS=5 TRAIN=1 python example_mnist_bn.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import defaultdict import os import numpy as...
{ "content_hash": "b4992a88f254ff9765eb4215dc97b575", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 79, "avg_line_length": 29.598958333333332, "alnum_prop": 0.6475453105754003, "repo_name": "google/qkeras", "id": "48fd53df44e2a7343a30001b1b571e1517bb80ec", "size": "6340"...
import pandas as pd import pytest from woodwork.column_schema import ColumnSchema from woodwork.logical_types import Boolean, Datetime, Timedelta from featuretools.feature_base import Feature from featuretools.primitives.base.transform_primitive_base import ( make_trans_primitive ) # Check the custom trans primi...
{ "content_hash": "b8be7e98f8f88062fe15ad695b2b43e4", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 83, "avg_line_length": 36.975806451612904, "alnum_prop": 0.6386041439476554, "repo_name": "Featuretools/featuretools", "id": "77a5ecbbcd6a3089a5b01cde135d3237c82dc3ce", "s...
"""Read and write notebook files as XML. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed a...
{ "content_hash": "15ec5992b1ec6375e6db1f76b671e956", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 94, "avg_line_length": 36.07936507936508, "alnum_prop": 0.5002199736031676, "repo_name": "omni5cience/django-inlineformfield", "id": "f9ca12496f8581e700fdad50980a9e500228995...
""" Exceptions and handlers for tools. FIXME: These are used by tool scripts, not the framework, and should not live in this package. """ class UCSCLimitException( Exception ): pass class UCSCOutWrapper( object ): """File-like object that throws an exception if it encounters the UCSC limit error lines...
{ "content_hash": "8d049344fea268bcaf4f13d78758ed78", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 95, "avg_line_length": 32.39393939393939, "alnum_prop": 0.5855940130963517, "repo_name": "dbcls/dbcls-galaxy", "id": "81479a60bc2504b07668101db34139126434859e", "size": "10...
from test_framework.test_framework import InfinitumTestFramework from test_framework.util import * class InvalidateTest(InfinitumTestFramework): def __init__(self): super().__init__() self.setup_clean_chain = True self.num_nodes = 3 def setup_network(self): self.n...
{ "content_hash": "fd2c6b796f282f98cc5e43f1b058fa21", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 95, "avg_line_length": 42.28358208955224, "alnum_prop": 0.6191316625485351, "repo_name": "fcecin/infinitum", "id": "76877528d3eedd2625eb7735bb04539050af7e5a", "size": "3081...
''' NVVM is not supported in the simulator, but stubs are provided to allow tests to import correctly. ''' class NvvmSupportError(ImportError): pass class NVVM(object): def __init__(self): raise NvvmSupportError('NVVM not supported in the simulator') CompilationUnit = None llvm_to_ptx = None set_cuda...
{ "content_hash": "33686df09116a16b7873f1ccec2a2445", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 77, "avg_line_length": 20.565217391304348, "alnum_prop": 0.7230443974630021, "repo_name": "stefanseefeld/numba", "id": "ce1b3897ba2f822352bc6e330acac6215ff70a9c", "size": "...
""" Peter Norvig's Python implementation http://norvig.com/spell-correct.html """ import re import collections def words(text): return re.findall('[a-z]+', text.lower()) def train(features): model = collections.defaultdict(lambda: 1) for f in features: model[f] += 1 return model NWORDS = t...
{ "content_hash": "0fc9e533c6dbdb2cb7d97ec9aa9760cb", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 78, "avg_line_length": 25.148936170212767, "alnum_prop": 0.6116751269035533, "repo_name": "danielcnorris/haskell-spelling-corrector", "id": "8c2d8f82b8a23c25076c0330b8c8bd5f8...
"""django_rest_framework_tutorial URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home...
{ "content_hash": "8b79d687cb08318435e77c7090718b74", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 82, "avg_line_length": 39.354838709677416, "alnum_prop": 0.7221311475409836, "repo_name": "twtrubiks/django-rest-framework-tutorial", "id": "1eb84ce9d5898bb5a58cb67a3cea86c45...
"""API renderers for accessing AFF4 objects.""" # pylint: disable=unused-import,g-bad-import-order from grr.lib import server_plugins # pylint: enable=unused-import,g-bad-import-order from grr.gui import api_aff4_object_renderers from grr.gui import api_call_renderers from grr.gui import api_value_renderers from gr...
{ "content_hash": "a552a3d5569a2bdda80dd159c4feb924", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 74, "avg_line_length": 30.791666666666668, "alnum_prop": 0.7293640054127198, "repo_name": "bgalehouse/grr", "id": "a5ccccd93e3862da15d565412cc1d62c29a49f67", "size": "2239"...
class Solution(object): def canJump(self, nums): """ :type nums: List[int] :rtype: bool """ # greedy # https://leetcode.com/articles/jump-game/ length = len(nums) begin = length - 1 for i in reversed(range(length - 1)): if i + nums[...
{ "content_hash": "1ce097765f1b27037541c88d5d4d30d6", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 50, "avg_line_length": 27.357142857142858, "alnum_prop": 0.47780678851174935, "repo_name": "qiyuangong/leetcode", "id": "0e8b9ec3aef9df65071e8d96dddf424763f5e505", "size": ...
import unittest2 as unittest import ast import math import itertools from stencil_kernel import * from stencil_python_front_end import * from stencil_unroll_neighbor_iter import * from stencil_convert import * from asp.util import * class BasicTests(unittest.TestCase): def test1(self): class TestKernel(Ste...
{ "content_hash": "5db818526fe49ca2bfce809420d6752c", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 62, "avg_line_length": 28.647058823529413, "alnum_prop": 0.5903490759753593, "repo_name": "richardxia/asp-multilevel-debug", "id": "5cacbb263f6ecb71950d647bb6e69f3c2c3ea8f1",...
from connector import channel from google3.cloud.graphite.mmv2.services.google.vmwareengine import private_cloud_pb2 from google3.cloud.graphite.mmv2.services.google.vmwareengine import ( private_cloud_pb2_grpc, ) from typing import List class PrivateCloud(object): def __init__( self, name: s...
{ "content_hash": "93dd744bdbff9777c5bef39d0c5e7103", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 87, "avg_line_length": 35.04627766599597, "alnum_prop": 0.6469743943047422, "repo_name": "GoogleCloudPlatform/declarative-resource-client-library", "id": "0da58420d94be11096...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) # -- General conf...
{ "content_hash": "8034f58cd035ce0257cdb0971199d197", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 80, "avg_line_length": 32.57142857142857, "alnum_prop": 0.7041666666666667, "repo_name": "paoloRais/lightfm", "id": "7ae74bacb13559dc0c6b190fa7398e69379f6c74", "size": "95...
""" WSGI config for dj17_testproject 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/dev/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj17_testproject.settings") ...
{ "content_hash": "41edde2ca7839565cd89608b1ea9219a", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 29.071428571428573, "alnum_prop": 0.7813267813267813, "repo_name": "anentropic/kombu-django-json-serializer", "id": "ff1fca02eb3a603d2a14b51e57ee3113e5...
r"""Generate python docs for tf.lite. # How to run ``` python build_docs.py --output_dir=/path/to/output ``` """ import pathlib from absl import app from absl import flags import tensorflow as tf from tensorflow_docs.api_generator import generate_lib flags.DEFINE_string('output_dir', '/tmp/lite_api/', ...
{ "content_hash": "c0960169e85c90c8b39048a10558be2d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 76, "avg_line_length": 24.22, "alnum_prop": 0.6374896779521056, "repo_name": "tensorflow/tensorflow-pywrap_saved_model", "id": "e019a791888a5bbabaab6306e8d6771356ef8ae1", "...
from toontown.coghq.SpecImports import * GlobalEntities = {1000: {'type': 'levelMgr', 'name': 'LevelMgr', 'comment': '', 'parentEntId': 0, 'cogLevel': 0, 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/lawbotHQ/LawbotCourtroom3', 'wantDoors': 1}, 1001...
{ "content_hash": "d9057a389115394b1facba14bc625380", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 69, "avg_line_length": 29.307692307692307, "alnum_prop": 0.5511811023622047, "repo_name": "linktlh/Toontown-journey", "id": "6cbc91f0e05b41f5469bd79987fb68505152a870", "siz...
import pygame, sys, os import CONST, SWSmenu, GameTime from pygame.locals import * from CONST import * from SWSmenu import * from GameTime import * """ IDEAS: -make bools such as isInMenu, startedGame/isInAction """ pygame.init() clock = pygame.time.Clock() screen = pygame.display.set_mode(WINDOW_SIZE)...
{ "content_hash": "e5bc3cef1428742374aad3e290cf0cae", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 78, "avg_line_length": 18.743589743589745, "alnum_prop": 0.6361149110807114, "repo_name": "iPatso/PyGameProjs", "id": "7c476401e128fb7cdbcfc727541b791a23a53083", "size": "7...
import functools __all__ = ['partial' , 'Layout'] def partial(handler): """ Mark the handler as a view partial (set response Content-Type). """ @functools.wraps(handler) def _handler(*args, **kwargs): response = handler(*args, **kwargs) response.content_type = 'x-application/partial'...
{ "content_hash": "d9f289910794337f52032de0ba7dc22d", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 79, "avg_line_length": 31.051948051948052, "alnum_prop": 0.6394813885403596, "repo_name": "yeiniel/aurora", "id": "22669962029fd9929c15f941d4ad8722b606f725", "size": "3964"...
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on May 14, 2012 @author: John Cornwell @contact: John@lucenaresearch.com @summary: ''' # Python imports i...
{ "content_hash": "de95d3f68e9e92bce35f16e8eaa0b45d", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 67, "avg_line_length": 17, "alnum_prop": 0.6644385026737968, "repo_name": "wogsland/QSTK", "id": "6e11ed35fa09fbf999fb4ed728dcebb48a93702e", "size": "748", "binary": fals...
import unittest from TASSELpy.TASSELbridge import TASSELbridge from TASSELpy.test.net.maizegenetics.trait.TraitTest import TraitTest from TASSELpy.test.net.maizegenetics.trait.PhenotypeTest import PhenotypeTest from TASSELpy.test.net.maizegenetics.trait.MarkerPhenotypeTest import MarkerPhenotypeTest class traitTestSui...
{ "content_hash": "0d4f720778f754f3bc78296d2997a7ab", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 89, "avg_line_length": 41.705882352941174, "alnum_prop": 0.765867418899859, "repo_name": "er432/TASSELpy", "id": "6c2a188f3c17b40d14a279481267fc340b7cc566", "size": "709", ...
"""empty message Revision ID: 37f460a1f4d2 Revises: 1584139036cb Create Date: 2019-02-28 14:53:48.334389 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSONB # revision identifiers, used by Alembic. revision = '37f460a1f4d2' down_revision = '1584139036cb' branch_labels...
{ "content_hash": "a98a78feed0442e5dbc37e5a1b0a1de0", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 81, "avg_line_length": 41.136842105263156, "alnum_prop": 0.6443193449334698, "repo_name": "viewportvr/daysinvr", "id": "fbcb129fcbad8bc2ced74fcffd6596e2409f9dba", "size": ...
import json import os import sys import traitlets from . import sklearn from . import generate from . import catboost from . import lightgbm from . import xgboost def lmap(f, values): return list(map(f, values)) def lmapstar(f, values): return [f(*k) for k in values] def to_trait(name, trait): retur...
{ "content_hash": "029ed6784c2a54d3d5cc927c8e3d28bd", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 68, "avg_line_length": 22.396551724137932, "alnum_prop": 0.5950731331793687, "repo_name": "maartenbreddels/vaex", "id": "7cd5fa595f4daa473274be89655e941f94e9b0b1", "size": ...
"""Adapted from https://stackoverflow.com/a/21912744/812183""" from __future__ import absolute_import from __future__ import unicode_literals import sys from collections import OrderedDict import yaml MAP_TYPE = yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG def load_map(loader, node): loader.flatten_mapping(...
{ "content_hash": "64fbfd5738759ed3c34e82792e9bb6c0", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 74, "avg_line_length": 24.735849056603772, "alnum_prop": 0.7315026697177727, "repo_name": "asottile/aspy.yaml", "id": "b97a815098cba00d23a7549244c33990ca5bcc65", "size": "1...
import unittest from pants.base.generator import TemplateData class TemplateDataTest(unittest.TestCase): def setUp(self): self.data = TemplateData(foo="bar", baz=42) def test_member_access(self): try: self.data.bip self.fail("Access to undefined template data slots sh...
{ "content_hash": "72ab09c5018ee5147e41f9822e61e1ac", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 95, "avg_line_length": 29.066666666666666, "alnum_prop": 0.6146788990825688, "repo_name": "tdyas/pants", "id": "dc52d2dbe95ca603efdc3040bf2ff4b6e7647792", "size": "1004", ...
import sys, os, inspect from abc import ABCMeta, abstractmethod from ctypes import * import math MY_DIR = os.path.dirname(os.path.abspath(inspect.getframeinfo(inspect.currentframe())[0])) HELPER_DIR = os.path.abspath(os.path.join(MY_DIR, '..', 'helpers')) sys.path.append(HELPER_DIR) import dhlog from dhcore import * f...
{ "content_hash": "b5145ef60dbb2db445e10b2a6d87c986", "timestamp": "", "source": "github", "line_count": 1076, "max_line_length": 103, "avg_line_length": 35.44516728624535, "alnum_prop": 0.5872466504103411, "repo_name": "UPO33/darkhammer", "id": "e2afbd27a812f3c4fa06c36a5f178502cc72a97e", "size": "3...
import os, sys import setuptools import pkg_resources from setuptools import setup, Command classifiers = ['Development Status :: 6 - Mature', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Operating...
{ "content_hash": "4a9ac8322855aecc42cac6149c658edc", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 113, "avg_line_length": 36.10569105691057, "alnum_prop": 0.5935600090069804, "repo_name": "doordash/pytest", "id": "69b6f5e5c3c01043fbed99ab391a1b83afe5de0b", "size": "444...
"""Tests for datastore helper.""" from __future__ import absolute_import import errno import random import sys import unittest from builtins import map from socket import error as SocketError from mock import MagicMock # Protect against environments where apitools library is not available. # pylint: disable=wrong-im...
{ "content_hash": "301e804ff9417ca7a43aa83c55775ab1", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 80, "avg_line_length": 32.92057761732852, "alnum_prop": 0.6641079065687027, "repo_name": "markflyhigh/incubator-beam", "id": "e71255a7159e9d54206b040607a6efb0f7c9337c", "s...
import re,shutil,traceback from optparse import OptionParser from trac.env import Environment parser = OptionParser("""usage: [options] trac-install trac-install <- The path to your trac install.""") def p(question): return raw_input('%s\nT&E-uninstall> '%question) def cast_bool(s): return len(re.findall...
{ "content_hash": "2af39bb674cf2499963aee07619e6dae", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 101, "avg_line_length": 38.36305732484077, "alnum_prop": 0.5621783164535945, "repo_name": "lexqt/EduTracTimingAndEstimation", "id": "24249e837b6b5e0e448c6b818d5ab607f0e39f56...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'User.phone' db.add_column('auth_user', 'phone', self.gf('lo...
{ "content_hash": "992c8a112d024d277634303db266cbe9", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 192, "avg_line_length": 62.220338983050844, "alnum_prop": 0.5625170253336965, "repo_name": "DArtagan/teetimer", "id": "5e05200aefd15a0c2ebf75e47818726ee1467e01", "size": "3...
import oauth2 as oauth import httplib2 import time, os, simplejson # Fill the keys and secrets you retrieved after registering your app consumer_key = '77t43u3loazvrz' consumer_secret = 'b95o3WkJj7vbNWMj' user_token = 'd77d38f5-6f3e-422a-9a6a-6fe985ae8c54' user_secret = '01027166-7044...
{ "content_hash": "eb93a961c1b827922853f009129a350a", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 119, "avg_line_length": 39.24324324324324, "alnum_prop": 0.721763085399449, "repo_name": "DistrictDataLabs/02-labormatch", "id": "a0f99426e0a0bcc975b8393439900669aaa2e5c7", ...
from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import tabs class OverviewTab(tabs.Tab): name = _("Overview") slug = "overview" template_name = "project/cg_snapshots/_detail_overview.html" def get_context_data(self, request): cg_snapshot =...
{ "content_hash": "75f689b50d8c7b8eee7db32bfdbb3e17", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 64, "avg_line_length": 27.363636363636363, "alnum_prop": 0.6976744186046512, "repo_name": "noironetworks/horizon", "id": "4c9cd997b45f9c28a172197fdac97ca2dee33d15", "size":...
import requests import logging import sys from apiwrapper import APIWrapper API_URL = 'https://api.sandbox.amadeus.com/v1.2' def configure_logger(log_level=logging.WARN): logger = logging.getLogger(__name__) logger.setLevel(log_level) try: sa = logging.StreamHandler(stream=sys.stdout) except...
{ "content_hash": "fa7c152378a50a6900680d6a8c405a69", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 115, "avg_line_length": 32.11, "alnum_prop": 0.6658361881033946, "repo_name": "jpmunic/udest", "id": "5f15c3902935ad7af6dbb86af23f9280349962ea", "size": "3211", "binary"...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models def _update(obj, model_contact_old, model_contact_new): contact_old = model_contact_old.objects.get(pk=obj.contact_id) contact_new = model_contact_new.objects.get(slug=contact_old.slug) obj.n...
{ "content_hash": "c929122577491e9d49598a9de574461d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 71, "avg_line_length": 32.38235294117647, "alnum_prop": 0.6821071752951862, "repo_name": "pkimber/crm", "id": "199d59d1921e8466435fce04cc437064abd50903", "size": "1125", ...
__author__ = 'bakl' from .sn_eve import PreSN from .snec import Snec from .stella import Stella # from .SneSpace import SneSpace
{ "content_hash": "12371604850225f9b705e61d457e3731", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 32, "avg_line_length": 21.666666666666668, "alnum_prop": 0.7384615384615385, "repo_name": "baklanovp/pystella", "id": "435a90c9d209c06a3c6ad158b2e5f9b4c3ec046b", "size": "13...
from __future__ import absolute_import from django.apps import apps from django.db import models from django.db.models import Sum from django.test import TestCase from django.utils import timezone from analytics.lib.counts import CountStat, COUNT_STATS, process_count_stat, \ zerver_count_user_by_realm, zerver_cou...
{ "content_hash": "d02c4d02a5ca868243d83a7d25a82d0f", "timestamp": "", "source": "github", "line_count": 634, "max_line_length": 125, "avg_line_length": 50.93375394321767, "alnum_prop": 0.6151988108509847, "repo_name": "JPJPJPOPOP/zulip", "id": "6a85342c81c4492d9edfad656dcc6e25bd20b1d8", "size": "32...
import xml.etree.ElementTree as ET class brocade_ras(object): """Auto generated class. """ def __init__(self, **kwargs): self._callback = kwargs.pop('callback') def logging_raslog_message_msgId_msgId(self, **kwargs): """Auto Generated Code """ config = ET....
{ "content_hash": "cc1c139d9ac99b44141d4c7ff283146c", "timestamp": "", "source": "github", "line_count": 958, "max_line_length": 92, "avg_line_length": 41.07724425887265, "alnum_prop": 0.6132343972352104, "repo_name": "SivagnanamCiena/pynos", "id": "aa6179f1be72a96af8c3374d636921b331591488", "size":...
import h5py import matplotlib.pyplot as plt import numpy as np import os import os.path import tensorflow as tf from keras.backend import floatx from keras.layers import Conv1D, Conv2D, Dense from keras.layers.core import Flatten, Reshape from keras.models import load_model, Sequential from keras import optimizers fr...
{ "content_hash": "38a520bdeba73a23ccaad6c15598caeb", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 80, "avg_line_length": 33.857142857142854, "alnum_prop": 0.6092827004219409, "repo_name": "spragunr/echolocation", "id": "3287d30571cfab8198bd9cbc2a5bc658ddc96c76", "size"...
from msrest.serialization import Model class SystemService(Model): """Information about a system service deployed in the cluster. Variables are only populated by the server, and will be ignored when sending a request. :param system_service_type: The system service type. Possible values include:...
{ "content_hash": "448e5b74421d07675cb4130b041c7bec", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 75, "avg_line_length": 35.333333333333336, "alnum_prop": 0.6462264150943396, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "a6d2975738e714400f26abe4b83b94afadae7e7d",...
"""Tests for the Outlook Windows Registry plugins.""" import unittest from dfdatetime import filetime as dfdatetime_filetime from dfwinreg import definitions as dfwinreg_definitions from dfwinreg import fake as dfwinreg_fake from plaso.parsers.winreg_plugins import outlook from tests.parsers.winreg_plugins import t...
{ "content_hash": "cc8493bcebbe12ae58242aa12eae685e", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 78, "avg_line_length": 35.850746268656714, "alnum_prop": 0.6917152373022482, "repo_name": "joachimmetz/plaso", "id": "bc3c9d1eb5cc5acf75a1d2bd68931e5b0f9f975f", "size": "4...
import unittest import jmespath from parameterized import parameterized from tests.helm_template_generator import render_chart class GitSyncWebserverTest(unittest.TestCase): def test_should_add_dags_volume_to_the_webserver_if_git_sync_and_persistence_is_enabled(self): docs = render_chart( va...
{ "content_hash": "2b5d09fcac25277feae3b1829ebc6aff", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 110, "avg_line_length": 35.15483870967742, "alnum_prop": 0.4931180033033584, "repo_name": "mistercrunch/airflow", "id": "506452f9e2ba0407a8b551a8fe1cb779b92ae43c", "size":...
"""Simple firmware for a temperature logger""" from dht import DHT22 import machine import network import time import urequests # turn off the access point ap_if = network.WLAN(network.AP_IF) ap_if.active(False) # join existing hotspot sta_if = network.WLAN(network.STA_IF) sta_if.active(True) sta_if.connect("G2_880...
{ "content_hash": "4f3e50f0a46bd554780e731d8f79ea81", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 70, "avg_line_length": 20.723076923076924, "alnum_prop": 0.5575352635486266, "repo_name": "wildtreetech/CRUMBS", "id": "832055bd1fc714ab3eff36d356d3b39651daf84d", "size": "...
"""prompt-toolkit utilities Everything in this module is a private API, not to be used outside IPython. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import unicodedata from wcwidth import wcwidth from IPython.core.completer import ( provisionalcomplete...
{ "content_hash": "d2ccebaa0af9664c8679f38a090a6570", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 127, "avg_line_length": 37.05, "alnum_prop": 0.6111673414304993, "repo_name": "nitin-cherian/LifeLongLearning", "id": "70140b4c612bab49de5424806eefc93551750355", "size": "...
"""Ops for GPU collective operations implemented using NVIDIA nccl.""" import threading from tensorflow.python.eager import context from tensorflow.python.eager import def_function from tensorflow.python.framework import device from tensorflow.python.framework import ops from tensorflow.python.ops import gen_nccl_ops ...
{ "content_hash": "b843c996a292111d989686f3442fc4e9", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 80, "avg_line_length": 29.47826086956522, "alnum_prop": 0.6898632341110217, "repo_name": "tensorflow/tensorflow", "id": "4b4d847acecda917bb96ee79e383915dbed84d33", "size":...
import importlib import os import pickle import sys import traceback def main(): script_dict = pickle.load(sys.stdin.buffer) req = script_dict['request'] inst = script_dict['vnf_instance'] grant_req = script_dict['grant_request'] grant = script_dict['grant_response'] tmp_csar_dir = script_dic...
{ "content_hash": "13fade5e94272dde0e843a2d6c688f7e", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 71, "avg_line_length": 27.75609756097561, "alnum_prop": 0.648506151142355, "repo_name": "stackforge/tacker", "id": "76acb4317cd025acf5bec5889fcb96007881da91", "size": "1800...
"""BC learner implementation.""" import time from typing import Any, Dict, Iterator, List, NamedTuple, Optional, Tuple from collections import OrderedDict import acme from acme import types from acme.jax import networks as networks_lib from acme.jax import utils from acme.utils import counting from acme.utils import ...
{ "content_hash": "2ef2ff84dece200f783a9363beb0653e", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 120, "avg_line_length": 32.40684410646388, "alnum_prop": 0.6482459227971371, "repo_name": "google-research/google-research", "id": "2b2e23b5f28125b12f2c51cf060ba593c6cd1b75"...
import logging, functools from bottle import Bottle, auth_basic, request, HTTPError from sqlalchemy.orm.exc import NoResultFound from enum import IntEnum, unique from .types import PropertySet, Property, strip from .database import get_db, password_hash from . import api, User BASE = '/user' app = Bottle() api.regist...
{ "content_hash": "eb334dd33381380c4045e576511b8ce1", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 78, "avg_line_length": 25.11764705882353, "alnum_prop": 0.593208430913349, "repo_name": "eblade/images4", "id": "1f784e434956af9249874546c4dabc1eeb0512d8", "size": "4271",...
"""Test that the set of gen-* files is the same as the generated files.""" import fnmatch import os import sys import generate UPDATE_TIP = ( 'To update the generated tests, run:\n' '$ python third_party/blink/web_tests/wpt_internal/bluetooth/generate.py') def main(): generated_files = set() # Tests...
{ "content_hash": "51a139080f675e0af8a34e8398c54251", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 78, "avg_line_length": 35.93617021276596, "alnum_prop": 0.6009473060982831, "repo_name": "nwjs/chromium.src", "id": "41c57a9baa37ec33b644f5418e3adfeb2b7b85d4", "size": "206...
""" III. Create a program that converts the following uptime strings to a time in seconds. uptime1 = 'twb-sf-881 uptime is 6 weeks, 4 days, 2 hours, 25 minutes' uptime2 = '3750RJ uptime is 1 hour, 29 minutes' uptime3 = 'CATS3560 uptime is 8 weeks, 4 days, 18 hours, 16 minutes' uptime4 = 'rtr1 uptime is 5 years, 18 ...
{ "content_hash": "0981d6f0f92069d4ef0ef40f596e327f", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 85, "avg_line_length": 30.61904761904762, "alnum_prop": 0.5898133748055988, "repo_name": "blahu/pynet-mat", "id": "b5d882e7b86fca8eb1b3c33f8b9cd2a7c409f2ef", "size": "2645"...
from . dev import *
{ "content_hash": "ac4e636700467f20a3e45fa0685958dd", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 19, "avg_line_length": 20, "alnum_prop": 0.65, "repo_name": "manuelnaranjo/django-template", "id": "80733c7546c3940aa8485ebe01ccd74a43f9c477", "size": "20", "binary": fals...
from django.conf.urls import patterns, url from horizon_contrib.forms.views import CreateView, UpdateView from .views import GenericIndexView, DataView urlpatterns = patterns('', url(r'^models/(?P<cls_name>[\w\.\-]+)/create/$', CreateView.as_view(), name='create'), url(r'^models/(?P<cls_name>[\w\.\-]+)/(?P<id...
{ "content_hash": "cb93059a52de1c0c258b1c601f0e830e", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 115, "avg_line_length": 57.714285714285715, "alnum_prop": 0.5977722772277227, "repo_name": "michaelkuty/horizon-contrib", "id": "a7f766f4f9d443532c0449fa9bb8eb3d4e61f18d", ...
""" This test checks the activation logic of OP_REVERSEBYTES. Derived from both abc-schnorrmultisig-activation.py (see https://reviews.bitcoinabc.org/D3736) and abc-schnorrmultisig.py """ import time from test_framework.blocktools import ( create_block, create_coinbase, make_conform_to_ctor, create_tx...
{ "content_hash": "f1f637e6b83cf9d4e2fa3c9bbc62c3cd", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 104, "avg_line_length": 36.045918367346935, "alnum_prop": 0.6508138711960368, "repo_name": "BitcoinUnlimited/BitcoinUnlimited", "id": "f18c6c38c2949234b86173a9a4e2c1560695e3...
from AccessControl import ClassSecurityInfo from bika.lims.browser.fields import DurationField from bika.lims.config import PROJECTNAME from bika.lims.content.bikaschema import BikaSchema from bika.lims.interfaces import ISamplePartition, ISamplePrepWorkflow from bika.lims.workflow import doActionFor from bika.li...
{ "content_hash": "d078a3873d8269f163433b18b5ef9740", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 89, "avg_line_length": 39.26171875, "alnum_prop": 0.6078997114714954, "repo_name": "hocinebendou/bika.gsoc", "id": "753438def7c0e38259d7b500f28c2bae6b74e8b7", "size": "100...
from multiprocessing import Pool from sqlalchemy import desc from base import Base from schema import Session, Feed, Post from datetime import datetime as dt from datetime import timedelta from config import max_post_age from parser import parse_one class Index(Base): def get(self): posts = Session.query...
{ "content_hash": "66fed6dbeaabb1ea5d57f69882fca75f", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 77, "avg_line_length": 27.518987341772153, "alnum_prop": 0.6039558417663293, "repo_name": "mfussenegger/Huluobo", "id": "46fe11c91ee460199d9ab8267528064e2ed5c650", "size": ...
from typing import MutableMapping, MutableSequence from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.osconfig.v1", manifest={ "GetOSPolicyAssignmentReportRequest", "ListOSPolicyAssignmentReportsRequest", ...
{ "content_hash": "336c8f882ac8c31c7c2470edce75cce2", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 177, "avg_line_length": 41.672872340425535, "alnum_prop": 0.5980598634245964, "repo_name": "googleapis/python-os-config", "id": "994582517e701083d933a5dd13fb8ea589cd065e", ...
from test_framework.mininode import wait_until from test_framework.test_framework import BitcoinTestFramework from test_framework.util import (assert_equal, assert_raises_jsonrpc, connect_nodes_bi, start_node, ...
{ "content_hash": "b70d6daba11aaf4aee00ea427b5df98d", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 138, "avg_line_length": 49.925, "alnum_prop": 0.585378067100651, "repo_name": "psionin/smartcoin", "id": "61be27ae2b67a7593d8f8c9ca914e8e46fba24ee", "size": "4235", "bina...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class GeocodeByAddress(Choreography): def __init__(self, temboo_session): """ Creat...
{ "content_hash": "b40f376e8d6ab286a2324ffe2b838af9", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 220, "avg_line_length": 46.043956043956044, "alnum_prop": 0.6890214797136038, "repo_name": "jordanemedlock/psychtruths", "id": "342ee00208f7b78d7345c38379a74f641fc6a097", "...
import ast from .common import * DEBUG = False ALLOWED_HOSTS = ['www.ava-project.com', 'ava-project.com', '163.5.84.224'] # email configuration EMAIL_HOST = env.get('EMAIL_HOST', '') EMAIL_PORT = int(env.get('EMAIL_PORT', 0)) EMAIL_HOST_USER = env.get('EMAIL_HOST_USER', '') EMAIL_HOST_PASSWORD = env.get('EMAIL_HOST...
{ "content_hash": "b07de000acf4ea3ac0fa82f034db464d", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 74, "avg_line_length": 28, "alnum_prop": 0.6979166666666666, "repo_name": "ava-project/ava-website", "id": "4e3b14ef48b36010ff21d4077ac9bd499db8c776", "size": "672", "bin...
from lib.mmonit import MmonitBaseAction class MmonitListStatusHost(MmonitBaseAction): def run(self, host_id=None, hostgroupid=None, status=None, platform=None, machine=None, led=None): self.login() data = {} # Way too explicit for my taste but I guess its easier to understand ...
{ "content_hash": "dfb64f5482aee6f300cd49ae4b40840b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 91, "avg_line_length": 30.903225806451612, "alnum_prop": 0.5636743215031316, "repo_name": "lmEshoo/st2contrib", "id": "a615df37364ac0fbd8a29a0e45172a3bd7354bb8", "size": "9...
import os import os.path import sys def main(): time_name_pairs = [(os.stat(name).st_mtime, name) for name in os.listdir('.') if name[:4] == 'IMG_' and name[-4:] == '.JPG'] time_name_pairs.sort() names = [] for i, (mtime, oldname) in enumerate(time_name_pairs, start=1): newname = 'IMG_{:04d}.JPG'.format(i) ...
{ "content_hash": "72e60626e2180e8715c5e60bfb0a6d19", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 78, "avg_line_length": 28.379310344827587, "alnum_prop": 0.6500607533414338, "repo_name": "nightjuggler/pig", "id": "34a885fd5c4c664b0eb7e713dcb670d1dd910411", "size": "823...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('domain', '0010_many_to_many_for_conditions'), ] operations = [ migrations.AlterField( model_name='attributeentity', name='co...
{ "content_hash": "d829fa2661935c31ca032535e67da6b8", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 80, "avg_line_length": 23.833333333333332, "alnum_prop": 0.6223776223776224, "repo_name": "rdmorganiser/rdmo", "id": "4d6aa5861bdd95ca4fa1ed8993924c2fd8565cf0", "size": "49...
try: import unittest2 as unittest except ImportError: import unittest # noqa from uuid import uuid4, UUID import random from datetime import datetime, date, time from decimal import Decimal from operator import itemgetter from cassandra.cqlengine import columns from cassandra.cqlengine import CQLEngineExcept...
{ "content_hash": "974f2a20f16bd799ff2b4f2572415a43", "timestamp": "", "source": "github", "line_count": 800, "max_line_length": 140, "avg_line_length": 37.64125, "alnum_prop": 0.6475276458672334, "repo_name": "kishkaru/python-driver", "id": "3faf62febcca903f335d07c064cac49b156e8162", "size": "30692...
""" Class for reading data from from Tucker Davis TTank format. Terminology: TDT hold data with tanks (actually a directory). And tanks hold sub block (sub directories). Tanks correspond to neo.Block and tdt block correspond to neo.Segment. Note the name Block is ambiguous because it does not refer to same thing in TD...
{ "content_hash": "ba02a824c6b9edf8001698ea79dd43a8", "timestamp": "", "source": "github", "line_count": 528, "max_line_length": 98, "avg_line_length": 41.178030303030305, "alnum_prop": 0.5494894673903045, "repo_name": "rgerkin/python-neo", "id": "f5e16629cc51386f08085d1e7002ac245e3036a9", "size": "...
import io import json import unittest import mock def _make_credentials(): import google.auth.credentials return mock.Mock(spec=google.auth.credentials.Credentials) class Test_ClientFactoryMixin(unittest.TestCase): @staticmethod def _get_target_class(): from google.cloud.client import _Cl...
{ "content_hash": "6e3d91fe1568a137b60c9f9e67c9874f", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 78, "avg_line_length": 34.92094861660079, "alnum_prop": 0.631918505942275, "repo_name": "jonparrott/google-cloud-python", "id": "c41fbdc4a20f7c51c14714302be31a0ea64f3fa0", ...
import unittest from test_helpers import TestHelpers helpers=TestHelpers() helpers.add_relative_path() from lib.protomemes import get_protomemes, build_corpus, get_protomemes_values_by_type, get_protomemes_values_by_type_as_array coll="week1" class TestProtomemes(unittest.TestCase): def setUp(self): pr...
{ "content_hash": "daaa8266fc363236bf1538d92c9e6bfc", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 126, "avg_line_length": 27.15740740740741, "alnum_prop": 0.6225707466757586, "repo_name": "clemsos/mitras", "id": "e9349a43411319a7ad589eac0324d88e2dc9917f", "size": "2980...
import json import sys class CMEModule: name = 'bh_owned' description = "Set pwned computer as owned in Bloodhound" supported_protocols = ['smb'] opsec_safe = True multiple_hosts = True def options(self, context, module_options): """ URI URI for Neo4j database (...
{ "content_hash": "f8101549d2228f5d6287694c8c7f2a24", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 123, "avg_line_length": 39.486486486486484, "alnum_prop": 0.579397672826831, "repo_name": "byt3bl33d3r/CrackMapExec", "id": "1a78bd8cb2938966e74715fc2ec7231e0c4e48fa", "siz...