text
stringlengths
0
1.05M
meta
dict
from factory import Factory import os import configparser Config = Factory.get('Config') class Translation(object): def __init__(self): """ Load language file as well as default file """ self.parser_default = self._load('english') self.parser = self._load(Config.language_f...
{ "repo_name": "f4ble/pyarc", "path": "translation.py", "copies": "2", "size": "1705", "license": "apache-2.0", "hash": -7468263547276883000, "line_mean": 30.5925925926, "line_max": 105, "alpha_frac": 0.5953079179, "autogenerated": false, "ratio": 4.4986807387862795, "config_test": true, "has_...
from .factory import Factory from collections import namedtuple import numpy as np class FactoryJoint(Factory): class Item(Factory.Item): # JointItem does not contain an explicit index; it uses the indices of the children items! @property def i(self): indices = tuple(s.i for ...
{ "repo_name": "bigblindbais/pytk", "path": "src/pytk/factory/joint.py", "copies": "1", "size": "2640", "license": "mit", "hash": -57808970968464670, "line_mean": 32.8461538462, "line_max": 99, "alpha_frac": 0.55, "autogenerated": false, "ratio": 3.987915407854985, "config_test": false, "has_n...
from .factory import Factory class FactoryFilter(Factory): class Item(Factory.Item): @property def i(self): fi = self.fitem.i return self.factory.fitoi(fi) @i.setter def i(self, ii): try: self.fitem.fi = self.factory.itofi(ii) ...
{ "repo_name": "bigblindbais/pytk", "path": "src/pytk/factory/filter.py", "copies": "1", "size": "2782", "license": "mit", "hash": -6008150161439717000, "line_mean": 28.9139784946, "line_max": 79, "alpha_frac": 0.5452911574, "autogenerated": false, "ratio": 3.774762550881954, "config_test": fals...
from factory import Factory, Sequence from inventory.devices.models import * class IpadFactory(Factory): FACTORY_FOR = Ipad name = "iPad" description = 'iPad 4, 16GB, WiFi' status = Device.CHECKED_IN_NOT_READY make = 'PD510LL/A iPad WiFi 16BG / Black' serial_number = Sequence(lambda n: 'DMRJM1...
{ "repo_name": "sloria/device-inventory", "path": "inventory/devices/tests/factories.py", "copies": "1", "size": "1092", "license": "bsd-3-clause", "hash": 1921488951967387100, "line_mean": 28.5405405405, "line_max": 67, "alpha_frac": 0.6355311355, "autogenerated": false, "ratio": 3.52258064516129...
from factory import Factory, Trait from contextlib import contextmanager from threading import local import logging # Registry for all factories factories = {} traits = {} debug = False local = local() # Methods to setup and declare factories @contextmanager def factory(name, collection=None): """Declares a new n...
{ "repo_name": "gamechanger/monufacture", "path": "monufacture/__init__.py", "copies": "1", "size": "3257", "license": "mit", "hash": -2420009749207690000, "line_mean": 29.7264150943, "line_max": 97, "alpha_frac": 0.698188517, "autogenerated": false, "ratio": 4.285526315789474, "config_test": fa...
from factory import Faker, post_generation from factory.django import DjangoModelFactory from django.contrib.auth.models import User, Permission from minicash.utils.factories import FuzzyText class UserFactory(DjangoModelFactory): username = Faker('user_name', locale='en_US') email = Faker('email', locale='e...
{ "repo_name": "BasicWolf/minicash", "path": "src/minicash/auth/tests/factories.py", "copies": "1", "size": "1115", "license": "apache-2.0", "hash": 1818648126151622100, "line_mean": 29.9722222222, "line_max": 86, "alpha_frac": 0.6421524664, "autogenerated": false, "ratio": 4.442231075697211, "c...
from factory import ManifestFactory, Service from factory import PresentationError, MetadataError, ConfigurationError, \ StructuralError, RequirementError, DataError import StringIO import json try: from pyld import jsonld except: jsonld = None class SerializationError(PresentationError): pass def ...
{ "repo_name": "hashimmm/iiifoo", "path": "testutils/presentation_api/implementations/manifest_factory/loader.py", "copies": "1", "size": "12495", "license": "mit", "hash": 8958366535281189000, "line_mean": 36.1875, "line_max": 83, "alpha_frac": 0.4540216086, "autogenerated": false, "ratio": 4.669...
from facts import FactRules from sympy.core.compatibility import cmp class CycleDetected(Exception): """(internal) used to detect cycles when evaluating assumptions through prerequisites """ pass class AssumeMeths(object): """ Define default assumption methods. AssumeMeths should be used...
{ "repo_name": "minrk/sympy", "path": "sympy/core/assumptions.py", "copies": "4", "size": "12183", "license": "bsd-3-clause", "hash": 3286201360744041000, "line_mean": 31.3156498674, "line_max": 81, "alpha_frac": 0.5290158417, "autogenerated": false, "ratio": 4.436635105608158, "config_test": fa...
from facts import FactRules class CycleDetected(Exception): """(internal) used to detect cycles when evaluating assumptions through prerequisites """ pass class AssumeMeths(object): """ Define default assumption methods. AssumeMeths should be used to derive Basic class only. All sym...
{ "repo_name": "tovrstra/sympy", "path": "sympy/core/assumptions.py", "copies": "5", "size": "12016", "license": "bsd-3-clause", "hash": 4210931983141747000, "line_mean": 31.128342246, "line_max": 81, "alpha_frac": 0.5280459387, "autogenerated": false, "ratio": 4.453669384729429, "config_test": ...
from facts_pb2 import TDocument import sys def ReadVarint32(f): offset = 0 result = 0 byte = f.read(1) while byte != "": if 0 == offset: result = ord(byte) & 0x7F else: result = result | ((ord(byte) & 0x7F) << offset) offset += 7 if (ord(byte) ...
{ "repo_name": "victorbocharov/factRuEval-2016-sample", "path": "scripts/parsefacts.py", "copies": "1", "size": "1371", "license": "mit", "hash": 7260400460688795000, "line_mean": 23.4821428571, "line_max": 93, "alpha_frac": 0.4449307075, "autogenerated": false, "ratio": 3.756164383561644, "conf...
from Facturacion.Misc import Config class Bill: def __init__(self, cod_factura, vendedor, cliente, fecha, articulos=None): if articulos is None: articulos = [] self.cod_factura = cod_factura self.vendedor = vendedor self.cliente = cliente self.fecha = fecha ...
{ "repo_name": "IhToN/DAW1-PRG", "path": "Facturacion/Objects/Bill.py", "copies": "1", "size": "1123", "license": "apache-2.0", "hash": -8731877466450937000, "line_mean": 25.7380952381, "line_max": 80, "alpha_frac": 0.5832591273, "autogenerated": false, "ratio": 3.181303116147309, "config_test":...
from factuurData import FactuurData from factuurInputRegel import FactuurInputHeader from factuurRegelList import FactuurRegelList from gui_lib.container import Container from gui_lib.label import Label from gui_lib.button import Button from client_lib.servercall import remote_call, ServerCallException class FactuurIn...
{ "repo_name": "thijsmie/madmin", "path": "factuurinput/factuurInput.py", "copies": "2", "size": "3377", "license": "mit", "hash": 5235764727236739000, "line_mean": 34.1770833333, "line_max": 119, "alpha_frac": 0.6597571809, "autogenerated": false, "ratio": 3.3369565217391304, "config_test": fal...
from factuurInfoBox import FactuurInfoBox from factuurInputRegel import FactuurInputHeader from factuurRegelList import FactuurRegelList from gui_lib.container import Container from gui_lib.label import Label from gui_lib.button import Button from gui_lib.core import unsetCursor from client_lib.servercall import remote...
{ "repo_name": "mrngm/madmin", "path": "factuurbewerk/factuurBewerk.py", "copies": "2", "size": "3121", "license": "mit", "hash": -3468271931562438000, "line_mean": 32.9239130435, "line_max": 94, "alpha_frac": 0.6526754245, "autogenerated": false, "ratio": 3.4221491228070176, "config_test": fals...
from FAdo.fa import * import math class MiniTasksAutomaton(object): _separator_string = " " _negation_string = "not" _anything_string = "anything" _and_string = "and" _or_string = "or" _sigma = [] for i in range(26): _sigma.append(chr(ord('A') + i)) def __init__(self, descrip...
{ "repo_name": "general-ai-challenge/Round1", "path": "src/fsa/__init__.py", "copies": "1", "size": "23932", "license": "bsd-3-clause", "hash": 4686181247118411000, "line_mean": 40.0497427101, "line_max": 132, "alpha_frac": 0.569530336, "autogenerated": false, "ratio": 4.395224977043159, "config...
from fakeclient import FakeCreaterClient from datetime import datetime from oaipmh import metadata registry = metadata.MetadataRegistry() registry.registerReader('oai_dc', metadata.oai_dc_reader) # tied to the server at EUR.. client = FakeCreaterClient( 'http://ep.eur.nl/oai/request', '/home/faassen/tmp/fake3'...
{ "repo_name": "wetneb/pyoai", "path": "src/oaipmh/tests/createbrokendata.py", "copies": "3", "size": "2278", "license": "bsd-3-clause", "hash": 6809773832812393000, "line_mean": 29.7837837838, "line_max": 62, "alpha_frac": 0.7172958736, "autogenerated": false, "ratio": 3.759075907590759, "confi...
from fakeclient import FakeCreaterClient # tied to the server at EUR.. client = FakeCreaterClient( 'http://dspace.ubib.eur.nl/oai/', '/home/faassen/py/oai/tests/fake2') print "GetRecord" header, metadata, about = client.getRecord( metadataPrefix='oai_dc', identifier='hdl:1765/315') print "identifier:", he...
{ "repo_name": "wetneb/pyoai", "path": "src/oaipmh/tests/createdata.py", "copies": "3", "size": "2109", "license": "bsd-3-clause", "hash": -728265642285031200, "line_mean": 30.0147058824, "line_max": 62, "alpha_frac": 0.7150308203, "autogenerated": false, "ratio": 3.7660714285714287, "config_tes...
from .fakedb import List, Todo, list from .app import App from .model import Root @App.json(model=Root) def view_root(self, request): return {"collection": request.link(list)} @App.json(model=List) def view_list(self, request): return {"todos": [request.view(todo) for todo in self.get_all()]} @App.json(mo...
{ "repo_name": "morepath/morepath_cerebral_todomvc", "path": "server/view.py", "copies": "1", "size": "1092", "license": "bsd-3-clause", "hash": 4051401851103854600, "line_mean": 23.2666666667, "line_max": 88, "alpha_frac": 0.6813186813, "autogenerated": false, "ratio": 3.1652173913043478, "conf...
from faker import Factory from faker.providers import BaseProvider from faker.utils.datetime_safe import date, datetime, real_date, real_datetime from faker.providers.date_time import datetime_to_timestamp import random from dateutil import parser from datetime import timedelta import psycopg2 import json import os f...
{ "repo_name": "Cocuyo-Labs-Team/ccytsk", "path": "ccytsk/core/fake/mfaker.py", "copies": "1", "size": "6465", "license": "bsd-3-clause", "hash": -6282198252025794000, "line_mean": 27.8616071429, "line_max": 133, "alpha_frac": 0.6120649652, "autogenerated": false, "ratio": 3.361934477379095, "co...
from faker import Factory from faker.providers import BaseProvider fake = Factory.create('en_GB') class FamilyProvider(BaseProvider): ''' A family and family member Faker provider ''' def family(self, size, inject=None): parents = [ self.family_member(sex='Male'), self.family...
{ "repo_name": "squarenomad/historia", "path": "backend/app/faker.py", "copies": "1", "size": "1911", "license": "mit", "hash": -1238138204399072000, "line_mean": 32.5263157895, "line_max": 59, "alpha_frac": 0.5028780743, "autogenerated": false, "ratio": 4.048728813559322, "config_test": false, ...
from faker import Factory from flask.ext.script import Manager, prompt_bool, Command, Option from .services import create_user, delete_all_users, UserExistsError manager = Manager(usage="Perform Collective Development user operations") @manager.command def create_admin(name='collectivedevelopment', password='collecti...
{ "repo_name": "thermokarst/collective-development", "path": "app/mod_user/manage.py", "copies": "2", "size": "1940", "license": "mit", "hash": 4025140643869886000, "line_mean": 39.4166666667, "line_max": 144, "alpha_frac": 0.7262886598, "autogenerated": false, "ratio": 3.4829443447037702, "conf...
from faker import Factory from gittip import orm from gittip.models.tip import Tip from gittip.models.participant import Participant from gittip.models.elsewhere import Elsewhere from gittip import AMOUNTS import string import random faker = Factory.create() platforms = ['github', 'twitter', 'bitbucket'] def fake_t...
{ "repo_name": "bountysource/www.gittip.com", "path": "gittip/fake_data.py", "copies": "1", "size": "3722", "license": "cc0-1.0", "hash": -6064983859097525000, "line_mean": 24.6689655172, "line_max": 72, "alpha_frac": 0.5961848469, "autogenerated": false, "ratio": 3.681503461918892, "config_test...
from faker import Factory from nose2.tools import such from pretend import stub from pyjoola.client import APITokenAuth with such.A("API authentication backend") as it: @it.should("assign the provided api token to the api_token attribute") def test_should_assign_the_provided_api_token_to_the_api_token_attrib...
{ "repo_name": "joola/joola.io.sdk-python", "path": "tests/unit/test_auth.py", "copies": "1", "size": "1700", "license": "mit", "hash": 4895961868825958000, "line_mean": 29.9090909091, "line_max": 83, "alpha_frac": 0.6617647059, "autogenerated": false, "ratio": 3.7861915367483294, "config_test":...
from faker import Factory from random import random, randint from datetime import date, timedelta import psycopg2 import getpass from decimal import Decimal import bcrypt ff = Factory.create() def generate_users(cursor): min_users = 10 max_users = 100 num_users = randint(min_users, max_users) ofile = open('...
{ "repo_name": "jamesmunns/wate_backend", "path": "prototyping/fill_fake_data.py", "copies": "1", "size": "2083", "license": "mit", "hash": -1709830052143957500, "line_mean": 25.7051282051, "line_max": 144, "alpha_frac": 0.5981757081, "autogenerated": false, "ratio": 3.295886075949367, "config_t...
from faker import Factory fake = Factory.create('pt_BR') class PostmonModelFake(object): """ Represents a fake model in postmon """ def __init__(self, faker): self.faker = faker class Cidade(PostmonModelFake): def __init__(self, faker): super(self.__class__, self).__init__(fake...
{ "repo_name": "IuryAlves/cep-web-service", "path": "cep_web_service/tests/fakedata.py", "copies": "1", "size": "1634", "license": "mit", "hash": -7154099529008022000, "line_mean": 23.0294117647, "line_max": 67, "alpha_frac": 0.6028151775, "autogenerated": false, "ratio": 3.178988326848249, "con...
from faker import Factory from django.core.management.base import BaseCommand from explainers.models import Explainer FAKE = Factory.create() class Command(BaseCommand): help = u'Load fake explainers into the database. For development ONLY.' def handle(self, *args, **kwargs): self.load_fake_explai...
{ "repo_name": "texastribune/txlege84", "path": "txlege84/explainers/management/commands/loadfakeexplainers.py", "copies": "1", "size": "1553", "license": "mit", "hash": 4633904396606957000, "line_mean": 28.8653846154, "line_max": 75, "alpha_frac": 0.5241468126, "autogenerated": false, "ratio": 3....
from faker import Faker fake = Faker() PHONE_NUMBERS = ('+62 812 1272 8059', '+1 (330) 776-8177', '81212728059', ) COUNTRY_CODES = ('USA', 'IDN', 'SIN', ) TOKEN_ID = 'i-am-a-fake-token' # Testing Cards # http://...
{ "repo_name": "derekjamescurtis/veritranspay", "path": "tests/fixtures.py", "copies": "1", "size": "15383", "license": "bsd-3-clause", "hash": -5065044149897205000, "line_mean": 27.0218579235, "line_max": 123, "alpha_frac": 0.500942599, "autogenerated": false, "ratio": 3.102036700947772, "confi...
from faker import Faker from kotti.resources import Document from kotti.resources import File from kotti.resources import Image from kotti.resources import DBSession from kotti.security import Principal from kotti.security import get_principals from kotti.security import set_groups from copy import deepcopy def infin...
{ "repo_name": "Kotti/kotti_contentgenerator", "path": "kotti_contentgenerator/generator.py", "copies": "2", "size": "5138", "license": "bsd-2-clause", "hash": -951370849607135600, "line_mean": 28.6994219653, "line_max": 80, "alpha_frac": 0.5901128844, "autogenerated": false, "ratio": 4.0298039215...
from faker import Faker from mdstudio.unittest.settings import load_settings from mock import mock from db.application import DBComponent from mdstudio.db.connection_type import ConnectionType from mdstudio.deferred.chainable import test_chainable from mdstudio.unittest.api import APITestCase from mdstudio.unittest.db...
{ "repo_name": "MD-Studio/MDStudio", "path": "core/db/db/tests/test_application_authorization.py", "copies": "1", "size": "2656", "license": "apache-2.0", "hash": -798704252977452800, "line_mean": 35.3835616438, "line_max": 115, "alpha_frac": 0.594503012, "autogenerated": false, "ratio": 4.0673813...
from faker import Faker from mock import mock, call from twisted.internet import reactor from logger.application import LoggerComponent from logger.log_repository import LogRepository from mdstudio.api.api_result import APIResult from mdstudio.api.exception import CallException from mdstudio.deferred.chainable import ...
{ "repo_name": "MD-Studio/MDStudio", "path": "core/logger/logger/tests/test_application.py", "copies": "1", "size": "4390", "license": "apache-2.0", "hash": 8011574275374083000, "line_mean": 36.5213675214, "line_max": 109, "alpha_frac": 0.6038724374, "autogenerated": false, "ratio": 3.440438871473...
from faker import Faker from opsy.auth.models import Role, User from opsy.utils import get_valid_permissions def test_user(): test_user = User.create( name='test', full_name='Test User', password='weakpass') test_role = Role.create(name='users') test_role.add_user(test_user) return test_user ...
{ "repo_name": "testeddoughnut/opsy", "path": "tests/data/auth.py", "copies": "1", "size": "1425", "license": "mit", "hash": 8890661669685800000, "line_mean": 25.8867924528, "line_max": 78, "alpha_frac": 0.6407017544, "autogenerated": false, "ratio": 3.45873786407767, "config_test": true, "has...
from faker import Faker from support.assertions import assert_valid_schema from support.helpers import create_new_user from urllib.parse import urljoin def test_user_partial_update(conf, requests_session, headers): # Create a new user user_data = create_new_user(requests_session, conf.getoption("server"), hea...
{ "repo_name": "mozilla/normandy", "path": "contract-tests/v3_api/test_user_partial_update.py", "copies": "1", "size": "1048", "license": "mpl-2.0", "hash": 3115076160447220000, "line_mean": 35.1379310345, "line_max": 86, "alpha_frac": 0.677480916, "autogenerated": false, "ratio": 3.76978417266187...
from faker import Faker from support.assertions import assert_valid_schema from support.helpers import create_new_user from urllib.parse import urljoin def test_user_update(conf, requests_session, headers): # Create a new user user_data = create_new_user(requests_session, conf.getoption("server"), headers) ...
{ "repo_name": "mozilla/normandy", "path": "contract-tests/v3_api/test_user_update.py", "copies": "1", "size": "1148", "license": "mpl-2.0", "hash": 8851837989759416000, "line_mean": 37.2666666667, "line_max": 86, "alpha_frac": 0.6742160279, "autogenerated": false, "ratio": 3.727272727272727, "c...
from faker import Faker from support.assertions import assert_valid_schema from urllib.parse import urljoin def test_user_create(conf, requests_session, headers): # Get a list of groups and grab the ID of the first one response = requests_session.get( urljoin(conf.getoption("server"), "/api/v3/group/"...
{ "repo_name": "mozilla/normandy", "path": "contract-tests/v3_api/test_user_create.py", "copies": "1", "size": "1044", "license": "mpl-2.0", "hash": 1392771762955275300, "line_mean": 36.2857142857, "line_max": 91, "alpha_frac": 0.6494252874, "autogenerated": false, "ratio": 3.676056338028169, "c...
from faker import Faker from pandamonium import pd, np from pandamonium.exceptions import PandamoniumError class DataFrame(object): def __init__(self, length=100, seed=None, language='en_GB'): self.language = language self.length = length self.seed = seed self.columns = {} ...
{ "repo_name": "Ffisegydd/pandamonium", "path": "pandamonium/dataframe.py", "copies": "1", "size": "2498", "license": "mit", "hash": 1410209853846744600, "line_mean": 34.1830985915, "line_max": 125, "alpha_frac": 0.6048839071, "autogenerated": false, "ratio": 3.773413897280967, "config_test": fa...
from faker import Faker class FakerSchema(object): def __init__(self, faker=None, locale=None, providers=None, includes=None): self._faker = faker or Faker(locale=locale, providers=providers, includes=includes) def generate_fake(self, schema, iterations=1): result = [self._generate_one_fake(...
{ "repo_name": "ueg1990/faker-schema", "path": "faker_schema/faker_schema.py", "copies": "1", "size": "1192", "license": "mit", "hash": -5062632975358095000, "line_mean": 36.25, "line_max": 94, "alpha_frac": 0.5973154362, "autogenerated": false, "ratio": 3.973333333333333, "config_test": false, ...
from faker.providers import BaseProvider class ExhibitorProvider(BaseProvider): formats = ( '{{exhibitor_name}} {{company_suffix}}', '{{exhibitor_shortname}} {{company_suffix}}', '{{exhibitor_name}}', ) exhibitor_names = ( ( 'Fun', 'World', 'Reel', 'Royal', 'Vie...
{ "repo_name": "RangerOfFire/faker-cinema", "path": "faker_cinema/exhibitor.py", "copies": "1", "size": "1476", "license": "mit", "hash": -6568563857328569000, "line_mean": 27.9411764706, "line_max": 118, "alpha_frac": 0.566395664, "autogenerated": false, "ratio": 3.481132075471698, "config_test...
from faker.providers import BaseProvider class ScreenProvider(BaseProvider): formats = ( '{{screen_name}} {{screen_number}}', '{{screen_name}} {{screen_number}} ({{screen_suffix}})', ) screen_names = ( 'Screen', 'Theatre', 'Auditorium', ) screen_suffixes = (...
{ "repo_name": "RangerOfFire/faker-cinema", "path": "faker_cinema/screen.py", "copies": "1", "size": "1039", "license": "mit", "hash": 1659835300476722400, "line_mean": 24.975, "line_max": 71, "alpha_frac": 0.5640038499, "autogenerated": false, "ratio": 3.906015037593985, "config_test": false, ...
from faker.utils.checksums import calculate_luhn from .. import Provider as CompanyProvider class Provider(CompanyProvider): formats = ( '{{last_name}} {{company_suffix}}', '{{last_name}}-{{last_name}} {{company_suffix}}', '{{last_name}}, {{last_name}} e {{last_name}} {{company_suffix}}',...
{ "repo_name": "danhuss/faker", "path": "faker/providers/company/it_IT/__init__.py", "copies": "1", "size": "8577", "license": "mit", "hash": 1791882781144523800, "line_mean": 22.7368421053, "line_max": 99, "alpha_frac": 0.4477768701, "autogenerated": false, "ratio": 3.6309322033898304, "config_...
from fakeserver import FakeCreaterServerProxy # tied to the server at EUR.. server = FakeCreaterServerProxy( 'http://dspace.ubib.eur.nl/oai/', '/home/eric/CVS_checkouts/oai/tests/fake2') #deleted record print "GetRecord" header, metadata, about = server.getRecord( metadataPrefix='oai_dc', identifier='hdl:...
{ "repo_name": "xarg/pyoai", "path": "src/oaipmh/tests/createdata_deleted_records.py", "copies": "3", "size": "1364", "license": "bsd-3-clause", "hash": 8428425629125424000, "line_mean": 29.3111111111, "line_max": 65, "alpha_frac": 0.7074780059, "autogenerated": false, "ratio": 3.5245478036175713,...
from fake_switches import switch_configuration from fake_switches.arista import arista_core from fake_switches.brocade import brocade_core from fake_switches.cisco import cisco_core from fake_switches.cisco6500 import cisco_core as cisco6500_core from fake_switches.dell import dell_core from fake_switches.dell10g impor...
{ "repo_name": "internap/fake-switches", "path": "fake_switches/switch_factory.py", "copies": "4", "size": "1990", "license": "apache-2.0", "hash": -8593138254873011000, "line_mean": 35.1818181818, "line_max": 99, "alpha_frac": 0.7045226131, "autogenerated": false, "ratio": 3.3333333333333335, "...
from fake_useragent import UserAgent as FakeUserAgent from scrapy.signals import spider_opened import random import base64 class RotateUserAgentMiddleware(object): use_default_useragent = False @classmethod def from_crawler(cls, crawler): o = cls() crawler.signals.connect(o.spider_opene...
{ "repo_name": "wtrevino/scrapy_rotate", "path": "scrapy_rotate/middleware.py", "copies": "1", "size": "3526", "license": "mit", "hash": 9215781743486214000, "line_mean": 33.9108910891, "line_max": 100, "alpha_frac": 0.6591038003, "autogenerated": false, "ratio": 3.957351290684624, "config_test"...
from faktura import app from flask import render_template, request from faktura.models import db, User from faktura.breadcrumbs import breadcrumbs from flask.ext.login import login_required from passlib.hash import sha256_crypt @app.route("/user/<int:user_id>", methods=["POST", "GET"]) @login_required def user(user_id...
{ "repo_name": "Tethik/faktura", "path": "faktura/user.py", "copies": "1", "size": "1289", "license": "mit", "hash": -6104407012327647000, "line_mean": 43.4482758621, "line_max": 115, "alpha_frac": 0.6276183088, "autogenerated": false, "ratio": 3.8363095238095237, "config_test": false, "has_no...
from faktura import app from flask import request, render_template, redirect, abort from flask.ext.login import LoginManager, login_user, logout_user, login_required, current_user from faktura.models import db, User, TemplateVariable from passlib.hash import sha256_crypt login_manager = LoginManager() login_manager.in...
{ "repo_name": "Tethik/faktura", "path": "faktura/auth.py", "copies": "1", "size": "2994", "license": "mit", "hash": -8392725971299373000, "line_mean": 30.5157894737, "line_max": 141, "alpha_frac": 0.6506346025, "autogenerated": false, "ratio": 3.8335467349551857, "config_test": false, "has_no...
from faktura import app from flask import request, render_template, send_file, redirect, make_response, jsonify from faktura.breadcrumbs import breadcrumbs from faktura.models import db, TemplateVariable, User from flask.ext.login import login_required from faktura.csrf import generate_csrf_token @app.route('/setting...
{ "repo_name": "Tethik/faktura", "path": "faktura/settings.py", "copies": "1", "size": "1422", "license": "mit", "hash": 6355141749435198000, "line_mean": 35.4615384615, "line_max": 115, "alpha_frac": 0.7222222222, "autogenerated": false, "ratio": 3.4514563106796117, "config_test": false, "has...
from faktura import app from flask import request, render_template, send_file, redirect, make_response, jsonify from faktura.models import db, Customer, Invoice from faktura.breadcrumbs import breadcrumbs from flask.ext.login import login_required @app.route('/customer/<int:customer_id>/json') @login_required def json...
{ "repo_name": "Tethik/faktura", "path": "faktura/customer.py", "copies": "1", "size": "2695", "license": "mit", "hash": -2255661501736963300, "line_mean": 39.8333333333, "line_max": 145, "alpha_frac": 0.7124304267, "autogenerated": false, "ratio": 3.5742705570291777, "config_test": false, "ha...
from faktura import app from flask import request, render_template, send_file, redirect, make_response, session from faktura.models import db, Customer, Invoice, InvoiceRow, TemplateVariable from decimal import Decimal from faktura.breadcrumbs import breadcrumbs from datetime import datetime import pdfkit import os fro...
{ "repo_name": "Tethik/faktura", "path": "faktura/invoice.py", "copies": "1", "size": "5525", "license": "mit", "hash": 2617868173654779000, "line_mean": 37.9084507042, "line_max": 168, "alpha_frac": 0.6731221719, "autogenerated": false, "ratio": 3.5439384220654264, "config_test": false, "has_...
from faktura import app from flask_sqlalchemy import SQLAlchemy from datetime import datetime from flask.ext.login import LoginManager, login_user, logout_user, login_required, current_user, UserMixin import uuid db = SQLAlchemy(app) class Customer(db.Model): id = db.Column(db.Integer, primary_key=True) name ...
{ "repo_name": "Tethik/faktura", "path": "faktura/models.py", "copies": "1", "size": "2844", "license": "mit", "hash": 1083728539990877400, "line_mean": 33.265060241, "line_max": 106, "alpha_frac": 0.6399437412, "autogenerated": false, "ratio": 3.357733175914994, "config_test": false, "has_no_...
from fakturo.core.exceptions import CommandNotSupported from fakturo.core.provider import get_provider """ This loads up the Provider which is the implementation of the billing system """ class ProviderManager(object): """ Helper that allows for Commands to "proxy" onto a Provider object """ def __i...
{ "repo_name": "billingstack/python-fakturo", "path": "fakturo/core/provider/manager.py", "copies": "1", "size": "1457", "license": "apache-2.0", "hash": -2319848622123148300, "line_mean": 27.568627451, "line_max": 77, "alpha_frac": 0.6334934798, "autogenerated": false, "ratio": 4.553125, "confi...
from falass import dataformat, job import numpy as np import matplotlib.pyplot as plt class SLD: """SLD profile calculation. This class enables the calculation of the SLD profile for each of the timesteps as defined in the falass.job.Job. Further it will then allow the calculation and plotting of the ave...
{ "repo_name": "arm61/falass", "path": "falass/sld.py", "copies": "1", "size": "7624", "license": "mit", "hash": 6739234634626191000, "line_mean": 44.380952381, "line_max": 128, "alpha_frac": 0.573976915, "autogenerated": false, "ratio": 3.4733485193621867, "config_test": false, "has_no_keywor...
from falcon.http_error import HTTPError from apiRequests.RequestCodes import Code, HTTP_809 class Error(Exception): def __init__(self, code, message): super(Error, self).__init__({'code': code, 'message': message}) # Mongodb's errors 1 - 999 class MongodbConnectionFail(Error): _CODE = 1 _DEFAUL...
{ "repo_name": "telefonicaid/fiware-sinfonier", "path": "sinfonier-backend-api/error/ErrorHandler.py", "copies": "1", "size": "6402", "license": "apache-2.0", "hash": 86119412120434610, "line_mean": 27.8378378378, "line_max": 115, "alpha_frac": 0.6658856607, "autogenerated": false, "ratio": 3.7177...
from falcon import api_helpers as falcon_helpers import falcon class Application(object): def __init__(self, modules=[], *args, **kwargs): self.modules = [] self.middlewares = [] self.wsgi_middlewares = [] self._is_prepared = False self.api = falcon.API() # Insta...
{ "repo_name": "slinghq/sling", "path": "sling/application.py", "copies": "1", "size": "2193", "license": "apache-2.0", "hash": 3174517742276124000, "line_mean": 30.7826086957, "line_max": 86, "alpha_frac": 0.6105791154, "autogenerated": false, "ratio": 3.88141592920354, "config_test": false, ...
from falcon import HTTP_200, HTTP_400, HTTP_404 import hug from PIL import Image import app from app import ( get_excuse_image, _get_text_font, _get_text_x_position, _sanitize_input, _decode_hex, _encode_hex ) def test_excuse__success(): OUTPUT = { 'data': { 'image_url...
{ "repo_name": "mislavcimpersak/xkcd-excuse-generator", "path": "tests/test_function.py", "copies": "1", "size": "6273", "license": "mpl-2.0", "hash": 5756557852178391000, "line_mean": 26.8666666667, "line_max": 127, "alpha_frac": 0.6381180223, "autogenerated": false, "ratio": 2.958942897593204, ...
from falcon import HTTPBadRequest, HTTPInvalidParam class DeserializationError(ValueError): """Raised when error happened during deserialization of representation.""" def __init__( self, missing=None, forbidden=None, invalid=None, failed=None ): """Initialize exception instance.""" ...
{ "repo_name": "swistakm/graceful", "path": "src/graceful/errors.py", "copies": "1", "size": "2510", "license": "bsd-3-clause", "hash": 1116479082575743900, "line_mean": 31.5974025974, "line_max": 78, "alpha_frac": 0.5812749004, "autogenerated": false, "ratio": 5.273109243697479, "config_test": ...
from falcon import HTTPUnauthorized import jwt class JwtChecker: """A middleware for the Falcon web framework. It will verify that a valid, signed jwt is present on requests to any resource, except for the specified exempt routes and the specified exempt methods. """ def __init__(self, secr...
{ "repo_name": "jhildreth/falcon-jwt-checker", "path": "falcon_jwt_checker/falcon_jwt_checker.py", "copies": "1", "size": "2162", "license": "mit", "hash": -5476626074637582000, "line_mean": 33.8709677419, "line_max": 79, "alpha_frac": 0.5559666975, "autogenerated": false, "ratio": 4.3501006036217...
from falcon import testing import hunterprice import falcon import model import json class MyTestCase(testing.TestCase): def setUp(self): super(MyTestCase, self).setUp() self.db_session = model.testing_session() self.usermail = 'a@b.com' self.user = {'name': 'ark', 'password': '12...
{ "repo_name": "arksega/peregrino", "path": "test_hunterprice.py", "copies": "1", "size": "9594", "license": "apache-2.0", "hash": -209957208271015940, "line_mean": 35.6183206107, "line_max": 79, "alpha_frac": 0.5859912445, "autogenerated": false, "ratio": 3.5798507462686566, "config_test": true...
from falcon import testing from example import initialize_app class TestExample(testing.TestCase): def setUp(self): super(TestExample, self).setUp() self.app = initialize_app() def test_gets(self): result = self.simulate_get('/things') self.assertEquals({'Requested_version': ...
{ "repo_name": "FreakinFacu/falcon_versioning", "path": "tests/test_example.py", "copies": "1", "size": "1937", "license": "mit", "hash": -9108583796158512000, "line_mean": 44.0465116279, "line_max": 98, "alpha_frac": 0.6231285493, "autogenerated": false, "ratio": 3.567219152854512, "config_test...
from falcon.routing.compiled import CompiledRouter from falcon_versioning.invalid_version_error import InvalidVersionError from falcon_versioning.version_parsers import parse_api_version_header class VersionedRouter: # Picking something that's not a valid character in the uri path # https://tools.ietf.org/ht...
{ "repo_name": "FreakinFacu/falcon_versioning", "path": "falcon_versioning/versioned_router.py", "copies": "1", "size": "2741", "license": "mit", "hash": 3371492052027022000, "line_mean": 32.8395061728, "line_max": 82, "alpha_frac": 0.644290405, "autogenerated": false, "ratio": 4.178353658536586, ...
from falconswagger.swagger_api import SwaggerAPI from unittest import mock from jsonschema import Draft4Validator from pytest_falcon.plugin import Client import pytest import sqlalchemy as sa import json @pytest.fixture def model1(model_base): class model2(model_base): __tablename__ = 'model2' __t...
{ "repo_name": "dutradda/falcon-swagger", "path": "tests/integration/base/test_swagger_api_integration.py", "copies": "1", "size": "8413", "license": "mit", "hash": 8386968417063406000, "line_mean": 32.9233870968, "line_max": 95, "alpha_frac": 0.4848448829, "autogenerated": false, "ratio": 3.97214...
from fallout_functions import slowWrite from fallout_functions import INPUT_PAUSE from fallout_functions import TYPE_DELAY from fallout_functions import upperInput import curses ######################## global 'constants' ############## ENTRY_1 = 'SET TERMINAL/INQUIRE' ENTRY_2 = 'SET FILE/PROTECTION=OWNER:RWED ACCOU...
{ "repo_name": "J77D/fallout-terminal", "path": "fallout_boot.py", "copies": "1", "size": "2938", "license": "mit", "hash": 9199740426586628000, "line_mean": 26.980952381, "line_max": 79, "alpha_frac": 0.5643294758, "autogenerated": false, "ratio": 3.4605418138987045, "config_test": false, "ha...
from falsy.loader import func try: from celery import chain, chord, group except Exception as e: raise Exception('celery import failed') def load(id, args, error_handler=None): if args and error_handler: return func.load(id).s(args).on_error(func.load(error_handler).s()) if args and not error...
{ "repo_name": "pingf/falsy", "path": "falsy/loader/task.py", "copies": "1", "size": "1056", "license": "mit", "hash": -2641241408512181000, "line_mean": 33.064516129, "line_max": 119, "alpha_frac": 0.6316287879, "autogenerated": false, "ratio": 3.462295081967213, "config_test": false, "has_no...
from fam.blud import GenericObject from fam.fields import * NAMESPACE = "glowinthedark.co.uk/test" class Dog(GenericObject): additional_properties = True sync_gateway_write = True fields = { "name": StringField(), "owner_id": ReferenceTo(NAMESPACE, "person", cascade_delete=True), ...
{ "repo_name": "paulharter/fam", "path": "src/fam/tests/models/test01.py", "copies": "1", "size": "3058", "license": "mit", "hash": -3553016915675780000, "line_mean": 20.2430555556, "line_max": 81, "alpha_frac": 0.5654022237, "autogenerated": false, "ratio": 3.6318289786223277, "config_test": fa...
from fam.blud import GenericObject, StringField, ReferenceFrom, ReferenceTo, BoolField, NumberField, DictField, ObjectField, ListField from fam.acl import CreateRequirement, DeleteRequirement, UpdateRequirement, NO_ONE, ANYONE NAMESPACE = "glowinthedark.co.uk/test" class Bike(GenericObject): fields = { ...
{ "repo_name": "paulharter/fam", "path": "src/fam/tests/models/acl.py", "copies": "1", "size": "1263", "license": "mit", "hash": -6528901370281187000, "line_mean": 23.2884615385, "line_max": 134, "alpha_frac": 0.6199524941, "autogenerated": false, "ratio": 4.035143769968051, "config_test": false...
from fam.blud import GenericObject, StringField, ReferenceTo, BoolField, NumberField, ListField, ReferenceFrom NAMESPACE = "http://glowinthedark.co.uk/test" class Dog(GenericObject): additional_properties = True sync_gateway_write = True fields = { "name": StringField(), "colour": Strin...
{ "repo_name": "paulharter/fam", "path": "src/fam/tests/test_mutation/models/test02.py", "copies": "1", "size": "1894", "license": "mit", "hash": -2110227459582319600, "line_mean": 23.9342105263, "line_max": 110, "alpha_frac": 0.5976768743, "autogenerated": false, "ratio": 3.7430830039525693, "c...
from fam.blud import ReferenceFrom, GenericObject import json class FamDbAuthException(Exception): pass class BaseDatabase(object): FOREIGN_KEY_MAP_STRING = '''function(doc) { var resources = %s; if (resources.indexOf(doc.type) != -1 && doc.namespace == \"%s\"){ emit(doc.%s, null); } }'''...
{ "repo_name": "paulharter/fam", "path": "src/fam/database/base.py", "copies": "1", "size": "1256", "license": "mit", "hash": 9107324974532637000, "line_mean": 26.9111111111, "line_max": 130, "alpha_frac": 0.6321656051, "autogenerated": false, "ratio": 3.6832844574780057, "config_test": false, ...
from familytree import signals from django.db import models from django.db.models import Q from django.db.models.signals import m2m_changed def format_date_location(city=None, state=None, country=None): format_string = '' if city: format_string += ' - %s' % (city) if state: format_string +=...
{ "repo_name": "rocktavious/django-familytree", "path": "familytree/models.py", "copies": "1", "size": "9196", "license": "mit", "hash": 216145361392973000, "line_mean": 35.6414342629, "line_max": 108, "alpha_frac": 0.6317964332, "autogenerated": false, "ratio": 3.5978090766823163, "config_test"...
from fancyimpute import KNN, SimpleFill, IterativeSVD import pandas as pd from sklearn.feature_selection import SelectKBest from sklearn.feature_selection import chi2, f_classif, mutual_info_classif class Preprocessing: """ Contains the functionalities for data standardization, feature selection and missing va...
{ "repo_name": "DEIB-GECO/PyGMQL", "path": "gmql/ml/algorithms/preprocessing.py", "copies": "1", "size": "4867", "license": "apache-2.0", "hash": -5218621182198634000, "line_mean": 37.936, "line_max": 149, "alpha_frac": 0.6396137251, "autogenerated": false, "ratio": 4.1705227077977725, "config_t...
from fancyimpute import NuclearNormMinimization import numpy as np from low_rank_data import XY, XY_incomplete, missing_mask from common import reconstruction_error def create_rank1_data(symmetric=False): """ Returns 5x5 rank1 matrix with missing element at index (1, 2) """ x = np.array([1, 2, 3, 4, ...
{ "repo_name": "iskandr/fancyimpute", "path": "test/test_nuclear_norm_minimization.py", "copies": "2", "size": "1997", "license": "apache-2.0", "hash": -4434408652995749000, "line_mean": 32.8474576271, "line_max": 71, "alpha_frac": 0.6579869805, "autogenerated": false, "ratio": 2.7969187675070026,...
from fancypants import Dataset, Rect, Point # Example: OECD data on broadband subscriber statistics # http://www.guardian.co.uk/news/datablog/2009/may/20/broadband-internetphonesbroadband data = [ ('Australasia', [ ('Australia', 5368000), ('New Zealand', 914961), ]), ('Europe', [ (...
{ "repo_name": "simonwhitaker/fancypants", "path": "python/examples/html/oecd-broadband.py", "copies": "1", "size": "2515", "license": "unlicense", "hash": 7305005602988551000, "line_mean": 28.2558139535, "line_max": 271, "alpha_frac": 0.5371769384, "autogenerated": false, "ratio": 3.1675062972292...
from fancypants.sampling import choice import sys if len(sys.argv) != 2: print "Please run me like:\n\tpython %s file_to_learn_from.txt" % sys.argv[0] context_size = 2 text = open(sys.argv[1], 'rU').read() # split the text up into tokens words = text.lower().split() # set up a dictionary to store things in d = {...
{ "repo_name": "andychisholm/ncss_markov", "path": "counting_ngrams.py", "copies": "1", "size": "1925", "license": "mit", "hash": 7732428206204327000, "line_mean": 31.6271186441, "line_max": 103, "alpha_frac": 0.6722077922, "autogenerated": false, "ratio": 3.48731884057971, "config_test": false,...
from fanfunding.support import run_fan_funding from fanfunding.models import FanFundingEvent from sponsors.support import run_sponsors from sponsors.models import SponsorEvent from streamjar.support import run_streamjar from streamjar.models import StreamjarEvent from streamtip.support import run_streamtip from stre...
{ "repo_name": "google/mirandum", "path": "alerts/main/appconfig.py", "copies": "1", "size": "3418", "license": "apache-2.0", "hash": 8927486982311437000, "line_mean": 25.9133858268, "line_max": 61, "alpha_frac": 0.6202457578, "autogenerated": false, "ratio": 3.4420946626384694, "config_test": f...
from .fangraphs_stats_base import FangraphsStatsBase class FangraphsFieldingStats(FangraphsStatsBase): COMMON = 'c' LINE_BREAK = '-1' NAME = '0' TEAM = '1' SEASON = '2'...
{ "repo_name": "jldbc/pybaseball", "path": "pybaseball/enums/fangraphs/fielding_data_enum.py", "copies": "1", "size": "4344", "license": "mit", "hash": 8007798797032794000, "line_mean": 47.2666666667, "line_max": 70, "alpha_frac": 0.2783149171, "autogenerated": false, "ratio": 3.503225806451613, ...
from fann2 import libfann import pickle import numpy as np # load neural network ann = libfann.neural_net() ann.create_from_file("NN.net") # obvious alpha = 0.5 numWords = 500 # load pickle wordsInOrder = pickle.load( open( "wordsInOrder.p", "rb" ) ) wordProb = pickle.load( open( "wordProbability.p", "rb" ) ) rWord...
{ "repo_name": "yollamttam/WordPrediction", "path": "RunNN.py", "copies": "1", "size": "1115", "license": "apache-2.0", "hash": -6301226734917895000, "line_mean": 21.3, "line_max": 62, "alpha_frac": 0.6412556054, "autogenerated": false, "ratio": 3.1857142857142855, "config_test": false, "has_n...
from fanstatic.compiler import NullCompiler import pkg_resources import threading prepare_lock = threading.Lock() class Registry(dict): ENTRY_POINT = NotImplemented def __init__(self, items=()): for item in items: self.add(item) def add(self, item): self[item.name] = item ...
{ "repo_name": "fanstatic/fanstatic", "path": "fanstatic/registry.py", "copies": "1", "size": "3251", "license": "bsd-3-clause", "hash": 1295585015973207300, "line_mean": 26.0916666667, "line_max": 78, "alpha_frac": 0.6358043679, "autogenerated": false, "ratio": 4.1519795657726695, "config_test"...
from fanstatic.compiler import NullCompiler import pkg_resources class Registry(dict): ENTRY_POINT = NotImplemented def __init__(self, items=()): for item in items: self.add(item) def add(self, item): self[item.name] = item def load_items_from_entry_points(self): ...
{ "repo_name": "fsys/fanstatic", "path": "fanstatic/registry.py", "copies": "1", "size": "2389", "license": "bsd-3-clause", "hash": -556726744970413800, "line_mean": 25.8426966292, "line_max": 78, "alpha_frac": 0.6668061951, "autogenerated": false, "ratio": 3.9750415973377704, "config_test": fal...
from fanstatic.core import Bundle def bundle_resources(resources): """Bundle sorted resources together. resources is expected to be a list previously sorted by sorted_resources. Returns a list of renderable resources, which can include several resources bundled together into Bundles. """ res...
{ "repo_name": "fanstatic/fanstatic", "path": "fanstatic/inclusion.py", "copies": "1", "size": "5357", "license": "bsd-3-clause", "hash": -6952351676368030000, "line_mean": 33.5612903226, "line_max": 78, "alpha_frac": 0.639723726, "autogenerated": false, "ratio": 4.56692242114237, "config_test":...
from fanstatic.core import register_inclusion_renderer from fanstatic import Library, Resource from os.path import isfile from os.path import join import subprocess import shutil import os import logging log = logging.getLogger(__name__) def render_less(url): if url.endswith('.css'): return ('<link rel="s...
{ "repo_name": "fsys/js.lesscss", "path": "js/lesscss/__init__.py", "copies": "1", "size": "3989", "license": "bsd-3-clause", "hash": 6559815073626154000, "line_mean": 30.4094488189, "line_max": 81, "alpha_frac": 0.5442466784, "autogenerated": false, "ratio": 3.876579203109815, "config_test": fa...
from fanstatic import compat import argparse import fanstatic import os.path import time import logging import pkg_resources import setuptools.command.sdist import subprocess import sys import shutil if not hasattr(shutil, 'which'): import shutilwhich from shutil import which mtime = os.path.getmtime logger = l...
{ "repo_name": "fsys/fanstatic", "path": "fanstatic/compiler.py", "copies": "1", "size": "9101", "license": "bsd-3-clause", "hash": -1587224941428865300, "line_mean": 28.1698717949, "line_max": 79, "alpha_frac": 0.6277332161, "autogenerated": false, "ratio": 4.1747706422018345, "config_test": fa...
from fanstatic import compat def _visit(resource, result, dead): if dead[(resource.library, resource.relpath)]: return dead[(resource.library, resource.relpath)] = True for depend in resource.depends: _visit(depend, result, dead) for depend in resource.supersedes: _visit(depend...
{ "repo_name": "fsys/fanstatic", "path": "fanstatic/codegen.py", "copies": "1", "size": "3270", "license": "bsd-3-clause", "hash": 4161702118593653000, "line_mean": 34.9340659341, "line_max": 88, "alpha_frac": 0.593883792, "autogenerated": false, "ratio": 4.2412451361867705, "config_test": false...
from fanstatic import generate_code, Library, Resource def test_generate_source(): foo = Library('foo', '') i1 = Resource(foo, 'i1.js') i2 = Resource(foo, 'i2.js', depends=[i1]) i3 = Resource(foo, 'i3.js', depends=[i2]) i5 = Resource(foo, 'i5.js', depends=[i3]) assert generate_code(i1=i1, i2=...
{ "repo_name": "MiCHiLU/fanstatic-tools", "path": "fanstatic/test_codegen.py", "copies": "2", "size": "2192", "license": "bsd-3-clause", "hash": -3500018281310228000, "line_mean": 30.3142857143, "line_max": 81, "alpha_frac": 0.608120438, "autogenerated": false, "ratio": 2.8066581306017926, "conf...
from fanstatic import Group from fanstatic import Library from fanstatic import Resource from fanstatic.core import render_print_css from js.jquery import jquery from js.momentjs import moment library = Library('js.fullcalendar', 'resources') fullcalendar_css = Resource( library, 'fullcalendar.css', mini...
{ "repo_name": "fanstatic/js.fullcalendar", "path": "js/fullcalendar/__init__.py", "copies": "1", "size": "1718", "license": "bsd-3-clause", "hash": 2194117126243855400, "line_mean": 28.6206896552, "line_max": 72, "alpha_frac": 0.5675203725, "autogenerated": false, "ratio": 2.779935275080906, "c...
from fanstatic import Group from fanstatic import Library from fanstatic import Resource from js.bootstrap import bootstrap_css from js.bootstrap import bootstrap_js from js.jquery import jquery library = Library('bootstrap_image_gallery', 'resources') # CSS blueimp_gallery_css = Resource( library, 'blueimp-g...
{ "repo_name": "fanstatic/js.bootstrap_image_gallery", "path": "js/bootstrap_image_gallery/__init__.py", "copies": "1", "size": "1545", "license": "bsd-3-clause", "hash": -134886228889508540, "line_mean": 34.1136363636, "line_max": 91, "alpha_frac": 0.7443365696, "autogenerated": false, "ratio": 3...
from fanstatic import (init_needed, del_needed, Publisher, get_library_registry, DEFAULT_SIGNATURE, Resource, Library, Group) from flask import Blueprint, g, Markup, current_app, request from werkzeug import cached_property from werkzeug.utils import import_string from werkzeug.wsgi import Dispat...
{ "repo_name": "mgood/flask-fanstatic", "path": "flask_fanstatic.py", "copies": "1", "size": "4346", "license": "bsd-3-clause", "hash": 4339397959241166300, "line_mean": 26.1625, "line_max": 81, "alpha_frac": 0.6635987115, "autogenerated": false, "ratio": 3.8596802841918296, "config_test": true,...
from fanstatic import Library, Group from js.jquery import jquery from js.mochikit import mochikit from js.select2 import select2_de from js.underscore import underscore from js.vanderlee_colorpicker import colorpicker import fanstatic import js.jqueryui import os.path import pkg_resources import sys lib_css = Librar...
{ "repo_name": "ZeitOnline/zeit.cms", "path": "src/zeit/cms/browser/resources.py", "copies": "1", "size": "4573", "license": "bsd-3-clause", "hash": 114267308983269100, "line_mean": 35.0078740157, "line_max": 77, "alpha_frac": 0.7235950142, "autogenerated": false, "ratio": 3.3428362573099415, "c...
from fanstatic import Library, Resource, Group from js.jquery import jquery from js.jqueryui import jqueryui library = Library('jqgrid', 'resources') jqgrid_js = Resource(library, 'js/jquery.jqGrid.src.js', minified='js/jquery.jqGrid.min.js', depends=[jquery, jqueryui]) jqgr...
{ "repo_name": "do3cc/js.jqgrid", "path": "js/jqgrid/__init__.py", "copies": "1", "size": "3072", "license": "bsd-3-clause", "hash": 3093674862368198000, "line_mean": 54.8545454545, "line_max": 75, "alpha_frac": 0.7281901042, "autogenerated": false, "ratio": 2.2309368191721135, "config_test": fa...
from fanstatic import Library, Resource, Group library = Library('css3_github_buttons', 'resources/css3-github-buttons', ignores=('*.txt', '*.md', '*.html', '\.*') ) buttons = Resource...
{ "repo_name": "davidjb/css.css3githubbuttons", "path": "css/css3githubbuttons/__init__.py", "copies": "1", "size": "1199", "license": "bsd-3-clause", "hash": -7122376657010269000, "line_mean": 38.9666666667, "line_max": 86, "alpha_frac": 0.4770642202, "autogenerated": false, "ratio": 4.7019607843...
from fanstatic import Library, Resource, init_needed, bundle_resources, sort_resources from fanstatic import Inclusion from fanstatic.core import Bundle def test_bundle_resources(): foo = Library('foo', '') x1 = Resource(foo, 'a.css') x2 = Resource(foo, 'b.css') x3 = Resource(foo, 'c.css', dont_bundl...
{ "repo_name": "fanstatic/fanstatic", "path": "tests/test_bundle.py", "copies": "1", "size": "2624", "license": "bsd-3-clause", "hash": 1665889301924684000, "line_mean": 35.4444444444, "line_max": 114, "alpha_frac": 0.6398628049, "autogenerated": false, "ratio": 3.0654205607476634, "config_test"...
from fanstatic import Library, Resource, NeededResources, bundle_resources, sort_resources from fanstatic import Inclusion from fanstatic.core import Bundle def test_bundle_resources(): foo = Library('foo', '') x1 = Resource(foo, 'a.css') x2 = Resource(foo, 'b.css') bundle = bundle_resources([x1, x2...
{ "repo_name": "fsys/fanstatic", "path": "tests/test_bundle.py", "copies": "1", "size": "2622", "license": "bsd-3-clause", "hash": -2537165349998233600, "line_mean": 35.9295774648, "line_max": 114, "alpha_frac": 0.6441647597, "autogenerated": false, "ratio": 3.0956316410861864, "config_test": fa...
from fanstatic import Library, Resource, NeededResources from fanstatic.core import bundle_resources, Bundle def test_bundle_resources(): foo = Library('foo', '') x1 = Resource(foo, 'a.css') x2 = Resource(foo, 'b.css') bundle = bundle_resources([x1, x2]) assert len(bundle) == 1 assert isinsta...
{ "repo_name": "MiCHiLU/fanstatic-tools", "path": "fanstatic/test_bundle.py", "copies": "2", "size": "2644", "license": "bsd-3-clause", "hash": 4067542510554786300, "line_mean": 36.2394366197, "line_max": 116, "alpha_frac": 0.6437216339, "autogenerated": false, "ratio": 3.1252955082742315, "conf...
from fanstatic import Library, Resource library = Library('angularjs', 'resources') angular = Resource(library, 'angular.js', minified='angular.min.js') angular_animate = Resource( library, 'angular-animate.js', minified='angular-animate.min.js', depends=[angular]) angular_cookies = Resource( library, 'an...
{ "repo_name": "minddistrict/js.angular", "path": "js/angular/__init__.py", "copies": "1", "size": "10614", "license": "mit", "hash": 3073287808879943000, "line_mean": 12.7131782946, "line_max": 68, "alpha_frac": 0.3532127379, "autogenerated": false, "ratio": 2.285037674919268, "config_test": fa...
from fanstatic import Library, Resource library = Library('angularjs', 'resources') angular = Resource(library, 'angular.js', minified='angular.min.js') angular_bootstrap = Resource(library, 'angular-bootstrap.js', ...
{ "repo_name": "MiCHiLU/js.angular", "path": "js/angular/__init__.py", "copies": "1", "size": "5629", "license": "mit", "hash": -2308606743092435000, "line_mean": 16.4813664596, "line_max": 126, "alpha_frac": 0.3620536507, "autogenerated": false, "ratio": 2.777010360138135, "config_test": false,...
from fanstatic import Library from fanstatic import Resource from fanstatic import Group from js import jqueryui from js.jquery_form import jquery_form from js.jquery import jquery import js.deform def open_layers_lookup(url): return """<script type="text/javascript" src="http://maps.google.com/maps/api/j...
{ "repo_name": "jcu-eresearch/TDH-rich-data-capture", "path": "jcudc24provisioning/resources.py", "copies": "1", "size": "2078", "license": "bsd-3-clause", "hash": -634936931693565400, "line_mean": 21.0888888889, "line_max": 119, "alpha_frac": 0.6650625602, "autogenerated": false, "ratio": 3.16286...
from fantasydota.lib.constants import API_URL from fantasydota.lib.valve_requests import get_league_match_list, get_match_details API_RESULTS_URL = API_URL + "results" BANS = list(range(6) + range(10, 14) + range(18, 20)) STAGE_1_MAX = 9 STAGE_2_MAX = 17 def result_to_points(stage, ban, win): if stage == 1: ...
{ "repo_name": "ThePianoDentist/fantasy-dota-heroes", "path": "fantasydota/lib/match.py", "copies": "1", "size": "2135", "license": "apache-2.0", "hash": 1274114079022651000, "line_mean": 29.0704225352, "line_max": 104, "alpha_frac": 0.5700234192, "autogenerated": false, "ratio": 3.454692556634304...
from fantasydota.lib.constants import DEFAULT_LEAGUE from pyramid.security import authenticated_userid from pyramid.view import view_config from fantasydota import DBSession from fantasydota.lib.general import all_view_wrapper from fantasydota.models import Friend @view_config(route_name='leaderboard', renderer='../...
{ "repo_name": "ThePianoDentist/fantasy-dota-heroes", "path": "fantasydota/views/leaderboard_views.py", "copies": "1", "size": "1303", "license": "apache-2.0", "hash": -4344780700351172000, "line_mean": 41.0322580645, "line_max": 111, "alpha_frac": 0.6792018419, "autogenerated": false, "ratio": 3....
from fantasydota.lib.constants import FESPORT_ACCOUNT from passlib.handlers.bcrypt import bcrypt from sqlalchemy import BigInteger from sqlalchemy import ( Column, Integer, Sequence, String, Date, func, Boolean, ForeignKey) from sqlalchemy import DateTime from sqlalchemy import UniqueConstra...
{ "repo_name": "ThePianoDentist/fantasy-dota-heroes", "path": "fantasydota/models.py", "copies": "1", "size": "3655", "license": "apache-2.0", "hash": -2502984312032856000, "line_mean": 35.1881188119, "line_max": 129, "alpha_frac": 0.6708618331, "autogenerated": false, "ratio": 3.8352570828961174,...
from fantasydota.lib.general import all_view_wrapper from fantasydota.models import ( DBSession, Friend, User) from pyramid.httpexceptions import ( HTTPForbidden) from pyramid.security import ( authenticated_userid) from pyramid.view import ( view_config, ) from sqlalchemy import and_ @view_config...
{ "repo_name": "ThePianoDentist/fantasy-dota-heroes", "path": "fantasydota/views/views.py", "copies": "1", "size": "1966", "license": "apache-2.0", "hash": -2486236713734580700, "line_mean": 30.2063492063, "line_max": 106, "alpha_frac": 0.6749745677, "autogenerated": false, "ratio": 3.485815602836...
from fantasy_footbot.entities.player import Player def rach_rank(player: Player, prev_season_name="2017/18", games_per_season=38): print(player) # undesirable statuses are s, i, d - suspended, injured, d... dead??? # a = available if player.status != 'a': return 0.0 # ignore any player ac...
{ "repo_name": "rachel-sharp/fantasy-scout", "path": "fantasy_footbot/ranking_functions/rach_rank.py", "copies": "1", "size": "1258", "license": "mit", "hash": 1561200127073535000, "line_mean": 36, "line_max": 113, "alpha_frac": 0.6406995231, "autogenerated": false, "ratio": 3.543661971830986, "...
from fantasy_sport import FantasySport from yahoo_oauth import OAuth1 from fantasy_sport.utils import pretty_json, pretty_xml import json import datetime # Inputs gameID = 346 leagueID = 1328 teamID = 12 playerID = 8781 input_date = '2015-09-08' ### new_optimal_lineup = {} ineligible = set() #Make ranking of positio...
{ "repo_name": "unpairestgood/yahoo-fantasy-sport", "path": "optimize_lineup.py", "copies": "1", "size": "8510", "license": "mit", "hash": 8605447342315352000, "line_mean": 30.8764044944, "line_max": 146, "alpha_frac": 0.5888366627, "autogenerated": false, "ratio": 3.548790658882402, "config_tes...
from fantasyx import app, db_session, engine from fantasyx.models import DraftHistory, DraftTicket, User, Episode, Character from fantasyx.game import generate_score import csv episodes = [ 'S07E01', 'S07E02', 'S07E03', 'S07E04', ] for episode in episodes: with open('fantasyx/data/episode_scores/%...
{ "repo_name": "emlprime/fantasyx", "path": "check_scores.py", "copies": "1", "size": "1327", "license": "mit", "hash": 4551822236303796700, "line_mean": 31.3658536585, "line_max": 109, "alpha_frac": 0.6073850791, "autogenerated": false, "ratio": 3.4829396325459316, "config_test": false, "has_...
from faps.draw_fathers import draw_fathers import numpy as np import faps as fp def test_draw_fathers(): np.random.seed(867) allele_freqs = np.random.uniform(0.3,0.5,50) adults = fp.make_parents(100, allele_freqs, family_name='a') progeny = fp.make_sibships(adults, 0, [1,2,3], 5, 'x') mothers = adu...
{ "repo_name": "ellisztamas/faps", "path": "tests/test_draw_fathers.py", "copies": "1", "size": "1703", "license": "mit", "hash": -4901931735587292000, "line_mean": 31.7692307692, "line_max": 93, "alpha_frac": 0.6447445684, "autogenerated": false, "ratio": 2.8430717863105177, "config_test": fals...
from faps.genotypeArray import genotypeArray from faps.alogsumexp import alogsumexp import numpy as np from warnings import warn class paternityArray(object): """ Likelihoods of that any of a set of candidate males is the true father of each offspring individual, assuming the mother is known. Call the wrap...
{ "repo_name": "ellisztamas/faps", "path": "faps/paternityArray.py", "copies": "1", "size": "17789", "license": "mit", "hash": 4625961686993251000, "line_mean": 44.3801020408, "line_max": 196, "alpha_frac": 0.6116701332, "autogenerated": false, "ratio": 4.159223754968436, "config_test": false, ...