text stringlengths 0 1.05M | meta dict |
|---|---|
from errors import ServerError
import urllib
import json
class Request():
ALLOWED_METHODS = ['HEAD', 'GET', 'POST', 'PUT', 'DELETE']
def __init__(self, request_text):
request_text = request_text.split('\r\n\r\n', 1)
if len(request_text) > 1:
self.body = request_text[1].strip()
... | {
"repo_name": "rockwotj/PieServer",
"path": "src/movie_quotes/framework/server/request.py",
"copies": "1",
"size": "2247",
"license": "mit",
"hash": 2978087331524580000,
"line_mean": 36.45,
"line_max": 93,
"alpha_frac": 0.5456163774,
"autogenerated": false,
"ratio": 3.8542024013722127,
"config_... |
from errors import ServerError
import urllib
class Request():
ALLOWED_METHODS = ['HEAD', 'GET', 'POST']
def __init__(self, request_text):
request_text = request_text.split('\r\n\r\n', 1)
if len(request_text) > 1:
self.body = request_text[1].strip()
else:
self.b... | {
"repo_name": "rockwotj/PieServer",
"path": "src/test_app/framework/server/request.py",
"copies": "1",
"size": "2518",
"license": "mit",
"hash": 5899438144490876000,
"line_mean": 36.5820895522,
"line_max": 93,
"alpha_frac": 0.5448768864,
"autogenerated": false,
"ratio": 3.9529042386185242,
"con... |
from ..errors import SimError
class ExplorationTechnique(object):
"""
An otiegnqwvk is a set of hooks for a simulation manager that assists in the implementation of new techniques in
symbolic exploration.
TODO: choose actual name for the functionality (techniques? strategies?)
Any number of thes... | {
"repo_name": "f-prettyland/angr",
"path": "angr/exploration_techniques/__init__.py",
"copies": "1",
"size": "5100",
"license": "bsd-2-clause",
"hash": 6766919805993629000,
"line_mean": 39.157480315,
"line_max": 164,
"alpha_frac": 0.6519607843,
"autogenerated": false,
"ratio": 4.485488126649076,
... |
from ..errors import SinglePayError
class Base( object ):
def __init__( self, api=None ):
self._api = api
def _proxy_request( self, method, action, body ):
return self._api._make_request( method, action, body )
def __repr__( self ):
klass = str( self.__class__ ).replace( "<class '", "" ).replace( "'>", ""... | {
"repo_name": "streed/singlepay",
"path": "singlepay/client/models/__init__.py",
"copies": "1",
"size": "3823",
"license": "mit",
"hash": 8038872808219945000,
"line_mean": 20.2388888889,
"line_max": 109,
"alpha_frac": 0.6437352864,
"autogenerated": false,
"ratio": 3.2207245155855095,
"config_te... |
from errors import StateValidationError, TransitionActionError, TransitionFatalError, TransitionValidationError
from tracking_state import TrackingState
class TrackingStateMachine(object):
def __init__(self):
self.states = {}
self.transitions = {}
self.actions = {}
def state(self, nam... | {
"repo_name": "jsok/TrackingStateMachine",
"path": "tracking_state_machine/tracking_state_machine.py",
"copies": "1",
"size": "4394",
"license": "bsd-3-clause",
"hash": -6049301790193758000,
"line_mean": 39.3211009174,
"line_max": 112,
"alpha_frac": 0.6228948566,
"autogenerated": false,
"ratio": ... |
from ..errors import StopValidation, ValidationError
__all__ = ["AnyValueType", "TypedValueType"]
class AnyValueType:
"""An instance of ValueType describes for some type of value (int, "int
between 0 and 10", list, "list with elements of value type
int-between-0-and-10", dict, namedtuple, whathaveyou):
... | {
"repo_name": "lars-tiede/aiorethink",
"path": "aiorethink/values_and_valuetypes/base_types.py",
"copies": "1",
"size": "6828",
"license": "mit",
"hash": -879721488218165900,
"line_mean": 37.1452513966,
"line_max": 79,
"alpha_frac": 0.6168717047,
"autogenerated": false,
"ratio": 4.771488469601677... |
from errors import TaskError, NoTaskFoundError, NoWorkFlowFoundError
import re, hashlib
SESSION_PIPELINE_KEY = "cr_pipe"
SESSION_DATA_KEY = "cr_data"
METHOD_POST = "POST"
METHOD_GET = "GET"
CR_DEBUG=False
def print_msg(string):
if CR_DEBUG == True:
print(string)
def digest(workflow_name, task_name, index... | {
"repo_name": "Project-EPIC/crowdrouter",
"path": "crowdrouter/utils.py",
"copies": "1",
"size": "2005",
"license": "mit",
"hash": -3383427452074579500,
"line_mean": 38.3137254902,
"line_max": 156,
"alpha_frac": 0.6703241895,
"autogenerated": false,
"ratio": 3.9468503937007875,
"config_test": f... |
from .errors import TokenError
from StringIO import StringIO
def tokenize(fd, specials, index=0):
if isinstance(fd, (str, unicode)):
fd = StringIO(fd)
specials = with_prefixes(specials)
ah = CharacterLookahead(fd, index)
indent = 0
layers = []
newlines = False
while ah.ch != '':
... | {
"repo_name": "cheery/lrkit",
"path": "lrkit/tokenizer.py",
"copies": "1",
"size": "4535",
"license": "mit",
"hash": -5930182278215631000,
"line_mean": 33.8846153846,
"line_max": 100,
"alpha_frac": 0.4632855568,
"autogenerated": false,
"ratio": 3.9920774647887325,
"config_test": false,
"has_n... |
from errors import TransitionValidationError
from transition_parameter import TransitionParameter
class TrackingItem(object):
def __init__(self):
self.validations = []
def validate(self):
"""
Apply each rule to the item and only succeed if all validations pass.
"""
imp... | {
"repo_name": "jsok/TrackingStateMachine",
"path": "tracking_state_machine/tracking_state.py",
"copies": "1",
"size": "3475",
"license": "bsd-3-clause",
"hash": 258540310713940960,
"line_mean": 31.7830188679,
"line_max": 115,
"alpha_frac": 0.6149640288,
"autogenerated": false,
"ratio": 4.54842931... |
from .errors import UnexpectedStatusError, InvalidParameterError
def list_aliases(api):
session = api.build_session()
def request(domain_name='', account_number=''):
if not account_number:
account_number = api._account_number
resource = ('customers', account_number, 'domains', do... | {
"repo_name": "mgrp/rackspaceapps",
"path": "rackspaceapps/aliases.py",
"copies": "1",
"size": "3244",
"license": "bsd-3-clause",
"hash": 4410134784138106000,
"line_mean": 28.7614678899,
"line_max": 78,
"alpha_frac": 0.5280517879,
"autogenerated": false,
"ratio": 4.660919540229885,
"config_test... |
from .errors import UnexpectedStatusError, InvalidParameterError
def list_rsemail(api):
session = api.build_session()
def request(domain_name='', account_number=''):
if not account_number:
account_number = api._account_number
resource = ('customers', account_number, 'domains', do... | {
"repo_name": "mgrp/rackspaceapps",
"path": "rackspaceapps/rsemail.py",
"copies": "1",
"size": "1860",
"license": "bsd-3-clause",
"hash": 3052021915982315500,
"line_mean": 24.8333333333,
"line_max": 78,
"alpha_frac": 0.5376344086,
"autogenerated": false,
"ratio": 4.525547445255475,
"config_test... |
from .errors import UnexpectedStatusError, InvalidParameterError
domain_param_casts = {
'serviceType': str,
'exchangeExtraStorage': int,
'exchangeMaxNumMailboxes': int,
'rsEmailProduct': str,
'rsEmailBaseMailboxSize': int,
'rsEmailMaxNumberMailboxes': int,
'rsEmailExtraStorage': int,
'... | {
"repo_name": "mgrp/rackspaceapps",
"path": "rackspaceapps/domains.py",
"copies": "1",
"size": "5104",
"license": "bsd-3-clause",
"hash": 8668671526457089000,
"line_mean": 31.5095541401,
"line_max": 79,
"alpha_frac": 0.5587774295,
"autogenerated": false,
"ratio": 4.329092451229855,
"config_test... |
from ....errors import UnsupportedIRStmtError, UnsupportedDirtyError, SimStatementError
from .... import sim_options as o
from .base import SimIRStmt
from .noop import SimIRStmt_NoOp
from .imark import SimIRStmt_IMark
from .abihint import SimIRStmt_AbiHint
from .wrtmp import SimIRStmt_WrTmp
from .put import SimIRStmt_... | {
"repo_name": "chubbymaggie/angr",
"path": "angr/engines/vex/statements/__init__.py",
"copies": "5",
"size": "1316",
"license": "bsd-2-clause",
"hash": 7776336828105597000,
"line_mean": 36.6,
"line_max": 127,
"alpha_frac": 0.7241641337,
"autogenerated": false,
"ratio": 3.3830334190231364,
"conf... |
from .errors import WidthRangeError, WidthToleranceError
from .constants import IMAGE_ZERO_WIDTH as ZERO_WIDTH
from .constants import SRCSET_MIN_WIDTH_TOLERANCE as ONE_PERCENT
def validate_min_width(value):
"""
Validate the minimum width value.
This function ensures that the `value`:
* is of type `in... | {
"repo_name": "imgix/imgix-python",
"path": "imgix/validators.py",
"copies": "1",
"size": "5822",
"license": "bsd-2-clause",
"hash": -3588303414964436000,
"line_mean": 30.6413043478,
"line_max": 79,
"alpha_frac": 0.6535554792,
"autogenerated": false,
"ratio": 4.0913562895291635,
"config_test": ... |
from ..errors.mtce import BadMultitonIdentifier as BMI
class Singleton(type):
"""The **singleton pattern** is a design pattern that restricts the
instantiation of a class to one object. This is useful when exactly one
object is needed to coordinate actions across the system.
As a metaclass, the patte... | {
"repo_name": "sadeghiafshin/rgCrawler",
"path": ".eggs/pynion-0.0.4-py2.7.egg/pynion/metaclass/tones.py",
"copies": "2",
"size": "2664",
"license": "mit",
"hash": -8994796695545181000,
"line_mean": 33.1538461538,
"line_max": 81,
"alpha_frac": 0.6171171171,
"autogenerated": false,
"ratio": 4.2967... |
from Escenario import *
from Jugador import*
from Duelo import *
from Observer import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from threading import *
from time import sleep
from PyQt4 import QtCore
import sys
import math
from pantallaPerdio import *
class EstadosPuente:
"""
Clase para especificar los ... | {
"repo_name": "jorenver/LP_Proyecto_Python",
"path": "nivel1.py",
"copies": "1",
"size": "5690",
"license": "unlicense",
"hash": -1170706842063782700,
"line_mean": 23.6363636364,
"line_max": 119,
"alpha_frac": 0.7094903339,
"autogenerated": false,
"ratio": 2.4347454000855797,
"config_test": fal... |
from Escenario import *
from Jugador import*
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from threading import *
from time import sleep
from PyQt4 import QtCore
import sys
import math
from Duelo import *
class EscenarioTres(Escenario):
def __init__(self,jugador,observer,*args):
Escenario.__init__(self,*ar... | {
"repo_name": "jorenver/LP_Proyecto_Python",
"path": "EscenarioTres.py",
"copies": "1",
"size": "5447",
"license": "unlicense",
"hash": -6303402085807412000,
"line_mean": 24.9428571429,
"line_max": 78,
"alpha_frac": 0.6847806132,
"autogenerated": false,
"ratio": 2.394285714285714,
"config_test"... |
from Escenario import *
from Jugador import*
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from threading import *
from time import sleep
from PyQt4 import QtCore
import sys
import math
import random
from EscenarioDos import *
from EscenarioTres import *
class Duelo(QWidget):
dimension_x=600 ... | {
"repo_name": "jorenver/LP_Proyecto_Python",
"path": "Duelo.py",
"copies": "1",
"size": "5121",
"license": "unlicense",
"hash": -7813265905142945000,
"line_mean": 23.7391304348,
"line_max": 104,
"alpha_frac": 0.6887326694,
"autogenerated": false,
"ratio": 2.4502392344497608,
"config_test": fals... |
from Escenario import *
from Jugador import*
import sys
import time
import threading
from Duelo import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4 import QtCore
class Accion:
pasadizo=0
caida=1
salto=2
teletransportacion=3
caidaLibre=4
caidaLibreD=5
class EstadoEscenario:
pasadizoOff=0
... | {
"repo_name": "jorenver/LP_Proyecto_Python",
"path": "EscenarioDos.py",
"copies": "1",
"size": "9339",
"license": "unlicense",
"hash": 1082964769230276900,
"line_mean": 31.543554007,
"line_max": 180,
"alpha_frac": 0.7422636257,
"autogenerated": false,
"ratio": 2.2929044930027005,
"config_test":... |
from Escenario import *
from Observer import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from threading import *
from time import sleep
from PyQt4 import QtCore
import sys
import math
from neuroListener import *
from nivel1 import *
from pantallaPerdio import *
class Menu(Escenario,NeuroListener):
def __i... | {
"repo_name": "jorenver/LP_Proyecto_Python",
"path": "Menu.py",
"copies": "1",
"size": "2663",
"license": "unlicense",
"hash": 1473444614645116200,
"line_mean": 23.8971962617,
"line_max": 73,
"alpha_frac": 0.7202403305,
"autogenerated": false,
"ratio": 2.5879494655004858,
"config_test": false,
... |
from escher.urls import get_url, names, root_directory
from escher.version import __version__, __schema_version__, __map_model_version__
import os
from os.path import join, exists
from pytest import raises
def test_urls():
# online
url = get_url('builder_embed_css', source='web', protocol='https')
assert ... | {
"repo_name": "fw1121/escher.github.io",
"path": "escher/tests/test_urls.py",
"copies": "1",
"size": "1477",
"license": "mit",
"hash": 5993259121674537000,
"line_mean": 34.1666666667,
"line_max": 102,
"alpha_frac": 0.6262694651,
"autogenerated": false,
"ratio": 3.311659192825112,
"config_test":... |
from es_connection import es
from es_queries import _build_filter, _build_email_query
from operator import itemgetter
# _score_lda_clusters={"query": { "match_all": {}},"sort":{ "_script": { "script_file": "lda-cluster-sum-score", "lang": "groovy", "type": "number","order": "desc" }}}
# _lda_clusters_by_idx={"query"... | {
"repo_name": "Sotera/newman",
"path": "app/newman_es/es_topic.py",
"copies": "1",
"size": "6048",
"license": "apache-2.0",
"hash": 2868173237957906400,
"line_mean": 55.523364486,
"line_max": 283,
"alpha_frac": 0.599702381,
"autogenerated": false,
"ratio": 3.3920358945597306,
"config_test": fal... |
from esdb import select as select_f
from esdb import insert as insert_f
from esdb import delete as delete_f
from esdb import count as count_f
from esdb import table_exists as table_exists_f
from esdb import drop_table as drop_table_f
class Table(object):
def __init__(self, conn, table_name):
self.conn = ... | {
"repo_name": "lgastako/esdb",
"path": "conn.py",
"copies": "1",
"size": "1774",
"license": "mit",
"hash": -6751787582208999000,
"line_mean": 25.0882352941,
"line_max": 68,
"alpha_frac": 0.6538895152,
"autogenerated": false,
"ratio": 3.548,
"config_test": false,
"has_no_keywords": false,
"f... |
from esengine.bases.py3 import * # noqa
from esengine.exceptions import RequiredField, InvalidMultiField
from esengine.exceptions import FieldTypeMismatch, ValidationError
from collections import Iterable
class BaseField(object):
_type = unicode
_default = None
_default_mapping = {'type': 'string'}
... | {
"repo_name": "catholabs/esengine",
"path": "esengine/bases/field.py",
"copies": "2",
"size": "3102",
"license": "mit",
"hash": 2914969759291222500,
"line_mean": 32,
"line_max": 77,
"alpha_frac": 0.5486782721,
"autogenerated": false,
"ratio": 4.707132018209408,
"config_test": false,
"has_no_k... |
from esengine.bases.py3 import * # noqa
from esengine.fields import StringField
from esengine.exceptions import ValidationError
import warnings
from six import iteritems
class BaseDocument(object):
_strict = False
_validators = None
_query_fields = None
def _initialize_defaults_fields(self, ignore=... | {
"repo_name": "seek-ai/esengine",
"path": "esengine/bases/document.py",
"copies": "2",
"size": "4389",
"license": "mit",
"hash": -8024287307024185000,
"line_mean": 34.3951612903,
"line_max": 75,
"alpha_frac": 0.5618591934,
"autogenerated": false,
"ratio": 4.510791366906475,
"config_test": false... |
from esengine.bases.py3 import * # noqa
from esengine.utils.payload.exception import InvalidArg, MissingArg
from six import iteritems
def _check_input(arg):
if arg is None:
return False
if type(arg) in (list, dict, tuple) and len(arg) == 0:
return False
return True
def _check_type(key... | {
"repo_name": "catholabs/esengine",
"path": "esengine/utils/payload/meta_util.py",
"copies": "2",
"size": "4625",
"license": "mit",
"hash": 9146272309619951000,
"line_mean": 29.2287581699,
"line_max": 78,
"alpha_frac": 0.5634594595,
"autogenerated": false,
"ratio": 3.9597602739726026,
"config_t... |
from esengine.exceptions import PayloadError
from esengine.utils.payload.queries import Query
from esengine.utils.payload.meta_util import unroll_struct
from esengine.utils.pagination import Pagination
class Payload(object):
def __init__(self, model=None, **kwargs):
"""
Optional parameters
... | {
"repo_name": "seek-ai/esengine",
"path": "esengine/utils/payload/base.py",
"copies": "2",
"size": "4935",
"license": "mit",
"hash": -1242956078113210600,
"line_mean": 27.3620689655,
"line_max": 74,
"alpha_frac": 0.548733536,
"autogenerated": false,
"ratio": 4.254310344827586,
"config_test": fa... |
from esengine import (
Document, Mapping,
IntegerField, LongField, StringField, FloatField,
DateField, BooleanField, GeoPointField
)
class BaseDoc(Document):
_index = 'index'
@classmethod
def put_mapping(cls, *args, **kwargs):
cls.called = True
class Doc(BaseDoc):
_doctype = 'do... | {
"repo_name": "catholabs/esengine",
"path": "tests/test_mapping.py",
"copies": "2",
"size": "4258",
"license": "mit",
"hash": -3845194653073428000,
"line_mean": 24.6506024096,
"line_max": 78,
"alpha_frac": 0.511038046,
"autogenerated": false,
"ratio": 4.125968992248062,
"config_test": true,
"... |
from esengine.utils.payload import Payload, Filter, Query
def test_query_must_not_by_ids():
raw_query = {
'query': {
'bool': {
'must': [
{
'bool': {
'must_not': [
{'ids': {'v... | {
"repo_name": "catholabs/esengine",
"path": "tests/test_payload.py",
"copies": "2",
"size": "1510",
"license": "mit",
"hash": 2995429086893329400,
"line_mean": 25.9642857143,
"line_max": 75,
"alpha_frac": 0.3754966887,
"autogenerated": false,
"ratio": 4.194444444444445,
"config_test": false,
... |
from esengine.utils.payload.meta import BaseAggregate, MetaAggregate
from esengine.utils.payload.exception import NoAggregate
AGGREGATES = {
'min': {
'args': ('field',)
},
'max': {
'args': ('field',)
},
'sum': {
'args': ('field',)
},
'avg': {
'args': ('field'... | {
"repo_name": "catholabs/esengine",
"path": "esengine/utils/payload/aggregates.py",
"copies": "2",
"size": "1846",
"license": "mit",
"hash": -2241525095069193000,
"line_mean": 18.2291666667,
"line_max": 68,
"alpha_frac": 0.408992416,
"autogenerated": false,
"ratio": 3.5229007633587788,
"config_... |
from esengine.utils.payload.meta import BaseFilterQuery, MetaFilterQuery
from esengine.utils.payload.exception import NoFilter
from six import with_metaclass
FILTERS = {
'and_': ['_filter'],
'bool': {
'kwargs': ({('must', 'must_not', 'should'): ['_filter']},)
},
'exists': {
'args': ('... | {
"repo_name": "seek-ai/esengine",
"path": "esengine/utils/payload/filters.py",
"copies": "2",
"size": "2632",
"license": "mit",
"hash": -7463480481739854000,
"line_mean": 22.0877192982,
"line_max": 72,
"alpha_frac": 0.422112462,
"autogenerated": false,
"ratio": 3.57123473541384,
"config_test": ... |
from esengine.utils.payload.meta_util import (
make_struct, unroll_definitions, unroll_struct
)
class MetaFilterQuery(type):
def __init__(self, name, bases, d):
super(MetaFilterQuery, self).__init__(name, bases, d)
unroll_definitions(self._definitions)
def __getattr__(self, key):
... | {
"repo_name": "seek-ai/esengine",
"path": "esengine/utils/payload/meta.py",
"copies": "2",
"size": "3131",
"license": "mit",
"hash": 1177844557019684000,
"line_mean": 23.4609375,
"line_max": 68,
"alpha_frac": 0.5209198339,
"autogenerated": false,
"ratio": 3.855911330049261,
"config_test": false... |
from ..es_ES import Provider as PersonProvider
class Provider(PersonProvider):
"""
Adds popular Catalan names.
https://www.idescat.cat/pub/?id=aec&n=946&lang=es&t=2018
https://www.idescat.cat/pub/?id=aec&n=947&lang=es&t=2018
"""
first_names_male = (
'Adam',
'Albert',
'A... | {
"repo_name": "joke2k/faker",
"path": "faker/providers/person/es_CA/__init__.py",
"copies": "2",
"size": "1707",
"license": "mit",
"hash": 2453327023742947000,
"line_mean": 17.7555555556,
"line_max": 60,
"alpha_frac": 0.38507109,
"autogenerated": false,
"ratio": 3.025089605734767,
"config_test"... |
from es_fluent.filters import Dict
from es_fluent.script_fields import ScriptFields
from es_fluent.fields import Fields
class QueryBuilder(object):
def __init__(self):
self.root_filter = Dict()
self.script_fields = ScriptFields()
self.fields = Fields()
self.sorts = []
self... | {
"repo_name": "planetlabs/es_fluent",
"path": "es_fluent/builder.py",
"copies": "1",
"size": "4956",
"license": "apache-2.0",
"hash": -6427297703400885000,
"line_mean": 28.8554216867,
"line_max": 81,
"alpha_frac": 0.5843422115,
"autogenerated": false,
"ratio": 4.136894824707847,
"config_test": ... |
from ..es import Provider as AddressProvider
class Provider(AddressProvider):
building_number_formats = ('%', '%#', '%#', '%#', '%##')
street_prefixes = (
'Plaza', 'Calle', 'Avenida', 'Via', 'Vial', 'Rambla', 'Glorieta',
'Urbanización', 'Callejón', 'Cañada', 'Alameda', 'Acceso', 'C.',
... | {
"repo_name": "danhuss/faker",
"path": "faker/providers/address/es_ES/__init__.py",
"copies": "1",
"size": "2348",
"license": "mit",
"hash": 64162388630191330,
"line_mean": 23.3020833333,
"line_max": 73,
"alpha_frac": 0.4744963566,
"autogenerated": false,
"ratio": 3.1442048517520216,
"config_te... |
from esipy.client import EsiClient
from typing import List
from esipy.exceptions import APIException
from ...eve import get_esi_client
from ....swagger import get_api
from .responses import MarketGroupsResponse, MarketGroupResponse
class MarketEndpoint(object):
def __init__(self, client: EsiClient = None) -> None:
... | {
"repo_name": "SpeedProg/eve-inc-waitlist",
"path": "waitlist/utility/swagger/eve/market/__init__.py",
"copies": "1",
"size": "1614",
"license": "mit",
"hash": 9076131285646614000,
"line_mean": 36.5348837209,
"line_max": 78,
"alpha_frac": 0.6065675341,
"autogenerated": false,
"ratio": 3.955882352... |
from esipy.client import EsiClient
from waitlist.utility.swagger.eve import get_esi_client
from waitlist.utility.swagger import get_api
from waitlist.utility.swagger.eve.universe.responses import ResolveIdsResponse,\
CategoriesResponse, CategoryResponse, GroupResponse, GroupsResponse,\
TypesResponse, TypeRespon... | {
"repo_name": "SpeedProg/eve-inc-waitlist",
"path": "waitlist/utility/swagger/eve/universe/__init__.py",
"copies": "1",
"size": "4995",
"license": "mit",
"hash": -8299143369531096000,
"line_mean": 34.4255319149,
"line_max": 80,
"alpha_frac": 0.5895895896,
"autogenerated": false,
"ratio": 4.018503... |
from esipy.exceptions import APIException
from flask import jsonify, Response
from flask.blueprints import Blueprint
import logging
from flask.globals import request
from flask.helpers import make_response
from waitlist.permissions import perm_manager
from waitlist.utility.swagger.character_info import open_informatio... | {
"repo_name": "SpeedProg/eve-inc-waitlist",
"path": "waitlist/blueprints/api/openwindow.py",
"copies": "1",
"size": "1040",
"license": "mit",
"hash": 5413551051941619000,
"line_mean": 31.5,
"line_max": 94,
"alpha_frac": 0.7567307692,
"autogenerated": false,
"ratio": 3.7545126353790614,
"config_... |
from eskimoapps.ui.application import *
from eskimoapps.ui.databoundui import *
from twisted.spread import pb
from twisted.internet import reactor
from views import *
from interactors import *
from pyrope.model import *
class PyropeApplicationPresenter(ApplicationPresenter):
def __init__(self, appName, reactor, ho... | {
"repo_name": "rgravina/Pyrope",
"path": "pyrope/client/presenters.py",
"copies": "1",
"size": "4294",
"license": "mit",
"hash": -5935432085442140000,
"line_mean": 43.2680412371,
"line_max": 130,
"alpha_frac": 0.6949231486,
"autogenerated": false,
"ratio": 4.281156530408774,
"config_test": fals... |
from esky import bdist_esky
from distutils.core import setup
import scipy.special
import PyQt5
import os
import sys
from glob import glob
from corpustools import acousticsim
from corpustools.corpus.io import textgrid
ufuncs_path = scipy.special._ufuncs.__file__
doc_files = dict()
for root, dirnames, filenames in os.wa... | {
"repo_name": "PhonologicalCorpusTools/CorpusTools",
"path": "esk_setup.py",
"copies": "1",
"size": "5594",
"license": "bsd-3-clause",
"hash": 8532011979889215000,
"line_mean": 37.0544217687,
"line_max": 79,
"alpha_frac": 0.4179478012,
"autogenerated": false,
"ratio": 4.681171548117155,
"config... |
from esky import bdist_esky
from setuptools import setup
import os
import sys
import glob
import subprocess
import platform
LONG_DESC = '''
World / Saved Game Editor for the indie game Minecraft
Import and export creations from saved games. Brush tools allow modifying
terrain on a larger scale. Create, remove, and r... | {
"repo_name": "mcedit/mcedit",
"path": "setup.py",
"copies": "1",
"size": "4566",
"license": "isc",
"hash": 9199709387012183000,
"line_mean": 21.603960396,
"line_max": 101,
"alpha_frac": 0.5304424004,
"autogenerated": false,
"ratio": 3.682258064516129,
"config_test": false,
"has_no_keywords":... |
# from esky import bdist_esky
from setuptools import setup
import os
import sys
import glob
import subprocess
import platform
sys.path.append('C:\\WINDOWS\\WinSxS\\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_5090ab56bcba71c2')
sys.path.append("C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\redist... | {
"repo_name": "skinny121/MCEdit-Unified",
"path": "setup.py",
"copies": "3",
"size": "5093",
"license": "isc",
"hash": -8517798085680834000,
"line_mean": 22.688372093,
"line_max": 116,
"alpha_frac": 0.5305321029,
"autogenerated": false,
"ratio": 3.5967514124293785,
"config_test": false,
"has_... |
from espa_api_client.Clients import Client
from espa_api_client.Order import Order
from espa_api_client.OrderTemplate import OrderTemplate
from espa_api_client.parse import get_order_inputs_from_earth_explorer_export
"""
An example for ordering a few tiles from landsat 7 and 8, as created
from an Earth explorer export... | {
"repo_name": "Jwely/espa-api-client",
"path": "docs/example/example.py",
"copies": "1",
"size": "1923",
"license": "mit",
"hash": -3366854477288500700,
"line_mean": 40.8043478261,
"line_max": 94,
"alpha_frac": 0.7228289132,
"autogenerated": false,
"ratio": 3.509124087591241,
"config_test": fal... |
from esprit import raw, models
import json, sys
class ScrollException(Exception):
pass
def copy(source_conn, source_type, target_conn, target_type, limit=None, batch_size=1000, method="POST", q=None):
if q is None:
q = models.QueryBuilder.match_all()
batch = []
for r in iterate(source_conn, so... | {
"repo_name": "JiscPER/esprit",
"path": "esprit/tasks.py",
"copies": "1",
"size": "3802",
"license": "apache-2.0",
"hash": 5099376675782347000,
"line_mean": 32.350877193,
"line_max": 113,
"alpha_frac": 0.5673329826,
"autogenerated": false,
"ratio": 3.716520039100684,
"config_test": false,
"ha... |
from esprit import tasks
from esprit import raw
def copy(source, source_type, target, target_type, limit=None, batch=1000):
source_index = source.split("/")[-1]
source_url = "/".join(source.split("/")[:-1])
sconn = raw.Connection(source_url, source_index)
target_index = target.split("/")[-1]
targe... | {
"repo_name": "JiscPER/esprit",
"path": "esprit/cli.py",
"copies": "1",
"size": "1613",
"license": "apache-2.0",
"hash": -1668761545405087700,
"line_mean": 40.3846153846,
"line_max": 107,
"alpha_frac": 0.6422814631,
"autogenerated": false,
"ratio": 3.665909090909091,
"config_test": false,
"ha... |
from esprit import tasks, raw
from portality import models
import json
'''
Use a scroll search to update mis-labelled licenses in the DOAJ.
'''
# The articles missed by the update_licenses script
missed_articles = ['0028-9930', '0034-7310', '1089-6891', '2014-7351', '1960-6004', '1326-2238', '1678-4226', '2036-3603',... | {
"repo_name": "DOAJ/doaj",
"path": "portality/migrate/licenses/missed_journals.py",
"copies": "1",
"size": "2377",
"license": "apache-2.0",
"hash": 6938388638956432000,
"line_mean": 36.7301587302,
"line_max": 473,
"alpha_frac": 0.5494320572,
"autogenerated": false,
"ratio": 3.0990873533246415,
... |
from esprit import tasks, raw
from portality import models
'''
Use a scroll search to update mis-labelled licenses in the DOAJ.
'''
license_correct_dict = { "CC by" : "CC BY",
"CC by-nc" : "CC BY-NC",
"CC by-nc-nd" : "CC BY-NC-ND",
"CC by-nc-s... | {
"repo_name": "DOAJ/doaj",
"path": "portality/migrate/licenses/update_licenses.py",
"copies": "1",
"size": "4378",
"license": "apache-2.0",
"hash": 2394996598662482000,
"line_mean": 31.9172932331,
"line_max": 167,
"alpha_frac": 0.5890817725,
"autogenerated": false,
"ratio": 3.4337254901960783,
... |
from .es_query import HQESQuery
from . import filters
class DomainES(HQESQuery):
index = 'domains'
@property
def builtin_filters(self):
return [
non_test_domains,
incomplete_domains,
real_domains,
commcare_domains,
commconnect_domains,
... | {
"repo_name": "benrudolph/commcare-hq",
"path": "corehq/apps/es/domains.py",
"copies": "1",
"size": "1661",
"license": "bsd-3-clause",
"hash": 2588566841921226000,
"line_mean": 23.4264705882,
"line_max": 68,
"alpha_frac": 0.6038531005,
"autogenerated": false,
"ratio": 3.9927884615384617,
"confi... |
from .es_query import HQESQuery
from . import filters
class FormES(HQESQuery):
index = 'forms'
default_filters = {
'is_xform_instance': {"term": {"doc_type": "xforminstance"}},
'has_xmlns': {"not": {"missing": {"field": "xmlns"}}},
'has_user': {"not": {"missing": {"field": "form.meta.u... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/es/forms.py",
"copies": "2",
"size": "1203",
"license": "bsd-3-clause",
"hash": -3798518552487586300,
"line_mean": 25.152173913,
"line_max": 72,
"alpha_frac": 0.5976724855,
"autogenerated": false,
"ratio": 3.2338709677419355,
"config... |
from .es_query import HQESQuery
from . import filters
class SMSES(HQESQuery):
index = 'sms'
@property
def builtin_filters(self):
return [
incoming_messages,
outgoing_messages,
to_commcare_user,
to_commcare_case,
to_web_user,
... | {
"repo_name": "benrudolph/commcare-hq",
"path": "corehq/apps/es/sms.py",
"copies": "2",
"size": "1254",
"license": "bsd-3-clause",
"hash": -5280887633711752000,
"line_mean": 22.2222222222,
"line_max": 69,
"alpha_frac": 0.6331738437,
"autogenerated": false,
"ratio": 3.308707124010554,
"config_te... |
from .es_query import HQESQuery
from . import filters
class UserES(HQESQuery):
index = 'users'
default_filters = {
'not_deleted': {"term": {"base_doc": "couchuser"}},
'active': {"term": {"is_active": True}},
}
@property
def builtin_filters(self):
return [
domain... | {
"repo_name": "puttarajubr/commcare-hq",
"path": "corehq/apps/es/users.py",
"copies": "1",
"size": "1379",
"license": "bsd-3-clause",
"hash": -1485105700527422000,
"line_mean": 19.8939393939,
"line_max": 63,
"alpha_frac": 0.6178390138,
"autogenerated": false,
"ratio": 3.554123711340206,
"config... |
from essence import World, System, Component
from fixtures import world, SomeComponent, AnotherComponent
def test_remembers_entities(world):
entities = set()
assert set(world.entities) == entities
entities.add(world.create_entity())
assert set(world.entities) == entities
entities.add(world.create_e... | {
"repo_name": "chromy/essence",
"path": "tests/test_world.py",
"copies": "1",
"size": "1189",
"license": "mit",
"hash": -5848694724975654000,
"line_mean": 29.4871794872,
"line_max": 64,
"alpha_frac": 0.7039529016,
"autogenerated": false,
"ratio": 3.727272727272727,
"config_test": false,
"has_... |
from essential_auth.essentialauth import EssentialAuth, VerificationFailedException
from flask import Flask, session, redirect, url_for, escape, request, g
app = Flask(__name__)
@app.before_request
def check_auth():
g.auth = EssentialAuth(auth_config)
@app.route('/')
def index():
if 'token' in session:
... | {
"repo_name": "shane-mason/essential-auth",
"path": "examples/flask_app.py",
"copies": "1",
"size": "1494",
"license": "mit",
"hash": -2780303720583141000,
"line_mean": 26.6851851852,
"line_max": 83,
"alpha_frac": 0.6144578313,
"autogenerated": false,
"ratio": 3.6174334140435835,
"config_test":... |
from essentia.standard import *
import numpy as np
import simplejson as json
import sqlite3 as lite
#db = lite.connect('genImpro.db')
#c = db.cursor()
import MySQLdb
# db = MySQLdb.connect(host="localhost",
# user="genimpro",
# passwd="genimpropw#2016",
# ... | {
"repo_name": "bastustrump/genimpro",
"path": "recordings.py",
"copies": "1",
"size": "16362",
"license": "mit",
"hash": 6802943309910054000,
"line_mean": 28.3225806452,
"line_max": 135,
"alpha_frac": 0.5964429776,
"autogenerated": false,
"ratio": 3.6432865731462925,
"config_test": false,
"ha... |
from estimate.constants import *
class Estimator(object):
''' Wrapper for loading stock price data and estimating covariance. '''
def __init__(self, ticker_column, date_column):
self.ticker = ticker_column # column name for tickers; e.g., 'ticker'
self.date = date_column # column name for times... | {
"repo_name": "haoyio/stock-opt",
"path": "src/estimate/estimator.py",
"copies": "1",
"size": "6993",
"license": "apache-2.0",
"hash": 5603916363841525000,
"line_mean": 36.4010695187,
"line_max": 145,
"alpha_frac": 0.5634205634,
"autogenerated": false,
"ratio": 3.674724119810825,
"config_test":... |
from estimation_goodness_info import EstimationGoodnessInfo
from asc.utils.indexer_property import IndexerProperty
class Model(object):
r"""
Class representing abstract statistical model of time series. Its
intended use is to be baseclass for specific models like exponential
smoothing models, or ARMA ... | {
"repo_name": "dexter2206/asc",
"path": "source/asc-0.1/src/asc/models/abstract_model.py",
"copies": "1",
"size": "3282",
"license": "mit",
"hash": -379991270193046400,
"line_mean": 32.4897959184,
"line_max": 169,
"alpha_frac": 0.6035953687,
"autogenerated": false,
"ratio": 4.154430379746835,
"... |
from .estimator_base import H2OEstimator
class H2ORandomForestEstimator(H2OEstimator):
def __init__(self, model_id=None, mtries=None, sample_rate=None, build_tree_one_node=None,
ntrees=None, max_depth=None, min_rows=None, nbins=None, nbins_cats=None,
binomial_double_trees=None, balance_... | {
"repo_name": "kyoren/https-github.com-h2oai-h2o-3",
"path": "h2o-py/h2o/estimators/random_forest.py",
"copies": "1",
"size": "3102",
"license": "apache-2.0",
"hash": 3160517803231774700,
"line_mean": 46.0151515152,
"line_max": 93,
"alpha_frac": 0.6847195358,
"autogenerated": false,
"ratio": 4.05... |
from .estimator_base import H2OEstimator
class H2ODeepLearningEstimator(H2OEstimator):
"""Build a supervised Deep Neural Network model
Builds a feed-forward multilayer artificial neural network on an H2OFrame
Parameters
----------
model_id : str, optional
The unique id assigne... | {
"repo_name": "YzPaul3/h2o-3",
"path": "h2o-py/h2o/estimators/deeplearning.py",
"copies": "1",
"size": "27113",
"license": "apache-2.0",
"hash": -5524750572744844000,
"line_mean": 30.7494145199,
"line_max": 94,
"alpha_frac": 0.6407996164,
"autogenerated": false,
"ratio": 4.097476197672662,
"con... |
from .estimator_base import H2OEstimator
class H2ODeepLearningEstimator(H2OEstimator):
def __init__(self, model_id=None, overwrite_with_best_model=None, checkpoint=None,
use_all_factor_levels=None, activation=None, hidden=None, epochs=None,
train_samples_per_iteration=None, seed=None, ... | {
"repo_name": "nilbody/h2o-3",
"path": "h2o-py/h2o/estimators/deeplearning.py",
"copies": "1",
"size": "22889",
"license": "apache-2.0",
"hash": -8163525122975598000,
"line_mean": 30.8802228412,
"line_max": 117,
"alpha_frac": 0.6900694657,
"autogenerated": false,
"ratio": 3.7783096731594585,
"c... |
from .estimator_base import H2OEstimator
class H2OGeneralizedLinearEstimator(H2OEstimator):
"""Build a Generalized Linear Model
Fit a generalized linear model, specified by a response variable, a set of predictors,
and a description of the error distribution.
Parameters
----------
model_id : ... | {
"repo_name": "YzPaul3/h2o-3",
"path": "h2o-py/h2o/estimators/glm.py",
"copies": "1",
"size": "11821",
"license": "apache-2.0",
"hash": -1794978111384932400,
"line_mean": 31.3863013699,
"line_max": 130,
"alpha_frac": 0.6829371458,
"autogenerated": false,
"ratio": 4.009837177747626,
"config_test... |
from .estimator_base import H2OEstimator
class H2OGeneralizedLinearEstimator(H2OEstimator):
def __init__(self, model_id=None, max_iterations=None, beta_epsilon=None, solver=None,
standardize=None, family=None, link=None, tweedie_variance_power=None,
tweedie_link_power=None, alpha=None,... | {
"repo_name": "pchmieli/h2o-3",
"path": "h2o-py/h2o/estimators/glm.py",
"copies": "2",
"size": "9353",
"license": "apache-2.0",
"hash": -7794542143530364000,
"line_mean": 32.523297491,
"line_max": 90,
"alpha_frac": 0.6875868705,
"autogenerated": false,
"ratio": 3.9648155998304366,
"config_test"... |
from .estimator_base import H2OEstimator
class H2OGeneralizedLowRankEstimator(H2OEstimator):
"""Builds a generalized low rank model of a H2O dataset.
Parameters
----------
k : int
The rank of the resulting decomposition. This must be between 1 and the number of
columns in the training frame inc... | {
"repo_name": "YzPaul3/h2o-3",
"path": "h2o-py/h2o/estimators/glrm.py",
"copies": "1",
"size": "8253",
"license": "apache-2.0",
"hash": -89534080085288800,
"line_mean": 29.4538745387,
"line_max": 88,
"alpha_frac": 0.6802374894,
"autogenerated": false,
"ratio": 3.869198312236287,
"config_test": ... |
from .estimator_base import H2OEstimator
class H2OGeneralizedLowRankEstimator(H2OEstimator):
def __init__(self,k=None, max_iterations=None, transform=None, seed=None,
ignore_const_cols=None,loss=None, multi_loss=None, loss_by_col=None,
loss_by_col_idx=None, regularization_x=None, regul... | {
"repo_name": "nilbody/h2o-3",
"path": "h2o-py/h2o/estimators/glrm.py",
"copies": "1",
"size": "8763",
"license": "apache-2.0",
"hash": 2700319679308513000,
"line_mean": 31.2169117647,
"line_max": 92,
"alpha_frac": 0.6397352505,
"autogenerated": false,
"ratio": 4.0739191073919105,
"config_test"... |
from .estimator_base import H2OEstimator
class H2OGradientBoostingEstimator(H2OEstimator):
"""
Builds gradient boosted classification trees, and gradient boosted regression trees on
a parsed data set. The default distribution function will guess the model type based on
the response column type run properly th... | {
"repo_name": "kyoren/https-github.com-h2oai-h2o-3",
"path": "h2o-py/h2o/estimators/gbm.py",
"copies": "1",
"size": "3338",
"license": "apache-2.0",
"hash": 3906163449079128000,
"line_mean": 44.7397260274,
"line_max": 90,
"alpha_frac": 0.7115038945,
"autogenerated": false,
"ratio": 3.978545887961... |
from .estimator_base import *
class H2OGradientBoostingEstimator(H2OEstimator):
"""
Builds gradient boosted classification trees, and gradient boosted regression trees on
a parsed data set. The default distribution function will guess the model type based on
the response column type run properly the response ... | {
"repo_name": "nilbody/h2o-3",
"path": "h2o-py/h2o/estimators/gbm.py",
"copies": "1",
"size": "8737",
"license": "apache-2.0",
"hash": -7660013777407638000,
"line_mean": 29.764084507,
"line_max": 115,
"alpha_frac": 0.6938308344,
"autogenerated": false,
"ratio": 3.6740958788898235,
"config_test"... |
from .estimator_base import *
class H2OKMeansEstimator(H2OEstimator):
def __init__(self, model_id=None, k=None, max_iterations=None,standardize=None,init=None,seed=None,
nfolds=None,fold_assignment=None, user_points=None,ignored_columns=None,
score_each_iteration=None, keep_cross_valid... | {
"repo_name": "pchmieli/h2o-3",
"path": "h2o-py/h2o/estimators/kmeans.py",
"copies": "2",
"size": "4684",
"license": "apache-2.0",
"hash": -8264303663931939000,
"line_mean": 29.0256410256,
"line_max": 101,
"alpha_frac": 0.6701537148,
"autogenerated": false,
"ratio": 3.972858354537744,
"config_t... |
from .estimator_base import *
class H2OKMeansEstimator(H2OEstimator):
"""Performs k-means clustering on an H2O dataset.
Parameters
----------
model_id : str, optional
The unique id assigned to the resulting model. If none is given, an id will
automatically be generated.
k : int
The n... | {
"repo_name": "YzPaul3/h2o-3",
"path": "h2o-py/h2o/estimators/kmeans.py",
"copies": "1",
"size": "5177",
"license": "apache-2.0",
"hash": -2093258609727362600,
"line_mean": 28.2485875706,
"line_max": 101,
"alpha_frac": 0.6893954027,
"autogenerated": false,
"ratio": 3.933890577507599,
"config_te... |
from .estimator_base import *
class H2ONaiveBayesEstimator(H2OEstimator):
def __init__(self,model_id=None, laplace=None, threshold=None, eps=None,
compute_metrics=None, balance_classes=None,
max_after_balance_size=None, nfolds=None, fold_assignment=None,
keep_cross_valid... | {
"repo_name": "madmax983/h2o-3",
"path": "h2o-py/h2o/estimators/naive_bayes.py",
"copies": "2",
"size": "3853",
"license": "apache-2.0",
"hash": -4551052774434885000,
"line_mean": 29.824,
"line_max": 91,
"alpha_frac": 0.69815728,
"autogenerated": false,
"ratio": 4.090233545647559,
"config_test"... |
from .estimator_base import *
class H2ONaiveBayesEstimator(H2OEstimator):
"""
The naive Bayes classifier assumes independence between predictor variables
conditional on the response, and a Gaussian distribution of numeric predictors with
mean and standard deviation computed from the training dataset. Wh... | {
"repo_name": "YzPaul3/h2o-3",
"path": "h2o-py/h2o/estimators/naive_bayes.py",
"copies": "1",
"size": "4328",
"license": "apache-2.0",
"hash": 511606928264872600,
"line_mean": 30.5912408759,
"line_max": 91,
"alpha_frac": 0.7005545287,
"autogenerated": false,
"ratio": 4.090737240075614,
"config_... |
from .estimator_base import *
class H2ORandomForestEstimator(H2OEstimator):
"""Builds a Random Forest Model on an H2OFrame
Parameters
----------
model_id : str, optional
The unique id assigned to the resulting model. If none is given, an id will
automatically be generated.
mtries : int
... | {
"repo_name": "YzPaul3/h2o-3",
"path": "h2o-py/h2o/estimators/random_forest.py",
"copies": "1",
"size": "10076",
"license": "apache-2.0",
"hash": 200881868779493340,
"line_mean": 31.9281045752,
"line_max": 125,
"alpha_frac": 0.6919412465,
"autogenerated": false,
"ratio": 3.780863039399625,
"con... |
from .estimator_base import *
class H2ORandomForestEstimator(H2OEstimator):
def __init__(self, model_id=None, mtries=None, sample_rate=None, build_tree_one_node=None,
ntrees=None, max_depth=None, min_rows=None, nbins=None, nbins_cats=None,
binomial_double_trees=None, balance_classes=No... | {
"repo_name": "pchmieli/h2o-3",
"path": "h2o-py/h2o/estimators/random_forest.py",
"copies": "1",
"size": "5878",
"license": "apache-2.0",
"hash": 1617995851537813200,
"line_mean": 29.2989690722,
"line_max": 93,
"alpha_frac": 0.6781218101,
"autogenerated": false,
"ratio": 3.7559105431309905,
"co... |
from .estimator_base import *
class H2ORandomForestEstimator(H2OEstimator):
def __init__(self, model_id=None, mtries=None, sample_rate=None, col_sample_rate_per_tree=None,
build_tree_one_node=None, ntrees=None, max_depth=None, min_rows=None, nbins=None,
nbins_cats=None, binomial_double... | {
"repo_name": "nilbody/h2o-3",
"path": "h2o-py/h2o/estimators/random_forest.py",
"copies": "1",
"size": "7999",
"license": "apache-2.0",
"hash": 7291003618613727000,
"line_mean": 30.8685258964,
"line_max": 117,
"alpha_frac": 0.6858357295,
"autogenerated": false,
"ratio": 3.7695570216776626,
"co... |
from .estimator import AbstractEstimator
from .projection import l1_projection_to_simplex
class MultiEstimator(AbstractEstimator):
def __init__(
self,
base_model_factory,
output_model_factories_and_weights,
*args,
**kwargs
):
self.base_model_factory = base_model... | {
"repo_name": "AmiiThinks/amii-tf-nn",
"path": "amii_tf_nn/multi_estimator.py",
"copies": "1",
"size": "1308",
"license": "mit",
"hash": 6668340253211406000,
"line_mean": 32.5384615385,
"line_max": 75,
"alpha_frac": 0.6123853211,
"autogenerated": false,
"ratio": 3.9279279279279278,
"config_test... |
from .estimator import def_estimator
from .flag import FLAGS, add_output_dir_flag
from .inputs import def_def_infer_input_fn
def def_evaluate(batch_inputs=True, prepare_filename_queues=True):
"""Define `evaluate()` function.
See also `help(def_evaluate())`.
- Args
- `batch_inputs`: Same as `def_... | {
"repo_name": "raviqqe/tensorflow-qnd",
"path": "qnd/evaluate.py",
"copies": "1",
"size": "1206",
"license": "unlicense",
"hash": -2014945482330197000,
"line_mean": 30.7368421053,
"line_max": 74,
"alpha_frac": 0.5953565506,
"autogenerated": false,
"ratio": 3.804416403785489,
"config_test": fals... |
from .estimator import def_estimator
from .flag import FLAGS, add_output_dir_flag
from .inputs import def_def_infer_input_fn
def def_infer(batch_inputs=True, prepare_filename_queues=True):
"""Define `infer()` function.
See also `help(def_infer())`.
- Args
- `batch_inputs`: Same as `def_train_and... | {
"repo_name": "raviqqe/tensorflow-qnd",
"path": "qnd/infer.py",
"copies": "1",
"size": "1297",
"license": "unlicense",
"hash": 8543646146791123000,
"line_mean": 31.425,
"line_max": 78,
"alpha_frac": 0.5913646877,
"autogenerated": false,
"ratio": 3.825958702064897,
"config_test": false,
"has_n... |
from ..estimators.estimator_base import H2OEstimator
from h2o.utils.typechecks import Enum
from h2o.utils.typechecks import assert_is_type
from h2o.frame import H2OFrame
from h2o.utils.typechecks import assert_is_type, Enum, numeric
class H2OPCA(H2OEstimator):
"""
Principal Component Analysis
"""
algo ... | {
"repo_name": "ryfeus/lambda-packs",
"path": "H2O/ArchiveH2O/h2o/transforms/decomposition.py",
"copies": "2",
"size": "8112",
"license": "mit",
"hash": -785364624850710400,
"line_mean": 49.7,
"line_max": 119,
"alpha_frac": 0.6394230769,
"autogenerated": false,
"ratio": 4.053973013493254,
"confi... |
from ..estimators.estimator_base import H2OEstimator
from h2o.utils.typechecks import Enum
from h2o.utils.typechecks import assert_is_type
class H2OPCA(H2OEstimator):
"""
Principal Component Analysis
"""
algo = "pca"
def __init__(self, model_id=None, k=None, max_iterations=None, seed=None,
... | {
"repo_name": "mathemage/h2o-3",
"path": "h2o-py/h2o/transforms/decomposition.py",
"copies": "1",
"size": "6936",
"license": "apache-2.0",
"hash": 5430239750534691000,
"line_mean": 47.8521126761,
"line_max": 119,
"alpha_frac": 0.6404267589,
"autogenerated": false,
"ratio": 4.203636363636364,
"c... |
from ..estimators.estimator_base import H2OEstimator
class H2OPCA(H2OEstimator):
"""
Principal Component Analysis
"""
algo = "pca"
def __init__(self, model_id=None, k=None, max_iterations=None, seed=None,
transform=("NONE", "DEMEAN", "DESCALE", "STANDARDIZE", "NORMALIZE"),
... | {
"repo_name": "jangorecki/h2o-3",
"path": "h2o-py/h2o/transforms/decomposition.py",
"copies": "1",
"size": "6615",
"license": "apache-2.0",
"hash": 2965159425234161000,
"line_mean": 41.4038461538,
"line_max": 94,
"alpha_frac": 0.5957671958,
"autogenerated": false,
"ratio": 4.629111266620014,
"c... |
from ..estimators.estimator_base import H2OEstimator
class H2OPCA(H2OEstimator):
"""
Principal Component Analysis
"""
def __init__(self, model_id=None, k=None, max_iterations=None, seed=None,
transform=("NONE","DEMEAN","DESCALE","STANDARDIZE","NORMALIZE"),
use_all_factor_levels=... | {
"repo_name": "nilbody/h2o-3",
"path": "h2o-py/h2o/transforms/decomposition.py",
"copies": "1",
"size": "6102",
"license": "apache-2.0",
"hash": -9142827495724521000,
"line_mean": 38.3741935484,
"line_max": 90,
"alpha_frac": 0.6461815798,
"autogenerated": false,
"ratio": 4.285112359550562,
"con... |
from estnltk import Text
from collections import Counter
import numpy as np
import pandas as pd
import re
# Eemaldab sisestatud sõnadest arvud, lausemärgid ja nimed.
# Tagastab DataFrame, ei eemaldata duplikaate.
def make_dataframe(text):
dataframe = Text(text).get(["word_texts", "lemmas", "postag_descriptions", "de... | {
"repo_name": "DTI-tudengite-tarkvaraprojektid/SYNMORF",
"path": "website/backend.py",
"copies": "1",
"size": "4488",
"license": "mit",
"hash": -7781622816986004000,
"line_mean": 41.5288461538,
"line_max": 144,
"alpha_frac": 0.7210038435,
"autogenerated": false,
"ratio": 2.48343627175744,
"conf... |
from .est_param import *
import numpy as np
"""
y: Dx1 phenotype vector
fixed: DxK covariates
genotypes: DxS SNPs
"""
def LM_cis_qtls(y,fixed,genotypes):
nsamples = y.shape[0]
nsnps = genotypes.shape[1]
"""
Null
"""
X0 = fixed
beta_0 = est_beta_LM([y, X0])
sigma2_0 = est_s... | {
"repo_name": "annacuomo/varQTL",
"path": "varqtl/LM_cis_qtls.py",
"copies": "1",
"size": "1855",
"license": "mit",
"hash": 9170630711525470000,
"line_mean": 27.1060606061,
"line_max": 77,
"alpha_frac": 0.5013477089,
"autogenerated": false,
"ratio": 2.6845151953690305,
"config_test": false,
"... |
from estrategias.jogadores import Jogador
import numpy as np
class MeuJogador(Jogador):
def __init__(self):
self.interacao = 0
def escolha_de_cacada(self, rodada, comida_atual, reputacao_atual, m, reputacoes_dos_jogadores):
caçadas_rodada = round(m ** (1 / 2))
n_jogadores = len(repu... | {
"repo_name": "fccoelho/jogos_vorazes",
"path": "estrategias/CorreVento.py",
"copies": "1",
"size": "1728",
"license": "mit",
"hash": -5037450535740317000,
"line_mean": 40.1428571429,
"line_max": 118,
"alpha_frac": 0.4562825709,
"autogenerated": false,
"ratio": 3.2340823970037453,
"config_test"... |
from estrategias.jogadores import Jogador
import random
from numpy import random
class MeuJogador(Jogador):
def __init__(self):
self.rodadabol = False
def escolha_de_cacada(self, rodada, comida_atual, reputacao_atual, m, reputacoes_dos_jogadores):
try:
if self.rodadabol:
... | {
"repo_name": "fccoelho/jogos_vorazes",
"path": "estrategias/popst.py",
"copies": "1",
"size": "4161",
"license": "mit",
"hash": -9076579005613534000,
"line_mean": 41.4183673469,
"line_max": 134,
"alpha_frac": 0.3384652394,
"autogenerated": false,
"ratio": 4.6240266963292544,
"config_test": fal... |
from estrategias.jogadores import Jogador
# class MeuJogador(Jogador):
#
# def basic_linear_regression(self, x,y):
# length = len(x)
# sum_x = sum(x)
# sum_y = sum(y)
# sum_x_squared = sum(map(lambda a: a * a,x))
# sum_of_products = sum([x[i] * y[i] f... | {
"repo_name": "fccoelho/jogos_vorazes",
"path": "estrategias/Otto2.py",
"copies": "1",
"size": "1593",
"license": "mit",
"hash": 956814819911117600,
"line_mean": 40.9210526316,
"line_max": 106,
"alpha_frac": 0.5116133082,
"autogenerated": false,
"ratio": 2.7996485061511422,
"config_test": false... |
from estreamer import plugin
from estreamer import base
from estreamer import config
import os
import errno
import pymssql
import binascii
import time
import ConfigParser
class MSSQLPlugin(plugin.Plugin):
''' Writes Connection Statitic data to MS SQL database '''
__info__ = {
'description': 'MSSQL wr... | {
"repo_name": "TeePaps/estreamer",
"path": "examples/plugins/mssql.py",
"copies": "1",
"size": "4280",
"license": "apache-2.0",
"hash": -5434736040184066000,
"line_mean": 37.2142857143,
"line_max": 91,
"alpha_frac": 0.4953271028,
"autogenerated": false,
"ratio": 4.3276036400404445,
"config_test... |
from estreamer import plugin
from estreamer import base
from estreamer import config
import os
import errno
class PcapPlugin(plugin.Plugin):
__info__ = {
'description': 'pcap writer',
'author': "Sean O'Hara",
'version': '0.1',
'callback': 'parse_record',
}
__pcap_dir__ = os... | {
"repo_name": "TeePaps/estreamer",
"path": "examples/plugins/pcap.py",
"copies": "1",
"size": "3025",
"license": "apache-2.0",
"hash": 3683490740611456500,
"line_mean": 39.3333333333,
"line_max": 95,
"alpha_frac": 0.532892562,
"autogenerated": false,
"ratio": 3.8388324873096447,
"config_test": ... |
from estruct.estruct import EStruct, StructObject
import unittest
class StructObjectTestCase(unittest.TestCase):
def setUp(self):
self.struct_object=StructObject("f1 f2.a1 f2.a2 f3.a1.b1 f3.a1.b2 f3.a2")
def tearDown(self):
del self.struct_object
def test___str__(self):
self.asse... | {
"repo_name": "simblack/EStruct",
"path": "estruct/tests/estruct_test.py",
"copies": "1",
"size": "32191",
"license": "mit",
"hash": 5699529205848165000,
"line_mean": 43.6477115118,
"line_max": 146,
"alpha_frac": 0.5481656364,
"autogenerated": false,
"ratio": 2.7717410022386773,
"config_test": ... |
from estudios_socioeconomicos.models import Subseccion, Pregunta, Estudio
from estudios_socioeconomicos.models import OpcionRespuesta, Respuesta, Seccion
from estudios_socioeconomicos.forms import RespuestaForm
from perfiles_usuario.utils import is_capturista, is_administrador
"""
Mapping of next and previous sect... | {
"repo_name": "erikiado/jp2_online",
"path": "captura/utils.py",
"copies": "1",
"size": "4429",
"license": "mit",
"hash": 9198019043931277000,
"line_mean": 36.218487395,
"line_max": 99,
"alpha_frac": 0.6507112215,
"autogenerated": false,
"ratio": 3.8782837127845884,
"config_test": false,
"has... |
from esv import esv, PassageNotFoundError, EsvQuotaExceededError
from django import template
from django.conf import settings
register = template.Library()
class PassageNode(template.Node):
def __init__(self, reference, footnotes='off', audio='on', headings='off', **kwargs):
on_off_map = { 'on': Tr... | {
"repo_name": "mintchaos/django_esv",
"path": "esv/templatetags/passage.py",
"copies": "1",
"size": "2228",
"license": "bsd-3-clause",
"hash": 5584693342797460000,
"line_mean": 32.7575757576,
"line_max": 141,
"alpha_frac": 0.6090664273,
"autogenerated": false,
"ratio": 3.7445378151260504,
"conf... |
from es.weso.faogenderextractor.extractor.keys_dict import KeysDict
__author__ = 'Dani'
from datetime import datetime
from model2xml.model2xml import ModelToXMLTransformer
from lpentities.observation import Observation
from lpentities.value import Value
from lpentities.indicator import Indicator
from lpentities.co... | {
"repo_name": "weso/landportal-importers",
"path": "FAOGender_Importer/es/weso/faogenderextractor/extractor/model_objects_management/model_object_builder.py",
"copies": "2",
"size": "12358",
"license": "unlicense",
"hash": 7391992444873250000,
"line_mean": 48.436,
"line_max": 120,
"alpha_frac": 0.640... |
from eszone_openvpn.settings import VPN_DEFAULT_VARS, VPN_PATHS, VPN_VARS, OPENVPN_COMMANDS, HELP_VARS
from rest_framework.exceptions import APIException
import os, subprocess
from exceptions import InstanceHaveNoVarsAttributesException
import os.path
from exceptions import *
import re
import time
logFileName = "open... | {
"repo_name": "erigones/api_openvpn",
"path": "functions.py",
"copies": "1",
"size": "9034",
"license": "bsd-3-clause",
"hash": 5530484739027728000,
"line_mean": 36.0245901639,
"line_max": 113,
"alpha_frac": 0.535643126,
"autogenerated": false,
"ratio": 3.6843393148450243,
"config_test": true,
... |
from etaprogress.components.bars import Bar, BarDoubled
def test_bar():
bar = Bar()
assert '[ ]' == bar.bar(12, 0)
assert '[ ]' == bar.bar(12, 9)
assert '[# ]' == bar.bar(12, 10)
assert '[# ]' == bar.bar(12, 15)
assert '[## ]' == bar.bar(12, 20)
as... | {
"repo_name": "Robpol86/etaprogress",
"path": "tests/test_components_bars.py",
"copies": "1",
"size": "1489",
"license": "mit",
"hash": -2058640968037130800,
"line_mean": 29.387755102,
"line_max": 55,
"alpha_frac": 0.4137004701,
"autogenerated": false,
"ratio": 2.9485148514851485,
"config_test"... |
from etaprogress.components.bars import BarUndefinedAnimated, BarUndefinedEmpty
def test_empty(request):
def fin():
BarUndefinedEmpty.CHAR_LEFT_BORDER = '['
BarUndefinedEmpty.CHAR_RIGHT_BORDER = ']'
request.addfinalizer(fin)
bar = BarUndefinedEmpty()
assert '[ ]' == bar.bar(10)... | {
"repo_name": "Robpol86/etaprogress",
"path": "tests/test_components_bars_undefined.py",
"copies": "1",
"size": "2488",
"license": "mit",
"hash": -9103943781390358000,
"line_mean": 31.3116883117,
"line_max": 79,
"alpha_frac": 0.4863344051,
"autogenerated": false,
"ratio": 2.9796407185628744,
"c... |
from etaprogress import eta
def test_one():
eta_instance = eta.ETA(1)
eta._NOW = lambda: 1411868722.680839
eta_instance.set_numerator(1)
assert 1 == eta_instance.denominator
assert eta_instance.eta_epoch is None
assert 0.0 == eta_instance.rate
assert 1 == eta_instance.numerator
assert... | {
"repo_name": "Robpol86/etaprogress",
"path": "tests/test_eta_3_simple.py",
"copies": "1",
"size": "3506",
"license": "mit",
"hash": 3806569661941356000,
"line_mean": 33.0388349515,
"line_max": 54,
"alpha_frac": 0.7065031375,
"autogenerated": false,
"ratio": 3.655891553701773,
"config_test": fa... |
from etc.decorators import PostOnly, AccountRequired
from django.contrib.contenttypes.models import ContentType
from django.shortcuts import redirect, get_object_or_404
from commitment.models import Commitment
from etc.view_helpers import json_error, json_response, render_inclusiontag, render_string
from django.core.ex... | {
"repo_name": "jumoconnect/openjumo",
"path": "jumodjango/commitment/views.py",
"copies": "1",
"size": "2469",
"license": "mit",
"hash": -8395166193930639000,
"line_mean": 38.1904761905,
"line_max": 96,
"alpha_frac": 0.6589712434,
"autogenerated": false,
"ratio": 3.9630818619582664,
"config_tes... |
from etc.furrypoll2015 import models
import csv
import sys
responses = models.Response.objects
results = []
while True:
try:
response = responses.next()
except:
break
if len(response.overview.characters) > 0 and response.sexuality and response.sexuality.dom_or_sub:
character = re... | {
"repo_name": "adjspecies/furrypoll-munger",
"path": "bin/other/species-dom-sub-2015.py",
"copies": "2",
"size": "1273",
"license": "mit",
"hash": -2214193791361014800,
"line_mean": 27.9318181818,
"line_max": 102,
"alpha_frac": 0.5734485467,
"autogenerated": false,
"ratio": 4.00314465408805,
"c... |
from etc.furrypoll2015 import models
results = {}
responses = models.Response.objects
n = 0
while True:
try:
response = responses.next()
except:
break
touchpoints = map(lambda tp: tp.touchpoint_type, response.metadata.touchpoints)
if -3 in touchpoints:
n += 1
if response.se... | {
"repo_name": "adjspecies/furrypoll-munger",
"path": "bin/other/sex-bits-2015.py",
"copies": "2",
"size": "1116",
"license": "mit",
"hash": -5477825191279955000,
"line_mean": 31.8235294118,
"line_max": 98,
"alpha_frac": 0.6218637993,
"autogenerated": false,
"ratio": 4.043478260869565,
"config_t... |
from etc.furrypoll2016 import furrypoll
import csv
import sys
from meta import FIELDNAMES
import logging
class Results2016():
def __init__(self):
self.logger = logging.getLogger(__name__)
def buildResults(self):
self.logger.info('Beginning 2016')
responses = furrypoll.models.Response.... | {
"repo_name": "adjspecies/furrypoll-munger",
"path": "bin/results/results2016.py",
"copies": "2",
"size": "16252",
"license": "mit",
"hash": -8324718501888471000,
"line_mean": 40.1443037975,
"line_max": 80,
"alpha_frac": 0.5593773074,
"autogenerated": false,
"ratio": 3.890830739765382,
"config_... |
from etc.furrypoll2016 import models
import csv
import sys
import datetime
responses = models.Response.objects
results = []
today = datetime.date.today().year + (datetime.date.today().month * (1 / 12))
while True:
try:
response = responses.next()
except:
break
try:
age = int(tod... | {
"repo_name": "makyo/furrypoll-munger",
"path": "bin/other/gender-bits-2016.py",
"copies": "2",
"size": "3068",
"license": "mit",
"hash": 2953503289843645000,
"line_mean": 28.219047619,
"line_max": 77,
"alpha_frac": 0.5612777053,
"autogenerated": false,
"ratio": 3.169421487603306,
"config_test"... |
from etc.furrypoll2016 import models
import csv
import sys
responses = models.Response.objects
results = []
while True:
try:
response = responses.next()
except:
break
if len(response.overview.characters) > 0 and response.sexuality and response.sexuality.dom_or_sub:
character = re... | {
"repo_name": "adjspecies/furrypoll-munger",
"path": "bin/other/species-dom-sub-2016.py",
"copies": "2",
"size": "1273",
"license": "mit",
"hash": -375733818823334700,
"line_mean": 27.9318181818,
"line_max": 102,
"alpha_frac": 0.5734485467,
"autogenerated": false,
"ratio": 4.00314465408805,
"co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.