text
stringlengths
0
1.05M
meta
dict
from frasco import Feature, action, OptionMissingError, AttrDict, current_app from PIL import Image import os class ImagesFeature(Feature): name = "images" defaults = {"search_dir": None, "dest_dir": None, "output_format": None} def init_app(self, app): default_dir...
{ "repo_name": "frascoweb/frasco-images", "path": "frasco_images.py", "copies": "1", "size": "5990", "license": "mit", "hash": -840452578093654100, "line_mean": 37.6516129032, "line_max": 99, "alpha_frac": 0.5507512521, "autogenerated": false, "ratio": 3.4644303065355695, "config_test": false, ...
from frasco import (Feature, action, request, signal, current_app, redirect, flash,\ url_for, cached_property, current_context, hook, Blueprint,\ lazy_translate, command, current_context) from frasco.utils import unknown_value from frasco_models import as_transaction, save_model ...
{ "repo_name": "frascoweb/frasco-stripe", "path": "frasco_stripe/__init__.py", "copies": "1", "size": "27615", "license": "mit", "hash": 6205671710279969000, "line_mean": 47.1097560976, "line_max": 125, "alpha_frac": 0.6099945682, "autogenerated": false, "ratio": 4.034921098772648, "config_test"...
from frasco import Feature, action, signal, current_app, command from frasco_models import as_transaction, save_model, ref, transaction import datetime from contextlib import contextmanager class InvoicingFeature(Feature): name = "invoicing" requires = ["models"] defaults = {"model": "Invoice", ...
{ "repo_name": "frascoweb/frasco-invoicing", "path": "frasco_invoicing/__init__.py", "copies": "1", "size": "3652", "license": "mit", "hash": 9068384569402114000, "line_mean": 33.4622641509, "line_max": 86, "alpha_frac": 0.5873493976, "autogenerated": false, "ratio": 4.075892857142857, "config_t...
from frasco import Feature, action, signal, current_app, request, current_context from frasco.utils import AttrDict, DictObject from jinja2 import FileSystemLoader import os import inspect from .form import * class FormsFeature(Feature): """Create and use forms using wtforms. """ name = "forms" defaul...
{ "repo_name": "frascoweb/frasco-forms", "path": "frasco_forms/__init__.py", "copies": "1", "size": "5499", "license": "mit", "hash": -2908307197528036400, "line_mean": 36.9310344828, "line_max": 106, "alpha_frac": 0.6032005819, "autogenerated": false, "ratio": 3.9222539229671898, "config_test":...
from frasco import Feature, current_app, action from .backends import upload_backends, StorageBackend from werkzeug import secure_filename, FileStorage from flask import send_from_directory import uuid import os from .utils import * from io import BytesIO from tempfile import TemporaryFile, NamedTemporaryFile, gettempd...
{ "repo_name": "frascoweb/frasco-upload", "path": "frasco_upload/__init__.py", "copies": "1", "size": "5908", "license": "mit", "hash": -1897133059630867200, "line_mean": 36.1572327044, "line_max": 118, "alpha_frac": 0.595971564, "autogenerated": false, "ratio": 4.032764505119454, "config_test":...
from frasco import Feature, flash, url_for, lazy_translate, Blueprint, redirect, request, abort, signal, current_app from frasco_users import current_user from frasco_models import transaction import requests import json def create_blueprint(app): bp = Blueprint("slack", __name__) feature = app.features.slac...
{ "repo_name": "frascoweb/frasco-slack", "path": "frasco_slack.py", "copies": "1", "size": "5365", "license": "mit", "hash": -4866841578800424000, "line_mean": 38.7481481481, "line_max": 116, "alpha_frac": 0.578751165, "autogenerated": false, "ratio": 4.0643939393939394, "config_test": false, ...
from frasco import Feature, hook, current_context from frasco.templating import FileLoader from jinja2 import PackageLoader import os class BootstrapFeature(Feature): name = "bootstrap" requires = ["assets"] defaults = {"auto_assets": True, "with_jquery": True, "with_fontaw...
{ "repo_name": "frascoweb/frasco-bootstrap", "path": "frasco_bootstrap/__init__.py", "copies": "1", "size": "2343", "license": "mit", "hash": 1929709590734892500, "line_mean": 43.2264150943, "line_max": 131, "alpha_frac": 0.5740503628, "autogenerated": false, "ratio": 3.8035714285714284, "config...
from frasco import Feature, Service, action, hook, abort, current_app, request, jsonify, g, Blueprint, url_for, signal from frasco_models import as_transaction, transaction, save_model import datetime import base64 import hashlib import uuid import re import os import json import codecs from apispec import APISpec from...
{ "repo_name": "frascoweb/frasco-api", "path": "frasco_api.py", "copies": "1", "size": "7951", "license": "mit", "hash": 5090923792689427000, "line_mean": 38.5621890547, "line_max": 148, "alpha_frac": 0.5468494529, "autogenerated": false, "ratio": 3.9814722083124687, "config_test": false, "has...
from frasco import (Feature, Service, action, signal, command, cached_property, expose,\ request_param, current_app, ServiceError, jsonify, lazy_translate) from frasco_models import transaction, save_model from suds.client import Client as SudsClient from suds import WebFault import requests import ...
{ "repo_name": "frascoweb/frasco-eu-vat", "path": "frasco_eu_vat.py", "copies": "1", "size": "10536", "license": "mit", "hash": -914873355121614500, "line_mean": 36.7670250896, "line_max": 129, "alpha_frac": 0.5864654518, "autogenerated": false, "ratio": 3.2669767441860467, "config_test": false,...
from frasco import lazy_translate, current_app from frasco.ext import * from frasco.models import transaction from flask.signals import Namespace as SignalNamespace from .data import * from .model import * from .service import eu_vat_service _signals = SignalNamespace() model_rate_updated = _signals.signal('vat_mode...
{ "repo_name": "frascoweb/frasco", "path": "frasco/billing/eu_vat/__init__.py", "copies": "1", "size": "2354", "license": "mit", "hash": 4955261930317070000, "line_mean": 39.5862068966, "line_max": 140, "alpha_frac": 0.6350892099, "autogenerated": false, "ratio": 3.790660225442834, "config_test"...
from frasco import lazy_translate, request, flash, redirect from frasco.ext import * from frasco.utils import unknown_value from frasco.models import as_transaction from frasco.mail import send_mail import stripe import datetime import time import os import json from frasco.billing.eu_vat import get_exchange_rate, is_...
{ "repo_name": "frascoweb/frasco", "path": "frasco/billing/stripe/__init__.py", "copies": "1", "size": "6714", "license": "mit", "hash": 8777067766481382000, "line_mean": 39.4457831325, "line_max": 111, "alpha_frac": 0.6869228478, "autogenerated": false, "ratio": 3.6429734129137277, "config_test...
from frasco import request_param from frasco.api import ApiService, ApiInputError, ApiNotFoundError from . import data eu_vat_service = ApiService('eu_vat', url_prefix='/eu-vat') @eu_vat_service.route('/rates/<country_code>') @request_param('country_code', type=str) def get_vat_rate(country_code): try: ...
{ "repo_name": "frascoweb/frasco", "path": "frasco/billing/eu_vat/service.py", "copies": "1", "size": "2530", "license": "mit", "hash": 7909503107000663000, "line_mean": 36.2058823529, "line_max": 106, "alpha_frac": 0.6494071146, "autogenerated": false, "ratio": 3.320209973753281, "config_test":...
from frasco.models import db from sqlalchemy.ext.declarative import declared_attr from .data import is_eu_country, should_charge_vat, get_vat_rate class EUVATModelMixin(object): @declared_attr def _eu_vat_country(cls): return db.deferred(db.Column('eu_vat_country', db.String), group='eu_vat') @de...
{ "repo_name": "frascoweb/frasco", "path": "frasco/billing/eu_vat/model.py", "copies": "1", "size": "1261", "license": "mit", "hash": -4773686099186008000, "line_mean": 30.525, "line_max": 82, "alpha_frac": 0.6526566217, "autogenerated": false, "ratio": 3.144638403990025, "config_test": false, ...
from frasco.models import db class InvoiceModelMixin(object): ref = db.Column(db.String, index=True) currency = db.Column(db.String) subtotal = db.Column(db.Float) total = db.Column(db.Float) tax_amount = db.Column(db.Float) description = db.Column(db.String) name = db.Column(db.String) ...
{ "repo_name": "frascoweb/frasco", "path": "frasco/billing/invoicing/model.py", "copies": "1", "size": "1128", "license": "mit", "hash": -7306746708476978000, "line_mean": 32.1764705882, "line_max": 51, "alpha_frac": 0.679964539, "autogenerated": false, "ratio": 3.1074380165289255, "config_test"...
from frasco.models import db, transaction from frasco.models.utils import MutableList from frasco import current_app from frasco.ext import get_extension_state from frasco.redis import redis from flask_login import UserMixin from sqlalchemy.dialects import postgresql import datetime import uuid __all__ = ('UserModelM...
{ "repo_name": "frascoweb/frasco", "path": "frasco/users/model.py", "copies": "1", "size": "3830", "license": "mit", "hash": -8107963434983320000, "line_mean": 33.5045045045, "line_max": 102, "alpha_frac": 0.6942558747, "autogenerated": false, "ratio": 3.4598012646793133, "config_test": false, ...
from frasco_upload.backends import StorageBackend, file_upload_backend from frasco import current_app @file_upload_backend class S3StorageBackend(StorageBackend): name = 's3' def save(self, file, filename, force_sync=False): kwargs = dict(filename=filename, content_disposition_filename=file.filename,...
{ "repo_name": "frascoweb/frasco-aws", "path": "frasco_aws/upload.py", "copies": "1", "size": "1808", "license": "mit", "hash": 7708057467779292000, "line_mean": 47.8918918919, "line_max": 103, "alpha_frac": 0.6675884956, "autogenerated": false, "ratio": 3.601593625498008, "config_test": false, ...
from frbpoppy import hist from goodness_of_fit import GoodnessOfFit from matplotlib.lines import Line2D from scipy.optimize import curve_fit from tests.convenience import plot_aa_style, rel_path import matplotlib.pyplot as plt import numpy as np class Plot(): """Plot runs.""" def __init__(self): plot...
{ "repo_name": "davidgardenier/frbpoppy", "path": "tests/monte_carlo/plot.py", "copies": "1", "size": "13349", "license": "mit", "hash": 4566525575374997500, "line_mean": 32.3725, "line_max": 95, "alpha_frac": 0.4967413289, "autogenerated": false, "ratio": 3.291173570019724, "config_test": false...
from fred.clients.categories import CategoriesClient from fred.clients.releases import ReleasesClient from fred.clients.tags import TagsClient from fred.clients.sources import SourcesClient from fred.clients.eseries import ESeriesClient import fred.config as c import weakref ## Establish Federal Reserve Economic Data ...
{ "repo_name": "avelkoski/FRB", "path": "fred/__init__.py", "copies": "1", "size": "2309", "license": "mit", "hash": -1133619696383050200, "line_mean": 53.9761904762, "line_max": 123, "alpha_frac": 0.7223906453, "autogenerated": false, "ratio": 3.5577812018489983, "config_test": false, "has_no...
from freebase.schema import dump_base, dump_type, restore try: import jsonlib2 as json except ImportError: try: import simplejson as json except ImportError: import json import sys def cmd_dump_base(fb, baseid): """dump a base to stdout %prog dump_base baseid Dump a base by o...
{ "repo_name": "tfmorris/freebase-python", "path": "freebase/fcl/schema.py", "copies": "5", "size": "1121", "license": "bsd-2-clause", "hash": 6122798271702516000, "line_mean": 26.3414634146, "line_max": 86, "alpha_frac": 0.6815343443, "autogenerated": false, "ratio": 3.6633986928104574, "config...
from freemix.dataset.transform import RawTransformView, AkaraTransformClient from freemix.dataset.augment import models from freemix.dataset.augment import conf from django.views.generic.base import View from freemix.views import JSONResponse class JSONView(View): template=None def get_dict(self, *args, **k...
{ "repo_name": "zepheira/freemix", "path": "freemix/dataset/augment/views.py", "copies": "1", "size": "1026", "license": "apache-2.0", "hash": -6750666305143666000, "line_mean": 26, "line_max": 92, "alpha_frac": 0.7456140351, "autogenerated": false, "ratio": 3.5136986301369864, "config_test": fa...
from freenect import sync_get_depth as get_depth import numpy as np import pygame from Xlib import X, display import Xlib.XK import Xlib.error import Xlib.ext.xtest class BlobAnalysis: def __init__(self, BW):#Constructor. BW es una imagen binaria en forma de una matriz numpy self.BW=BW cs...
{ "repo_name": "jhonduarte/kinnect", "path": "examples/demo_control.py", "copies": "1", "size": "6175", "license": "mit", "hash": 998354736703652200, "line_mean": 42.7375886525, "line_max": 419, "alpha_frac": 0.5673747365, "autogenerated": false, "ratio": 3.517969195664575, "config_test": false,...
from freenect import sync_get_depth as get_depth #Uses freenect to get depth information from the Kinect import numpy as np #Imports NumPy import cv,cv2 #Uses both of cv and cv2 import pygame #Uses pygame #The libaries below are used for mouse manipulation from Xlib import X, display import Xlib.XK import Xlib.error i...
{ "repo_name": "ActiveState/code", "path": "recipes/Python/578104_OpenKinect_Mouse_Control_Using/recipe-578104.py", "copies": "1", "size": "9409", "license": "mit", "hash": -7824071109695744000, "line_mean": 52.7657142857, "line_max": 161, "alpha_frac": 0.6568179403, "autogenerated": false, "ratio...
from freeradius.models import UserData, UserQuota, UserBillingDetail, UserInfo, RadPostAuth, RadReply, RadCheck, UserInfo from rest_framework import serializers class UserDataSerializer(serializers.ModelSerializer): class Meta: model = UserData fields = ('username', 'datain', 'dataout', 'totaldata', 'data_hour',...
{ "repo_name": "realworldtech/radius_restserver", "path": "src/freeradius/serializers.py", "copies": "1", "size": "1261", "license": "mit", "hash": -7521683231507072000, "line_mean": 28.3255813953, "line_max": 121, "alpha_frac": 0.739888977, "autogenerated": false, "ratio": 3.5322128851540615, "...
from freesasa import * import unittest import math import os # this class tests using derived classes to create custom Classifiers class DerivedClassifier(Classifier): purePython = True def classify(self,residueName,atomName): return 'bla' def radius(self,residueName,atomName): return 10 ...
{ "repo_name": "JoaoRodrigues/freesasa", "path": "bindings/python/test.py", "copies": "1", "size": "14379", "license": "mit", "hash": -8068843702292461000, "line_mean": 43.7943925234, "line_max": 124, "alpha_frac": 0.6058140344, "autogenerated": false, "ratio": 3.510498046875, "config_test": tru...
from FreesteelPython import * import FreesteelWindow from FreesteelWindow import inspect from coreRough import * import sys, time, locale cstart = time.clock() clast = cstart def status(msg): global cstart, clast print locale.format("%f", time.clock()-cstart, True), locale.format("%f", time.clock()-clast, True), m...
{ "repo_name": "JohnyEngine/CNC", "path": "deprecated/libactp/freesteel/test/test-coreRough.py", "copies": "2", "size": "1371", "license": "apache-2.0", "hash": -3207159225878336500, "line_mean": 23.4821428571, "line_max": 109, "alpha_frac": 0.7206418673, "autogenerated": false, "ratio": 2.742, ...
from FreesteelPython import * import FreesteelWindow import sys import string class pp: def __init__(self): self.lx0 = "" self.ly0 = "" self.lz0 = "" def writeheading(self, fout): fout.write("BEGINPGM\n") fout.write("LOADTL1\n") def writeline(self, fout, x, y, z): res = [ 'L' ] sx = "X%.3f" % x ...
{ "repo_name": "JohnyEngine/CNC", "path": "deprecated/libactp/freesteel/test/postprocessor.py", "copies": "2", "size": "1601", "license": "apache-2.0", "hash": 3520092539490090000, "line_mean": 21.5492957746, "line_max": 95, "alpha_frac": 0.5858838226, "autogenerated": false, "ratio": 2.3753709198...
from FreesteelPython import * import FreesteelWindow import sys import postprocessor #from postprocessor import postprocess from coreRough import coreRough def makeRectBoundary(sx): bdy = PathXSeries() bdy.Add(P2(sx.gxrg.lo, sx.gyrg.lo)) bdy.Add(P2(sx.gxrg.hi, sx.gyrg.lo)) bdy.Add(P2(sx.gxrg.hi, sx.gyrg.hi)) b...
{ "repo_name": "JohnyEngine/CNC", "path": "deprecated/libactp/freesteel/test/garston.py", "copies": "2", "size": "2258", "license": "apache-2.0", "hash": 7275262958853369000, "line_mean": 22.5208333333, "line_max": 106, "alpha_frac": 0.7555358725, "autogenerated": false, "ratio": 2.625581395348837...
from FreesteelPython import * """ Issues: Crashes when toolflatrad != 0.0 """ def makeParams(stepdown=15.0, toolcornerrad=3.0, toolflatrad=0.0, retractheight=50.0): params = MachineParams() # linking parameters params.leadoffdz = 0.1 params.leadofflen = 1.1 params.leadoffrad = 2.0 params.retractzheight = ret...
{ "repo_name": "JohnyEngine/CNC", "path": "deprecated/libactp/freesteel/test/coreRough.py", "copies": "2", "size": "4325", "license": "apache-2.0", "hash": -1690465699692290300, "line_mean": 29.2447552448, "line_max": 124, "alpha_frac": 0.7255491329, "autogenerated": false, "ratio": 2.597597597597...
from freetype import Face import numpy as np from pylab import axis, close, figure, plot, show def unpackCharacter(glyph): outline = glyph.outline points = np.array(outline.points, dtype=float) # Find the start and stop points for each loop in the segment list starts = [0] + [s + 1 for s in outline....
{ "repo_name": "meawoppl/babyfood", "path": "babyfood/features/FontsExtractor.py", "copies": "1", "size": "4539", "license": "bsd-2-clause", "hash": 271112771825512130, "line_mean": 29.26, "line_max": 97, "alpha_frac": 0.558713373, "autogenerated": false, "ratio": 3.2032462949894143, "config_tes...
from freezegame.sprite import Sprite class Particle(Sprite): def __init__(self, pos, state, image_name, image_region, batch, group, life_time=1.0, vel=[0.0, 0.0], acc=[0.0, 0.0], fric=0.0, rot=0.0, rot_vel=0.0, rot_acc=0.0, rot_fric=0.0, fade=False, fade_in=False): self.pos = pos ...
{ "repo_name": "mattfister/freezegame", "path": "freezegame/particle.py", "copies": "1", "size": "3311", "license": "mit", "hash": -4635647073956852000, "line_mean": 30.5333333333, "line_max": 119, "alpha_frac": 0.4919963757, "autogenerated": false, "ratio": 3.00453720508167, "config_test": fals...
from freeze_globals import freeze_globals @freeze_globals def too_many_constants(): x = 0 x = 1 x = 2 x = 3 x = 4 x = 5 x = 6 x = 7 x = 8 x = 9 x = 10 x = 11 x = 12 x = 13 x = 14 x = 15 x = 16 x = 17 x = 18 x = 19 x = 20 x = 21 ...
{ "repo_name": "ssanderson/pycon-2016", "path": "snippets/freeze_too_many_constants.py", "copies": "1", "size": "1459", "license": "cc0-1.0", "hash": 8096665092095175000, "line_mean": 10.3984375, "line_max": 41, "alpha_frac": 0.3173406443, "autogenerated": false, "ratio": 2.833009708737864, "con...
from freezegun import freeze_time from django.test import TestCase, override_settings from django.contrib.gis.geos import Point from django.core.exceptions import ValidationError from accounts.models import User from busstops.models import DataSource, Region, Operator, Service from .models import (Vehicle, VehicleType,...
{ "repo_name": "jclgoodwin/bustimes.org.uk", "path": "vehicles/tests.py", "copies": "1", "size": "22672", "license": "mpl-2.0", "hash": 1173538754752949500, "line_mean": 45.2408163265, "line_max": 118, "alpha_frac": 0.6133815871, "autogenerated": false, "ratio": 3.6456958970233306, "config_test"...
from freezegun import freeze_time from hamcrest import assert_that, has_item, has_entries, \ has_length, contains, has_entry, is_ from mock import Mock, patch from nose.tools import assert_raises from backdrop.core import data_set from backdrop.core.query import Query from backdrop.core.timeseries import WEEK, MON...
{ "repo_name": "alphagov/backdrop", "path": "tests/core/test_data_set.py", "copies": "1", "size": "24289", "license": "mit", "hash": 6654049791038853000, "line_mean": 38.8180327869, "line_max": 107, "alpha_frac": 0.5088311581, "autogenerated": false, "ratio": 3.355761260016579, "config_test": tr...
from freezegun import freeze_time from rest_framework import test from waldur_core.structure.tests import factories as structure_factories from waldur_mastermind.invoices import models as invoice_models from waldur_mastermind.invoices.tests import factories as invoice_factories from waldur_mastermind.invoices.tests im...
{ "repo_name": "opennode/waldur-mastermind", "path": "src/waldur_mastermind/billing/tests/test_price_current.py", "copies": "1", "size": "1560", "license": "mit", "hash": 5037352213644866000, "line_mean": 38, "line_max": 88, "alpha_frac": 0.6717948718, "autogenerated": false, "ratio": 4.0625, "c...
from freezegun import freeze_time from rest_framework import test from waldur_core.structure.tests import factories as structure_factories from . import factories class EventsStatsGetTest(test.APITransactionTestCase): def setUp(self) -> None: with freeze_time('2021-01-01'): self.user = struc...
{ "repo_name": "opennode/waldur-mastermind", "path": "src/waldur_core/logging/tests/test_events_stats.py", "copies": "1", "size": "1883", "license": "mit", "hash": 6467918269006275000, "line_mean": 31.4655172414, "line_max": 87, "alpha_frac": 0.5942644716, "autogenerated": false, "ratio": 3.858606...
from freezegun import freeze_time from sure import expect from moto.swf.exceptions import SWFWorkflowExecutionClosedError from moto.swf.models import DecisionTask, Timeout from ..utils import make_workflow_execution, process_first_timeout def test_decision_task_creation(): wfe = make_workflow_execution() dt...
{ "repo_name": "EarthmanT/moto", "path": "tests/test_swf/models/test_decision_task.py", "copies": "3", "size": "2386", "license": "apache-2.0", "hash": -7731872442409320000, "line_mean": 31.2432432432, "line_max": 104, "alpha_frac": 0.6877619447, "autogenerated": false, "ratio": 3.237449118046133,...
from freezegun import freeze_time from sure import expect from moto.swf.exceptions import SWFWorkflowExecutionClosedError from moto.swf.models import ( ActivityTask, ActivityType, Timeout, ) from ..utils import ( ACTIVITY_TASK_TIMEOUTS, make_workflow_execution, process_first_timeout, ) def t...
{ "repo_name": "zonk1024/moto", "path": "tests/test_swf/models/test_activity_task.py", "copies": "3", "size": "4683", "license": "apache-2.0", "hash": -2569850106161329000, "line_mean": 30.4295302013, "line_max": 104, "alpha_frac": 0.644885757, "autogenerated": false, "ratio": 3.5450416351249054, ...
from freezegun import freeze_time from .testcase import BaseTestCase class TTLTestCase(BaseTestCase): def test_it(self): from djangostdnet import models, ttl as ttl_mod class AModel(models.Model): ttl = ttl_mod.TTLField() manager_class = ttl_mod.TTLManager cl...
{ "repo_name": "capy-inc/django-stdnet", "path": "tests/ttl.py", "copies": "2", "size": "3443", "license": "mit", "hash": -2914404350123311600, "line_mean": 35.6276595745, "line_max": 107, "alpha_frac": 0.5788556491, "autogenerated": false, "ratio": 4.045828437132785, "config_test": true, "has...
from freezegun import freeze_time import responses from botless.integrations.toggl import Toggl, TOGGL_REPORTS_DETAILS_URL @freeze_time('2017-12-31') def test_toggl_since_until_defaults(monkeypatch): monkeypatch.setenv('TOGGL_API_KEY', 'SECRET_API_KEY') monkeypatch.setenv('TOGGL_WORKSPACE_ID', '649573') ...
{ "repo_name": "ivansabik/botless", "path": "tests/test_toggl.py", "copies": "1", "size": "2616", "license": "mit", "hash": -5397074136260392000, "line_mean": 29.0689655172, "line_max": 98, "alpha_frac": 0.4877675841, "autogenerated": false, "ratio": 3.241635687732342, "config_test": false, "h...
from freezegun import freeze_time import sure # noqa from moto.swf.exceptions import SWFWorkflowExecutionClosedError from moto.swf.models import ActivityTask, ActivityType, Timeout from ..utils import ( ACTIVITY_TASK_TIMEOUTS, make_workflow_execution, process_first_timeout, ) def test_activity_task_cre...
{ "repo_name": "spulec/moto", "path": "tests/test_swf/models/test_activity_task.py", "copies": "2", "size": "5227", "license": "apache-2.0", "hash": 293613638028003500, "line_mean": 29.9289940828, "line_max": 82, "alpha_frac": 0.6407116893, "autogenerated": false, "ratio": 3.5899725274725274, "c...
from freezegun import freeze_time import sure # noqa from moto.swf.models import ( ActivityType, Timeout, WorkflowType, WorkflowExecution, ) from moto.swf.exceptions import SWFDefaultUndefinedFault from ..utils import ( auto_start_decision_tasks, get_basic_domain, get_basic_workflow_type, ...
{ "repo_name": "tootedom/moto", "path": "tests/test_swf/models/test_workflow_execution.py", "copies": "7", "size": "18405", "license": "apache-2.0", "hash": -4562475565737336000, "line_mean": 36.5612244898, "line_max": 100, "alpha_frac": 0.6715023092, "autogenerated": false, "ratio": 3.41212458286...
from freezegun import freeze_time import unittest.mock as mock from tests.plugins import PluginTestCase from plugins.owleague import OwleaguePlugin f = "plugins.owleague.get_owl_data" @freeze_time("2017-12-08 10:00:00") class OwleaguePluginTest(PluginTestCase): def create_plugin(self): return OwleaguePl...
{ "repo_name": "anlutro/botologist", "path": "tests/plugins/owleague_test.py", "copies": "1", "size": "10033", "license": "mit", "hash": -2673475916145381400, "line_mean": 34.7046263345, "line_max": 137, "alpha_frac": 0.4837037775, "autogenerated": false, "ratio": 3.6025134649910235, "config_tes...
from freezegun import freeze_time from app.dao.event_dates_dao import dao_get_event_date_by_id from app.dao.events_dao import ( dao_create_event, dao_delete_event, dao_update_event, dao_get_events, dao_get_event_by_id, dao_get_events_in_year, dao_get_future_events, dao_get_limited_even...
{ "repo_name": "NewAcropolis/api", "path": "tests/app/dao/test_events_dao.py", "copies": "1", "size": "7045", "license": "mit", "hash": 2695704700863603000, "line_mean": 35.6927083333, "line_max": 106, "alpha_frac": 0.6249822569, "autogenerated": false, "ratio": 3.275220827522083, "config_test":...
from freezegun import freeze_time from app.na_celery.event_tasks import send_event_email_reminder from app.dao.events_dao import dao_update_event from app.models import APPROVED class WhenProcessingSendEventEmailReminderTask: @freeze_time("2017-12-20T10:00:00") def it_sends_the_event_email_reminder(self, mo...
{ "repo_name": "NewAcropolis/api", "path": "tests/app/na_celery/test_event_tasks.py", "copies": "1", "size": "2042", "license": "mit", "hash": 2828527517430938600, "line_mean": 45.4090909091, "line_max": 112, "alpha_frac": 0.6978452498, "autogenerated": false, "ratio": 3.1609907120743035, "confi...
from freezegun import freeze_time from great_expectations.checkpoint.actions import StoreMetricsAction from great_expectations.core import ExpectationConfiguration from great_expectations.core.expectation_validation_result import ( ExpectationSuiteValidationResult, ExpectationValidationResult, ) from great_exp...
{ "repo_name": "great-expectations/great_expectations", "path": "tests/actions/test_store_metric_action.py", "copies": "1", "size": "6174", "license": "apache-2.0", "hash": -1452434998005617400, "line_mean": 32.0160427807, "line_max": 88, "alpha_frac": 0.5704567541, "autogenerated": false, "ratio"...
from freezegun import freeze_time from moto.swf.exceptions import SWFWorkflowExecutionClosedError from moto.swf.models import ( ActivityTask, ActivityType, Timeout, ) from ..utils import ( ACTIVITY_TASK_TIMEOUTS, make_workflow_execution, process_first_timeout, ) def test_activity_task_creati...
{ "repo_name": "dbfr3qs/moto", "path": "tests/test_swf/models/test_activity_task.py", "copies": "7", "size": "4645", "license": "apache-2.0", "hash": -4757272046823138000, "line_mean": 29.3594771242, "line_max": 82, "alpha_frac": 0.6419806243, "autogenerated": false, "ratio": 3.5539403213465954, ...
from freezegun import freeze_time from openinghours.tests.tests import OpeningHoursTestCase class FormsTestCase(OpeningHoursTestCase): def setUp(self): super(FormsTestCase, self).setUp() def tearDown(self): super(FormsTestCase, self).tearDown() def test_hours_are_published(self): ...
{ "repo_name": "arteria/django-openinghours", "path": "openinghours/tests/test_forms.py", "copies": "1", "size": "1879", "license": "mit", "hash": -2769883819271983000, "line_mean": 41.7045454545, "line_max": 76, "alpha_frac": 0.5513571048, "autogenerated": false, "ratio": 2.739067055393586, "co...
from freezegun import freeze_time import lemonyellow.data.dialogue as dialogue import lemonyellow.data.items as items from lemonyellow.data.pokemon_data import pokemon from lemonyellow.core.kernel import create_player from lemonyellow.core.kernel import pokemon_lotto def test_player_not_initialized(): result = ...
{ "repo_name": "itsthejoker/Pokemon-Homage", "path": "lemonyellow/core/tests/test_pokemon_lotto.py", "copies": "1", "size": "4698", "license": "mit", "hash": 7016016297389958000, "line_mean": 35.4186046512, "line_max": 60, "alpha_frac": 0.7203065134, "autogenerated": false, "ratio": 2.821621621621...
from freight import vcs from freight.config import db, queue from freight.models import LogChunk, TaskStatus from freight.testutils import TransactionTestCase from freight.utils.workspace import Workspace class ExecuteTaskTestCase(TransactionTestCase): # TODO(dcramer): this test relies on quite a few things actua...
{ "repo_name": "getsentry/freight", "path": "tests/tasks/test_execute_task.py", "copies": "1", "size": "1472", "license": "apache-2.0", "hash": 8862780254515075000, "line_mean": 32.4545454545, "line_max": 83, "alpha_frac": 0.6379076087, "autogenerated": false, "ratio": 3.8839050131926123, "confi...
from freight.models import TaskStatus from freight.notifiers import NotifierEvent, NotificationQueue from freight.testutils import TestCase class NotificationQueueTest(TestCase): def setUp(self): self.user = self.create_user() self.repo = self.create_repo() self.app = self.create_app(repos...
{ "repo_name": "getsentry/freight", "path": "tests/notifiers/test_queue.py", "copies": "1", "size": "1036", "license": "apache-2.0", "hash": 7789812179910072000, "line_mean": 30.3939393939, "line_max": 68, "alpha_frac": 0.583976834, "autogenerated": false, "ratio": 3.9693486590038316, "config_te...
from frequency_plan import Frequency from enum import Enum from utils.log import logger, ConstLog from struct import pack class EU863_870(Frequency): JOIN_ACCEPT_DELAY = 5 MAX_FCNT_GAP = 16384 ADR_ACK_LIMIT = 64 ADR_ACK_DELAY = 32 ACK_TIMEOUT = 2 # 2 +/-1 s random delay between 1 and 3 seconds ...
{ "repo_name": "soybean217/lora-python", "path": "GServer/frequency_plan/EU863_870.py", "copies": "1", "size": "3993", "license": "mit", "hash": -2564942947560669700, "line_mean": 23.9625, "line_max": 89, "alpha_frac": 0.4678186827, "autogenerated": false, "ratio": 3.254278728606357, "config_tes...
from frequency_plan import Frequency from enum import Enum from utils.log import logger, ConstLog class CP500(Frequency): JOIN_ACCEPT_DELAY = 5 MAX_FCNT_GAP = 16384 ADR_ACK_LIMIT = 64 ADR_ACK_DELAY = 32 ACK_TIMEOUT = 2 # 2 +/-1 s random delay between 1 and 3 seconds RF_CH = 0 class Da...
{ "repo_name": "soybean217/lora-python", "path": "GServer/frequency_plan/CP500.py", "copies": "1", "size": "3914", "license": "mit", "hash": -5836978879399225000, "line_mean": 23.9363057325, "line_max": 89, "alpha_frac": 0.4667858968, "autogenerated": false, "ratio": 3.2698412698412698, "config_...
from frequency_plan import Frequency from enum import Enum from utils.log import logger, ConstLog class EU433(Frequency): JOIN_ACCEPT_DELAY = 5 MAX_FCNT_GAP = 16384 ADR_ACK_LIMIT = 64 ADR_ACK_DELAY = 32 ACK_TIMEOUT = 2 # 2 +/-1 s random delay between 1 and 3 seconds RF_CH = 0 class Da...
{ "repo_name": "soybean217/lora-python", "path": "GServer/frequency_plan/EU433.py", "copies": "1", "size": "3599", "license": "mit", "hash": 6817399547284538000, "line_mean": 24.5319148936, "line_max": 89, "alpha_frac": 0.462350653, "autogenerated": false, "ratio": 3.373008434864105, "config_tes...
from frequency_plan import Frequency from enum import Enum from utils.log import logger, ConstLog class MT433(Frequency): JOIN_ACCEPT_DELAY = 5 MAX_FCNT_GAP = 16384 ADR_ACK_LIMIT = 64 ADR_ACK_DELAY = 32 ACK_TIMEOUT = 2 # 2 +/-1 s random delay between 1 and 3 seconds RF_CH = 0 class Da...
{ "repo_name": "soybean217/lora-python", "path": "GServer/frequency_plan/MT433.py", "copies": "1", "size": "3578", "license": "mit", "hash": 4832990538746725000, "line_mean": 24.5642857143, "line_max": 89, "alpha_frac": 0.46254891, "autogenerated": false, "ratio": 3.350187265917603, "config_test...
from frequency_plan import Frequency from enum import Enum class CN470_510(Frequency): JOIN_ACCEPT_DELAY = 5 MAX_FCNT_GAP = 16384 ADR_ACK_LIMIT = 64 ADR_ACK_DELAY = 32 ACK_TIMEOUT = 2 # 2 +/-1 s random delay between 1 and 3 seconds RF_CH = 0 class DataRate(Enum): SF12BW125 = 0...
{ "repo_name": "soybean217/lora-python", "path": "GServer/frequency_plan/CN470_510.py", "copies": "1", "size": "3877", "license": "mit", "hash": 8133878657188914000, "line_mean": 23.5443037975, "line_max": 98, "alpha_frac": 0.4650502966, "autogenerated": false, "ratio": 3.424911660777385, "confi...
from frequency_plan import Frequency from enum import Enum class CNICG470(Frequency): JOIN_ACCEPT_DELAY = 5 MAX_FCNT_GAP = 16384 ADR_ACK_LIMIT = 64 ADR_ACK_DELAY = 32 ACK_TIMEOUT = 2 # 2 +/-1 s random delay between 1 and 3 seconds RF_CH = 0 class DataRate(Enum): SF12BW125 = 0 ...
{ "repo_name": "soybean217/lora-python", "path": "GServer/frequency_plan/CNICG470.py", "copies": "1", "size": "3055", "license": "mit", "hash": -8215020838560402000, "line_mean": 21.8059701493, "line_max": 89, "alpha_frac": 0.4533551555, "autogenerated": false, "ratio": 3.3645374449339207, "conf...
from .frequencyscale import LinearScale, FrequencyBand, ExplicitScale from .tfrepresentation import FrequencyDimension from .frequencyadaptive import FrequencyAdaptive from zounds.timeseries import \ audio_sample_rate, TimeSlice, Seconds, TimeDimension, HalfLapped, \ Milliseconds, SampleRate from zounds.core im...
{ "repo_name": "JohnVinyard/zounds", "path": "zounds/spectral/functional.py", "copies": "1", "size": "14161", "license": "mit", "hash": 7143041640942476000, "line_mean": 32.7971360382, "line_max": 80, "alpha_frac": 0.6375255985, "autogenerated": false, "ratio": 3.4197053851726635, "config_test":...
from fresh_tomatoes import open_movies_page class Movie: """Store movie related infromation""" def __init__(self, title, poster_url, trailer_url): self.title = title self.poster_image_url = poster_url self.trailer_youtube_url = trailer_url # movies title list movies_title = ["The Sh...
{ "repo_name": "li-xinyang/FSND_P1_MovieTrailerWebsite", "path": "server.py", "copies": "1", "size": "1671", "license": "mit", "hash": 4686140828069327000, "line_mean": 52.9032258065, "line_max": 352, "alpha_frac": 0.7145421903, "autogenerated": false, "ratio": 2.2220744680851063, "config_test":...
from ..fr_FR import Provider as CompanyProvider class Provider(CompanyProvider): company_suffixes = ('SA', 'Sàrl.') def ide(self): """ Generates a IDE number (9 digits). http://www.bfs.admin.ch/bfs/portal/fr/index/themen/00/05/blank/03/02.html """ def _checksum(digits)...
{ "repo_name": "danhuss/faker", "path": "faker/providers/company/fr_CH/__init__.py", "copies": "2", "size": "1307", "license": "mit", "hash": -2005712102381753000, "line_mean": 33.3684210526, "line_max": 81, "alpha_frac": 0.5206738132, "autogenerated": false, "ratio": 3.886904761904762, "config_...
from friendly.silverpop.helpers import to_python, pep_up from .constants import ( LIST_TYPE_DATABASE, LIST_TYPE_QUERY, LIST_TYPE_TEST_LIST, LIST_TYPE_SEED_LIST, LIST_TYPE_SUPPRESSION_LIST, LIST_TYPE_RELATIONAL_TABLE, LIST_TYPE_CONTACT_LIST, CONTACT_CREATED_MANUALLY) class Resource(obje...
{ "repo_name": "butfriendly/friendly-silverpop", "path": "friendly/silverpop/engage/resources.py", "copies": "1", "size": "7753", "license": "isc", "hash": 7540538281430424000, "line_mean": 26.590747331, "line_max": 118, "alpha_frac": 0.5871275635, "autogenerated": false, "ratio": 3.75994180407371...
from friendsecure.node import Node from mock import MagicMock import json def test_message_received(): class Screen(object): def __init__(self): self.addLine = MagicMock() screen = Screen() class Peer(object): def __init__(self, host='127.0.0.1', port=8888): self....
{ "repo_name": "hpk42/p4p", "path": "tests/test_node.py", "copies": "1", "size": "1258", "license": "mit", "hash": 3165935239622146600, "line_mean": 25.2083333333, "line_max": 66, "alpha_frac": 0.5953895072, "autogenerated": false, "ratio": 3.4751381215469612, "config_test": false, "has_no_key...
from friendsecure.protocol import MessageProtocol from mock import MagicMock import json def test_stringReceived(): proto = MessageProtocol() # *SIGH* class C(object): def __init__(self, name, val): setattr(self, name, val) node = C('message_received', MagicMock()) factory = C...
{ "repo_name": "hpk42/p4p", "path": "tests/test_protocol.py", "copies": "1", "size": "1242", "license": "mit", "hash": 990257023828552000, "line_mean": 25.4255319149, "line_max": 69, "alpha_frac": 0.6264090177, "autogenerated": false, "ratio": 3.685459940652819, "config_test": false, "has_no_k...
from frigg.helpers.common import is_retest_comment from .base import Event class GithubEvent(Event): REPOSITORY_URL = 'git@github.com:{event.repository_owner}/{event.repository_name}.git' ALLOWED_EVENT_TYPES = ['ping', 'push', 'delete', 'pull_request', 'issue_comment'] ALLOWED_PULL_REQUEST_ACTIONS = ['op...
{ "repo_name": "frigg/frigg-hq", "path": "frigg/webhooks/events/github.py", "copies": "1", "size": "3666", "license": "mit", "hash": -652788898005573400, "line_mean": 32.9444444444, "line_max": 90, "alpha_frac": 0.5564648118, "autogenerated": false, "ratio": 4.105263157894737, "config_test": fal...
from frmwk import flask_framework # from frmwk import db, lm, oid, babel from flask.ext.login import login_required, current_user # from flask.ext.login import login_user, logout_user from flask import render_template, jsonify, g # from flask import flash, redirect, session, url_for, request # from frmwk.forms.app_f...
{ "repo_name": "martinhbramwell/evalOfFlask", "path": "frmwk/view/overview.py", "copies": "1", "size": "1527", "license": "bsd-3-clause", "hash": -6465848023048864000, "line_mean": 28.9411764706, "line_max": 62, "alpha_frac": 0.6751800917, "autogenerated": false, "ratio": 3.1226993865030677, "co...
from frmwk import flask_framework, orm_db from flask.ext.login import login_required, current_user from flask.ext.babel import gettext from flask import render_template, flash, request, redirect, url_for, g from frmwk import administrator_permission # from flask import Response from frmwk.model.mdRole import Role fro...
{ "repo_name": "martinhbramwell/evalOfFlask", "path": "frmwk/view/vwRole.py", "copies": "1", "size": "2472", "license": "bsd-3-clause", "hash": -9184709729844391000, "line_mean": 32.4054054054, "line_max": 112, "alpha_frac": 0.6371359223, "autogenerated": false, "ratio": 3.5517241379310347, "con...
from frmwk import flask_framework, orm_db # from frmwk import db, lm, oid, babel from flask.ext.login import login_required, current_user # from flask.ext.login import login_user, logout_user from flask.ext.babel import gettext from flask import render_template, flash, request, redirect, url_for # from flask import ...
{ "repo_name": "martinhbramwell/evalOfFlask", "path": "frmwk/view/vwLease.py", "copies": "1", "size": "2537", "license": "bsd-3-clause", "hash": -4576220857533282300, "line_mean": 33.7534246575, "line_max": 124, "alpha_frac": 0.6673236106, "autogenerated": false, "ratio": 3.396251673360107, "con...
from froide.celery import app as celery_app from .utils import ( run_guidance, run_guidance_on_queryset, GuidanceApplicator, GuidanceResult, notify_users ) @celery_app.task(name='froide.guide.tasks.run_guidance_task') def run_guidance_task(message_id): from froide.foirequest.models import FoiMessage ...
{ "repo_name": "stefanw/froide", "path": "froide/guide/tasks.py", "copies": "1", "size": "1390", "license": "mit", "hash": -6140929993998612000, "line_mean": 30.5909090909, "line_max": 73, "alpha_frac": 0.7179856115, "autogenerated": false, "ratio": 3.3737864077669903, "config_test": false, "h...
from froide.publicbody.api_views import PublicBodySerializer from rest_framework import serializers from .models import InformationObject class CampaignProviderItemSerializer(serializers.Serializer): ident = serializers.CharField() title = serializers.CharField() subtitle = serializers.CharField(require...
{ "repo_name": "okfde/froide-campaign", "path": "froide_campaign/serializers.py", "copies": "1", "size": "3451", "license": "mit", "hash": 1626687117393133600, "line_mean": 37.3444444444, "line_max": 72, "alpha_frac": 0.709649377, "autogenerated": false, "ratio": 4.324561403508772, "config_test"...
from fro._implementation.chompers import abstract from fro._implementation.chompers.box import Box class ChainChomper(abstract.AbstractChomper): def __init__(self, func, significant=True, name=None): abstract.AbstractChomper.__init__(self, significant=significant, name=name) self._generation_func ...
{ "repo_name": "ethantkoenig/fro", "path": "fro/_implementation/chompers/util.py", "copies": "1", "size": "2115", "license": "mit", "hash": -3973277758464495000, "line_mean": 35.4655172414, "line_max": 104, "alpha_frac": 0.653427896, "autogenerated": false, "ratio": 3.8524590163934427, "config_t...
from fro._implementation import iters from fro._implementation.chompers import abstract from fro._implementation.chompers.box import Box class SequenceChomper(abstract.AbstractChomper): def __init__(self, element, reducer, separator=None, significant=True, name=None): abstract.AbstractCho...
{ "repo_name": "ethantkoenig/fro", "path": "fro/_implementation/chompers/sequence.py", "copies": "1", "size": "2072", "license": "mit", "hash": 4644263364839866000, "line_mean": 35.350877193, "line_max": 66, "alpha_frac": 0.5772200772, "autogenerated": false, "ratio": 4.352941176470588, "config_...
from fro._implementation import pretty_printing class FroParseError(Exception): """ An exception for parsing failures """ def __init__(self, chomp_errors, cause=None): self._messages = [_message_of_chomp_error(ce) for ce in chomp_errors] self._location = chomp_errors[0].location() ...
{ "repo_name": "ethantkoenig/fro", "path": "fro/_implementation/parse_error.py", "copies": "1", "size": "4624", "license": "mit", "hash": 4962636492798149000, "line_mean": 32.7518248175, "line_max": 120, "alpha_frac": 0.5815311419, "autogenerated": false, "ratio": 4.624, "config_test": false, ...
from fro._implementation.iters import CheckableIterator from fro._implementation.location import Location class ChompState(object): """ Represents a position during parsing/chomping """ def __init__(self, lines, column=0): """ :param lines: iterable<str> :param column: index at...
{ "repo_name": "ethantkoenig/fro", "path": "fro/_implementation/chompers/state.py", "copies": "1", "size": "2072", "license": "mit", "hash": -8617001842106473000, "line_mean": 31.8888888889, "line_max": 87, "alpha_frac": 0.5656370656, "autogenerated": false, "ratio": 3.9391634980988592, "config_...
"""License: # Licensing terms Traitlets is adapted from enthought.traits, Copyright (c) Enthought, Inc., under the terms of the Modified BSD License. This project is licensed under the terms of the Modified BSD License (also known as New or Revised or 3-Clause BSD), as follows: - Copyright (c) 2001-, IPython Develop...
{ "repo_name": "maartenbreddels/vaex", "path": "packages/vaex-jupyter/vaex/jupyter/decorators.py", "copies": "1", "size": "5934", "license": "mit", "hash": -9085873587535400000, "line_mean": 39.3673469388, "line_max": 124, "alpha_frac": 0.7509268622, "autogenerated": false, "ratio": 4.561106840891...
from frontend import app from flask import render_template from flask import send_from_directory from flask import request from flask import redirect from flask import url_for from flask import flash from flask import abort import os import models import forms from wtfpeewee.orm import model_form @app.r...
{ "repo_name": "maltonx/workforce", "path": "views.py", "copies": "1", "size": "7037", "license": "mit", "hash": 3968290124876270600, "line_mean": 30.7302325581, "line_max": 130, "alpha_frac": 0.5566292454, "autogenerated": false, "ratio": 4.27002427184466, "config_test": false, "has_no_keywor...
from ..frontend import jit import numpy as np def CND(x): """ Simpler approximation of the cumulative normal density. """ a1 = 0.31938153 a2 = -0.356563782 a3 = 1.781477937 a4 = -1.821255978 a5 = 1.330274429 L = abs(x) K = 1.0 / (1.0 + 0.2316419 * L) w = 1.0 - 1.0/np.sqrt(2*3.141592653589793)* n...
{ "repo_name": "pombredanne/parakeet", "path": "parakeet/lib/prob.py", "copies": "2", "size": "2741", "license": "bsd-3-clause", "hash": 182760853572861470, "line_mean": 16.2452830189, "line_max": 73, "alpha_frac": 0.6256840569, "autogenerated": false, "ratio": 2.025868440502587, "config_test": ...
from ..frontend import jit import numpy as np @jit def conjugate(x): """ For now we don't have complex numbers so this is just the identity function """ return x @jit def real(x): """ For now we don't have complex types, so real is just the identity function """ return x def _scalar_sign(x): ...
{ "repo_name": "pombredanne/parakeet", "path": "parakeet/lib/math.py", "copies": "2", "size": "1470", "license": "bsd-3-clause", "hash": -3449270461884445000, "line_mean": 14.3125, "line_max": 79, "alpha_frac": 0.5911564626, "autogenerated": false, "ratio": 2.6775956284153004, "config_test": fal...
from FrontEnd.models import * from django.contrib.auth.models import User from rest_framework import serializers from django.db.models import Sum from datetime import datetime, date, timedelta class InterstitialSerializer(serializers.ModelSerializer): Company = serializers.PrimaryKeyRelatedField() class Meta: m...
{ "repo_name": "BryceBrown/LinkstrDjango", "path": "FrontEnd/serializers.py", "copies": "1", "size": "5957", "license": "apache-2.0", "hash": 8000516978742907000, "line_mean": 33.8421052632, "line_max": 161, "alpha_frac": 0.7700184657, "autogenerated": false, "ratio": 3.661339889366933, "config_...
from FrontEnd.models import * from FrontEnd.serializers import * from FrontEnd import utility from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 from django.http import Http404, HttpResponse, HttpResponseRedirect from rest_framework.authentication import SessionAuthentication, To...
{ "repo_name": "BryceBrown/LinkstrDjango", "path": "FrontEnd/api.py", "copies": "1", "size": "15613", "license": "apache-2.0", "hash": 8723561267864894000, "line_mean": 35.3962703963, "line_max": 185, "alpha_frac": 0.73675783, "autogenerated": false, "ratio": 3.387502712085051, "config_test": fa...
from frontend.stmt_inferrer import * import ast import time r = open("tests/inference/example.py") t = ast.parse(r.read()) r.close() solver = z3_types.TypesSolver(t) context = Context() solver.infer_stubs(context, infer) for stmt in t.body: infer(stmt, context, solver) solver.push() def print_solver(z3solver...
{ "repo_name": "gitsimon/spadup-lyra", "path": "tests/inference_runner.py", "copies": "1", "size": "1693", "license": "mpl-2.0", "hash": 2065677412989154300, "line_mean": 26.3064516129, "line_max": 71, "alpha_frac": 0.6107501477, "autogenerated": false, "ratio": 3.2557692307692307, "config_test"...
from frontend.z3_types import And, Or, Implies, Not def add(left, right, result, types): """Constraints for the addition operation Cases: - Number_1 + Number_2 --> Stronger(Number_1, Number_2) - Sequence + Sequence --> Sequence Ex: - 1 + 2.0 - [1, 2, 3] + [4] ...
{ "repo_name": "gitsimon/spadup-lyra", "path": "frontend/z3_axioms.py", "copies": "1", "size": "14595", "license": "mpl-2.0", "hash": -6778523597855774000, "line_mean": 31.578125, "line_max": 124, "alpha_frac": 0.58218568, "autogenerated": false, "ratio": 3.85193982581156, "config_test": false, ...
from frontera.core.components import Middleware from frontera.exceptions import NotConfigured from frontera.utils.url import canonicalize_url from frontera.utils.misc import load_object class BaseFingerprintMiddleware(Middleware): component_name = 'Base Fingerprint Middleware' fingerprint_function_name = '' ...
{ "repo_name": "TeamHG-Memex/frontera", "path": "frontera/contrib/middlewares/fingerprint.py", "copies": "1", "size": "4085", "license": "bsd-3-clause", "hash": -7756593196304651000, "line_mean": 34.8333333333, "line_max": 113, "alpha_frac": 0.6702570379, "autogenerated": false, "ratio": 3.9660194...
from frontera.core import OverusedBuffer from frontera.core.models import Request r1 = Request('http://www.example.com') r2 = Request('http://www.example.com/some/') r3 = Request('htttp://www.example.com/some/page/') r4 = Request('http://example.com') r5 = Request('http://example.com/some/page') r6 = Request('http://...
{ "repo_name": "TeamHG-Memex/frontera", "path": "frontera/tests/test_core_overused_buffer.py", "copies": "1", "size": "2275", "license": "bsd-3-clause", "hash": -2745170546972579000, "line_mean": 38.9122807018, "line_max": 96, "alpha_frac": 0.5195604396, "autogenerated": false, "ratio": 3.65168539...
from frontera.core.manager import FrontierManager from converters import BaseRequestConverter, BaseResponseConverter class FrontierManagerWrapper(object): def __init__(self, settings, manager=None): manager = manager or FrontierManager self.manager = manager.from_settings(settings) def start...
{ "repo_name": "TeamHG-Memex/frontera", "path": "frontera/utils/managers.py", "copies": "1", "size": "2158", "license": "bsd-3-clause", "hash": 9215412267348764000, "line_mean": 48.0454545455, "line_max": 118, "alpha_frac": 0.6529193698, "autogenerated": false, "ratio": 4.316, "config_test": fal...
from frontera.core.manager import FrontierManager from converters import BaseRequestConverter, BaseResponseConverter class FrontierManagerWrapper(object): def __init__(self, settings): self.manager = FrontierManager.from_settings(settings) def start(self): if not hasattr(self, 'request_conve...
{ "repo_name": "rahulsharma1991/frontera", "path": "frontera/utils/managers.py", "copies": "5", "size": "2045", "license": "bsd-3-clause", "hash": -5062291660967596000, "line_mean": 50.125, "line_max": 118, "alpha_frac": 0.6528117359, "autogenerated": false, "ratio": 4.287211740041928, "config_t...
from frontera.settings import Settings class FakeFrontierManager(object): def __init__(self, settings): self.settings = settings self.auto_start = settings.get('AUTO_START') self.iteration = 0 self.finished = False self._started = True self._stopped = False ...
{ "repo_name": "TeamHG-Memex/frontera", "path": "frontera/tests/mocks/frontier_manager.py", "copies": "1", "size": "1615", "license": "bsd-3-clause", "hash": -2373274256556816400, "line_mean": 26.8448275862, "line_max": 87, "alpha_frac": 0.5913312693, "autogenerated": false, "ratio": 4.0375, "co...
from fronter import * class RoomInfo(Tool): class Message: def __init__(self, title, mid, url = None): self.title = title self.id = mid self.url = url self.text = '' self.xml = None self.fname = '' self.menu = {...
{ "repo_name": "kjempelodott/ananas", "path": "fronter/roominfo.py", "copies": "1", "size": "4499", "license": "mit", "hash": 1287192356156944000, "line_mean": 27.8397435897, "line_max": 93, "alpha_frac": 0.4945543454, "autogenerated": false, "ratio": 3.570634920634921, "config_test": false, "...
from fronter import * unescape = HTMLParser().unescape def to_file(xml, add_meta=False): fd, fname = mkstemp(prefix='fronter_', suffix='.html') string = '' if not add_meta else \ '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n' string += re.sub('</?div.*?>', '', une...
{ "repo_name": "kjempelodott/ananas", "path": "fronter/html.py", "copies": "1", "size": "1777", "license": "mit", "hash": -7291342526370586000, "line_mean": 29.1186440678, "line_max": 85, "alpha_frac": 0.4575126618, "autogenerated": false, "ratio": 3.648870636550308, "config_test": false, "has...
from frontpage.models import Article, Profile, Media, ArticleGroup from frontpage.uitools import body from django.http import HttpRequest from frontpage.management.magic import get_current_user, get_article_pcs_free from frontpage.management.form import Form, PlainText, SubmitButton, NumberField, TextField, CheckBox, C...
{ "repo_name": "Technikradio/C3FOCSite", "path": "c3shop/frontpage/management/articletools/article_page.py", "copies": "1", "size": "6381", "license": "bsd-3-clause", "hash": 4196826863107259400, "line_mean": 39.3860759494, "line_max": 121, "alpha_frac": 0.5840777308, "autogenerated": false, "rati...
from frontynium.exceptions import ObjectMappingNotFound, InvalidObjectMapping from frontynium.finder import Finder, ExpressionBuilder from types import FunctionType class Page(object): """Implementation of the PageObject Pattern (https://code.google.com/p/selenium/wiki/PageObjects) This class provides tools ...
{ "repo_name": "Ketouem/python-frontynium", "path": "frontynium/page.py", "copies": "1", "size": "4762", "license": "mit", "hash": 2349407716269278700, "line_mean": 33.2589928058, "line_max": 119, "alpha_frac": 0.5999580008, "autogenerated": false, "ratio": 4.274685816876122, "config_test": fals...
from frostsynth import epsilon, linspace from frostsynth.polytable import CubicTable def zeros(f, resolution=0.01, iterations=100): t0 = 0 f0 = f(t0) if abs(f0) < epsilon: yield 0 t1 = resolution f1 = f(t1) while True: while f0 * f1 >= 0: t0 = t1 f0 = f1...
{ "repo_name": "frostburn/frostsynth", "path": "frostsynth/numeric.py", "copies": "1", "size": "2132", "license": "mit", "hash": -2711941201260535000, "line_mean": 25.9873417722, "line_max": 123, "alpha_frac": 0.4788930582, "autogenerated": false, "ratio": 3.0632183908045976, "config_test": fals...
from frostsynth import * from frostsynth.interpolation import * def resampler0_gen(source, ratio): """Dynamic resampling of 'source' by variable ratio. Constant interpolation.""" ratio = to_iterable(ratio) sample = next(source) index = 0.0 source_index = 1 while True: yield sample ...
{ "repo_name": "frostburn/frostsynth", "path": "frostsynth/resample.py", "copies": "1", "size": "2229", "license": "mit", "hash": 5971018846677080000, "line_mean": 27.9480519481, "line_max": 95, "alpha_frac": 0.579632122, "autogenerated": false, "ratio": 3.70265780730897, "config_test": false, ...
from frozendict import frozendict from os import environ import googlemaps from pyrules2.route import Place, Route __author__ = 'nhc' # Read Google Maps API key from environment, and create a client object if the key was there try: key = environ['GOOGLE_MAPS_API_KEY'] _client_object = googlemaps.Client(key=ke...
{ "repo_name": "mr-niels-christensen/pyrules", "path": "src/pyrules2/route_gmaps.py", "copies": "1", "size": "2719", "license": "mit", "hash": -1640888612458466000, "line_mean": 39.5820895522, "line_max": 92, "alpha_frac": 0.6303788157, "autogenerated": false, "ratio": 4.151145038167939, "config...
from frozendict import frozendict import re _VM_KWARGS = ( ('ostype', 1), ('ostype_text', 'test'), ('dc_name', 'test'), ('disk_image', 'test'), ('disk_image_abbr', 'test'), ) VM_KWARGS = frozendict(_VM_KWARGS) VM_KWARGS_KEYS = tuple(VM_KWARGS.keys()) VM_KWARGS_NIC = frozendict(_VM_KWARGS + (('net...
{ "repo_name": "erigones/esdc-ce", "path": "api/mon/backends/abstract/__init__.py", "copies": "1", "size": "3935", "license": "apache-2.0", "hash": 2493233355199858700, "line_mean": 23.748427673, "line_max": 88, "alpha_frac": 0.6531130877, "autogenerated": false, "ratio": 4.060887512899897, "con...
from frozen_dict import FrozenDict def freeze(obj): ''' Recursive function which turns dictionaries into FrozenDict objects, lists into tuples, and sets into frozensets. Can also be used to turn JSON data into a hasahable value. ''' try: #See if the object is hashable ...
{ "repo_name": "zelaznik/frozen_dict", "path": "freeze_recursive.py", "copies": "1", "size": "1219", "license": "mit", "hash": 6448178210015224000, "line_mean": 22, "line_max": 66, "alpha_frac": 0.5537325677, "autogenerated": false, "ratio": 4.2622377622377625, "config_test": false, "has_no_ke...
from frozendict import frozendict from api.decorators import lock from api.mon.messages import MON_OBJ_HOSTGROUP from api.mon.backends.zabbix.exceptions import (RemoteObjectDoesNotExist, RemoteObjectAlreadyExists, RemoteObjectManipulationError) from api.mon.backends.zabb...
{ "repo_name": "erigones/esdc-ce", "path": "api/mon/backends/zabbix/containers/host_group.py", "copies": "1", "size": "7823", "license": "apache-2.0", "hash": 4155683692752875000, "line_mean": 39.324742268, "line_max": 120, "alpha_frac": 0.5977246581, "autogenerated": false, "ratio": 3.90759240759...
from frozendict import frozendict from api import serializers as s from vms.models import Node class NodeSerializer(s.Serializer): """ Node details serializer (read-only). """ hostname = s.Field() address = s.Field() status = s.IntegerChoiceField(choices=Node.STATUS_DB, read_only=True) no...
{ "repo_name": "erigones/esdc-ce", "path": "api/node/base/serializers.py", "copies": "1", "size": "1758", "license": "apache-2.0", "hash": -6024319982136754000, "line_mean": 40.8571428571, "line_max": 107, "alpha_frac": 0.649032992, "autogenerated": false, "ratio": 3.279850746268657, "config_tes...
from frozendict import frozendict from api import serializers as s from vms.models import Vm, Node class VmCreateSerializer(s.Serializer): recreate = s.BooleanField(default=False) force = s.BooleanField(default=False) class VmBaseSerializer(s.Serializer): """Save request and display node color for non-...
{ "repo_name": "erigones/esdc-ce", "path": "api/vm/base/serializers.py", "copies": "1", "size": "4230", "license": "apache-2.0", "hash": 5872266532632285000, "line_mean": 41.3, "line_max": 119, "alpha_frac": 0.6430260047, "autogenerated": false, "ratio": 3.566610455311973, "config_test": false, ...
from frozendict import frozendict from que.tasks import get_task_logger from api.mon.backends.zabbix.exceptions import (RemoteObjectManipulationError, RemoteObjectDoesNotExist, RemoteObjectAlreadyExists) from api.mon.backends.zabbix.containers.base import ZabbixBaseConta...
{ "repo_name": "erigones/esdc-ce", "path": "api/mon/backends/zabbix/containers/user_group.py", "copies": "1", "size": "12151", "license": "apache-2.0", "hash": 1005228748668497700, "line_mean": 40.0506756757, "line_max": 116, "alpha_frac": 0.6334458069, "autogenerated": false, "ratio": 3.754944375...
from frt_server.common import CommonColumns, Base from sqlalchemy import Table, Column, Integer, ForeignKey, String from sqlalchemy.orm import relationship class Tag(CommonColumns): __tablename__ = 'tag' text = Column(String(200)) type = Column(String(100)) tag_font_association_table = Table('tag_font_ass...
{ "repo_name": "HPI-SWA-Lab/BP2016H1", "path": "frt_server/tag.py", "copies": "1", "size": "1055", "license": "mit", "hash": -4180132482261220000, "line_mean": 42.9583333333, "line_max": 87, "alpha_frac": 0.7071090047, "autogenerated": false, "ratio": 3.7279151943462896, "config_test": false, ...
from frt_server.tests import TestMinimal from frt_server.tables import Family, Font from sqlalchemy.orm import joinedload import json import os class OtfDownloadingTestCase(TestMinimal): def setUp(self): super().setUp() self.login_as('eve@evil.com', 'eveisevil') family = Family(family_n...
{ "repo_name": "HPI-SWA-Lab/BP2016H1", "path": "frt_server/tests/test_otf_downloading.py", "copies": "1", "size": "1109", "license": "mit", "hash": -6920600139095400000, "line_mean": 28.1842105263, "line_max": 88, "alpha_frac": 0.6546438233, "autogenerated": false, "ratio": 3.4123076923076923, "...