text
stringlengths
0
1.05M
meta
dict
from fixture.orm import ORMFixture from model.group import Group db = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="root") try: l = db.get_contacts_not_in_group(Group(id='185')) for item in l: print(item) print(len(l)) finally: pass # db.destroy() # import mysql....
{ "repo_name": "posypaylo/python_training", "path": "check_db_connection.py", "copies": "1", "size": "1190", "license": "apache-2.0", "hash": 9161437094835141000, "line_mean": 21.4716981132, "line_max": 110, "alpha_frac": 0.625210084, "autogenerated": false, "ratio": 3.020304568527919, "config_t...
from fixtures.constants import * from sqlalchemy import Integer, Column, Numeric, String from sqlalchemy import create_engine, MetaData, Table from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base from collections import Counter, defaultdict import argparse import os import jso...
{ "repo_name": "ChrisCintron/text-sentiment", "path": "text_sentiment/app.py", "copies": "1", "size": "7263", "license": "unlicense", "hash": -4000581696379262000, "line_mean": 36.828125, "line_max": 115, "alpha_frac": 0.6048464822, "autogenerated": false, "ratio": 4.053013392857143, "config_tes...
from fixture.session import SessionHelper from fixture.group import GroupHelper from fixture.contact import UserHelper from selenium import webdriver class Application: def __init__(self, browser, base_url): if browser == "firefox": self.wd = webdriver.Firefox() elif browser == "chrom...
{ "repo_name": "ManiKarnika/python_automation", "path": "fixture/application.py", "copies": "1", "size": "1135", "license": "apache-2.0", "hash": -1640595388039591200, "line_mean": 28.1025641026, "line_max": 107, "alpha_frac": 0.5823788546, "autogenerated": false, "ratio": 4.053571428571429, "co...
from fixture.session import SessionHelper from fixture.group import GroupHelper from selenium import webdriver class Application: def __init__(self, browser, base_url): if browser == "firefox": self.wd = webdriver.Firefox() elif browser == "chrome": sel...
{ "repo_name": "esemin83/python_training", "path": "fixture/application.py", "copies": "1", "size": "1029", "license": "apache-2.0", "hash": 7660767707714060000, "line_mean": 28.4, "line_max": 69, "alpha_frac": 0.5053449951, "autogenerated": false, "ratio": 4.741935483870968, "config_test": fals...
from fixture.session import SessionHelper from fixture.project import Project from fixture.james import James from selenium import webdriver from fixture.singup import SingupHelper from fixture.mail import MailHelper from fixture.soap import SoapHelper class Application: def __init__(self, browser, config): ...
{ "repo_name": "esemin83/python_training_mantis", "path": "fixture/application.py", "copies": "1", "size": "1422", "license": "apache-2.0", "hash": 6475150281267891000, "line_mean": 30.6, "line_max": 69, "alpha_frac": 0.5407876231, "autogenerated": false, "ratio": 4.5, "config_test": false, "h...
from .fixtures import BING_MAPS_KEY, parametrize from bingmaps.apiservices import ElevationsApi DATA = [ {'method': 'List', 'points': [15.5467, 34.5676], 'key': BING_MAPS_KEY }, {'method': 'Polyline', 'points': [35.89431, -110.72522, 35.89393, -110.72578], 'samples': 10, 'key': BI...
{ "repo_name": "bharadwajyarlagadda/bingmaps", "path": "tests/test_elevations_query_url.py", "copies": "1", "size": "2433", "license": "mit", "hash": 9050289528577954000, "line_mean": 33.2676056338, "line_max": 70, "alpha_frac": 0.6366625565, "autogenerated": false, "ratio": 2.4801223241590216, ...
from .fixtures import BING_MAPS_KEY, parametrize from bingmaps.urls import Coordinates, Polyline, Offset, BoundingBox DATA = [ {'method': 'List', 'points': [15.5467, 34.5676], 'key': BING_MAPS_KEY }, {'key': BING_MAPS_KEY}, {'method': 'List', 'points': [15.5423, ], 'key': BING_MAPS...
{ "repo_name": "bharadwajyarlagadda/bingmaps", "path": "tests/test_elevations_query_string.py", "copies": "1", "size": "4024", "license": "mit", "hash": -5515097013533005000, "line_mean": 26.5616438356, "line_max": 79, "alpha_frac": 0.6105864811, "autogenerated": false, "ratio": 2.9138305575669805...
from .fixtures import centos from . import path_params import pytest class TestRpm: @pytest.mark.parametrize("path", path_params(centos.pkgfiles_all)) def test_pkgfiles_all(self, analyzed_data, path): result = analyzed_data("rpm") pkgs = result["image"]["imagedata"]["analysis_report"]["package...
{ "repo_name": "anchore/anchore-engine", "path": "tests/functional/clients/standalone/package_list/test_centos.py", "copies": "1", "size": "1228", "license": "apache-2.0", "hash": 5632239583680452000, "line_mean": 33.1111111111, "line_max": 79, "alpha_frac": 0.5871335505, "autogenerated": false, "...
from fixtures import GaeTestCase from gutter.client.models import Switch from gutter.client import arguments from gutter.appengine.forms import SwitchForm from gutter.appengine import registry class User(arguments.Container): nickname = arguments.String(lambda self: self.input.nickname()) email = arguments....
{ "repo_name": "soofaloofa/gutter-appengine", "path": "tests/test_forms.py", "copies": "1", "size": "3061", "license": "mit", "hash": 4828360548149869000, "line_mean": 33.393258427, "line_max": 70, "alpha_frac": 0.6269193074, "autogenerated": false, "ratio": 4.239612188365651, "config_test": tru...
from ._fixtures import _GenericBackendTest, _GenericMutexTest from . import eq_, assert_raises_message from unittest import TestCase from threading import Thread import time import os from nose import SkipTest from dogpile.core.readwrite_lock import ReadWriteMutex from dogpile.cache.backends.file import AbstractFileLoc...
{ "repo_name": "thruflo/dogpile.cache", "path": "tests/cache/test_dbm_backend.py", "copies": "1", "size": "2803", "license": "bsd-3-clause", "hash": 5822112727664170000, "line_mean": 23.1637931034, "line_max": 61, "alpha_frac": 0.5815198002, "autogenerated": false, "ratio": 3.914804469273743, "c...
from fixtures import MonkeyPatch class FakeThreads(MonkeyPatch): def __init__(self): super(FakeThreads, self).__init__("threading.Thread", self) self._threads = [] self._hang = False def hang(self, flag=True): self._hang = flag def __getitem__(self, index): retur...
{ "repo_name": "debian-python/systemfixtures", "path": "systemfixtures/threads.py", "copies": "1", "size": "1735", "license": "mit", "hash": -3899555872440534000, "line_mean": 28.406779661, "line_max": 79, "alpha_frac": 0.5682997118, "autogenerated": false, "ratio": 4.252450980392157, "config_te...
from fixtures import * import fixtures import argparse class FixtureError(ValueError): pass def _available_fixtures(): fix = [f for f in dir(fixtures) if not f.startswith("_")] fix.sort() return fix def list_fixtures(opts): fix = _available_fixtures() msg = "Listing available fixtures:" ...
{ "repo_name": "ggerrietts/leadpipe", "path": "util/load_fixture.py", "copies": "1", "size": "1471", "license": "apache-2.0", "hash": -1938271261005134000, "line_mean": 29.0204081633, "line_max": 116, "alpha_frac": 0.645139361, "autogenerated": false, "ratio": 3.801033591731266, "config_test": f...
from fixtures import * import warnings def test_createModel(blank_model): assert isinstance(blank_model, LcoptModel) assert blank_model.name == MODEL_NAME def test_createForwastModel(forwast_model): assert isinstance(forwast_model, LcoptModel) assert forwast_model.name == MODEL_NAME def test_cr...
{ "repo_name": "pjamesjoyce/lcopt", "path": "tests/test_model.py", "copies": "1", "size": "7381", "license": "bsd-3-clause", "hash": -6128106484105638000, "line_mean": 27.83203125, "line_max": 125, "alpha_frac": 0.6904213521, "autogenerated": false, "ratio": 3.3383084577114426, "config_test": tr...
from .fixtures import * def test_regex_operator(backend, small_test_data): backend.filter(Actor, {}).delete() marlon_brando = Actor({'name': 'Marlon Brando', 'gross_income_m': 1.453, 'appearances': 78, 'is_funny': False, 'birth_year': 1924}) marlon_wayans = Actor({'name': 'Marlon Wayans'}) backend.sa...
{ "repo_name": "orgkhnargh/blitzdb", "path": "blitzdb/tests/test_query_operators.py", "copies": "5", "size": "22230", "license": "mit", "hash": -4391899061421996500, "line_mean": 42.0813953488, "line_max": 178, "alpha_frac": 0.6384615385, "autogenerated": false, "ratio": 3.0410396716826265, "con...
from .fixtures import ( parametrize, create_tmp_dir, https_protocol, BING_MAPS_KEY ) import json import os from bingmaps.apiservices import LocationByPoint DATA = [ { 'point': '16.506174,80.648015', 'includeEntityTypes': 'address', 'key': BING_MAPS_KEY }, { '...
{ "repo_name": "bharadwajyarlagadda/bingmaps", "path": "tests/test_location_by_point_get_data.py", "copies": "1", "size": "3162", "license": "mit", "hash": -2297312608784357600, "line_mean": 21.5857142857, "line_max": 66, "alpha_frac": 0.555028463, "autogenerated": false, "ratio": 2.92506938020351...
from .fixtures import ( parametrize, https_protocol, create_tmp_dir, BING_MAPS_KEY ) import json import os from bingmaps.apiservices import LocationByQuery DATA = [ { 'q': '8672 Eagle Road Teaneck, NJ 07666', 'key': BING_MAPS_KEY }, { 'q': '7266 Canterbury Court Oshk...
{ "repo_name": "bharadwajyarlagadda/bingmaps", "path": "tests/test_location_by_query_get_data.py", "copies": "1", "size": "2446", "license": "mit", "hash": -5807229032869665000, "line_mean": 19.905982906, "line_max": 66, "alpha_frac": 0.5310711365, "autogenerated": false, "ratio": 2.79862700228832...
from .fixtures import parametrize, BING_MAPS_KEY from bingmaps.apiservices import TrafficIncidentsApi DATA = [ {'mapArea': [16.5467, 26.4367, 17.4367, 27.4356], 'includeLocationCodes': 'true', 'severity': [2, 4], 'type': [2, 3], 'key': BING_MAPS_KEY} ] EXPECTED = [ 'http://dev.virtualeart...
{ "repo_name": "bharadwajyarlagadda/bingmaps", "path": "tests/test_traffic_query_url.py", "copies": "1", "size": "1085", "license": "mit", "hash": -2975690472335080400, "line_mean": 30.9117647059, "line_max": 79, "alpha_frac": 0.6857142857, "autogenerated": false, "ratio": 2.6856435643564356, "c...
from .fixtures import parametrize from bingmaps.urls import TrafficIncidentsSchema DATA = [ {'mapArea': [1, 2, 3, 4], 'includeLocationCodes': 'true', 'severity': [2, 4], 'type': [2, 3], 'key': 'abs'}, {'includeLocationCodes': 'true', 'severity': [2, 4], 'type': [2, 3]} ] EXPECTED...
{ "repo_name": "bharadwajyarlagadda/bingmaps", "path": "tests/test_traffic_query_string.py", "copies": "1", "size": "1075", "license": "mit", "hash": -6919276192302202000, "line_mean": 25.875, "line_max": 58, "alpha_frac": 0.6474418605, "autogenerated": false, "ratio": 3.1524926686217007, "confi...
from fixtures import pdt2, multi_volume def test_split_echoes(pdt2): echo1, echo2 = pdt2.split_echoes() assert echo1.pixels.shape == (50, 240, 240) assert echo2.pixels.shape == (50, 240, 240) echo1_times = [s.echo_time for s in echo1.header.slices] assert all([x == 0.018888 for x in echo1_times]) ...
{ "repo_name": "jstutters/PyUNC", "path": "tests/test_split.py", "copies": "1", "size": "1041", "license": "mit", "hash": -6287591305497635000, "line_mean": 39.0384615385, "line_max": 65, "alpha_frac": 0.6657060519, "autogenerated": false, "ratio": 2.828804347826087, "config_test": false, "has...
from fixture.TestBase import BaseClass from selenium.webdriver.firefox.webdriver import WebDriver from fixture.variables import UserLogin from tests_contract.contract_lib import ContractBase class Group: def __init__(self, group_name='', group_header='', group_footer=''): self.group_name = group_name ...
{ "repo_name": "werbk/task-2.3", "path": "tests_group/group_lib.py", "copies": "1", "size": "1779", "license": "apache-2.0", "hash": 8244021950300758000, "line_mean": 38.5333333333, "line_max": 83, "alpha_frac": 0.6475548061, "autogenerated": false, "ratio": 3.421153846153846, "config_test": fal...
from fixture.TestBase import BaseClass from selenium.webdriver.firefox.webdriver import WebDriver class Contract: def __init__(self, first_name=None, middle_name=None, last_name=None, nickname=None, title=None, company_name=None, address_name=None, home=None, mobile=None, work=None, fax=None, ema...
{ "repo_name": "werbk/task-2.3", "path": "tests_contract/contract_lib.py", "copies": "1", "size": "7123", "license": "apache-2.0", "hash": -8144645597090015000, "line_mean": 43.8050314465, "line_max": 119, "alpha_frac": 0.5958163695, "autogenerated": false, "ratio": 3.3551577955723033, "config_t...
from fixture.variables import UserLogin from functools import wraps from fixture.variables import Profinity from sys import maxsize import re def connection(fn): @wraps(fn) def wrapper(app): app.session.login(UserLogin.name, UserLogin.password) try: fn(app) finally: ...
{ "repo_name": "werbk/python_for_homework", "path": "tests_contract/contract_lib.py", "copies": "3", "size": "17992", "license": "apache-2.0", "hash": -7096704696900576000, "line_mean": 43.2088452088, "line_max": 121, "alpha_frac": 0.5306247221, "autogenerated": false, "ratio": 3.6591417531014847,...
from fixture.variables import UserLogin from functools import wraps from fixture.variables import Profinity from sys import maxsize def connection(fn): @wraps(fn) def wrapper(app): app.session.login(UserLogin.name, UserLogin.password) try: fn(app) finally: app.s...
{ "repo_name": "werbk/task-4.11", "path": "tests_contract/contract_lib.py", "copies": "1", "size": "10205", "license": "apache-2.0", "hash": 8785179406334936000, "line_mean": 40.4837398374, "line_max": 125, "alpha_frac": 0.579421852, "autogenerated": false, "ratio": 3.5201793721973096, "config_t...
from fixture.variables import UserLogin from functools import wraps from fixture.variables import Profinity def connection(fn): @wraps(fn) def wrapper(app): app.session.login(UserLogin.name, UserLogin.password) try: fn(app) finally: app.session.logout() ret...
{ "repo_name": "werbk/task--3-10", "path": "tests_contract/contract_lib.py", "copies": "1", "size": "8232", "license": "apache-2.0", "hash": -7575000977642315000, "line_mean": 42.0994764398, "line_max": 119, "alpha_frac": 0.5846695821, "autogenerated": false, "ratio": 3.4925753075943997, "config...
from fixture.variables import UserLogin from functools import wraps def connection(fn): @wraps(fn) def wrapper(app): app.session.login(UserLogin.name, UserLogin.password) try: fn(app) finally: app.session.logout() return wrapper class Contract: def __...
{ "repo_name": "werbk/task-2.2", "path": "tests_contract/contract_lib.py", "copies": "1", "size": "6977", "license": "apache-2.0", "hash": 4286328710778532400, "line_mean": 44.3116883117, "line_max": 119, "alpha_frac": 0.5829152931, "autogenerated": false, "ratio": 3.4420325604341393, "config_te...
from fixures import * from django.core import mail from django.conf import settings CLIENT_NAME = "Joe" CLIENT_EMAIL = "joe@doe.com" EXPERT_NAME = "Miguel" EXPERT_EMAIL = "miguel@hoe.com" MR_WOLF_EMAIL = "mrwolf@jonnyibiza.com" MR_WOLF_EMAIL_DEST = "support@jonnyibiza.com" EXPERT_PHONE_NO = "+15005550012" CLIENT_ID = ...
{ "repo_name": "popara/jonny-api", "path": "notifications/tests.py", "copies": "1", "size": "3835", "license": "mit", "hash": 2224722104944770300, "line_mean": 23.4267515924, "line_max": 56, "alpha_frac": 0.6054758801, "autogenerated": false, "ratio": 2.747134670487106, "config_test": true, "h...
from fizzbuzzapi import api, factor from flask.ext.restful import Resource import re class FizzBuzz(Resource): def get(self, low=False, high=False): number_re = re.compile('^\d+$') # if not number_re.match(str(low)) or not number_re.match(str(high)): # return False, 400 if l...
{ "repo_name": "mrcrilly/fizzbuzz-api", "path": "fizzbuzzapi/endpoints.py", "copies": "1", "size": "1199", "license": "mit", "hash": -4690881812736690000, "line_mean": 27.5714285714, "line_max": 92, "alpha_frac": 0.4904086739, "autogenerated": false, "ratio": 3.9701986754966887, "config_test": f...
from fizzbuzz import fizzbuzz import pytest def test_fizzbuzz_2_9(): assert fizzbuzz(9, 2, 9) == 'buzz' assert fizzbuzz(17, 2, 9) == 17 assert fizzbuzz(18, 2, 9) == 'fizzbuzz' assert fizzbuzz(19, 2, 9) == 19 assert fizzbuzz(20, 2, 9) == 'fizz' def test_fizzbuzz_divzero(): assert fizzbuzz(20, 0, 9) == 'e...
{ "repo_name": "cromambo/pythonIntro", "path": "fizzbuzz/test_fizzbuzz.py", "copies": "1", "size": "1436", "license": "apache-2.0", "hash": -8596418552332378000, "line_mean": 30.2391304348, "line_max": 70, "alpha_frac": 0.6044568245, "autogenerated": false, "ratio": 2.2793650793650793, "config_t...
from fizzbuzz.models import FizzBuzz from fizzbuzz.serializers import FizzBuzzSerializer from rest_framework import generics from rest_framework.response import Response from rest_framework import status class FizzBuzzList(generics.ListCreateAPIView): queryset = FizzBuzz.objects.all() serializer_class = FizzB...
{ "repo_name": "feydan/django-rest-framework-fizzbuzz", "path": "fizzbuzz/views.py", "copies": "1", "size": "1354", "license": "apache-2.0", "hash": -2715945457896854000, "line_mean": 35.6216216216, "line_max": 78, "alpha_frac": 0.723042836, "autogenerated": false, "ratio": 3.8140845070422533, "...
from fjagepy import * from fjagepy import Message as _Message from fjagepy import MessageClass as _MessageClass from fjagepy import Performative as _Performative from fjagepy import Services as _Services from fjagepy import Gateway from fjagepy import AgentID as _AgentID from types import MethodType as _mt from warning...
{ "repo_name": "org-arl/unet-contrib", "path": "unetsocket/python/unetpy/__init__.py", "copies": "1", "size": "18787", "license": "bsd-3-clause", "hash": -2922635937168788000, "line_mean": 42.1885057471, "line_max": 111, "alpha_frac": 0.6452866344, "autogenerated": false, "ratio": 3.80149736948603...
from fjord.base.middleware import MOBILE_COOKIE from fjord.base.tests import LocalizingClient, reverse from fjord.search.tests import ElasticTestCase # This is an ElasticTestCase instead of a normal one because the front # page (which this queries) uses ElasticSearch. Being an # ElasticTestCase makes sure that the t...
{ "repo_name": "staranjeet/fjord", "path": "fjord/base/tests/test_templates.py", "copies": "1", "size": "1697", "license": "bsd-3-clause", "hash": -6335659269530206000, "line_mean": 35.1063829787, "line_max": 70, "alpha_frac": 0.6682380672, "autogenerated": false, "ratio": 4.2109181141439205, "c...
from fjord.base.tests import eq_ from fjord.feedback.models import ResponseMappingType from fjord.feedback.tests import ResponseFactory from fjord.search.index import get_index from fjord.search.models import Record from fjord.search.tasks import index_chunk_task from fjord.search.tests import RecordFactory, ElasticTes...
{ "repo_name": "rlr/fjord", "path": "fjord/search/tests/test_tasks.py", "copies": "1", "size": "1455", "license": "bsd-3-clause", "hash": 1085982466903227900, "line_mean": 36.3076923077, "line_max": 70, "alpha_frac": 0.6900343643, "autogenerated": false, "ratio": 3.88, "config_test": true, "ha...
from fjord.base.tests import eq_, reverse, TestCase from fjord.redirector import get_redirectors from fjord.redirector.base import build_redirect_url from fjord.redirector.providers.dummy import DummyRedirector from fjord.redirector.tests import RedirectorTestMixin class DummyRedirectorLoadingTestCase(RedirectorTestM...
{ "repo_name": "rlr/fjord", "path": "fjord/redirector/tests/test_dummy.py", "copies": "1", "size": "1394", "license": "bsd-3-clause", "hash": 1789072160885030000, "line_mean": 32.1904761905, "line_max": 68, "alpha_frac": 0.6721664275, "autogenerated": false, "ratio": 3.583547557840617, "config_t...
from fjord.base.tests import ( AnalyzerProfileFactory, LocalizingClient, reverse, TestCase ) from fjord.heartbeat.api_views import log_error from fjord.heartbeat.tests import AnswerFactory, SurveyFactory class TestHeartbeatHBData(TestCase): client_class = LocalizingClient def test_permissions...
{ "repo_name": "mozilla/fjord", "path": "fjord/heartbeat/tests/test_analyzer_views.py", "copies": "2", "size": "4030", "license": "bsd-3-clause", "hash": 8291350749851845000, "line_mean": 29.3007518797, "line_max": 79, "alpha_frac": 0.6213399504, "autogenerated": false, "ratio": 3.8712776176753123...
from fjord.base.tests import ( LocalizingClient, reverse, TestCase, ) from fjord.feedback.tests import ResponseFactory from fjord.redirector import build_redirect_url from fjord.redirector.tests import RedirectorTestMixin from fjord.suggest.providers.trigger.provider import ( format_redirect, interp...
{ "repo_name": "hoosteeno/fjord", "path": "fjord/suggest/providers/trigger/tests/test_provider.py", "copies": "3", "size": "7702", "license": "bsd-3-clause", "hash": -9168884554518915000, "line_mean": 29.3228346457, "line_max": 78, "alpha_frac": 0.5307712283, "autogenerated": false, "ratio": 3.903...
from fjord.feedback.models import ResponseDocType from fjord.feedback.tests import ResponseFactory from fjord.search.index import chunked, get_doctypes from fjord.search.tests import ElasticTestCase def test_chunked(): # chunking nothing yields nothing. assert list(chunked([], 1)) == [] # chunking list w...
{ "repo_name": "mozilla/fjord", "path": "fjord/search/tests/test_index.py", "copies": "3", "size": "1235", "license": "bsd-3-clause", "hash": -7921492305748875000, "line_mean": 29.1219512195, "line_max": 74, "alpha_frac": 0.6356275304, "autogenerated": false, "ratio": 3.4887005649717513, "config...
from fjord.feedback.models import ResponseDocType from fjord.feedback.tests import ResponseFactory from fjord.search.index import get_index_name from fjord.search.models import Record from fjord.search.tasks import index_chunk_task from fjord.search.tests import RecordFactory, ElasticTestCase from fjord.search.utils im...
{ "repo_name": "staranjeet/fjord", "path": "fjord/search/tests/test_tasks.py", "copies": "1", "size": "1440", "license": "bsd-3-clause", "hash": -989880681069572500, "line_mean": 35, "line_max": 73, "alpha_frac": 0.6763888889, "autogenerated": false, "ratio": 3.9344262295081966, "config_test": t...
from fjord.translations.exceptions import NoSuchSystem def translate(instance, system, src_lang, src_field, dst_lang, dst_field): """Translates specified field using specified system :arg instance: A model instance with fields to be translated :arg system: The name of the system to be used to do the tran...
{ "repo_name": "hoosteeno/fjord", "path": "fjord/translations/utils.py", "copies": "4", "size": "1936", "license": "bsd-3-clause", "hash": -7530803633268335000, "line_mean": 37.72, "line_max": 78, "alpha_frac": 0.7226239669, "autogenerated": false, "ratio": 4.460829493087558, "config_test": fals...
from flag_bearer.config import Config from argparse import Namespace def test_load(): c = Config.load(noflagrc=True) assert c.get('iscore', 'api_version') == 'v1' assert c.get('iscore', 'base_url') == 'https://iscore.iseage.org' def test_merge(): c = Config.load(noflagrc=True) args = Namespace(...
{ "repo_name": "ISEAGE-ISU/flag-bearer", "path": "tests/test_config.py", "copies": "1", "size": "1658", "license": "mit", "hash": 1881821252361516300, "line_mean": 29.7037037037, "line_max": 97, "alpha_frac": 0.6773220748, "autogenerated": false, "ratio": 3.093283582089552, "config_test": true, ...
from .flag import FlagMetaclass from .value import ZERO from .tags import has_tag, get_tag class Filter(object, metaclass=FlagMetaclass): flags = [] def __init__(self, predicate): self.predicate = predicate def __call__(self, *args): return self.predicate(*args) def __and__(self, ot...
{ "repo_name": "pcapriotti/pledger", "path": "pledger/filter.py", "copies": "1", "size": "3011", "license": "mit", "hash": 3721321055061562000, "line_mean": 23.088, "line_max": 70, "alpha_frac": 0.5831949518, "autogenerated": false, "ratio": 4.217086834733894, "config_test": false, "has_no_key...
from .flag import Flag class UnknownTag(Flag): """ Defines a mult-value unrecognized tag object These are special tag objects that represent an unexpected or unknown tag. They are added automatically when attempting to access a tag that was not initialized. These tags cannot be required and w...
{ "repo_name": "aurule/npc", "path": "npc/character/tags/unknown_tag.py", "copies": "1", "size": "2952", "license": "mit", "hash": 9040268414817373000, "line_mean": 35, "line_max": 128, "alpha_frac": 0.5914634146, "autogenerated": false, "ratio": 4.670886075949367, "config_test": false, "has_n...
from .flag import make_flag, FlagMapper FACILITY_NULL = make_flag("FACILITY_NULL", 0) FACILITY_RPC = make_flag("FACILITY_RPC", 1) FACILITY_DISPATCH = make_flag("FACILITY_DISPATCH", 2) FACILITY_STORAGE = make_flag("FACILITY_STORAGE", 3) FACILITY_ITF = make_flag("FACILITY_ITF", 4) FACILITY_WIN32 = make_flag("FACI...
{ "repo_name": "hakril/PythonForWindows", "path": "windows/generated_def/winerror.py", "copies": "1", "size": "570899", "license": "bsd-3-clause", "hash": 4362887873010230300, "line_mean": 80.8350261172, "line_max": 170, "alpha_frac": 0.7456134973, "autogenerated": false, "ratio": 2.46591596261165...
from ..flags import * from ..setops import asymmetric_difference_ from .utils import * def test_asymmetric_difference_with_data(): a = make_indexset([0, 1, 3, 4, 5, 6, 7]) a_data = make_data([na, -3, -6, na, -9, na, 1]) # Overlap | | | | b = make_indexset( ...
{ "repo_name": "mvsaha/blahb", "path": "blahb/test/test_adiff.py", "copies": "1", "size": "2265", "license": "mit", "hash": 8768935955404620000, "line_mean": 31.8405797101, "line_max": 71, "alpha_frac": 0.4896247241, "autogenerated": false, "ratio": 2.8419071518193224, "config_test": false, "h...
from ..flags import * if BACKEND_FLAGS.HAS_PROTO: from . import ChainProto def get_protobuf_numbering_scheme(numbering_scheme): """ Returns ChainProto field value of a given numbering scheme Args: numbering_scheme: Returns: """ if numbering_scheme == NUMBERING_FLAGS.KABAT: ...
{ "repo_name": "gf712/AbPyTools", "path": "abpytools/core/formats/utils.py", "copies": "1", "size": "1484", "license": "mit", "hash": -8405564799606235000, "line_mean": 31.9777777778, "line_max": 115, "alpha_frac": 0.6967654987, "autogenerated": false, "ratio": 3.71, "config_test": false, "has...
#from .flags_structure import dgraphFlags class dgraphFlags(): @classmethod def query(cls, *args, **kwargs): self = dgraphQueryFlags(*args, **kwargs) return self @classmethod def init(cls, *args, **kwargs): self = dgraphInitFlags(*args, **kwargs) return self #ClassQueries class dgraphQueryFlags(): def __...
{ "repo_name": "SpreadPost/pydgraphORM", "path": "pydgraphORM/structure/flags_structure.py", "copies": "1", "size": "4544", "license": "apache-2.0", "hash": 3923556338309821000, "line_mean": 27.5849056604, "line_max": 137, "alpha_frac": 0.6188380282, "autogenerated": false, "ratio": 2.899808551372...
from flair.data import TaggedCorpus, Sentence from flair.data_fetcher import NLPTaskDataFetcher, NLPTask from flair.embeddings import TokenEmbeddings, WordEmbeddings, StackedEmbeddings, FlairEmbeddings from typing import List from flair.models import SequenceTagger from torch.optim.adam import Adam columns = {0: 'text...
{ "repo_name": "Bilingual-Annotation-Task-Force/Scripts", "path": "train_flair_POS.py", "copies": "2", "size": "2075", "license": "mit", "hash": -4124831847560811000, "line_mean": 33.0163934426, "line_max": 102, "alpha_frac": 0.6612048193, "autogenerated": false, "ratio": 3.4128289473684212, "co...
from flake8_class_newline import new_line_checker from unittest import TestCase class TestChecks(TestCase): def check_file(self, lines, filename): errors = [] for line_number, line in enumerate(lines): errors.append( list( new_line_checker( ...
{ "repo_name": "AlexanderVanEck/flake8-class-newline", "path": "tests/test_checks.py", "copies": "1", "size": "3202", "license": "mit", "hash": 4283152436444431000, "line_mean": 30.0873786408, "line_max": 77, "alpha_frac": 0.4172392255, "autogenerated": false, "ratio": 4.4908835904628335, "confi...
from flake8_class_newline.__version__ import __version__ new_lines_on = {} DOUBLE_QUOTE = '"' SINGLE_QUOTE = "'" CLASS = 'class' METHOD = 'def ' DECORATOR = '@' def new_line_checker(logical_line, line_number, filename): if filename not in new_lines_on: new_lines_on[filename] = [] if logical_line.st...
{ "repo_name": "AlexanderVanEck/flake8-class-newline", "path": "flake8_class_newline/__init__.py", "copies": "1", "size": "1259", "license": "mit", "hash": 8032523898889693000, "line_mean": 32.1315789474, "line_max": 77, "alpha_frac": 0.6552819698, "autogenerated": false, "ratio": 3.65988372093023...
from flake8_commas import CommaChecker import os from unittest import TestCase class TestChecks(TestCase): def test_get_noqa_lines(self): checker = CommaChecker(None, filename=get_absolute_path('data/no_qa.py')) self.assertEqual(checker.get_noqa_lines(checker.get_file_contents()), [2]) class Com...
{ "repo_name": "srusskih/flake8-commas", "path": "test/test_checks.py", "copies": "1", "size": "2123", "license": "mit", "hash": 3689441515959647000, "line_mean": 46.1777777778, "line_max": 101, "alpha_frac": 0.6801695714, "autogenerated": false, "ratio": 3.491776315789474, "config_test": true, ...
from flake8.formatting import base from flake8_truveris import ( inline_comments, trailing_commas, ) error_modules = { "T568": { "module": inline_comments, "line_adjustment": 1, }, "T812": { "module": trailing_commas, "line_adjustment": 0, }, } class FormatTru...
{ "repo_name": "truveris/flake8-truveris", "path": "flake8_truveris/format_truveris.py", "copies": "1", "size": "1715", "license": "mit", "hash": 2515702913653347300, "line_mean": 27.5833333333, "line_max": 78, "alpha_frac": 0.532361516, "autogenerated": false, "ratio": 4.025821596244131, "confi...
from flake8 import engine, util, __version__ import pep8 import unittest import mock class TestEngine(unittest.TestCase): def setUp(self): self.patches = {} def tearDown(self): assert len(self.patches.items()) == 0 def start_patch(self, patch): self.patches[patch] = mock.patch(pa...
{ "repo_name": "apporc/flake8", "path": "flake8/tests/test_engine.py", "copies": "3", "size": "2976", "license": "mit", "hash": 5078185949156500000, "line_mean": 35.7407407407, "line_max": 82, "alpha_frac": 0.5887096774, "autogenerated": false, "ratio": 3.7528373266078185, "config_test": true, ...
from flaky import flaky from slm_lab.experiment.control import Trial from slm_lab.experiment.monitor import InfoSpace from slm_lab.lib import util from slm_lab.spec import spec_util import os import pandas as pd import pytest import sys # helper method to run all tests in test_spec def run_trial_test(spec_file, spec_...
{ "repo_name": "kengz/Unity-Lab", "path": "test/spec/test_spec.py", "copies": "1", "size": "8182", "license": "mit", "hash": 1721130875872328400, "line_mean": 36.0226244344, "line_max": 82, "alpha_frac": 0.6888291371, "autogenerated": false, "ratio": 2.803014731072285, "config_test": true, "ha...
from flaky import flaky import pytest from time import sleep import capybara from capybara.exceptions import WindowError from capybara.window import Window from capybara.tests.assertions import assert_windows_open @pytest.mark.requires("windows") class TestWindowOpenedBy: @pytest.fixture(autouse=True) def s...
{ "repo_name": "elliterate/capybara.py", "path": "capybara/tests/session/window/test_window_opened_by.py", "copies": "1", "size": "2906", "license": "mit", "hash": -5721813040967932000, "line_mean": 38.8082191781, "line_max": 87, "alpha_frac": 0.659669649, "autogenerated": false, "ratio": 3.673830...
from flaky import flaky import tensorflow as tf from tensorflow.contrib.rnn import LSTMCell from numpy.testing import assert_allclose import numpy as np from duplicate_questions.util.switchable_dropout_wrapper import SwitchableDropoutWrapper from ..common.test_case import DuplicateTestCase class TestUtilsSwitchableD...
{ "repo_name": "nelson-liu/paraphrase-id-tensorflow", "path": "tests/util/test_switchable_dropout_wrapper.py", "copies": "1", "size": "5831", "license": "mit", "hash": 7144771540127876000, "line_mean": 49.7043478261, "line_max": 90, "alpha_frac": 0.4407477277, "autogenerated": false, "ratio": 3.76...
from flaky import flaky from web3.utils.threads import ( Timeout, ) @flaky(max_runs=3) def test_sync_filter_against_latest_blocks(web3, sleep_interval, wait_for_block, skip_if_testrpc): skip_if_testrpc(web3) seen_blocks = [] txn_filter = web3.eth.filter("latest") current_block = web3.eth.blockN...
{ "repo_name": "pipermerriam/web3.py", "path": "tests/core/filtering/test_filter_against_latest_blocks.py", "copies": "1", "size": "1446", "license": "mit", "hash": 1463743735217605000, "line_mean": 25.7777777778, "line_max": 99, "alpha_frac": 0.6597510373, "autogenerated": false, "ratio": 3.12987...
from flaky import flaky import deepchem as dc from deepchem.models.optimizers import Adam, PolynomialDecay from tensorflow.keras.layers import Input, Dense, GRU, Reshape, Softmax import numpy as np import tensorflow as tf import unittest import pytest class TestA2C(unittest.TestCase): @flaky def test_roulette(s...
{ "repo_name": "miaecle/deepchem", "path": "deepchem/rl/tests/test_a2c.py", "copies": "1", "size": "10461", "license": "mit", "hash": -5474976406122245000, "line_mean": 31.690625, "line_max": 99, "alpha_frac": 0.603575184, "autogenerated": false, "ratio": 3.566655301738834, "config_test": true, ...
from flaky.names import FlakyNames def _true(*args): """ Default rerun filter function that always returns True. """ # pylint:disable=unused-argument return True class FilterWrapper: """ Filter function wrapper. Expected to be called as though it's a filter function. Since @flaky add...
{ "repo_name": "box/flaky", "path": "flaky/defaults.py", "copies": "1", "size": "1791", "license": "apache-2.0", "hash": 8212924420611843000, "line_mean": 28.3606557377, "line_max": 80, "alpha_frac": 0.6359575656, "autogenerated": false, "ratio": 3.6776180698151952, "config_test": false, "has_...
from flame_math.matrix import Matrix from flame_math.vector import Vector from flame_math import vector from itertools import izip class SquareMatrix(Matrix): """ This matrix class represent a squared matrix """ def __init__(self, size=4, data=None, identity = True): Matrix.__init__(self,siz...
{ "repo_name": "giordi91/flame_math", "path": "square_matrix.py", "copies": "1", "size": "19077", "license": "mit", "hash": -5548030493461651000, "line_mean": 30.1715686275, "line_max": 101, "alpha_frac": 0.53855428, "autogenerated": false, "ratio": 4.276395427034298, "config_test": false, "ha...
#from flam import * from aspects import * from features import * from elixir import * class Page(Entity): name = Field(Unicode(128), primary_key=True) text = Field(Text, required=True) author = ManyToOne('Author', required=True) attachments = OneToMany('Attachment') class Attachment(Entity): fil...
{ "repo_name": "nullice/flam", "path": "random/mock5.py", "copies": "3", "size": "2505", "license": "bsd-3-clause", "hash": -4509149001736708600, "line_mean": 33.3150684932, "line_max": 80, "alpha_frac": 0.6954091816, "autogenerated": false, "ratio": 4.053398058252427, "config_test": false, "h...
from flam import * # context_factory is an object with callable attributes used to construct the # real context. # # context_factory.req = ... """ Decorators provided by flam: accept(mime_type) route(path, endpoint, methods) template(template) resource(model) unpack_form(schema) unpack_query(schema) """ class Pat...
{ "repo_name": "alecthomas/flam", "path": "random/u.py", "copies": "3", "size": "3535", "license": "bsd-3-clause", "hash": 8264211072371659000, "line_mean": 28.7058823529, "line_max": 83, "alpha_frac": 0.6455445545, "autogenerated": false, "ratio": 3.724973656480506, "config_test": false, "has...
from flam import * """ Operations: CREATE: 0. (for HTML only) Render form. 2. Validate data. 3. Create resource. READ: 1. Convert data into rendered form. UPDATE: 0. (for HTLM only) Render form. 1. Validate data. 2. Update resource. DELETE: 0. (for HTML only) Render confirmation for...
{ "repo_name": "nullice/flam", "path": "random/mock2.py", "copies": "3", "size": "2131", "license": "bsd-3-clause", "hash": -1064696047547567500, "line_mean": 22.6777777778, "line_max": 79, "alpha_frac": 0.6025340216, "autogenerated": false, "ratio": 3.5398671096345513, "config_test": false, "...
from flango import database # class Post_Tag_Relate(database.Model): # # """ # Many to many relationship test. # """ # id = database.PrimaryKeyField() # my_post_id = database.ForeignKeyField('my_post') # tag_id = database.ForeignKeyField('tag') # # def __repr__(self): # return '<Re...
{ "repo_name": "hziling/flango", "path": "tests/orm/models.py", "copies": "1", "size": "1172", "license": "mit", "hash": -2182461970034371600, "line_mean": 23.4375, "line_max": 97, "alpha_frac": 0.6322525597, "autogenerated": false, "ratio": 3.4985074626865673, "config_test": false, "has_no_ke...
from flapp.pmath.rect import Rect from flapp.pmath.vec2 import Vec2 class BaseTileDisplayObject: def __init__(self, screenRect, fullRect, absRect, zoom=(4,4), pos=None, size=None, blend=False, cropRect=None): self.screenRect = screenRect self.fullRect = fullRect self.absRect = absRect ...
{ "repo_name": "rpwagner/tiled-display", "path": "flTile/baseTileDisplayObject.py", "copies": "1", "size": "4782", "license": "apache-2.0", "hash": -2265425224916628700, "line_mean": 39.5254237288, "line_max": 145, "alpha_frac": 0.6365537432, "autogenerated": false, "ratio": 3.3231410701876305, ...
from flapp.pmath.vec2 import Vec2 from flapp.pmath.rect import Rect from glUtils import glTxtrBox import copy import traceback class BaseObject: # other things don't need to inherit this, but # need to have similar functions. def __init__(self): self.pos = Vec2(0.0,0.0) def setPos(self, x, y...
{ "repo_name": "rpwagner/tiled-display", "path": "flTile/groupObject.py", "copies": "1", "size": "4355", "license": "apache-2.0", "hash": -3105778166968376000, "line_mean": 31.9924242424, "line_max": 98, "alpha_frac": 0.5777267509, "autogenerated": false, "ratio": 3.9844464775846293, "config_tes...
from flapp.RuleSystem.ruleSystem import Trigger class TriggerWhenKeyPressed(Trigger): def __init__(self, key): self.name = "KeyPress_" + str(key) class TriggerWhenKeyReleased(Trigger): def __init__(self, key): self.name = "KeyRelease_" + str(key) class TriggerWhenAnyKeyPressed(Trigger): d...
{ "repo_name": "rpwagner/tiled-display", "path": "flapp/RuleSystem/triggers.py", "copies": "1", "size": "1075", "license": "apache-2.0", "hash": 7641797164492065000, "line_mean": 24.5952380952, "line_max": 51, "alpha_frac": 0.6623255814, "autogenerated": false, "ratio": 3.5130718954248366, "conf...
from flapp.texture import Texture, EasyTexture from flapp.pmath.vec2 import Vec2 from flapp.pmath.rect import Rect from OpenGL.GL import GL_MAX_TEXTURE_SIZE, glGetInteger from baseTileDisplayObject import BaseTileDisplayObject import traceback def GetMaxTextureSize(): maxTxtrSize = glGetInteger(GL_MAX_TEXTURE_SIZ...
{ "repo_name": "rpwagner/tiled-display", "path": "flTile/glUtils.py", "copies": "1", "size": "10800", "license": "apache-2.0", "hash": 2305033648850586000, "line_mean": 41.6877470356, "line_max": 225, "alpha_frac": 0.6290740741, "autogenerated": false, "ratio": 3.517915309446254, "config_test": ...
from flaptor.indextank.rpc import Indexer, Searcher, Suggestor, Storage, LogWriter, WorkerManager,\ DeployManager, Controller, FrontendManager from flaptor.indextank.rpc.ttypes import NebuException, IndextankException ''' =========================== THRIFT STUFF =========================== '''...
{ "repo_name": "linkedin/indextank-service", "path": "backoffice/api_linked_rpc.py", "copies": "3", "size": "5895", "license": "apache-2.0", "hash": 4343900378904495600, "line_mean": 33.8816568047, "line_max": 99, "alpha_frac": 0.6759966073, "autogenerated": false, "ratio": 4.113747383112352, "c...
from flasgger import Swagger from functools import wraps from flask import Flask, jsonify, request, render_template, flash, redirect, url_for, session from passlib.hash import sha256_crypt from wtforms import Form, StringField, PasswordField, validators from flask_cors import CORS from ..manager.models import AppUser f...
{ "repo_name": "LeKono/pyhgnc", "path": "src/pyhgnc/webserver/web.py", "copies": "1", "size": "32239", "license": "apache-2.0", "hash": -4005815483202275300, "line_mean": 23.8565921357, "line_max": 120, "alpha_frac": 0.5844474084, "autogenerated": false, "ratio": 3.8384331468031907, "config_test...
from .flashcard_construction import get_direction, get_option_set from collections import defaultdict from proso.django.request import get_time, is_time_overridden from proso.list import flatten from proso.models.context import selected_item_context from proso_common.models import get_config from proso_flashcards.model...
{ "repo_name": "adaptive-learning/proso-apps", "path": "proso_flashcards/json_enrich.py", "copies": "1", "size": "6496", "license": "mit", "hash": 8669031068515817000, "line_mean": 51.8130081301, "line_max": 192, "alpha_frac": 0.6665640394, "autogenerated": false, "ratio": 3.761436016213086, "co...
from flashcards.models import * from flashcards.db_interactions import * from random import shuffle from random import randint from random import choice from json import dumps #This is the amount of difficulties available NUMBOXES = 5 class engine: """ Class for producing a spaced repetition algorithm ...
{ "repo_name": "latreides/SE_Team3", "path": "flashcards/play.py", "copies": "1", "size": "4074", "license": "mit", "hash": -9214395461256693000, "line_mean": 30.3384615385, "line_max": 86, "alpha_frac": 0.5549828179, "autogenerated": false, "ratio": 4.1827515400410675, "config_test": false, "...
from flash.display import DisplayObject, Sprite from flash.text import TextField from flash.text import TextFormat from flash.display import StageAlign from flash.events import Event, IEventDispatcher from flash.utils import Dictionary from unittest import Test, Failure, Reporter from string import repr, format CONST1...
{ "repo_name": "tailhook/pyzza", "path": "test/testpy.py", "copies": "1", "size": "32674", "license": "mit", "hash": -258541759002953280, "line_mean": 29.2257169288, "line_max": 81, "alpha_frac": 0.5065189447, "autogenerated": false, "ratio": 3.607994699646643, "config_test": true, "has_no_key...
from flash.display import Sprite from flash.display import StageAlign, StageScaleMode from flash.events import Event, KeyboardEvent from flash.text import TextField from flash.utils import getTimer from flash.geom import Matrix from flash.display import GradientType, SpreadMethod from game import Frame, Keys from layou...
{ "repo_name": "tailhook/pyzza", "path": "examples/arkanoid/main.py", "copies": "1", "size": "9220", "license": "mit", "hash": 3429420215603192300, "line_mean": 31.4647887324, "line_max": 79, "alpha_frac": 0.5454446855, "autogenerated": false, "ratio": 3.5003796507213365, "config_test": false, ...
from flash.display import Sprite, Shape as BaseShape from flash.events import Event from flash.display import StageAlign, StageScaleMode from string import repr @package('layout') class WidgetConflict(Error): def __init__(self, message): super().__init__(message) @package('layout') class Rect: __slots...
{ "repo_name": "tailhook/pyzza", "path": "lib/layout/base.py", "copies": "1", "size": "8685", "license": "mit", "hash": -2991836656607723000, "line_mean": 32.92578125, "line_max": 87, "alpha_frac": 0.4854346575, "autogenerated": false, "ratio": 3.3793774319066148, "config_test": false, "has_no...
from flash.events import Event, KeyboardEvent from flash.utils import getTimer from flash.text import TextField @package('game') class Keys: stage = None keys = None keycodes = None LEFT = '37' UP = '38' RIGHT = '39' DOWN = '40' F1 = '112' F2 = '113' F3 = '114' F4 = '115' ...
{ "repo_name": "tailhook/pyzza", "path": "lib/game.py", "copies": "1", "size": "3143", "license": "mit", "hash": -4415314701668714000, "line_mean": 24.3467741935, "line_max": 77, "alpha_frac": 0.5692013999, "autogenerated": false, "ratio": 3.6504065040650406, "config_test": false, "has_no_keyw...
from flashget.page import Page, log from flashget.stream import extract_stream from flashget.url import UrlMgr from flashget.helper import textextract, textextractall import re import json class Kinox(Page): eregex = '^(https?://)?(www\.)?kinox\.to/.*' ename = 'anime-loads' name = 'kinox.to' url = 'ht...
{ "repo_name": "balrok/Flashget", "path": "flashget/pages/kinox.py", "copies": "1", "size": "8064", "license": "mit", "hash": -7353457437085730000, "line_mean": 36.5069767442, "line_max": 116, "alpha_frac": 0.4956597222, "autogenerated": false, "ratio": 4.091324200913242, "config_test": false, ...
from flashget.page import Page, log from flashget.url import UrlMgr from flashget.helper import textextract from lxml import html from lxml import etree import re class AnimeLoads(Page): eregex = r'.*anime-loads.org/media/.*' ename = 'anime-loads' name = 'anime-loads' url = 'http://anime-loads.org' ...
{ "repo_name": "balrok/Flashget", "path": "flashget/pages/animeloads.py", "copies": "1", "size": "6482", "license": "mit", "hash": -218699971738809600, "line_mean": 44.6478873239, "line_max": 132, "alpha_frac": 0.4489355137, "autogenerated": false, "ratio": 4.9632465543644715, "config_test": fal...
from flashget.page import Page, log from flashget.url import UrlMgr from flashget.helper import textextract, textextractall from lxml import html import re class EliteAnimes(Page): eregex = r'^(http://)?(www\.)?eliteanimes\.com/.+$' ename = 'EliteAnimes_s' name = 'Eliteanimes' url = 'http://www.elitea...
{ "repo_name": "balrok/Flashget", "path": "flashget/pages/eliteanimes.py", "copies": "1", "size": "3540", "license": "mit", "hash": 3680273352737782000, "line_mean": 37.4782608696, "line_max": 127, "alpha_frac": 0.5446327684, "autogenerated": false, "ratio": 3.852013057671382, "config_test": fal...
from flashlight import * from level import * from math import * import ctypes import json def quit_game(): pygame.quit() sys.exit() class KeyChecker(): def __init__(self): self.input_event = None self.data = None self.position = (0, 0) self.pressed_buttons = [0, 0, 0] ...
{ "repo_name": "cs-hse-projects/Plat", "path": "event_checker.py", "copies": "1", "size": "3003", "license": "mit", "hash": 6200578862884949000, "line_mean": 32.3666666667, "line_max": 112, "alpha_frac": 0.5537795538, "autogenerated": false, "ratio": 3.528789659224442, "config_test": false, "h...
from flash.models import Collection, Users_Collections, Course_Map, Course from django_auth_lti import const import datetime import logging import urlparse log = logging.getLogger(__name__) class LTIService: ''' This class provides services for when the tool is running as an LTI tool in the context of a ...
{ "repo_name": "Harvard-ATG/HarvardCards", "path": "flash/lti_service.py", "copies": "1", "size": "8342", "license": "bsd-3-clause", "hash": 1884879082408209700, "line_mean": 38.7238095238, "line_max": 157, "alpha_frac": 0.6388156317, "autogenerated": false, "ratio": 4.164752870693959, "config_t...
from FlashSession import * from psychopy.hardware.emulator import launchScan from psychopy import core # Kill all background processes (macOS only) try: import appnope appnope.nope() except: pass # Kill Finder during execution (this will be fun) applescript="\'tell application \"Finder\" to quit\'" shellC...
{ "repo_name": "StevenM1/flashtask", "path": "run_practice.py", "copies": "1", "size": "1688", "license": "mit", "hash": 4436272679622975500, "line_mean": 29.7090909091, "line_max": 118, "alpha_frac": 0.6273696682, "autogenerated": false, "ratio": 3.5240083507306887, "config_test": false, "has...
from FlashSession import * from psychopy import core # Kill all background processes (macOS only) try: import appnope appnope.nope() except: pass try: # Kill Finder during execution (this will be fun) applescript="\'tell application \"Finder\" to quit\'" shellCmd = 'osascript -e '+ applescript...
{ "repo_name": "StevenM1/flashtask", "path": "run_experiment.py", "copies": "1", "size": "5244", "license": "mit", "hash": -4045744098980393000, "line_mean": 38.4285714286, "line_max": 119, "alpha_frac": 0.5455758963, "autogenerated": false, "ratio": 3.7890173410404624, "config_test": false, "...
from flash.text.engine import (TextElement, ElementFormat, FontDescription, TextBlock) from graph import Colors @package('graph') class Drawer: def __init__(self, graph, sprite): self.graph = graph self.sprite = sprite self.canvas = sprite.graphics def color(self, value): i...
{ "repo_name": "tailhook/pyzza", "path": "examples/graph/draw.py", "copies": "1", "size": "3721", "license": "mit", "hash": 1975104919733242600, "line_mean": 35.4803921569, "line_max": 76, "alpha_frac": 0.5622144585, "autogenerated": false, "ratio": 3.1994840928632846, "config_test": false, "h...
from flashtext import KeywordProcessor import logging import unittest import json import re logger = logging.getLogger(__name__) class TestKeywordReplacer(unittest.TestCase): def setUp(self): logger.info("Starting...") with open('test/keyword_extractor_test_cases.json') as f: self.tes...
{ "repo_name": "vi3k6i5/flashtext", "path": "test/test_replacer.py", "copies": "1", "size": "1935", "license": "mit", "hash": -924041672384752400, "line_mean": 40.170212766, "line_max": 111, "alpha_frac": 0.6103359173, "autogenerated": false, "ratio": 4.243421052631579, "config_test": true, "h...
from flashtext import KeywordProcessor import logging import unittest import json logger = logging.getLogger(__name__) class TestFileLoad(unittest.TestCase): def setUp(self): logger.info("Starting...") def tearDown(self): logger.info("Ending.") def test_file_format_one(self): ke...
{ "repo_name": "vi3k6i5/flashtext", "path": "test/test_file_load.py", "copies": "1", "size": "1591", "license": "mit", "hash": 2902874564707035000, "line_mean": 39.7948717949, "line_max": 79, "alpha_frac": 0.6587052168, "autogenerated": false, "ratio": 4.545714285714285, "config_test": true, "...
from flashtext import KeywordProcessor import logging import unittest logger = logging.getLogger(__name__) class TestExtractFuzzy(unittest.TestCase): def setUp(self): logger.info("Starting...") def tearDown(self): logger.info("Ending.") def test_extract_deletion(self): """ ...
{ "repo_name": "vi3k6i5/flashtext", "path": "test/test_extract_fuzzy.py", "copies": "1", "size": "6869", "license": "mit", "hash": 5112169392758067000, "line_mean": 40.6363636364, "line_max": 117, "alpha_frac": 0.6255641287, "autogenerated": false, "ratio": 3.991284137129576, "config_test": true...
from flashtext import KeywordProcessor import logging import unittest logger = logging.getLogger(__name__) class TestReplaceFuzzy(unittest.TestCase): def setUp(self): logger.info("Starting...") def tearDown(self): logger.info("Ending.") def test_extract_deletion(self): """ ...
{ "repo_name": "vi3k6i5/flashtext", "path": "test/test_replace_fuzzy.py", "copies": "1", "size": "3790", "license": "mit", "hash": 624001866396023000, "line_mean": 42.0568181818, "line_max": 105, "alpha_frac": 0.6626187962, "autogenerated": false, "ratio": 4.1764057331863285, "config_test": true...
from flask_admin.actions import action from feedrsub.admin.views import SecuredModelView from feedrsub.models.userfeed import UserFeed from feedrsub.utils.strings import stringify_list from feedrsub.websub.tasks import task_send_content_distribution_requests from feedrsub.authors.tasks import task_update_authors_feeds...
{ "repo_name": "DBeath/flask-feedrsub", "path": "feedrsub/admin/views/userfeed_model_view.py", "copies": "1", "size": "2257", "license": "mit", "hash": 3112738595811159000, "line_mean": 31.2428571429, "line_max": 84, "alpha_frac": 0.6083296411, "autogenerated": false, "ratio": 3.742951907131012, ...
from flask_admin.babel import lazy_gettext from flask_admin.model import filters from flask_admin.contrib.sqla import tools from sqlalchemy.sql import not_, or_ import enum class BaseSQLAFilter(filters.BaseFilter): """ Base SQLAlchemy filter. """ def __init__(self, column, name, options=None, data...
{ "repo_name": "flask-admin/flask-admin", "path": "flask_admin/contrib/sqla/filters.py", "copies": "1", "size": "19110", "license": "bsd-3-clause", "hash": 3884852955953193000, "line_mean": 33.3705035971, "line_max": 98, "alpha_frac": 0.6357927786, "autogenerated": false, "ratio": 4.05560271646859...
from flask_admin.babel import lazy_gettext from flask_admin.model import filters from flask_admin.contrib.sqla import tools from sqlalchemy.sql import not_, or_ class BaseSQLAFilter(filters.BaseFilter): """ Base SQLAlchemy filter. """ def __init__(self, column, name, options=None, data_type=None):...
{ "repo_name": "haradashinya/flask-admin", "path": "flask_admin/contrib/sqla/filters.py", "copies": "7", "size": "13601", "license": "bsd-3-clause", "hash": -6024755939869203000, "line_mean": 31.3833333333, "line_max": 91, "alpha_frac": 0.6489963973, "autogenerated": false, "ratio": 4.010911235623...
from flask_admin.babel import lazy_gettext from flask_admin.model import filters from django.db.models import Q def parse_like_term(term): """ Parse search term into (operation, term) tuple. Recognizes operators in the beginning of the search term. * = case insensitive (can precede other ...
{ "repo_name": "likaiguo/flask-admin", "path": "flask_admin/contrib/django/filters.py", "copies": "1", "size": "7347", "license": "bsd-3-clause", "hash": 563995622630339650, "line_mean": 27.1494252874, "line_max": 89, "alpha_frac": 0.6310058527, "autogenerated": false, "ratio": 4.050165380374862, ...
from flask_admin.babel import lazy_gettext from flask_admin.model import filters from .tools import parse_like_term from mongoengine.queryset import Q from bson.errors import InvalidId from bson.objectid import ObjectId class BaseMongoEngineFilter(filters.BaseFilter): """ Base MongoEngine filter. """...
{ "repo_name": "closeio/flask-admin", "path": "flask_admin/contrib/mongoengine/filters.py", "copies": "17", "size": "8771", "license": "bsd-3-clause", "hash": 7767627672383261000, "line_mean": 28.531986532, "line_max": 91, "alpha_frac": 0.6439402577, "autogenerated": false, "ratio": 4.049399815327...
from flask_admin.babel import lazy_gettext from flask_admin.model import filters from .tools import parse_like_term class BasePeeweeFilter(filters.BaseFilter): """ Base Peewee filter. """ def __init__(self, column, name, options=None, data_type=None): """ Constructor. ...
{ "repo_name": "jmagnusson/flask-admin", "path": "flask_admin/contrib/peewee/filters.py", "copies": "2", "size": "9936", "license": "bsd-3-clause", "hash": -5490848557835621000, "line_mean": 28.2235294118, "line_max": 91, "alpha_frac": 0.6555958132, "autogenerated": false, "ratio": 4.1608040201005...
from flask_admin._compat import as_unicode, string_types from flask_admin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE from .tools import get_primary_key class QueryAjaxModelLoader(AjaxModelLoader): def __init__(self, name, model, **options): """ Constructor. :param field...
{ "repo_name": "flask-admin/flask-admin", "path": "flask_admin/contrib/peewee/ajax.py", "copies": "1", "size": "2260", "license": "bsd-3-clause", "hash": -3328739927875877400, "line_mean": 26.9012345679, "line_max": 109, "alpha_frac": 0.5619469027, "autogenerated": false, "ratio": 4.07942238267148...
from flask_admin._compat import pass_context, string_types, reduce from flask_admin.babel import gettext class BaseListRowAction(object): def __init__(self, title=None): self.title = title def render(self, context, row_id, row): raise NotImplementedError() @pass_context def render_ct...
{ "repo_name": "flask-admin/flask-admin", "path": "flask_admin/model/template.py", "copies": "1", "size": "3518", "license": "bsd-3-clause", "hash": -3137070473490992000, "line_mean": 26.9206349206, "line_max": 85, "alpha_frac": 0.608584423, "autogenerated": false, "ratio": 3.7868675995694296, "...
from flask_admin.contrib.sqla import ModelView from flask_admin.actions import action from flask_admin import Admin, AdminIndexView, expose from flask import flash, current_app, url_for from jinja2 import Markup from gettext import ngettext from .models import Emote, Guild, db from .discord import User class CustomAd...
{ "repo_name": "abalabahaha/emotes-website", "path": "website/admin_views.py", "copies": "2", "size": "2455", "license": "mit", "hash": -7456039014240181000, "line_mean": 32.1756756757, "line_max": 125, "alpha_frac": 0.6028513238, "autogenerated": false, "ratio": 3.806201550387597, "config_test"...
from flask_admin.contrib.sqla import ModelView from flask_admin import Admin, BaseView, expose from flask_security import current_user from flask import redirect from flask_security import logout_user from application import app from database import db from models import User, Role, SomeStuff class LogoutView(BaseVi...
{ "repo_name": "graup/flask-restless-security", "path": "admin.py", "copies": "1", "size": "1283", "license": "mit", "hash": -898651143007050000, "line_mean": 26.2978723404, "line_max": 69, "alpha_frac": 0.7014809041, "autogenerated": false, "ratio": 3.740524781341108, "config_test": false, "h...
from flask_admin.contrib.sqla import ModelView from flask_admin import AdminIndexView from flask import redirect, url_for from flask_login import current_user class BLEXTModelView(ModelView): can_view_details = True create_modal = True edit_modal = True def is_accessible(self): return current...
{ "repo_name": "seagullbird/BLEXT", "path": "app/ModelView.py", "copies": "1", "size": "1238", "license": "mit", "hash": -7207466093085858000, "line_mean": 27.1363636364, "line_max": 87, "alpha_frac": 0.7092084006, "autogenerated": false, "ratio": 3.60932944606414, "config_test": false, "has_n...
from flask_admin.contrib.sqla import ModelView from flask_admin import Admin from flask_security import current_user,utils from website import db from website.models import User, Role from wtforms.fields import TextField class AdminModelView(ModelView): # Prevent administration of Users unless the currently logge...
{ "repo_name": "Rassilion/shiritori", "path": "website/admin.py", "copies": "1", "size": "1940", "license": "mit", "hash": 5882538827113175000, "line_mean": 45.2142857143, "line_max": 116, "alpha_frac": 0.7164948454, "autogenerated": false, "ratio": 4.217391304347826, "config_test": false, "ha...
from flask_admin.contrib.sqla import ModelView from flask import request, Response from werkzeug.exceptions import HTTPException class AuthModelView(ModelView): def is_accessible(self): auth = request.authorization or request.environ.get('REMOTE_USER') # workaround for Apache if not auth or (auth...
{ "repo_name": "wseaton/pongr", "path": "app/admin.py", "copies": "1", "size": "1109", "license": "mit", "hash": -1602447663089609500, "line_mean": 33.6875, "line_max": 99, "alpha_frac": 0.6429215509, "autogenerated": false, "ratio": 3.531847133757962, "config_test": false, "has_no_keywords": ...
from flask_admin.contrib.sqla import ModelView from tahiti.models import OperationForm, OperationPort class BaseModelView(ModelView): extra_css = [ '/static/css/site.css' ] class OperationModelView(BaseModelView): can_delete = True # disable model deletion page_size = 50 # the number of e...
{ "repo_name": "eubr-bigsea/tahiti", "path": "tahiti/admin.py", "copies": "1", "size": "1186", "license": "apache-2.0", "hash": 3756429083394360300, "line_mean": 33.8823529412, "line_max": 80, "alpha_frac": 0.5826306914, "autogenerated": false, "ratio": 3.9798657718120807, "config_test": false, ...