text stringlengths 0 1.05M | meta dict |
|---|---|
from functools import partial
import fast_ext
from fast_ext import double_integral, single_integral, aligned_single_integral
# Let's make a whole bunch of the c++ classes picklable!
# They all have constant internal state after initialization, so
# it is simple to pickle them -- just store the initialization arguments... | {
"repo_name": "tbenthompson/codim1",
"path": "codim1/fast_lib.py",
"copies": "1",
"size": "1782",
"license": "mit",
"hash": -7902335764775118000,
"line_mean": 47.1621621622,
"line_max": 137,
"alpha_frac": 0.7070707071,
"autogenerated": false,
"ratio": 3.592741935483871,
"config_test": false,
... |
from functools import partial
import functools
import time
import weakref
import asyncio
from copy import deepcopy
from numpy.lib.arraysetops import isin
OBSERVE_GRAPH_DELAY = 0.23 # 23 is not a multiple of 50
OBSERVE_STATUS_DELAY = 0.5
OBSERVE_STATUS_DELAY2 = 0.2
status_observers = []
class StatusObserver:
def... | {
"repo_name": "sjdv1982/seamless",
"path": "seamless/metalevel/bind_status_graph.py",
"copies": "1",
"size": "6632",
"license": "mit",
"hash": 1206266007567772700,
"line_mean": 30.4360189573,
"line_max": 94,
"alpha_frac": 0.6102231604,
"autogenerated": false,
"ratio": 3.8335260115606937,
"confi... |
from functools import partial
import gc
from operator import add
import weakref
import sys
import pytest
from distributed.protocol import deserialize, serialize
from distributed.protocol.pickle import HIGHEST_PROTOCOL, dumps, loads
try:
from pickle import PickleBuffer
except ImportError:
pass
def test_pick... | {
"repo_name": "blaze/distributed",
"path": "distributed/protocol/tests/test_pickle.py",
"copies": "1",
"size": "3414",
"license": "bsd-3-clause",
"hash": 387636780172350100,
"line_mean": 24.8636363636,
"line_max": 75,
"alpha_frac": 0.5779144698,
"autogenerated": false,
"ratio": 3.6012658227848102... |
from functools import partial
import gc
import time
import sys
from py4j.java_gateway import JavaGateway, CallbackServerParameters
ITERATIONS_FOR_LENGTHY_METHOD = 3
class ComparablePython(object):
def __init__(self, value):
self.value = value
def compareTo(self, obj):
if obj is None:
... | {
"repo_name": "nadav-har-tzvi/amaterasu",
"path": "executor/src/test/resources/py4j/tests/benchmark1.py",
"copies": "4",
"size": "3946",
"license": "apache-2.0",
"hash": 5024822875718897000,
"line_mean": 26.0273972603,
"line_max": 79,
"alpha_frac": 0.6315255955,
"autogenerated": false,
"ratio": 3... |
from functools import partial
import gevent
from gevent import monkey
from gevent.pool import Pool
monkey.patch_all(thread=False, select=False)
class AsyncInflux(object):
def __init__(self, method, infdb, **kwargs):
self.infdb = infdb
self.method = method
self.kwargs = kwargs
sel... | {
"repo_name": "Ombitron/async-influx",
"path": "ginflux.py",
"copies": "1",
"size": "2055",
"license": "bsd-3-clause",
"hash": 4260940107667650000,
"line_mean": 25.6883116883,
"line_max": 86,
"alpha_frac": 0.597080292,
"autogenerated": false,
"ratio": 3.8994307400379506,
"config_test": false,
... |
from functools import partial
import glob
import json
import logging
import os
import hashlib
import mimetypes
import pprint
import requests
from daf_fruit_dist.checksums import Checksums
from daf_fruit_dist.file_management import get_file_digests
_HEADER_USER_AGENT = 'User-Agent'
_HEADER_MD5_CHECKSUM = 'X-Checksum-M... | {
"repo_name": "teamfruit/defend_against_fruit",
"path": "defend_against_fruit/daf_fruit_dist/daf_fruit_dist/artifactory/artifactory_rest.py",
"copies": "1",
"size": "7632",
"license": "apache-2.0",
"hash": 3571977514060902400,
"line_mean": 26.5523465704,
"line_max": 77,
"alpha_frac": 0.6126834382,
... |
from functools import partial
import gym
from gym.spaces import Box, Dict, Discrete
import numpy as np
import unittest
import ray
from ray.rllib.models import ActionDistribution, ModelCatalog, MODEL_DEFAULTS
from ray.rllib.models.preprocessors import NoPreprocessor, Preprocessor
from ray.rllib.models.tf.tf_action_dist... | {
"repo_name": "ray-project/ray",
"path": "rllib/tests/test_catalog.py",
"copies": "1",
"size": "8187",
"license": "apache-2.0",
"hash": 2653137008839018500,
"line_mean": 37.6179245283,
"line_max": 79,
"alpha_frac": 0.616098693,
"autogenerated": false,
"ratio": 3.8545197740112993,
"config_test":... |
from functools import partial
import gym
import logging
import numpy as np
import tree
from typing import List, Optional, Type, Union
from ray.tune.registry import RLLIB_MODEL, RLLIB_PREPROCESSOR, \
RLLIB_ACTION_DIST, _global_registry
from ray.rllib.models.action_dist import ActionDistribution
from ray.rllib.model... | {
"repo_name": "richardliaw/ray",
"path": "rllib/models/catalog.py",
"copies": "1",
"size": "25640",
"license": "apache-2.0",
"hash": -1916023029952308700,
"line_mean": 42.904109589,
"line_max": 79,
"alpha_frac": 0.5667316693,
"autogenerated": false,
"ratio": 4.58840372226199,
"config_test": tru... |
from functools import partial
import hashlib
import struct
import spindrift.mysql._compat as compat
def byte2int(b):
if isinstance(b, int):
return b
else:
return struct.unpack("!B", b)[0]
def int2byte(i):
return struct.pack("!B", i)
def join_bytes(bs):
if len(bs) == 0:
ret... | {
"repo_name": "robertchase/spindrift",
"path": "spindrift/mysql/util.py",
"copies": "1",
"size": "1653",
"license": "mit",
"hash": -3053013468097634000,
"line_mean": 22.6142857143,
"line_max": 118,
"alpha_frac": 0.5638233515,
"autogenerated": false,
"ratio": 3.1972920696324953,
"config_test": f... |
from functools import partial
import hashlib
class CaseInsensitiveDict(dict):
def __init__(self, obj = None, **kwargs):
if obj is not None:
if isinstance(obj, dict):
for k, v in obj.items():
self[k] = v
else:
for k, v in obj:
... | {
"repo_name": "fjxhkj/Cactus",
"path": "cactus/utils/helpers.py",
"copies": "9",
"size": "2312",
"license": "bsd-3-clause",
"hash": -1826707449982062800,
"line_mean": 26.8674698795,
"line_max": 73,
"alpha_frac": 0.5709342561,
"autogenerated": false,
"ratio": 4.099290780141844,
"config_test": tr... |
from functools import partial
import html
import json
from django.core.serializers import serialize
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models.query import QuerySet
from django.utils.encoding import force_str
from django.utils.encoding import smart_str
from django.utils.formats im... | {
"repo_name": "GeotrekCE/Geotrek-admin",
"path": "mapentity/serializers/helpers.py",
"copies": "2",
"size": "2311",
"license": "bsd-2-clause",
"hash": 501738902651263400,
"line_mean": 32.9852941176,
"line_max": 93,
"alpha_frac": 0.6724361748,
"autogenerated": false,
"ratio": 4.012152777777778,
... |
from functools import partial
import importlib
import inspect
import pkgutil
def get_all_corpora():
"""Returns all corpus classes defined in the corpus package."""
from emLam.corpus.corpus_base import Corpus
return get_all_classes(Corpus)
def get_all_preprocessors():
"""Returns all preprocessor clas... | {
"repo_name": "DavidNemeskey/emLam",
"path": "emLam/corpus/__init__.py",
"copies": "2",
"size": "1489",
"license": "mit",
"hash": -4270226376510091000,
"line_mean": 37.1794871795,
"line_max": 80,
"alpha_frac": 0.6581598388,
"autogenerated": false,
"ratio": 4.0572207084468666,
"config_test": fal... |
from functools import partial
import inspect
from multiprocessing import Process, Event, Pipe
from collections import deque
import asyncio
from threading import Thread
class Worker(Process):
"""
Starts a new process and inits an instance of proxy_type.
Calls methods and returns results communicated over t... | {
"repo_name": "dustyrockpyle/mpworker",
"path": "mpworker/__init__.py",
"copies": "1",
"size": "6859",
"license": "mit",
"hash": 948675471580182100,
"line_mean": 34.1794871795,
"line_max": 118,
"alpha_frac": 0.6028575594,
"autogenerated": false,
"ratio": 4.046607669616519,
"config_test": false,... |
from functools import partial
import inspect
import logging
import sys
import re
from django.utils import six
from silk.profiling.profiler import silk_profile
Logger = logging.getLogger('silk.profiling.dynamic')
def _get_module(module_name):
"""
Given a module name in form 'path.to.module' return module ob... | {
"repo_name": "crunchr/silk",
"path": "silk/profiling/dynamic.py",
"copies": "3",
"size": "6905",
"license": "mit",
"hash": 1596864540213770000,
"line_mean": 30.5296803653,
"line_max": 115,
"alpha_frac": 0.5989862419,
"autogenerated": false,
"ratio": 3.70042872454448,
"config_test": false,
"h... |
from functools import partial
import inspect
import logging
import sys
import re
from silk.profiling.profiler import silk_profile
Logger = logging.getLogger('silk.profiling.dynamic')
def _get_module(module_name):
"""
Given a module name in form 'path.to.module' return module object for 'module'.
"""
... | {
"repo_name": "jazzband/silk",
"path": "silk/profiling/dynamic.py",
"copies": "1",
"size": "6732",
"license": "mit",
"hash": -3945707038645118000,
"line_mean": 30.1666666667,
"line_max": 115,
"alpha_frac": 0.5952168746,
"autogenerated": false,
"ratio": 3.7152317880794703,
"config_test": false,
... |
from functools import partial
import inspect
import logging
import sys
import re
from silk.utils import six
from silk.profiling.profiler import silk_profile
Logger = logging.getLogger('silk')
def _get_module(module_name):
"""
Given a module name in form 'path.to.module' return module object for 'module'.
... | {
"repo_name": "Alkalit/silk",
"path": "silk/profiling/dynamic.py",
"copies": "1",
"size": "6882",
"license": "mit",
"hash": -5570775661581381000,
"line_mean": 30.2818181818,
"line_max": 115,
"alpha_frac": 0.5970648067,
"autogenerated": false,
"ratio": 3.6940418679549114,
"config_test": false,
... |
from functools import partial
import inspect
import logging
import sys
import re
import six
from silk.profiling.profiler import silk_profile
Logger = logging.getLogger('silk')
def _get_module(module_name):
"""
Given a module name in form 'path.to.module' return module object for 'module'.
"""
if '... | {
"repo_name": "rosscdh/silk",
"path": "django_silky/silk/profiling/dynamic.py",
"copies": "8",
"size": "6869",
"license": "mit",
"hash": 8137319883238759000,
"line_mean": 29.802690583,
"line_max": 115,
"alpha_frac": 0.5963022274,
"autogenerated": false,
"ratio": 3.6969860064585576,
"config_test... |
from functools import partial
import inspect
from nose.tools import ( # noqa
assert_almost_equal,
assert_almost_equals,
assert_dict_contains_subset,
assert_false,
assert_greater,
assert_greater_equal,
assert_in,
assert_is,
assert_is_instance,
assert_is_none,
assert_is_not,
... | {
"repo_name": "umuzungu/zipline",
"path": "zipline/testing/predicates.py",
"copies": "1",
"size": "8350",
"license": "apache-2.0",
"hash": 479777998003796700,
"line_mean": 24.9316770186,
"line_max": 79,
"alpha_frac": 0.5405988024,
"autogenerated": false,
"ratio": 3.890959925442684,
"config_test... |
from functools import partial
import inspect
from typing import (
Any,
Callable,
Iterable,
List,
Optional,
overload,
Union,
Tuple,
Type,
TypeVar,
)
T = TypeVar("T")
RichReprResult = Iterable[Union[Any, Tuple[Any], Tuple[str, Any], Tuple[str, Any, Any]]]
class ReprError(Exc... | {
"repo_name": "willmcgugan/rich",
"path": "rich/repr.py",
"copies": "1",
"size": "4297",
"license": "mit",
"hash": -3898887246026729500,
"line_mean": 27.6466666667,
"line_max": 88,
"alpha_frac": 0.5012799628,
"autogenerated": false,
"ratio": 4.038533834586466,
"config_test": false,
"has_no_ke... |
from functools import partial
import io
import os
from tempfile import NamedTemporaryFile
import unittest
import six
from unittest import mock
from cloak.serverapi.cli.main import main, get_config
from cloak.serverapi.tests.mock import MockSession
class TestCase(unittest.TestCase):
def_target_id = 'tgt_z24y7mie... | {
"repo_name": "encryptme/private-end-points",
"path": "cloak/serverapi/tests/base.py",
"copies": "1",
"size": "1331",
"license": "mit",
"hash": -4686587875226498000,
"line_mean": 26.1632653061,
"line_max": 80,
"alpha_frac": 0.664162284,
"autogenerated": false,
"ratio": 3.869186046511628,
"confi... |
from functools import partial
import itertools, datetime
from bandicoot_dev.helper.tools import mean, std, SummaryStats, advanced_wrap, AutoVivification, flatarr
DATE_GROUPERS = {
None: lambda _: None,
"day": lambda d: d.isocalendar(),
"week": lambda d: d.isocalendar()[0:2],
"month": lambda d: (d.year... | {
"repo_name": "ulfaslak/bandicoot",
"path": "helper/group.py",
"copies": "1",
"size": "13108",
"license": "mit",
"hash": 4263673354872722400,
"line_mean": 39.5820433437,
"line_max": 140,
"alpha_frac": 0.5772047605,
"autogenerated": false,
"ratio": 3.9541478129713425,
"config_test": false,
"ha... |
from functools import partial
import itertools
from bandicoot.helper.tools import mean, std, SummaryStats, advanced_wrap, AutoVivification
DATE_GROUPERS = {
None: lambda _: None,
"day": lambda d: d.isocalendar(),
"week": lambda d: d.isocalendar()[0:2],
"month": lambda d: (d.year, d.month),
"year":... | {
"repo_name": "econandrew/bandicoot",
"path": "bandicoot/helper/group.py",
"copies": "1",
"size": "11439",
"license": "mit",
"hash": -8694669272772959000,
"line_mean": 38.0409556314,
"line_max": 140,
"alpha_frac": 0.5949820789,
"autogenerated": false,
"ratio": 3.9636174636174637,
"config_test":... |
from functools import partial
import itertools
import os
from _pydev_bundle._pydev_imports_tipper import TYPE_IMPORT, TYPE_CLASS, TYPE_FUNCTION, TYPE_ATTR, \
TYPE_BUILTIN, TYPE_PARAM
from _pydev_bundle.pydev_is_thread_alive import is_thread_alive
from _pydev_bundle.pydev_override import overrides
from _pydevd_bund... | {
"repo_name": "fabioz/PyDev.Debugger",
"path": "_pydevd_bundle/pydevd_net_command_factory_json.py",
"copies": "2",
"size": "20002",
"license": "epl-1.0",
"hash": 9076747113526776000,
"line_mean": 44.0495495495,
"line_max": 164,
"alpha_frac": 0.6423857614,
"autogenerated": false,
"ratio": 3.943611... |
from functools import partial
import itertools
import os.path
from sys import float_info
import networkx as nx
import matplotlib.pyplot as plt
from matplotlib import animation
from edge import Edge
from point import AbstractPoint
#import random
#print plt.cm._cmapnames; exit()
class ScreenPresentingDirectorMixin(o... | {
"repo_name": "ppolewicz/ant-colony",
"path": "antcolony/vizualizer.py",
"copies": "1",
"size": "8550",
"license": "bsd-3-clause",
"hash": -1964502984151239400,
"line_mean": 36.6651982379,
"line_max": 177,
"alpha_frac": 0.6692397661,
"autogenerated": false,
"ratio": 3.555093555093555,
"config_t... |
from functools import partial
import itertools
import posixpath
import threading
try:
from twitter.common import log
except ImportError:
import logging as log
from twitter.common.concurrent import Future
from .group_base import (
Capture,
GroupBase,
GroupInterface,
Membership,
set_different)
... | {
"repo_name": "jsirois/commons",
"path": "src/python/twitter/common/zookeeper/group/kazoo_group.py",
"copies": "14",
"size": "12041",
"license": "apache-2.0",
"hash": 2334406609272874000,
"line_mean": 29.2537688442,
"line_max": 95,
"alpha_frac": 0.6309276638,
"autogenerated": false,
"ratio": 3.81... |
from functools import partial
import itertools
import sublime
from ...common import util
from ..git_command import GitCommand
class PanelActionMixin(object):
"""
Use this mixin to initially display a quick panel, select from pre-defined
actions and execute the matching instance method.
The `default_a... | {
"repo_name": "divmain/GitSavvy",
"path": "core/ui_mixins/quick_panel.py",
"copies": "1",
"size": "18947",
"license": "mit",
"hash": 7949672426559235000,
"line_mean": 31.8370883882,
"line_max": 103,
"alpha_frac": 0.5927059693,
"autogenerated": false,
"ratio": 3.90659793814433,
"config_test": fa... |
from functools import partial
import itertools
import urlparse
import json
import collections
from flask import current_app
from flask.ext.wtf import Form
from wtforms import Form as InsecureForm
from wtforms import (TextField, DateField, DecimalField, IntegerField,
SelectField, SelectMultipleField... | {
"repo_name": "Psycojoker/ffdn-db",
"path": "ffdnispdb/forms.py",
"copies": "1",
"size": "14004",
"license": "bsd-3-clause",
"hash": 1072523343347227400,
"line_mean": 44.0289389068,
"line_max": 140,
"alpha_frac": 0.6007569266,
"autogenerated": false,
"ratio": 4.038062283737024,
"config_test": f... |
from functools import partial
import itertools
import numpy as np
import pandas._libs.algos as _algos
import pandas._libs.reshape as _reshape
from pandas._libs.sparse import IntIndex
from pandas.core.dtypes.cast import maybe_promote
from pandas.core.dtypes.common import (
ensure_platform_int, is_bool_dtype, is_e... | {
"repo_name": "cbertinato/pandas",
"path": "pandas/core/reshape/reshape.py",
"copies": "1",
"size": "36241",
"license": "bsd-3-clause",
"hash": -5374240042623319000,
"line_mean": 33.8806544755,
"line_max": 79,
"alpha_frac": 0.5767776827,
"autogenerated": false,
"ratio": 3.8603536429484446,
"con... |
from functools import partial
import json
from os.path import join
from . import base
from buildercore import core, utils, project
from unittest import skip
from mock import patch
class SimpleCases(base.BaseCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_hostname_struct_no_... | {
"repo_name": "elifesciences/builder",
"path": "src/tests/test_buildercore_core.py",
"copies": "1",
"size": "9386",
"license": "mit",
"hash": 2394419617615650000,
"line_mean": 41.0896860987,
"line_max": 118,
"alpha_frac": 0.5950351587,
"autogenerated": false,
"ratio": 3.723125743752479,
"config... |
from functools import partial
import json
from warnings import warn
import numpy as np
from pandas import Series, DataFrame
from pandas.core.indexing import _NDFrameIndexer
from pandas.util.decorators import cache_readonly
import pyproj
from shapely.geometry import box, shape, Polygon, Point
from shapely.geometry.coll... | {
"repo_name": "IamJeffG/geopandas",
"path": "geopandas/geoseries.py",
"copies": "2",
"size": "10658",
"license": "bsd-3-clause",
"hash": -186227760433238620,
"line_mean": 32.9426751592,
"line_max": 99,
"alpha_frac": 0.5765622068,
"autogenerated": false,
"ratio": 4.318476499189627,
"config_test"... |
from functools import partial
import json
import feedparser
from feeds_repository import RssFeedsRepository
import os
from tornado.httpclient import AsyncHTTPClient
import tornado.web
from tornado.ioloop import IOLoop
from tornado.web import asynchronous
from tornado.gen import coroutine
from utils import json_encode, ... | {
"repo_name": "bamthomas/myrefs",
"path": "site/app_tornado.py",
"copies": "1",
"size": "3409",
"license": "mit",
"hash": -4828005539949403000,
"line_mean": 39.5833333333,
"line_max": 137,
"alpha_frac": 0.6661777647,
"autogenerated": false,
"ratio": 3.4574036511156185,
"config_test": false,
"... |
from functools import partial
import json
import logging
import sys
import click
import fiona
from fiona.transform import transform_geom
from fiona.fio.cli import cli, obj_gen
def make_ld_context(context_items):
"""Returns a JSON-LD Context object.
See http://json-ld.org/spec/latest/json-ld."""
ctx = {... | {
"repo_name": "johanvdw/Fiona",
"path": "fiona/fio/cat.py",
"copies": "1",
"size": "20823",
"license": "bsd-3-clause",
"hash": 7366666735776433000,
"line_mean": 39.4330097087,
"line_max": 97,
"alpha_frac": 0.4902271527,
"autogenerated": false,
"ratio": 4.555458324217896,
"config_test": false,
... |
from functools import partial
import json
import mock
from flask import url_for
from app import db
from app.models.users import User
from common import BaseTest
class TestUsersApi(BaseTest):
"""
Users API Functional Tests.
"""
username = 'testuser'
password = 'password'
email = 'testuser@tes... | {
"repo_name": "chamilto/flask_starter_pack",
"path": "tests/test_users.py",
"copies": "1",
"size": "6380",
"license": "mit",
"hash": 1967650177789387800,
"line_mean": 32.5789473684,
"line_max": 79,
"alpha_frac": 0.5631661442,
"autogenerated": false,
"ratio": 4.3758573388203015,
"config_test": t... |
from functools import partial
import json
import tornado.web
from tornado.autoreload import _reload
import os
IMAGE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'images')
class JSONHandler(tornado.web.RequestHandler):
def __init__(self, application, request, **kwargs):
super(JSONHandler,... | {
"repo_name": "josephok/httpbin2",
"path": "utils.py",
"copies": "1",
"size": "2118",
"license": "bsd-2-clause",
"hash": 4601753203503716000,
"line_mean": 31.6,
"line_max": 84,
"alpha_frac": 0.581680831,
"autogenerated": false,
"ratio": 3.632933104631218,
"config_test": false,
"has_no_keyword... |
from functools import partial
import json
from django.http import HttpResponseNotAllowed, HttpResponseNotFound, HttpResponseBadRequest
from rip.django_adapter import django_response_builder, \
action_resolver
from rip.django_adapter import api_request_builder
def handle_api_call(http_request, url, api):
if ... | {
"repo_name": "Aplopio/rip",
"path": "rip/django_adapter/django_http_handler.py",
"copies": "2",
"size": "1501",
"license": "mit",
"hash": -956374395139568800,
"line_mean": 36.525,
"line_max": 92,
"alpha_frac": 0.6615589607,
"autogenerated": false,
"ratio": 4.363372093023256,
"config_test": fal... |
from functools import partial
import json
import numpy as np
from pandas import Series
import pyproj
from shapely.geometry import shape, Point
from shapely.geometry.base import BaseGeometry
from shapely.ops import transform
from geopandas.plotting import plot_series
from geopandas.base import GeoPandasBase, _series_u... | {
"repo_name": "ozak/geopandas",
"path": "geopandas/geoseries.py",
"copies": "1",
"size": "11473",
"license": "bsd-3-clause",
"hash": -8676075371085869000,
"line_mean": 32.4489795918,
"line_max": 79,
"alpha_frac": 0.5814521049,
"autogenerated": false,
"ratio": 4.360699353857849,
"config_test": f... |
from functools import partial
import json
try:
from urllib.request import urlopen
from urllib.parse import urlencode
except ImportError:
from urllib2 import urlopen
from urllib import urlencode
def utf8_encode(s):
return s if isinstance(s, bytes) else s.encode('utf8')
def utf8_encode_dict_values... | {
"repo_name": "CHI2017LS/CLC_prototyping",
"path": "etherpad_lite/__init__.py",
"copies": "1",
"size": "1397",
"license": "mit",
"hash": 49184047609643630,
"line_mean": 31.488372093,
"line_max": 110,
"alpha_frac": 0.6299212598,
"autogenerated": false,
"ratio": 3.483790523690773,
"config_test": ... |
from functools import partial
import logging
from enum import Enum
from types import SimpleNamespace
from biothings.hub.databuild.backend import create_backend
from biothings.utils.es import ESIndexer
try:
from biothings.utils.mongo import doc_feeder
except ImportError:
import biothings
biothings.config = ... | {
"repo_name": "biothings/biothings.api",
"path": "biothings/hub/dataindex/indexer_task.py",
"copies": "1",
"size": "5013",
"license": "apache-2.0",
"hash": 39704291526830370,
"line_mean": 27.6457142857,
"line_max": 78,
"alpha_frac": 0.5765010971,
"autogenerated": false,
"ratio": 3.741044776119403... |
from functools import partial
import logging
import numpy as np
import time
from qcodes.instrument.parameter import ManualParameter
from qcodes import Instrument
from qcodes.utils import validators as vals
log = logging.getLogger(__name__)
class VirtualSIM928(Instrument):
"""
A virtual driver, emulating the... | {
"repo_name": "QudevETH/PycQED_py3",
"path": "pycqed/instrument_drivers/virtual_instruments/virtual_SIM928.py",
"copies": "1",
"size": "12703",
"license": "mit",
"hash": 1046876763163879600,
"line_mean": 36.5828402367,
"line_max": 80,
"alpha_frac": 0.5061796426,
"autogenerated": false,
"ratio": 4... |
from functools import partial
import logging
import os
import sys
from prometheus_client import CollectorRegistry, Gauge, Histogram, Counter,\
Summary, pushadd_to_gateway, push_to_gateway
from ._timer import Timer
from ._util import maybe_labels, tags_to_labels
logger = logging.getLogger(__name__)
_version_info... | {
"repo_name": "Intel471/prom-stats",
"path": "promstats/__init__.py",
"copies": "1",
"size": "5649",
"license": "mit",
"hash": -6162724492865202000,
"line_mean": 34.753164557,
"line_max": 77,
"alpha_frac": 0.594795539,
"autogenerated": false,
"ratio": 4.12035010940919,
"config_test": false,
"... |
from functools import partial
import logging
import sys
import curio
from garage import asyncs
from garage.asyncs.utils import make_server_socket, serve
import http2
async def handle(sock, addr):
session = http2.Session(sock)
async with await asyncs.cancelling.spawn(session.serve()) as server:
asyn... | {
"repo_name": "clchiou/garage",
"path": "py/http2/examples/hello_world.py",
"copies": "1",
"size": "1162",
"license": "mit",
"hash": -5979846438749424000,
"line_mean": 26.023255814,
"line_max": 77,
"alpha_frac": 0.604130809,
"autogenerated": false,
"ratio": 3.5,
"config_test": false,
"has_no_... |
from functools import partial
import logging
import threading
import time
class TimerTask(object):
def __init__(self, callable_, *args, **kwargs):
self._callable = partial(callable_, *args, **kwargs)
self._finished = False
def is_finished(self):
return self._finished
def run(sel... | {
"repo_name": "TurboGears/backlash",
"path": "backlash/tracing/slowrequests/timer.py",
"copies": "1",
"size": "3013",
"license": "mit",
"hash": 3507517143300797000,
"line_mean": 27.1588785047,
"line_max": 78,
"alpha_frac": 0.5074676402,
"autogenerated": false,
"ratio": 4.558245083207262,
"confi... |
from functools import partial
import logging
import time
import requests
log = logging.getLogger(__name__)
DEFAULT_ROOT_RES_PATH = '/'
class HTTPResponse(object):
"""
Wrapper around :class:`requests.Response`.
Parses ``Content-Type`` header and makes it available as a list of fields
in the :attr:`c... | {
"repo_name": "brantai/python-rightscale",
"path": "rightscale/httpclient.py",
"copies": "1",
"size": "5867",
"license": "mit",
"hash": 6036430246622865000,
"line_mean": 36.3694267516,
"line_max": 79,
"alpha_frac": 0.6001363559,
"autogenerated": false,
"ratio": 4.0184931506849315,
"config_test"... |
from functools import partial
import logging
from django.conf import settings
from django.core.cache import caches
from django.core.exceptions import ValidationError, NON_FIELD_ERRORS
from django.db import models
from django.db.models.signals import post_save
from django.urls import reverse
from django.utils.translati... | {
"repo_name": "CTPUG/wafer",
"path": "wafer/pages/models.py",
"copies": "1",
"size": "7179",
"license": "isc",
"hash": 2232297504548192300,
"line_mean": 33.8495145631,
"line_max": 123,
"alpha_frac": 0.5804429586,
"autogenerated": false,
"ratio": 4.188448074679113,
"config_test": false,
"has_n... |
from functools import partial
import logging
from mlabns.db import model
from mlabns.util import constants
from mlabns.util import message
from google.appengine.api import memcache
def _filter_by_status(tools, address_family, status):
"""Filter sliver tools based on the status of their available interfaces.
... | {
"repo_name": "fernandalavalle/mlab-ns",
"path": "server/mlabns/db/sliver_tool_fetcher.py",
"copies": "1",
"size": "8067",
"license": "apache-2.0",
"hash": 449270669259679500,
"line_mean": 34.3815789474,
"line_max": 80,
"alpha_frac": 0.6009669022,
"autogenerated": false,
"ratio": 4.35113268608414... |
from functools import partial
import logging
from nephila.xmlparser import HTMLParser
from nephila.agent import AsyncAgent
from nephila.utils import get_full_url
class Spider:
def __init__(self, sitemap, handler):
self.metainfo = sitemap[0]
self.route = sitemap[1:]
self.start_url = self.m... | {
"repo_name": "rydesun/nephila",
"path": "nephila/spider.py",
"copies": "1",
"size": "2158",
"license": "mit",
"hash": 6362652025662133000,
"line_mean": 38.2363636364,
"line_max": 88,
"alpha_frac": 0.5848007414,
"autogenerated": false,
"ratio": 3.988909426987061,
"config_test": false,
"has_no... |
from functools import partial
import logging
from scapy.all import ARP, Ether, sendp
import sleepproxy.manager
from sleepproxy.sniff import SnifferThread
_HOSTS = {}
def handle(othermac, addresses, mymac, iface):
if othermac in _HOSTS:
logging.info("I already seem to be managing %s, ignoring" % othermac... | {
"repo_name": "kfix/SleepProxyServer",
"path": "sleepproxy/arp.py",
"copies": "1",
"size": "2086",
"license": "bsd-2-clause",
"hash": 137844992970985340,
"line_mean": 33.7666666667,
"line_max": 158,
"alpha_frac": 0.610738255,
"autogenerated": false,
"ratio": 3.3269537480063796,
"config_test": f... |
from functools import partial
import logging
from scapy.all import IP, TCP
import sleepproxy.manager
from sleepproxy.sniff import SnifferThread
from sleepproxy.wol import wake
from time import sleep
_HOSTS = {}
def handle(mac, addresses, iface):
if mac in _HOSTS:
logging.debug("Ignoring already managed ... | {
"repo_name": "kfix/SleepProxyServer",
"path": "sleepproxy/tcp.py",
"copies": "1",
"size": "1991",
"license": "bsd-2-clause",
"hash": 6103448528637281000,
"line_mean": 38.82,
"line_max": 170,
"alpha_frac": 0.6579608237,
"autogenerated": false,
"ratio": 3.323873121869783,
"config_test": false,
... |
from functools import partial
import logging
from six import iteritems
from bravado_core.docstring import docstring_property
from bravado_core.schema import SWAGGER_PRIMITIVES
log = logging.getLogger(__name__)
# Models in #/definitions are tagged with this key so that they can be
# differentiated from 'object' typ... | {
"repo_name": "MphasisWyde/eWamSublimeAdaptor",
"path": "POC/v0_4_POC_with_generic_cmd_and_swagger/third-party/bravado_core/model.py",
"copies": "7",
"size": "8303",
"license": "mit",
"hash": 7042798429062460000,
"line_mean": 34.1822033898,
"line_max": 77,
"alpha_frac": 0.6495242683,
"autogenerated... |
from functools import partial
import logging
import lib.const as C
import lib.visit as v
from .. import util
from .. import sample
from ..meta import class_lookup
from ..meta.template import Template
from ..meta.clazz import Clazz
from ..meta.method import Method
from ..meta.field import Field
from ..meta.statement i... | {
"repo_name": "plum-umd/pasket",
"path": "pasket/rewrite/singleton_anno.py",
"copies": "1",
"size": "3474",
"license": "mit",
"hash": -612840833987537200,
"line_mean": 27.95,
"line_max": 81,
"alpha_frac": 0.6137017847,
"autogenerated": false,
"ratio": 3.2650375939849625,
"config_test": false,
... |
from functools import partial
import logging
import lib.const as C
import lib.visit as v
from .. import util
from ..meta.template import Template
from ..meta.clazz import Clazz
from ..meta.method import Method
from ..meta.field import Field
from ..meta.statement import Statement, to_statements
from ..meta.expression ... | {
"repo_name": "plum-umd/pasket",
"path": "pasket/rewrite/factory.py",
"copies": "1",
"size": "2087",
"license": "mit",
"hash": -7185121601809617000,
"line_mean": 24.1445783133,
"line_max": 76,
"alpha_frac": 0.6300910398,
"autogenerated": false,
"ratio": 3.2866141732283465,
"config_test": false,... |
from functools import partial
import logging
import six
import simplejson as json
from bravado_core import schema
from bravado_core.content_type import APP_JSON
from bravado_core.exception import SwaggerMappingError
from bravado_core.marshal import marshal_schema_object
from bravado_core.unmarshal import unmarshal_sc... | {
"repo_name": "admetricks/bravado-core",
"path": "bravado_core/param.py",
"copies": "1",
"size": "9655",
"license": "bsd-3-clause",
"hash": 3079083851122469400,
"line_mean": 31.7288135593,
"line_max": 108,
"alpha_frac": 0.6341791818,
"autogenerated": false,
"ratio": 3.968351829017674,
"config_t... |
from functools import partial
import math
from turtle import Turtle
from domino_puzzle import Board, CaptureBoardGraph, Domino, Cell
from dominosa import PairState
DEFAULT_CELL_SIZE = 100
PIP_PATTERNS = """\
---+
|
|
|
---+
|
O |
|
---+
O |
|
O|
---+
O |
O |
O|
---+
O O|
|
O O|
---+
O O|
... | {
"repo_name": "donkirkby/domiculture",
"path": "diagram.py",
"copies": "2",
"size": "20479",
"license": "mit",
"hash": -6108718821538360000,
"line_mean": 27.1691884457,
"line_max": 79,
"alpha_frac": 0.5602324332,
"autogenerated": false,
"ratio": 3.3347988926884873,
"config_test": false,
"has_... |
from functools import partial
import math
import actions
from actions import _get_as_str
import call_definitions
from call_definitions import xpcom_constructor as xpcom_const, python_wrap
from entity_values import entity
import instanceactions
from jstypes import JSWrapper
from validator.compat import FX40_DEFINITION
... | {
"repo_name": "magopian/amo-validator",
"path": "validator/testcases/javascript/predefinedentities.py",
"copies": "1",
"size": "46367",
"license": "bsd-3-clause",
"hash": -519853311760494660,
"line_mean": 43.4554170662,
"line_max": 132,
"alpha_frac": 0.5405352945,
"autogenerated": false,
"ratio":... |
from functools import partial
import math
import requests
from . import csfd
COLORS = {
'20m': 'blue',
'30m': 'sky',
'45m': 'green',
'1h': 'lime',
'1.5h': 'yellow',
'2h': 'orange',
'2.5h': 'red',
'3+h': 'purple',
}
AEROVOD_LABEL = dict(name='Aerovod', color='black')
class InvalidU... | {
"repo_name": "honzajavorek/film2trello",
"path": "film2trello/trello.py",
"copies": "1",
"size": "2717",
"license": "mit",
"hash": -8797006892851157000,
"line_mean": 21.8319327731,
"line_max": 75,
"alpha_frac": 0.6013986014,
"autogenerated": false,
"ratio": 3.514877102199224,
"config_test": fa... |
from functools import partial
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pycpd import AffineRegistration
import numpy as np
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], X[:, 2], color='red', label='Target')
ax.scatter(Y[:, 0], Y[:, 1... | {
"repo_name": "siavashk/pycpd",
"path": "examples/fish_affine_3D.py",
"copies": "1",
"size": "1451",
"license": "mit",
"hash": -3578270484543069700,
"line_mean": 31.9772727273,
"line_max": 128,
"alpha_frac": 0.6085458305,
"autogenerated": false,
"ratio": 2.8450980392156864,
"config_test": false... |
from functools import partial
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pycpd import DeformableRegistration
import numpy as np
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], X[:, 2], color='red', label='Target')
ax.scatter(Y[:, 0], Y[... | {
"repo_name": "siavashk/pycpd",
"path": "examples/fish_deformable_3D.py",
"copies": "1",
"size": "1439",
"license": "mit",
"hash": -4401594938846702600,
"line_mean": 31.7045454545,
"line_max": 121,
"alpha_frac": 0.6115357887,
"autogenerated": false,
"ratio": 2.8722554890219563,
"config_test": f... |
from functools import partial
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pycpd import RigidRegistration
import numpy as np
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], X[:, 2], color='red', label='Target')
ax.scatter(Y[:, 0], Y[:, 1]... | {
"repo_name": "siavashk/pycpd",
"path": "examples/fish_rigid_3D.py",
"copies": "1",
"size": "1197",
"license": "mit",
"hash": -25547731728966140,
"line_mean": 30.5,
"line_max": 128,
"alpha_frac": 0.6207184628,
"autogenerated": false,
"ratio": 2.9776119402985075,
"config_test": false,
"has_no_... |
from functools import partial
import matplotlib.pyplot as plt
import numpy as np
import scipy.sparse as sp
import re
import pandas as pd
class HyperparameterExplorer:
def __init__(self, X, y, classifier, score_name, primary_hyperparameter,
validation_split=0.1, test_X=None, test_y=None,
... | {
"repo_name": "JanetMatsen/Machine_Learning_CSE_546",
"path": "HW3/code/hyperparameter_explorer_semi-orig.py",
"copies": "1",
"size": "9961",
"license": "mit",
"hash": -4863505734092000000,
"line_mean": 39.4918699187,
"line_max": 93,
"alpha_frac": 0.5583776729,
"autogenerated": false,
"ratio": 3.... |
from functools import partial
import matplotlib.pyplot as plt
import numpy as np
import scipy.sparse as sp
import re
import pandas as pd
class HyperparameterExplorer:
def __init__(self, X, y, model, score_name, validation_split=0.1,
test_X=None, test_y=None, use_prev_best_weights=True):
... | {
"repo_name": "JanetMatsen/Machine_Learning_CSE_546",
"path": "HW2/code/hyperparameter_explorer.py",
"copies": "1",
"size": "9683",
"license": "mit",
"hash": -8137249052814065000,
"line_mean": 39.0123966942,
"line_max": 93,
"alpha_frac": 0.5571620366,
"autogenerated": false,
"ratio": 3.9028617492... |
from functools import partial
import mimetypes
import os
import unittest
from tempfile import NamedTemporaryFile
from pydub import AudioSegment
from pydub.utils import (
db_to_float,
ratio_to_db,
make_chunks,
mediainfo,
get_encoder_name,
)
from pydub.exceptions import (
InvalidTag,
InvalidI... | {
"repo_name": "sgml/pydub",
"path": "test/test.py",
"copies": "3",
"size": "30984",
"license": "mit",
"hash": -874881519336827500,
"line_mean": 36.9705882353,
"line_max": 145,
"alpha_frac": 0.5976633101,
"autogenerated": false,
"ratio": 3.355789017654067,
"config_test": true,
"has_no_keywords... |
from functools import partial
import mimetypes
import os
from celery.utils.log import get_task_logger
from girder.models.collection import Collection
from girder.models.file import File
from girder.models.folder import Folder
from girder.models.item import Item
from girder.models.user import User
from isic_archive.c... | {
"repo_name": "ImageMarkup/isic-archive",
"path": "isic_archive/tasks/zip.py",
"copies": "1",
"size": "5921",
"license": "apache-2.0",
"hash": 1670203386913984300,
"line_mean": 34.4550898204,
"line_max": 86,
"alpha_frac": 0.558013849,
"autogenerated": false,
"ratio": 4.5651503469545105,
"config... |
from functools import partial
import multiprocessing
from collections import Counter
from functools32 import lru_cache
from itertools import combinations
from collections import namedtuple
import datetime
import hashlib
import sys
import time
import signal
import gzip
# Signal handler updates GLOBAL to stop processin... | {
"repo_name": "d-grossman/magichour",
"path": "deprecated/LogSig/multi/LogSigMulti.py",
"copies": "2",
"size": "6737",
"license": "apache-2.0",
"hash": 1261389348936189000,
"line_mean": 22.5559440559,
"line_max": 79,
"alpha_frac": 0.6007124833,
"autogenerated": false,
"ratio": 3.604601391118245,
... |
from functools import partial
import multiprocessing
import pandas as pd
from .synthesizer import synthesize, enable_logging
from . import categorizer as cat
def load_data(hh_marginal_file, person_marginal_file,
hh_sample_file, person_sample_file):
"""
Load and process data inputs from .csv fi... | {
"repo_name": "UDST/synthpop",
"path": "synthpop/zone_synthesizer.py",
"copies": "2",
"size": "7532",
"license": "bsd-3-clause",
"hash": -5054512268951539000,
"line_mean": 34.8666666667,
"line_max": 79,
"alpha_frac": 0.6549389272,
"autogenerated": false,
"ratio": 3.7012285012285013,
"config_tes... |
from functools import partial
import numpy as np
from codim1.core import *
def test_quadratic_no_fnc_fail():
m = simple_line_mesh(2, (-1.0, 0.0), (1.0, 0.0))
try:
lm = PolynomialMapping(m.elements[0], 2)
assert(False)
except:
pass
def test_coeffs():
m = simple_line_mesh(4)
... | {
"repo_name": "tbenthompson/codim1",
"path": "test/test_poly_mapping.py",
"copies": "1",
"size": "2541",
"license": "mit",
"hash": 7252302733068035000,
"line_mean": 35.8260869565,
"line_max": 70,
"alpha_frac": 0.6328217237,
"autogenerated": false,
"ratio": 2.7205567451820127,
"config_test": tru... |
from functools import partial
import numpy as np
from gym.spaces import Box, Dict, Tuple
from scipy.stats import beta, norm
import tree
import unittest
from ray.rllib.models.tf.tf_action_dist import Beta, Categorical, \
DiagGaussian, GumbelSoftmax, MultiActionDistribution, MultiCategorical, \
SquashedGaussian
... | {
"repo_name": "robertnishihara/ray",
"path": "rllib/models/tests/test_distributions.py",
"copies": "1",
"size": "26060",
"license": "apache-2.0",
"hash": 10524478258828692,
"line_mean": 41.0322580645,
"line_max": 79,
"alpha_frac": 0.5,
"autogenerated": false,
"ratio": 3.934772761588404,
"config... |
from functools import partial
import numpy as np
from operator import itemgetter
import os
import subprocess
import yaml
def RunCommand(command):
command = "".join(command)
print "[RUNNING COMMAND]: ", command
p = subprocess.Popen(command, shell=True, executable='/bin/bash')
stdout, stderr = p.communicate()
... | {
"repo_name": "mfehr/voxblox",
"path": "htwfsc_benchmarks/python/htwfsc_benchmarks/helpers.py",
"copies": "1",
"size": "2198",
"license": "bsd-3-clause",
"hash": 4670776960359328000,
"line_mean": 35.0491803279,
"line_max": 82,
"alpha_frac": 0.7101910828,
"autogenerated": false,
"ratio": 3.6151315... |
from functools import partial
import numpy as np
from pandas import pandas as pd, DataFrame
from bs4 import BeautifulSoup
import requests
from util.utils import check_cached
wthr = ('https://www.wunderground.com/history/airport/KPDK/{yr}/{m}/1/'
'MonthlyHistory.html?req_city=Alpharetta&req_state=GA&'
... | {
"repo_name": "d10genes/pollen",
"path": "util/wthr_utils.py",
"copies": "1",
"size": "3690",
"license": "mit",
"hash": -772470176764385900,
"line_mean": 27.1679389313,
"line_max": 85,
"alpha_frac": 0.5953929539,
"autogenerated": false,
"ratio": 2.7765237020316027,
"config_test": false,
"has_... |
from functools import partial
import numpy as np
from scipy.sparse import bsr_matrix
from menpo.base import name_of_callable
from menpo.math import as_matrix
from menpo.shape import UndirectedGraph
from menpo.visualize import print_progress, bytes_str, print_dynamic
def _covariance_matrix_inverse(cov_mat, n_componen... | {
"repo_name": "patricksnape/menpo",
"path": "menpo/model/gmrf.py",
"copies": "2",
"size": "47953",
"license": "bsd-3-clause",
"hash": 7701037856883641000,
"line_mean": 32.3238359972,
"line_max": 90,
"alpha_frac": 0.5577753217,
"autogenerated": false,
"ratio": 3.7037923843361398,
"config_test": ... |
from functools import partial
import numpy as np
from violajones.HaarLikeFeature import HaarLikeFeature
from violajones.HaarLikeFeature import FeatureTypes
import progressbar
from multiprocessing import Pool
LOADING_BAR_LENGTH = 50
# TODO: select optimal threshold for each feature
# TODO: attentional cascading
def ... | {
"repo_name": "Ronneesley/redesocial",
"path": "pesquisas/Viola-Jones/recursos/codigo_python/Viola-Jones-master/violajones/AdaBoost.py",
"copies": "2",
"size": "5105",
"license": "mit",
"hash": 2471837154856277000,
"line_mean": 40.8442622951,
"line_max": 239,
"alpha_frac": 0.6738491675,
"autogenera... |
from functools import partial
#import numpy as np
import hyperopt
#from hyperopt import pyll
from hyperopt.fmin import fmin_pass_expr_memo_ctrl
from hpnnet.nips2011 import nnet1_preproc_space
#from hpnnet.skdata_learning_algo import PyllLearningAlgo
from hpnnet.skdata_learning_algo import eval_fn
from skdata.larochel... | {
"repo_name": "hyperopt/hyperopt-nnet",
"path": "hpnnet/tests/test_nips2011.py",
"copies": "1",
"size": "1286",
"license": "bsd-3-clause",
"hash": -7666882368194989000,
"line_mean": 26.3617021277,
"line_max": 72,
"alpha_frac": 0.7060653188,
"autogenerated": false,
"ratio": 3.0187793427230045,
"... |
from functools import partial
import numpy as np
import menpo.io as mio
def bbox_overlap_area(a, b):
max_overlap = np.min([a.max(axis=0), b.max(axis=0)], axis=0)
min_overlap = np.max([a.min(axis=0), b.min(axis=0)], axis=0)
overlap_size = max_overlap - min_overlap
if np.any(overlap_size < 0):
re... | {
"repo_name": "trigeorgis/mdm",
"path": "detect.py",
"copies": "1",
"size": "4300",
"license": "bsd-3-clause",
"hash": -8842400370397917000,
"line_mean": 28.8611111111,
"line_max": 83,
"alpha_frac": 0.6602325581,
"autogenerated": false,
"ratio": 3.377847604084839,
"config_test": false,
"has_n... |
from functools import partial
import numpy as np
import pandas as pd
import traceback
import easysparql
import data_extraction
import learning
from models import MLModel, PredictionRun, Membership
def get_classes(endpoint=None):
if endpoint is None:
print "get_classes> endpoint should not be None"
... | {
"repo_name": "ahmad88me/tada",
"path": "tadacode/tadaa/core.py",
"copies": "1",
"size": "12923",
"license": "mit",
"hash": 5943542223786269000,
"line_mean": 48.3244274809,
"line_max": 128,
"alpha_frac": 0.6164977172,
"autogenerated": false,
"ratio": 3.7534127214638398,
"config_test": false,
... |
from functools import partial
import numpy as np
import pandas as pd
from .utils import isstr, aggregate_common_doc, funcs_no_separate_nan
from .utils_numpy import allnan, anynan, check_dtype
from .aggregate_numpy import _aggregate_base
def _wrapper(group_idx, a, size, fill_value, func='sum', dtype=None, ddof=0, **k... | {
"repo_name": "ml31415/numpy-groupies",
"path": "numpy_groupies/aggregate_pandas.py",
"copies": "1",
"size": "2320",
"license": "bsd-2-clause",
"hash": -8894907731305714000,
"line_mean": 40.4285714286,
"line_max": 106,
"alpha_frac": 0.6202586207,
"autogenerated": false,
"ratio": 3.653543307086614... |
from functools import partial
import numpy as np
import theano
import theano.tensor as tt
from scipy import stats
import warnings
from pymc3.util import get_variable_name
from .dist_math import bound, factln, binomln, betaln, logpow
from .distribution import Discrete, draw_values, generate_samples, reshape_sampled
fro... | {
"repo_name": "springcoil/pymc3",
"path": "pymc3/distributions/discrete.py",
"copies": "1",
"size": "27864",
"license": "apache-2.0",
"hash": -275463274920102980,
"line_mean": 32.8155339806,
"line_max": 109,
"alpha_frac": 0.4938271605,
"autogenerated": false,
"ratio": 3.63096168881939,
"config_... |
from functools import partial
import numpy as np
import z5py
import nifty.graph.rag as nrag
from cluster_tools.utils.segmentation_utils import mutex_watershed_with_seeds, mutex_watershed
# from cluster_tools.utils.segmentation_utils import compute_grid_graph
from two_pass_agglomeration import two_pass_agglomeration
fr... | {
"repo_name": "DerThorsten/nifty",
"path": "test_two_pass.py",
"copies": "1",
"size": "4253",
"license": "mit",
"hash": 4510196145845485000,
"line_mean": 39.8942307692,
"line_max": 103,
"alpha_frac": 0.5767693393,
"autogenerated": false,
"ratio": 3.5265339966832503,
"config_test": false,
"has... |
from functools import partial
import numpy as np
def _obj_wrapper(func, args, kwargs, x):
return func(x, *args, **kwargs)
def _is_feasible_wrapper(func, x):
return np.all(func(x)>=0)
def _cons_none_wrapper(x):
return np.array([0])
def _cons_ieqcons_wrapper(ieqcons, args, kwargs, x):
return np.array(... | {
"repo_name": "sujithvm/skynet",
"path": "code/pso.py",
"copies": "1",
"size": "8374",
"license": "mit",
"hash": -9109218231293582000,
"line_mean": 34.7905982906,
"line_max": 90,
"alpha_frac": 0.5695008359,
"autogenerated": false,
"ratio": 3.790855590765052,
"config_test": false,
"has_no_keyw... |
from functools import partial
import numpy as np
from optimize_utils import *
def initial_population(domain, size):
if domain == "binary":
return np.random.randint(2, size=size)
elif domain == "gaussian":
return np.random.randn(*size)
else:
raise ValueError("Unknown domain: %s" % ... | {
"repo_name": "diogo149/simbo",
"path": "optimize/genetic.py",
"copies": "1",
"size": "3059",
"license": "mit",
"hash": 3406762692997374000,
"line_mean": 30.5360824742,
"line_max": 74,
"alpha_frac": 0.5845047401,
"autogenerated": false,
"ratio": 4.196159122085048,
"config_test": false,
"has_n... |
from functools import partial
import numpy as np
import paddle.fluid as fluid
import paddle.fluid.layers as layers
from config import *
def position_encoding_init(n_position, d_pos_vec):
"""
Generate the initial values for the sinusoid position encoding table.
"""
position_enc = np.array([[
... | {
"repo_name": "lcy-seso/models",
"path": "fluid/neural_machine_translation/transformer/model.py",
"copies": "1",
"size": "26190",
"license": "apache-2.0",
"hash": 662389911366689800,
"line_mean": 34.2016129032,
"line_max": 85,
"alpha_frac": 0.5373043146,
"autogenerated": false,
"ratio": 3.7366243... |
from functools import partial
import numpy as np
import paddle.fluid as fluid
import paddle.fluid.layers as layers
from config import *
def wrap_layer_with_block(layer, block_idx):
"""
Make layer define support indicating block, by which we can add layers
to other blocks within current block. This will ... | {
"repo_name": "kuke/models",
"path": "fluid/PaddleNLP/neural_machine_translation/transformer/model.py",
"copies": "1",
"size": "32421",
"license": "apache-2.0",
"hash": 3025806600157278000,
"line_mean": 34.8243093923,
"line_max": 84,
"alpha_frac": 0.5460658215,
"autogenerated": false,
"ratio": 3.... |
from functools import partial
import numpy as np
import paddle.v2 as paddle
import paddle.fluid as fluid
import paddle.fluid.layers as layers
from config import TrainTaskConfig, input_data_names, pos_enc_param_names
# FIXME(guosheng): Remove out the batch_size from the model.
batch_size = TrainTaskConfig.batch_size
... | {
"repo_name": "Superjom/models-1",
"path": "fluid/transformer/model.py",
"copies": "1",
"size": "16695",
"license": "apache-2.0",
"hash": 7324230512600988000,
"line_mean": 33.2813141684,
"line_max": 81,
"alpha_frac": 0.5635220126,
"autogenerated": false,
"ratio": 3.6191198786039456,
"config_tes... |
from functools import partial
import numpy as np
def bbox_overlap_area(a, b):
max_overlap = np.min([a.max(axis=0), b.max(axis=0)], axis=0)
min_overlap = np.max([a.min(axis=0), b.min(axis=0)], axis=0)
overlap_size = max_overlap - min_overlap
if np.any(overlap_size < 0):
return 0
else:
... | {
"repo_name": "nontas/menpobench",
"path": "menpobench/bbox.py",
"copies": "2",
"size": "4629",
"license": "bsd-3-clause",
"hash": 7501703693361502000,
"line_mean": 35.1640625,
"line_max": 82,
"alpha_frac": 0.6208684381,
"autogenerated": false,
"ratio": 3.5362872421695952,
"config_test": false,... |
from functools import partial
import numpy
from skimage import transform
EPS = 1e-66
RESOLUTION = 0.001
num_grids = int(1/RESOLUTION+0.5)
def generate_lut(img):
"""
linear approximation of CDF & marginal
:param density_img:
:return: lut_y, lut_x
"""
density_img = transform.resize(img, (num_gri... | {
"repo_name": "frombeijingwithlove/dlcv_for_beginners",
"path": "random_bonus/gan_n_cgan_2d_example/sampler.py",
"copies": "1",
"size": "2899",
"license": "bsd-3-clause",
"hash": -8451797065231053000,
"line_mean": 32.7093023256,
"line_max": 137,
"alpha_frac": 0.5774404967,
"autogenerated": false,
... |
from functools import partial
import numpy
import os
import re
import random
import signal
from collections import OrderedDict
from scipy.misc import imread
from unicsv import DictUnicodeReader
from multiprocessing import Pool, cpu_count
from multiprocessing.pool import ThreadPool
from scipy.ndimage.interpolation impor... | {
"repo_name": "bonyuta0204/NetDissec",
"path": "src/loadseg.py",
"copies": "1",
"size": "26369",
"license": "mit",
"hash": 4619950005472423000,
"line_mean": 35.5221606648,
"line_max": 88,
"alpha_frac": 0.564716144,
"autogenerated": false,
"ratio": 4.1240225211135435,
"config_test": false,
"ha... |
from functools import partial
import operator
import os
import shutil
import tempfile
import time
import numpy
from numpy.testing import assert_raises, assert_equal
from six.moves import range, cPickle
from fuel import config
from fuel.iterator import DataIterator
from fuel.utils import do_not_pickle_attributes, find... | {
"repo_name": "markusnagel/fuel",
"path": "tests/test_utils.py",
"copies": "1",
"size": "11136",
"license": "mit",
"hash": 6970396646501087000,
"line_mean": 37.6666666667,
"line_max": 79,
"alpha_frac": 0.5915948276,
"autogenerated": false,
"ratio": 3.341134113411341,
"config_test": true,
"has... |
from functools import partial
import operator
import warnings
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas.core.dtypes.common import is_integer_dtype
import pandas as pd
from pandas import (
Series,
isna,
)
import pandas._testing as tm
from pandas.core.arrays import... | {
"repo_name": "datapythonista/pandas",
"path": "pandas/tests/test_nanops.py",
"copies": "2",
"size": "38532",
"license": "bsd-3-clause",
"hash": -6876011179655665000,
"line_mean": 34.3829201102,
"line_max": 88,
"alpha_frac": 0.5658413786,
"autogenerated": false,
"ratio": 3.2885550908935732,
"co... |
from functools import partial
import operator
def compare(op, expected_val, err_str):
def check(obj):
if not op(obj, expected_val):
return [err_str]
else:
return []
return check
equals = partial(compare, operator.eq)
not_equals = partial(compare, operator.ne)
is_ = p... | {
"repo_name": "AbletonAG/abl.util",
"path": "abl/util/checks.py",
"copies": "1",
"size": "1162",
"license": "mit",
"hash": 3175455239623694300,
"line_mean": 21.7843137255,
"line_max": 109,
"alpha_frac": 0.578313253,
"autogenerated": false,
"ratio": 4.091549295774648,
"config_test": false,
"ha... |
from functools import partial
import operator
from peewee import *
from playhouse.db_url import connect as db_url_connect
from huey.api import Huey
from huey.constants import EmptyData
from huey.exceptions import ConfigurationError
from huey.storage import BaseStorage
class BytesBlobField(BlobField):
def python... | {
"repo_name": "coleifer/huey",
"path": "huey/contrib/sql_huey.py",
"copies": "2",
"size": "6855",
"license": "mit",
"hash": -1680070728710509000,
"line_mean": 31.1830985915,
"line_max": 79,
"alpha_frac": 0.5622173596,
"autogenerated": false,
"ratio": 4.034726309593879,
"config_test": false,
"... |
from functools import partial
import os
from ..core.compute import Compute
from ..taxbrain.mock_compute import (MockCompute,
MockFailedCompute,
NodeDownCompute,
)
import requests_mock
requests_mock.Mocker.TEST... | {
"repo_name": "OpenSourcePolicyCenter/PolicyBrain",
"path": "webapp/apps/btax/compute.py",
"copies": "2",
"size": "3307",
"license": "mit",
"hash": 6849730317821656000,
"line_mean": 34.1808510638,
"line_max": 74,
"alpha_frac": 0.6011490777,
"autogenerated": false,
"ratio": 3.514346439957492,
"c... |
from functools import partial
import os
from datetime import datetime, timedelta
import numpy as np
import torch
import neptune
from torch.autograd import Variable
from torch.optim.lr_scheduler import ExponentialLR
from tempfile import TemporaryDirectory
from steppy.base import Step, IdentityOperation
from steppy.ada... | {
"repo_name": "Diyago/Machine-Learning-scripts",
"path": "DEEP LEARNING/segmentation/Kaggle TGS Salt Identification Challenge/v2/common_blocks/callbacks.py",
"copies": "1",
"size": "21327",
"license": "apache-2.0",
"hash": 3932554816071721000,
"line_mean": 33.7345276873,
"line_max": 87,
"alpha_frac":... |
from functools import partial
import os
import logging
import pandas as pd
from .example_filetype_format import FileTypeFormat
from . import process_functions
logger = logging.getLogger(__name__)
def validateSymbol(x, bedDf, returnMappedDf=True):
valid=False
gene = x['HUGO_SYMBOL']
if sum(bedDf['Hugo_S... | {
"repo_name": "thomasyu888/Genie",
"path": "genie/fusions.py",
"copies": "1",
"size": "6813",
"license": "mit",
"hash": -7618228003008167000,
"line_mean": 46.6433566434,
"line_max": 169,
"alpha_frac": 0.6186701893,
"autogenerated": false,
"ratio": 3.3561576354679805,
"config_test": false,
"ha... |
from functools import partial
import os
import re
import sys
import time
import threading
import sublime
import sublime_plugin
from sublimelinter.loader import Loader
from sublimelinter.modules.base_linter import INPUT_METHOD_FILE
LINTERS = {} # mapping of language name to linter module
QUEUE = {} # views ... | {
"repo_name": "uschmidt83/SublimeLinter-for-ST2",
"path": "SublimeLinter.py",
"copies": "5",
"size": "31563",
"license": "mit",
"hash": 1890449192952797000,
"line_mean": 30.8496468214,
"line_max": 181,
"alpha_frac": 0.6115071444,
"autogenerated": false,
"ratio": 3.8765659543109803,
"config_test... |
from functools import partial
import os
import re
import sys
import time
import threading
import sublime
import sublime_plugin
from .sublimelinter.loader import Loader
from .sublimelinter.modules.base_linter import INPUT_METHOD_FILE
LINTERS = {} # mapping of language name to linter module
QUEUE = {} # view... | {
"repo_name": "benesch/sublime-linter",
"path": "SublimeLinter.py",
"copies": "1",
"size": "31667",
"license": "mit",
"hash": 612613231846596000,
"line_mean": 30.8581488934,
"line_max": 163,
"alpha_frac": 0.612814602,
"autogenerated": false,
"ratio": 3.8821870785828123,
"config_test": false,
... |
from functools import partial
import os
import shutil
from subprocess import check_call
import sys
from nose.plugins import Plugin
from funfactory import manage
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
PLAYDOH_ROOT = '.playdoh'
PLAYDOH = os.path.join(ROOT, PLAYDOH_ROOT, 'funtestapp')
EN... | {
"repo_name": "mozilla/funfactory",
"path": "tests/__init__.py",
"copies": "1",
"size": "4838",
"license": "bsd-3-clause",
"hash": 8374660565356384000,
"line_mean": 36.796875,
"line_max": 101,
"alpha_frac": 0.5438197602,
"autogenerated": false,
"ratio": 3.570479704797048,
"config_test": true,
... |
from functools import partial
import os
import sys
import textwrap
from .vendor import six
from .context import Context
from .loader import FilesystemLoader, DEFAULT_COLLECTION_NAME
from .parser import Parser, Context as ParserContext, Argument
from .executor import Executor
from .exceptions import Failure, Collectio... | {
"repo_name": "ericholscher/invoke",
"path": "invoke/cli.py",
"copies": "1",
"size": "9613",
"license": "bsd-2-clause",
"hash": -5503793811804124000,
"line_mean": 31.4763513514,
"line_max": 108,
"alpha_frac": 0.5674607303,
"autogenerated": false,
"ratio": 4.201486013986014,
"config_test": false... |
from functools import partial
import os
import sys
try:
from configparser import ConfigParser # Python 3
except:
from ConfigParser import ConfigParser # Python 2
from .config import USER_CONFIG
from .error import GeosupportError
from .function_info import FUNCTIONS, function_help, list_functions, input_help
f... | {
"repo_name": "ishiland/python-geosupport",
"path": "geosupport/geosupport.py",
"copies": "1",
"size": "4974",
"license": "mit",
"hash": -1025265138202885400,
"line_mean": 33.0684931507,
"line_max": 79,
"alpha_frac": 0.5341777242,
"autogenerated": false,
"ratio": 3.957040572792363,
"config_test... |
from functools import partial
import os
import tempfile
import unittest
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage as storage
from nose.tools import eq_
from amo.storage_utils import (walk_storage, copy_stored_file,
move_stored_... | {
"repo_name": "jinankjain/zamboni",
"path": "apps/amo/tests/test_storage_utils.py",
"copies": "7",
"size": "4706",
"license": "bsd-3-clause",
"hash": 8351431824970932000,
"line_mean": 36.0551181102,
"line_max": 84,
"alpha_frac": 0.5665108372,
"autogenerated": false,
"ratio": 3.3566333808844506,
... |
from functools import partial
import os
import tempfile
import unittest
from django.core.files.base import ContentFile
from django.test.utils import override_settings
from nose.tools import eq_
from mkt.site.storage_utils import (copy_stored_file, get_private_storage,
get_public_s... | {
"repo_name": "tsl143/zamboni",
"path": "mkt/site/tests/test_storage_utils.py",
"copies": "1",
"size": "4662",
"license": "bsd-3-clause",
"hash": 1015515176527736400,
"line_mean": 36,
"line_max": 77,
"alpha_frac": 0.5720720721,
"autogenerated": false,
"ratio": 3.613953488372093,
"config_test": ... |
from functools import partial
import os
import tempfile
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage as storage
import pytest
from nose.tools import eq_
from olympia.amo.storage_utils import (walk_storage, copy_stored_file,
... | {
"repo_name": "jpetto/olympia",
"path": "src/olympia/amo/tests/test_storage_utils.py",
"copies": "1",
"size": "4926",
"license": "bsd-3-clause",
"hash": 6795467902090702000,
"line_mean": 34.9562043796,
"line_max": 77,
"alpha_frac": 0.5667884693,
"autogenerated": false,
"ratio": 3.371663244353183,... |
from functools import (partial)
import os
import time
import boto.ec2
from fabric.api import (
abort,
env,
hide,
run,
sudo
)
from fabric.context_managers import (
quiet,
settings
)
CLOUD_INIT_TMPL = """#cloud-config
ssh_authorized_keys:
- {0}
packages:
- git
runcmd:
- apt-key adv ... | {
"repo_name": "loads/tc-builder",
"path": "fabfile.py",
"copies": "1",
"size": "4398",
"license": "apache-2.0",
"hash": 9067656159679115000,
"line_mean": 26.835443038,
"line_max": 110,
"alpha_frac": 0.6252842201,
"autogenerated": false,
"ratio": 3.5640194489465156,
"config_test": false,
"has_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.