text
stringlengths
0
1.05M
meta
dict
from eadrax.errors import AuthorisationError def load(**data): return Usecase( data['user'], data['repository'], data['authenticator'], data['encryptor'] ); class Usecase(object): def __init__(self, user, repository, authenticator, encryptor): self.user = user ...
{ "repo_name": "Moult/eadrax", "path": "eadrax/user/login.py", "copies": "1", "size": "1058", "license": "mit", "hash": 7767316220113809000, "line_mean": 26.8421052632, "line_max": 95, "alpha_frac": 0.6635160681, "autogenerated": false, "ratio": 4.2151394422310755, "config_test": false, "has_n...
from eadrax.errors import AuthorisationError, ValidationError def load(**data): return Usecase( Registrant( data['user'], data['repository'], data['authenticator'], data['emailer'], data['encryptor'], data['formatter'], dat...
{ "repo_name": "Moult/eadrax", "path": "eadrax/user/register.py", "copies": "1", "size": "2623", "license": "mit", "hash": -5213892012250892000, "line_mean": 28.4719101124, "line_max": 98, "alpha_frac": 0.5985512772, "autogenerated": false, "ratio": 4.203525641025641, "config_test": false, "ha...
from eAE.eAE import eAE def main(): # Setting up the connection to interface ip = "interfaceeae.doc.ic.ac.uk" port = 443 eae = eAE(ip, port) # Testing if the interface is Alive is_alive = eae.is_eae_alive() if is_alive != 200: raise Exception("!!!") # Initialize i...
{ "repo_name": "akaraspt/deepsleepnet", "path": "submit_eAE.py", "copies": "1", "size": "1057", "license": "apache-2.0", "hash": -1648083098059392300, "line_mean": 33.3, "line_max": 176, "alpha_frac": 0.6073793756, "autogenerated": false, "ratio": 3.282608695652174, "config_test": false, "has_...
from Eagle import SignalVertex import math def distance(p1, p2): """ Returns the distance between two points.""" coord1 = to_coord(p1) coord2 = to_coord(p2) return math.sqrt( (coord1[0]-coord2[0])**2 + (coord1[1]-coord2[1])**2 ) def distance_theta(p1, p2, theta): """ This function calculates the t...
{ "repo_name": "ghallsimpsons/pyEagle", "path": "Utils.py", "copies": "1", "size": "1280", "license": "unlicense", "hash": 6717168360969468000, "line_mean": 34.5555555556, "line_max": 78, "alpha_frac": 0.6453125, "autogenerated": false, "ratio": 3.0695443645083933, "config_test": false, "has_n...
from earley import Rule, print_result from reader import CStream, L2, Literal, Position import earley import sys import time class Parser(object): def __init__(self, symboltab, grammar, accept, debug=False): self.init, self.nullable = earley.simulate(grammar, accept, debug) self.symboltab = symbolt...
{ "repo_name": "cheery/lever", "path": "compiler/lever_parser/__init__.py", "copies": "1", "size": "6313", "license": "mit", "hash": 4754587037984176000, "line_mean": 40.5328947368, "line_max": 131, "alpha_frac": 0.5648661492, "autogenerated": false, "ratio": 3.826060606060606, "config_test": fa...
from earnings.models import Earning from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required import datetime from datetime import date, timedelta from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound from django....
{ "repo_name": "carquois/blobon", "path": "blobon/earnings/views.py", "copies": "1", "size": "1581", "license": "mit", "hash": 5779146299910666000, "line_mean": 46.9090909091, "line_max": 191, "alpha_frac": 0.7166350411, "autogenerated": false, "ratio": 3.9328358208955225, "config_test": false, ...
from earth_distance import get_earth_distance from datetime import date matchrank = 0 def decode_json_response(): pass def location_rank(loc_ref, loc_host, matchrank): distance = get_earth_distance(str(loc_ref),str(loc_host)) # great one if distance<10: matchrank+=5 elif distance<25: matchrank+=3 elif dist...
{ "repo_name": "RefugeeMatchmaking/HackZurich", "path": "GAE_Playground/matchmaking.py", "copies": "1", "size": "3018", "license": "mit", "hash": 8699176222947465000, "line_mean": 21.8712121212, "line_max": 95, "alpha_frac": 0.6829025845, "autogenerated": false, "ratio": 2.67790594498669, "confi...
from earth_distance import get_earth_distance matchrank = 0 def decode_json_response(): pass def location_rank(loc_ref, loc_host, matchrank): distance = get_earth_distance(loc_ref,loc_host) if distance<10: matchrank+=5 elif distance<25: matchrank+=3 elif distance<50: matchrank+=1 else: matchrank = 0 #...
{ "repo_name": "RefugeeMatchmaking/HackZurich", "path": "GAE_Playground/templates/matchmaking.py", "copies": "1", "size": "1384", "license": "mit", "hash": -5444779657896931000, "line_mean": 20.2923076923, "line_max": 96, "alpha_frac": 0.6929190751, "autogenerated": false, "ratio": 2.8595041322314...
from earthdragon.class_util import get_unbounded_super from earthdragon.multidecorator import MultiDecorator # TODO make this lockable class Attr: """ Represents a MultiDecorator that is meant to wrap the attr name it is assigned to. This could have just been a simple wrapper and handled by a metaclas...
{ "repo_name": "dalejung/earthdragon", "path": "earthdragon/feature/attr.py", "copies": "1", "size": "3060", "license": "mit", "hash": -6546200925617709000, "line_mean": 29, "line_max": 75, "alpha_frac": 0.5777777778, "autogenerated": false, "ratio": 4.358974358974359, "config_test": false, "h...
from earthdragon.typelet import Bool from earthdragon.multidecorator import ( MultiDecorator, require_self, static, only_self, first ) import nose.tools as nt from ... import feature from ...feature import features, FeatureBase, Attr from earthdragon.context import WithScope class BareFeature: ...
{ "repo_name": "dalejung/earthdragon", "path": "earthdragon/feature/test/test_feature.py", "copies": "1", "size": "2780", "license": "mit", "hash": 5969551522906998000, "line_mean": 21.24, "line_max": 72, "alpha_frac": 0.6014388489, "autogenerated": false, "ratio": 3.6057068741893645, "config_te...
from easilyb.os_ops.desktop import get_mouse_location, get_active_window import logging import time logger = logging.getLogger(__name__) import datetime SLEEP_INTERVAL = 10 #10 INACTIVITY_THRESHOLD = 60 # 60 SYNC_INTERVAL = 600 # 600 TIMEDATE_FORMAT = "%d/%m/%Y %H:%M:%S" class WindowActivityTracker: def __init__...
{ "repo_name": "xaled/wunderous-analytics", "path": "wunderous/activity_tracking.py", "copies": "1", "size": "3463", "license": "mit", "hash": 800792479963069000, "line_mean": 34.3469387755, "line_max": 121, "alpha_frac": 0.5578977765, "autogenerated": false, "ratio": 4.389100126742712, "config_...
from easyAI.AI.DictTT import DictTT from easyAI.AI.MTDbi import MTDbi try: import numpy as np except ImportError: print("Sorry, this example requires Numpy installed !") raise from easyAI import TwoPlayersGame class ConnectFour(TwoPlayersGame): """ The game of Connect Four, as described here: ...
{ "repo_name": "mrfesol/easyAI", "path": "easyAI/games/ConnectFour.py", "copies": "1", "size": "2570", "license": "mit", "hash": -8527333793128856000, "line_mean": 29.5952380952, "line_max": 73, "alpha_frac": 0.5101167315, "autogenerated": false, "ratio": 3.3333333333333335, "config_test": false...
from easyAI.AI.DictTT import DictTT try: import numpy as np except ImportError: print("Sorry, this example requires Numpy installed !") raise from easyAI import TwoPlayersGame class ConnectFour(TwoPlayersGame): """ The game of Connect Four, as described here: http://en.wikipedia.org/wiki/Conn...
{ "repo_name": "alekfestekjian/easyAI", "path": "easyAI/games/ConnectFour.py", "copies": "1", "size": "2527", "license": "mit", "hash": 7115789403715286000, "line_mean": 29.4457831325, "line_max": 72, "alpha_frac": 0.504946577, "autogenerated": false, "ratio": 3.360372340425532, "config_test": f...
from easyAI.AI import Negamax from easyAI.AI import TT from easyAI.Player import AI_Player def id_solve(game, ai_depths, win_score, scoring=None, tt=None, verbose=True): """ Solves a game using iterative deepening, i.e. determines if by playing perfectly the first player can force a win, or wheth...
{ "repo_name": "mrfesol/easyAI", "path": "easyAI/AI/solving.py", "copies": "1", "size": "5328", "license": "mit", "hash": 2667293747912526300, "line_mean": 29.1016949153, "line_max": 77, "alpha_frac": 0.6022897898, "autogenerated": false, "ratio": 3.9940029985007497, "config_test": false, "has...
from easyAI import TwoPlayersGame from easyAI.AI import MCTS from easyAI.AI.MCTS import MCTS class Nim(TwoPlayersGame): """ The game starts with 4 piles of 5 pieces. In turn the players remove as much pieces as they want, but from one pile only. The player that removes the last piece loses. A...
{ "repo_name": "mrfesol/easyAI", "path": "easyAI/games/Nim.py", "copies": "1", "size": "2767", "license": "mit", "hash": 2156008290160179000, "line_mean": 34.9350649351, "line_max": 78, "alpha_frac": 0.6172750271, "autogenerated": false, "ratio": 3.112485939257593, "config_test": false, "has_n...
from easyAI import TwoPlayersGame from easyAI.Player import Human_Player class TicTacToe( TwoPlayersGame ): """ The board positions are numbered as follows: 7 8 9 4 5 6 1 2 3 """ def __init__(self, players): self.players = players self.board = [0 for...
{ "repo_name": "mrfesol/easyAI", "path": "easyAI/games/TicTacToe.py", "copies": "2", "size": "1596", "license": "mit", "hash": -5838101583782162000, "line_mean": 30.94, "line_max": 70, "alpha_frac": 0.4805764411, "autogenerated": false, "ratio": 3.4923413566739607, "config_test": false, "has_n...
from easyAI import TwoPlayersGame # Convert D7 to (3,6) and back... to_string = lambda move: " ".join(["ABCDEFGHIJ"[move[i][0]] + str(move[i][1] + 1) for i in (0, 1)]) to_tuple = lambda s: ("ABCDEFGHIJ".index(s[0]), int(s[1:]) - 1) class Hexapawn(TwoPlayersGame): """ A nice...
{ "repo_name": "alekfestekjian/easyAI", "path": "easyAI/games/Hexapawn.py", "copies": "3", "size": "2453", "license": "mit", "hash": 2959650065924593000, "line_mean": 33.0694444444, "line_max": 81, "alpha_frac": 0.5067264574, "autogenerated": false, "ratio": 3.0855345911949685, "config_test": fa...
from easyAI import TwoPlayersGame class Nim(TwoPlayersGame): """ The game starts with 4 piles of 5 pieces. In turn the players remove as much pieces as they want, but from one pile only. The player that removes the last piece loses. Arguments: - players: the players... - piles: t...
{ "repo_name": "alekfestekjian/easyAI", "path": "easyAI/games/Nim.py", "copies": "2", "size": "2458", "license": "mit", "hash": 5237007857841783000, "line_mean": 34.1142857143, "line_max": 72, "alpha_frac": 0.6078112286, "autogenerated": false, "ratio": 3.221494102228047, "config_test": false, ...
from easy.ast import FuncDefinition, IdExpr from easy.type import Type from easy.visitors.base import BaseVisitor def error(msg, a=None, b=None): print msg lines = None if a and b: lines = (min(a.lineno_between + b.lineno_between), max(a.lineno_between + b.lineno_between)) elif a: line...
{ "repo_name": "helgefmi/Easy", "path": "src/easy/visitors/symbol_table.py", "copies": "1", "size": "6229", "license": "mit", "hash": -4160454093242051600, "line_mean": 31.7842105263, "line_max": 100, "alpha_frac": 0.57376786, "autogenerated": false, "ratio": 3.6512309495896833, "config_test": f...
from easy.ast import NumberExpr from easy.visitors.base import BaseVisitor class ConstantFoldingVisitor(BaseVisitor): def visitNumberExpr(self, node): return node def visitStringExpr(self, node): return node def visitFuncCallExpr(self, node): constants = self._visit_list(node.args...
{ "repo_name": "helgefmi/Easy", "path": "src/easy/visitors/constant_folding.py", "copies": "1", "size": "1828", "license": "mit", "hash": -3632752298040090000, "line_mean": 28.0158730159, "line_max": 85, "alpha_frac": 0.5979212254, "autogenerated": false, "ratio": 4.17351598173516, "config_test"...
from easyCall.apps.call_records.models import CallRecord, QueueEntry class TypeReport: """Retrieve record counts to provide to the report serializer.""" def __init__(self, list_type): self.call_record_set = CallRecord.objects.filter(list_type=list_type) self.list_type = list_type sel...
{ "repo_name": "jacquesbeukes/easy-call", "path": "easyCall/apps/lists/report.py", "copies": "1", "size": "1148", "license": "mit", "hash": 6786973365343710000, "line_mean": 33.8181818182, "line_max": 88, "alpha_frac": 0.6846689895, "autogenerated": false, "ratio": 3.5541795665634677, "config_te...
from easydata.func.function_db import dictfetchall, dictfetchall_pk from easydata.constant import CTYPE_DICT from django.utils.translation import ugettext_lazy as _ from django.db import connection def get_category_dict_pk(): cursor = connection.cursor() cursor.execute("SELECT cid,fid,name FROM `category_cate...
{ "repo_name": "ehomeshasha/easydata", "path": "easydata/func/function_category.py", "copies": "1", "size": "3772", "license": "mit", "hash": 8113033174103230000, "line_mean": 35.9901960784, "line_max": 189, "alpha_frac": 0.5999469777, "autogenerated": false, "ratio": 3.756972111553785, "config_...
from easydata.func.function_session import set_form_session_for_custom_field,\ clear_form_session_for_custom_field, save_value_session_for_custom_field from django.utils.translation import ugettext as _ def save_cleaned_data(cleaned_data, session): for key,value in cleaned_data.items(): save_value_sess...
{ "repo_name": "ehomeshasha/easydata", "path": "easydata/validator.py", "copies": "1", "size": "4221", "license": "mit", "hash": -8502051951031852000, "line_mean": 37.036036036, "line_max": 110, "alpha_frac": 0.6038853352, "autogenerated": false, "ratio": 3.9375, "config_test": false, "has_no_...
from easydev import TempFile from sequana.scripts import main as script import subprocess from sequana import sequana_data def test_sequana_app(): from click.testing import CliRunner runner = CliRunner() # fastq command filename1 = sequana_data("test.fastq") filename2 = sequana_data("test_1_1000....
{ "repo_name": "sequana/sequana", "path": "test/scripts/test_sequana.py", "copies": "1", "size": "1843", "license": "bsd-3-clause", "hash": -2464566388858816000, "line_mean": 29.7166666667, "line_max": 82, "alpha_frac": 0.6483993489, "autogenerated": false, "ratio": 3.4320297951582868, "config_t...
from easydict import EasyDict as edict import json config = edict() config.model = edict() config.model.result_path = "samples" config.model.checkpoint_path = "checkpoint" config.model.log_path = "log" config.model.scale = 4 config.model.resblock_depth = 10 config.model.recursive_depth = 1 config.valid = edict() co...
{ "repo_name": "zjuela/LapSRN-tensorflow", "path": "config.py", "copies": "1", "size": "1421", "license": "apache-2.0", "hash": 8214757290152758000, "line_mean": 37.4054054054, "line_max": 101, "alpha_frac": 0.6868402533, "autogenerated": false, "ratio": 2.9604166666666667, "config_test": true, ...
from easydict import EasyDict as edict import numpy as np __C = edict() cfg = __C __C.TRAIN = edict() __C.IMG_WIDTH = 300 __C.IMG_HEIGHT = 300 __C.IMG_CHANNEL = 3 __C.CLASS_NUM = 21 __C.BACKGROUND_ID = 0 # training settings __C.TRAIN.LEARNING_RATE = 0.001 / 4 __C.TRAIN.MOMENTUM = 0.9 __C.TRAIN.BATCH_SIZE = 32 __C.T...
{ "repo_name": "xinghai-sun/models", "path": "ssd/config/pascal_voc_conf.py", "copies": "1", "size": "2573", "license": "apache-2.0", "hash": 3311865019211779000, "line_mean": 27.2747252747, "line_max": 48, "alpha_frac": 0.6490478041, "autogenerated": false, "ratio": 2.080032336297494, "config_t...
from easyfuse import Operations as BaseOperations from llfuse import ROOT_INODE from easyfuse import Directory, File, mount from dokuwiki import DokuWiki import logging import argparse from pprint import pprint # noqa try: from config import Config except: from default_config import DefaultConfig as Config...
{ "repo_name": "JelteF/dokuwikifuse", "path": "dokuwikifuse.py", "copies": "1", "size": "6891", "license": "mit", "hash": 3028018115620359700, "line_mean": 25.6061776062, "line_max": 78, "alpha_frac": 0.5840951966, "autogenerated": false, "ratio": 3.7635172037138176, "config_test": true, "has_...
from easygui import * import serial, threading, datetime, time ZERO_PRECISION = 100 SERIAL_BAUD = 9600 SERIAL_PORT = "/dev/cu.usbmodem1263031" GUI_TITLE = "Spark Control GUI" die = False def dieThread(): while not die: readVal = teensy.readline().split(",") time = str(long(readVal[0])-subMils) val = str(float...
{ "repo_name": "ApsisAero/Spark", "path": "Python/Gui.py", "copies": "1", "size": "1815", "license": "mit", "hash": 7158452902390779000, "line_mean": 24.2083333333, "line_max": 104, "alpha_frac": 0.6936639118, "autogenerated": false, "ratio": 2.9274193548387095, "config_test": false, "has_no_k...
from easygui import * import subprocess import os, sys import nodefinder import requests, json import getpass import random import calendar, time import string import dogecoinrpc def Die(): sys.exit() def createpassword(): securetime = int(time.time()) numlist = [int(i) for i in str(securetime)] lengt...
{ "repo_name": "Argutus1/1ClickMiner", "path": "1ClickMiner.py", "copies": "1", "size": "3888", "license": "mit", "hash": 6756813624349294000, "line_mean": 36.0285714286, "line_max": 249, "alpha_frac": 0.5859053498, "autogenerated": false, "ratio": 3.7348703170028816, "config_test": false, "ha...
from easygui import * import sys def getval(msg="", title="", default="", minval=0, maxval=1): val_ok = False while not val_ok: val = enterbox(msg=msg, title=title, default=default) if val == None: if ynbox(msg="Really Exit?"): sys.exit(1) else: ...
{ "repo_name": "t-brandt/acorns-adi", "path": "adiparam/adiparam.py", "copies": "1", "size": "6258", "license": "bsd-2-clause", "hash": -4713262384701392000, "line_mean": 41.5714285714, "line_max": 82, "alpha_frac": 0.4525407478, "autogenerated": false, "ratio": 4.780748663101604, "config_test":...
from easygui import * def getval(msg="", title="", default="", minval=0, maxval=1): val_ok = False while not val_ok: val = enterbox(msg=msg, title=title, default=default) if val == None: if ynbox(msg="Really Exit?"): sys.exit(1) else: try: ...
{ "repo_name": "t-brandt/acorns-adi", "path": "adiparam/lociparam.py", "copies": "1", "size": "6139", "license": "bsd-2-clause", "hash": -3933809228107733500, "line_mean": 48.112, "line_max": 80, "alpha_frac": 0.4520280176, "autogenerated": false, "ratio": 4.510653930933137, "config_test": false...
from easy import ast class Parser(object): def __init__(self, tokens): self._tokens = tokens def _get_current_lineno(self): return self._tokens[0].lineno if self._tokens else -1 def _assert(self, cond, expected): if not cond: lineno = self._get_current_lineno() ...
{ "repo_name": "helgefmi/Easy", "path": "src/easy/parser.py", "copies": "1", "size": "5619", "license": "mit", "hash": 3680340545752159700, "line_mean": 32.0529411765, "line_max": 87, "alpha_frac": 0.5694963517, "autogenerated": false, "ratio": 3.8381147540983607, "config_test": false, "has_no...
from easyium import Chrome, StaticElement # This class maps the google page in the browser. class Google: def __init__(self): # Create a WebDriver instance for chrome. self._web_driver = Chrome() # The google apps grid button is in the top-right. # This button is always in the pag...
{ "repo_name": "KarlGong/easyium", "path": "examples/google.py", "copies": "2", "size": "2683", "license": "apache-2.0", "hash": -8843721877228822000, "line_mean": 35.2567567568, "line_max": 102, "alpha_frac": 0.6462914648, "autogenerated": false, "ratio": 3.905385735080058, "config_test": false...
from easy_print import * from working_init import * def main(): """ Working With Adversaries """ # optionally set max results tc.set_max_results("500") """ Get Adversary by ID Method: get_adversary_by_id(id) id -> adversary id # Use this method to return a single adv...
{ "repo_name": "andybarilla/TCPy_V2", "path": "working_with_adversaries.py", "copies": "1", "size": "11010", "license": "apache-2.0", "hash": -1780164047775211500, "line_mean": 28.36, "line_max": 87, "alpha_frac": 0.5707538601, "autogenerated": false, "ratio": 4.280715396578538, "config_test": f...
from easy_print import * from working_init import * def main(): """ Working With Emails """ # optionally set max results tc.set_max_results("500") """ Get Email by Id Method: get_email_by_id(id) id -> email id # Use this method to return a single email result by pass...
{ "repo_name": "andybarilla/TCPy_V2", "path": "working_with_emails.py", "copies": "1", "size": "10864", "license": "apache-2.0", "hash": 8849717794960596000, "line_mean": 27.9706666667, "line_max": 87, "alpha_frac": 0.5664580265, "autogenerated": false, "ratio": 4.336926147704591, "config_test":...
from easy_print import * from working_init import * def main(): """ Working With Groups """ # optionally set max results tc.set_max_results("500") """ Get Group Attributes Method: get_group_attributes(group_type, group_id): group_type -> predefined group type group_...
{ "repo_name": "andybarilla/TCPy_V2", "path": "working_with_groups.py", "copies": "1", "size": "11035", "license": "apache-2.0", "hash": -5527731696568494000, "line_mean": 28.3484042553, "line_max": 87, "alpha_frac": 0.5698232895, "autogenerated": false, "ratio": 4.370297029702971, "config_test"...
from easy_print import * from working_init import * def main(): """ Working With Incidents """ # optionally set max results tc.set_max_results("500") """ Get Incident by Id Method: get_incident_by_id(id) id -> email id # Use this method to return a single incident re...
{ "repo_name": "andybarilla/TCPy_V2", "path": "working_with_incidents.py", "copies": "1", "size": "10849", "license": "apache-2.0", "hash": -7984657919398907000, "line_mean": 28.0857908847, "line_max": 87, "alpha_frac": 0.5702829754, "autogenerated": false, "ratio": 4.310290027810886, "config_te...
from easy_print import * from working_init import * def main(): """ Working With Indicators """ # optionally set max results tc.set_max_results("500") """ Get Indicator Method: get_indicator(indicator, indicator_type=None, owners=[]): indicator -> any indicator indi...
{ "repo_name": "andybarilla/TCPy_V2", "path": "working_with_indicators.py", "copies": "1", "size": "27903", "license": "apache-2.0", "hash": 4823666079886906000, "line_mean": 30.3516853933, "line_max": 100, "alpha_frac": 0.5706196466, "autogenerated": false, "ratio": 4.334109972041007, "config_t...
from easy_print import * from working_init import * def main(): """ Working With Owners """ # optionally set max results tc.set_max_results("500") """ Get Owners Method: get_owners() Use this method to return all owners. The "tc.get_owners()" function can be used to g...
{ "repo_name": "andybarilla/TCPy_V2", "path": "working_with_owners.py", "copies": "1", "size": "7371", "license": "apache-2.0", "hash": -6798093968196118000, "line_mean": 27.5697674419, "line_max": 87, "alpha_frac": 0.5673585674, "autogenerated": false, "ratio": 4.32824427480916, "config_test": ...
from easy_print import * from working_init import * def main(): """ Working With Signatures """ # optionally set max results tc.set_max_results("500") """ Get Signature by Id Method: get_signature_by_id(id) id -> email id # Use this method to return a single signatur...
{ "repo_name": "andybarilla/TCPy_V2", "path": "working_with_signatures.py", "copies": "1", "size": "11181", "license": "apache-2.0", "hash": -8119043056834986000, "line_mean": 28.1171875, "line_max": 87, "alpha_frac": 0.5695376084, "autogenerated": false, "ratio": 4.357365549493375, "config_test...
from easy_print import * from working_init import * def main(): """ Working With Tags """ # optionally set max results tc.set_max_results("500") """ Get Tag by Name Method: get_tag_by_name(tag_name, owners=<list of owners>) tag_name -> tag name owners -> (optional) ...
{ "repo_name": "andybarilla/TCPy_V2", "path": "working_with_tags.py", "copies": "1", "size": "9547", "license": "apache-2.0", "hash": 8854881892844664000, "line_mean": 28.7414330218, "line_max": 87, "alpha_frac": 0.5702314863, "autogenerated": false, "ratio": 4.339545454545455, "config_test": fa...
from easy_print import * from working_init import * def main(): """ Working With Threats """ # optionally set max results tc.set_max_results("500") """ Get Threat by ID Method: get_threat_by_id(id) id -> threat id # Use this method to return a single threat result by...
{ "repo_name": "andybarilla/TCPy_V2", "path": "working_with_threats.py", "copies": "1", "size": "10904", "license": "apache-2.0", "hash": 1373141131782643000, "line_mean": 28, "line_max": 87, "alpha_frac": 0.5674064563, "autogenerated": false, "ratio": 4.2660406885759, "config_test": false, "h...
from easyprocess import EasyProcess from easyprocess import extract_version from PIL import Image import tempfile PROGRAM = 'import' URL = 'http://www.imagemagick.org/' PACKAGE = 'imagemagick' class ImagemagickWrapper(object): name = 'imagemagick' childprocess = True def __init__(self): EasyProc...
{ "repo_name": "daodaoliang/pyscreenshot", "path": "pyscreenshot/plugins/imagemagick.py", "copies": "1", "size": "1164", "license": "bsd-2-clause", "hash": -8908515771894519000, "line_mean": 29.6315789474, "line_max": 98, "alpha_frac": 0.5979381443, "autogenerated": false, "ratio": 3.8163934426229...
from easyprocess import EasyProcess from image_debug import img_debug from nose.tools import eq_, with_setup from pyvirtualdisplay import Display from PIL import ImageChops import pyscreenshot from config import bbox_ls def display_size(): # http://www.cyberciti.biz/faq/how-do-i-find-out-screen-resolution-of-my-l...
{ "repo_name": "daodaoliang/pyscreenshot", "path": "tests/size.py", "copies": "1", "size": "1290", "license": "bsd-2-clause", "hash": -2823389991352572400, "line_mean": 27.6666666667, "line_max": 91, "alpha_frac": 0.5953488372, "autogenerated": false, "ratio": 3.6440677966101696, "config_test": ...
from easyprocess import EasyProcess from pyvirtualdisplay.abstractdisplay import AbstractDisplay import logging log = logging.getLogger(__name__) PROGRAM = 'Xvfb' URL = None PACKAGE = 'xvfb' class XvfbDisplay(AbstractDisplay): ''' Xvfb wrapper Xvfb is an X server that can run on machines with no displa...
{ "repo_name": "suninsky/ReceiptOCR", "path": "Python/server/lib/python2.7/site-packages/pyvirtualdisplay/xvfb.py", "copies": "1", "size": "1563", "license": "mit", "hash": -5363503662381478000, "line_mean": 28.4905660377, "line_max": 86, "alpha_frac": 0.5681381958, "autogenerated": false, "ratio"...
from easyprocess import EasyProcess from pyvirtualdisplay.abstractdisplay import AbstractDisplay import logging log = logging.getLogger(__name__) PROGRAM = 'Xvnc' URL = None PACKAGE = 'tightvncserver' class XvncDisplay(AbstractDisplay): ''' Xvnc wrapper ''' def __init__(self, size=(1024, 768), color...
{ "repo_name": "suninsky/ReceiptOCR", "path": "Python/server/lib/python2.7/site-packages/pyvirtualdisplay/xvnc.py", "copies": "1", "size": "1336", "license": "mit", "hash": 451960090756389100, "line_mean": 30.0697674419, "line_max": 207, "alpha_frac": 0.5980538922, "autogenerated": false, "ratio":...
from easyprocess import EasyProcess from pyvirtualdisplay.abstractdisplay import AbstractDisplay PROGRAM = 'Xephyr' URL = None PACKAGE = 'xephyr' class XephyrDisplay(AbstractDisplay): ''' Xephyr wrapper Xephyr is an X server outputting to a window on a pre-existing X display ''' def __init__(sel...
{ "repo_name": "suninsky/ReceiptOCR", "path": "Python/server/lib/python2.7/site-packages/pyvirtualdisplay/xephyr.py", "copies": "1", "size": "1107", "license": "mit", "hash": -35009042533593244, "line_mean": 26.675, "line_max": 76, "alpha_frac": 0.5709123758, "autogenerated": false, "ratio": 3.996...
from easyprocess import EasyProcess import fnmatch import logging import os import time import tempfile from threading import Lock from pyvirtualdisplay import xauth mutex = Lock() log = logging.getLogger(__name__) # TODO: not perfect # randomize to avoid possible conflicts RANDOMIZE_DISPLAY_NR = False if RANDOMIZE...
{ "repo_name": "suninsky/ReceiptOCR", "path": "Python/server/lib/python2.7/site-packages/pyvirtualdisplay/abstractdisplay.py", "copies": "1", "size": "4276", "license": "mit", "hash": -5195576610168273000, "line_mean": 27.1315789474, "line_max": 76, "alpha_frac": 0.5633769878, "autogenerated": false...
from easyprocess import EasyProcess from psidialogs import mixins from psidialogs.iplugin import IPlugin from psidialogs.util import extract_version class GmessageWrapper(IPlugin): name = "gmessage" is_subprocess = True def backend_version(self): return extract_version(EasyProcess(["gmessage", "...
{ "repo_name": "ponty/psidialogs", "path": "psidialogs/plugins/gmessage_wrapper.py", "copies": "1", "size": "2626", "license": "bsd-2-clause", "hash": 2598172468687225000, "line_mean": 29.183908046, "line_max": 96, "alpha_frac": 0.5514089871, "autogenerated": false, "ratio": 3.6522948539638387, ...
from easyprocess import EasyProcess from psidialogs.iplugin import IPlugin from psidialogs.util import extract_version class ZenityWrapper(IPlugin): name = "zenity" is_subprocess = True def backend_version(self): return extract_version(EasyProcess(["zenity", "--version"]).call().stdout) def...
{ "repo_name": "ponty/psidialogs", "path": "psidialogs/plugins/zenity_wrapper.py", "copies": "1", "size": "4225", "license": "bsd-2-clause", "hash": -9148774678127537000, "line_mean": 29.3956834532, "line_max": 82, "alpha_frac": 0.5282840237, "autogenerated": false, "ratio": 3.970864661654135, "...
from easyprocess import EasyProcess from pyscreenshot.plugins.backend import CBackend from pyscreenshot.tempexport import read_prog_img from pyscreenshot.util import extract_version PROGRAM = "gnome-screenshot" # https://gitlab.gnome.org/GNOME/gnome-screenshot/blob/master/src/screenshot-utils.c # DBus is used for sc...
{ "repo_name": "ponty/pyscreenshot", "path": "pyscreenshot/plugins/gnome_screenshot.py", "copies": "1", "size": "1213", "license": "bsd-2-clause", "hash": -6929272377588707000, "line_mean": 31.7837837838, "line_max": 90, "alpha_frac": 0.6892003298, "autogenerated": false, "ratio": 3.47564469914040...
from easyprocess import EasyProcess from pyscreenshot.plugins.backend import UNKNOWN_VERSION, CBackend from pyscreenshot.tempexport import read_prog_img from pyscreenshot.util import platform_is_osx PROGRAM = "screencapture" # https://ss64.com/osx/screencapture.html # By default screneshots are saved as .png files, ...
{ "repo_name": "ponty/pyscreenshot", "path": "pyscreenshot/plugins/mac_screencapture.py", "copies": "1", "size": "1098", "license": "bsd-2-clause", "hash": -4542656891771160600, "line_mean": 27.8947368421, "line_max": 80, "alpha_frac": 0.6320582878, "autogenerated": false, "ratio": 3.7862068965517...
from easyprocess import EasyProcess def test_return_code(): # process has finished but no stop() or wait() was called assert EasyProcess("echo hello").start().sleep(0.5).return_code is None # wait() assert EasyProcess("echo hello").start().wait().return_code == 0 # stop() after process has finis...
{ "repo_name": "ponty/EasyProcess", "path": "tests/test_fast/test_returncode.py", "copies": "1", "size": "1287", "license": "bsd-2-clause", "hash": -8681390121400569000, "line_mean": 25.8125, "line_max": 79, "alpha_frac": 0.655011655, "autogenerated": false, "ratio": 3.7089337175792507, "config_...
from easyprocess import Proc, extract_version from pyavrutils.avrsize import AvrSize from pyavrutils.util import tmpdir, tmpfile, separate_sources, CompileError import tempfile from path import Path class AvrGccCompileError(CompileError): pass class AvrGcc(object): minprog = 'int main(){};' def __init_...
{ "repo_name": "ponty/pyavrutils", "path": "pyavrutils/avrgcc.py", "copies": "1", "size": "6977", "license": "bsd-2-clause", "hash": -6292870722429527000, "line_mean": 30.4279279279, "line_max": 79, "alpha_frac": 0.5328937939, "autogenerated": false, "ratio": 3.886908077994429, "config_test": fa...
from easyprocess import Proc from path import Path class AvrSizeError(Exception): pass class AvrSize(object): ''' wrapper for avr-size ''' def __init__(self): self.program_bytes = 0 self.data_bytes = 0 self.program_percentage = 0 self.data_percentage = 0 def ...
{ "repo_name": "ponty/pyavrutils", "path": "pyavrutils/avrsize.py", "copies": "1", "size": "1844", "license": "bsd-2-clause", "hash": 2855860828145582600, "line_mean": 28.2698412698, "line_max": 151, "alpha_frac": 0.5086767896, "autogenerated": false, "ratio": 3.802061855670103, "config_test": f...
from easypy.colors import Colorized from easypy.collections import listify class CancelledException(KeyboardInterrupt): pass def message(fmt, *args, wait_for_user=False, **kwargs): msg = fmt.format(*args, **kwargs) if (args or kwargs) else fmt print(Colorized(msg)) if wait_for_user: globals(...
{ "repo_name": "weka-io/easypy", "path": "easypy/interaction.py", "copies": "1", "size": "2054", "license": "bsd-3-clause", "hash": -4723060793098364000, "line_mean": 28.768115942, "line_max": 109, "alpha_frac": 0.5944498539, "autogenerated": false, "ratio": 3.803703703703704, "config_test": fal...
from easypy.exceptions import TException # TODO: some methods like fromkeys/update can insert keys which are not strings - and that causes problems. # need to either convert keys to strings (like in _convert), or raise ValueError. class Bunch(dict): __slots__ = ("__stop_recursing__",) def __getattr__(s...
{ "repo_name": "weka-io/easypy", "path": "easypy/bunch.py", "copies": "1", "size": "4027", "license": "bsd-3-clause", "hash": 2118277559941709600, "line_mean": 29.5075757576, "line_max": 114, "alpha_frac": 0.5612118202, "autogenerated": false, "ratio": 3.763551401869159, "config_test": false, ...
from easypy.humanize import from_hexdump, hexdump, IndentableTextBuffer, format_table _SAMPLE_DATA = b'J\x9c\xe8Z!\xc2\xe6\x8b\xa0\x01\xcb\xc3.x]\x11\x9bsC\x1c\xb2\xcd\xb3\x9eM\xf7\x13`\xc8\xce\xf8g1H&\xe2\x9b' \ b'\xd1\xa8\xfd\x14\x08U\x175\xc7\x03q\xac\xda\xe6)q}}T44\x9e\xb5;\xf1.\xf6*\x16\xba\xe0~m\x96o\xb...
{ "repo_name": "weka-io/easypy", "path": "tests/test_humanize.py", "copies": "1", "size": "3712", "license": "bsd-3-clause", "hash": -5026803642399037000, "line_mean": 40.2444444444, "line_max": 130, "alpha_frac": 0.6255387931, "autogenerated": false, "ratio": 2.4388961892247045, "config_test": ...
from easypy.meta import EasyMeta, GetAllSubclasses def test_easy_meta_before_cls_init(): class FooMaker(metaclass=EasyMeta): @EasyMeta.Hook def before_subclass_init(name, bases, dct): dct[name] = "foo" class BarMaker(metaclass=EasyMeta): @EasyMeta.Hook def before_...
{ "repo_name": "weka-io/easypy", "path": "tests/test_meta.py", "copies": "1", "size": "2968", "license": "bsd-3-clause", "hash": 5604151061457892000, "line_mean": 25.9818181818, "line_max": 94, "alpha_frac": 0.5781671159, "autogenerated": false, "ratio": 3.399770904925544, "config_test": false, ...
from easypy.semver import SemVer, SMV def test_loads(): semver = SemVer.loads('3.4.5.6-hello') assert semver.build == 6 assert semver.patch == 5 assert semver.minor == 4 assert semver.major == 3 assert semver.tag == 'hello' semver = SemVer.loads('3_4_5:hello', separator='_', tag_separator...
{ "repo_name": "weka-io/easypy", "path": "tests/test_semver.py", "copies": "1", "size": "1535", "license": "bsd-3-clause", "hash": -1091049392578777600, "line_mean": 27.9622641509, "line_max": 74, "alpha_frac": 0.6260586319, "autogenerated": false, "ratio": 2.918250950570342, "config_test": fals...
from easypy.units import byte, KiB def test_data_sizes(): assert "{0!s}, {0!r}, {0:10text}".format(byte) == "byte, byte, 1 byte" assert "{0!s}, {0!r}, {0:10text}".format(1000 * byte) == "KB, KB, 1 KB" assert "{0!s}, {0!r}, {0:10text}".format(1020 * byte) == "1020bytes, 1020*bytes, 1020bytes" ...
{ "repo_name": "weka-io/easypy", "path": "tests/test_units.py", "copies": "1", "size": "1232", "license": "bsd-3-clause", "hash": -9042219233887397000, "line_mean": 38.7419354839, "line_max": 110, "alpha_frac": 0.5430194805, "autogenerated": false, "ratio": 2.6157112526539277, "config_test": fal...
from easyquery import Query, QueryMaker _list_by_pgc = { # fmt: off 'hostlist_v1': ( 1952, 2052, 2081, 2437, 2778, 3089, 3743, 4948, 5139, 5619, 6110, 6656, 6993, 8160, 8631, 9057, 9747, 9788, 9843, 9988, 10330, 10965, 771919, 11819, 12007, 12431, 12626, 13130, 13166, 13602, 13881, 1399...
{ "repo_name": "sagasurvey/saga", "path": "SAGA/hosts/cuts.py", "copies": "1", "size": "4787", "license": "mit", "hash": -4986521314712266000, "line_mean": 44.1603773585, "line_max": 100, "alpha_frac": 0.6400668477, "autogenerated": false, "ratio": 2.36980198019802, "config_test": false, "has_...
from easyrec.utils import get_gateway from django import template from django.db.models import get_model Product = get_model('catalogue', 'Product') easyrec = get_gateway() register = template.Library() @register.assignment_tag def user_recommendations( user, max_results=None, requested_item_type=None...
{ "repo_name": "snowball-one/django-oscar-easyrec", "path": "easyrec/templatetags/recommendations.py", "copies": "1", "size": "3116", "license": "bsd-3-clause", "hash": -7078486877490891000, "line_mean": 21.4172661871, "line_max": 75, "alpha_frac": 0.5754172015, "autogenerated": false, "ratio": 3....
from easy_rest.views import RestApiView from challenge_framework.mixins import ChallengeMixin from users.models import Team from .models import RunningChallenge from challenge_processor.models import Challenge from django.views.generic import TemplateView from django.contrib.auth.mixins import LoginRequiredMixin from d...
{ "repo_name": "jonatanSh/challenge-framework", "path": "challenge_framework/challenge_runner/views.py", "copies": "1", "size": "2280", "license": "apache-2.0", "hash": 1633079259603734000, "line_mean": 30.6666666667, "line_max": 90, "alpha_frac": 0.6535087719, "autogenerated": false, "ratio": 4.1...
from easy_rest.views import RestApiView from easy_rest.mixins import ModelUnpacker, FunctionUnPackerMixin, DecorativeKeysMixin, HelpMixin, FormPostMixin from django.views.generic import CreateView, UpdateView, TemplateView from django.contrib.auth.models import User from easy_rest.test_framework.recorder.post_record_mi...
{ "repo_name": "jonatanSh/django-easy-rest", "path": "demo_app/demo_app/views.py", "copies": "1", "size": "2504", "license": "mit", "hash": -2321880060112598000, "line_mean": 35.2898550725, "line_max": 115, "alpha_frac": 0.6577476038, "autogenerated": false, "ratio": 4, "config_test": false, "...
from easysnmp import Session class Session(Session): def __get_tbl_row(self, table, index, *fields): """SNMP get given fields of given index row :param table: teasysnmp table :param index: the index that defines the row in the snmp table :returns: snmp get results :rtype:...
{ "repo_name": "thebinary/teasysnmp", "path": "teasysnmp/session.py", "copies": "1", "size": "3744", "license": "mit", "hash": -2677729442720830500, "line_mean": 29.4390243902, "line_max": 76, "alpha_frac": 0.5761217949, "autogenerated": false, "ratio": 4.2593856655290105, "config_test": false, ...
from easytesting import TestWrapper __author__ = 'Ulltor' class TestSuite(object): __tests = [] def __init__(self, name=None, version='1.0'): """ Initializes a new instance of TestSuite with given name and version :param name: test suite name :type name: str :param ...
{ "repo_name": "ulltor/easytesting", "path": "easytesting/TestSuite.py", "copies": "1", "size": "1045", "license": "mit", "hash": 4546429381070256000, "line_mean": 22.7727272727, "line_max": 75, "alpha_frac": 0.5799043062, "autogenerated": false, "ratio": 4.523809523809524, "config_test": true, ...
from easy_test.metas.options import Options class BaseMeta(type): """ Metaclass for all tests """ def __new__(cls, name, bases, attrs): super_new = super(BaseMeta, cls).__new__ # Ensure initialization is only performed for subclasses of Meta parents = [b for b in bases if isin...
{ "repo_name": "raphaelcmacedo/easy-test", "path": "easy_test/metas/base.py", "copies": "1", "size": "1326", "license": "mit", "hash": 4508725385973772000, "line_mean": 29.1363636364, "line_max": 72, "alpha_frac": 0.5467571644, "autogenerated": false, "ratio": 4.118012422360248, "config_test": f...
from easy_test.util import contains_option class Options(object): def __init__(self, meta): self.obj = meta.obj self.model = self.obj.__class__ #ModelTest if contains_option(meta, 'blank_fields'): self.blank_fields = meta.blank_fields if contains_option(meta,...
{ "repo_name": "raphaelcmacedo/easy-test", "path": "easy_test/metas/options.py", "copies": "1", "size": "1659", "license": "mit", "hash": -5559200757681942000, "line_mean": 29.7222222222, "line_max": 77, "alpha_frac": 0.6015672092, "autogenerated": false, "ratio": 4.178841309823677, "config_test...
from easy_thumbnails.conf import settings class Aliases: """ A container which stores and retrieves named easy-thumbnail options dictionaries. """ def __init__(self, populate_from_settings=True): """ Initialize the Aliases object. :param populate_from_settings: If ``True`...
{ "repo_name": "SmileyChris/easy-thumbnails", "path": "easy_thumbnails/alias.py", "copies": "1", "size": "4000", "license": "bsd-3-clause", "hash": -4388769496393527000, "line_mean": 31.2580645161, "line_max": 79, "alpha_frac": 0.5675, "autogenerated": false, "ratio": 4.419889502762431, "config_...
from easy_thumbnails.conf import settings class Aliases(object): """ A container which stores and retrieves named easy-thumbnail options dictionaries. """ def __init__(self, populate_from_settings=True): """ Initialize the Aliases object. :param populate_from_settings: If...
{ "repo_name": "vipins/ccccms", "path": "env/Lib/site-packages/easy_thumbnails/alias.py", "copies": "4", "size": "3983", "license": "bsd-3-clause", "hash": -4212003884579503600, "line_mean": 31.3821138211, "line_max": 79, "alpha_frac": 0.568666834, "autogenerated": false, "ratio": 4.41574279379157...
from easy_thumbnails.conf import settings class ThumbnailOptions(dict): def __init__(self, *args, **kwargs): self._prepared_options = None super().__init__(*args, **kwargs) if settings.THUMBNAIL_DEFAULT_OPTIONS: for key, value in settings.THUMBNAIL_DEFAULT_OPTIONS.items(): ...
{ "repo_name": "SmileyChris/easy-thumbnails", "path": "easy_thumbnails/options.py", "copies": "1", "size": "1615", "license": "bsd-3-clause", "hash": -7727681917201266000, "line_mean": 36.5581395349, "line_max": 78, "alpha_frac": 0.5448916409, "autogenerated": false, "ratio": 4.424657534246576, ...
from easy_thumbnails.exceptions import InvalidImageFormatError from rest_framework import serializers, relations from mes_fichiers.models import MonFichier, MonAlbum class FullUrlFileField(serializers.FileField): def to_native(self, value): return value.url class ThumbnailFileField(serializers.FileField...
{ "repo_name": "pavelulyashev/django-mes-fichiers", "path": "mes_fichiers/serializers.py", "copies": "1", "size": "2782", "license": "bsd-3-clause", "hash": -6293945764081777000, "line_mean": 28.9139784946, "line_max": 64, "alpha_frac": 0.6171818835, "autogenerated": false, "ratio": 4.415873015873...
from easy_thumbnails.files import Thumbnailer import os import re from filer import settings as filer_settings # match the source filename using `__` as the seperator. ``opts_and_ext`` is non # greedy so it should match the last occurence of `__`. # in ``ThumbnailerNameMixin.get_thumbnail_name`` we ensure that there i...
{ "repo_name": "ionelmc/django-filer", "path": "filer/utils/filer_easy_thumbnails.py", "copies": "2", "size": "2978", "license": "mit", "hash": -7993305787422829000, "line_mean": 40.375, "line_max": 109, "alpha_frac": 0.6584956347, "autogenerated": false, "ratio": 3.6140776699029127, "config_tes...
from easy_thumbnails import widgets from easy_thumbnails.files import get_thumbnailer from easy_thumbnails.tests import utils as test_utils from django.forms.widgets import ClearableFileInput class ImageClearableFileInput(test_utils.BaseTest): def setUp(self): super(ImageClearableFileInput, self).setUp()...
{ "repo_name": "enkiv2/popcorn_maker", "path": "vendor-local/lib/python/easy_thumbnails/tests/widgets.py", "copies": "4", "size": "3614", "license": "bsd-3-clause", "hash": -3353486890839804000, "line_mean": 39.606741573, "line_max": 79, "alpha_frac": 0.6430547869, "autogenerated": false, "ratio":...
from easy_thumbnails.processors import scale_and_crop def scale_and_crop_with_ranges( im, size, size_range=None, crop=False, upscale=False, zoom=None, target=None, **kwargs): """ An easy_thumbnails processor that accepts a `size_range` tuple, which indicates that one or both dimensions can give by a n...
{ "repo_name": "ic-labs/django-icekit", "path": "icekit/utils/images.py", "copies": "1", "size": "1337", "license": "mit", "hash": 7663301978715798000, "line_mean": 33.2820512821, "line_max": 92, "alpha_frac": 0.6499626028, "autogenerated": false, "ratio": 3.428205128205128, "config_test": false...
from easy.type import Type # Abstract class ASTNode(object): def accept(self, visitor, *args, **kwargs): name = self.__class__.__name__ return getattr(visitor, 'visit%s' % name)(self, *args, **kwargs) def is_leaf_node(self): return isinstance(self, StringExpr) or isinstance(self, Numbe...
{ "repo_name": "helgefmi/Easy", "path": "src/easy/ast.py", "copies": "1", "size": "1960", "license": "mit", "hash": 2107435058811415800, "line_mean": 24.7894736842, "line_max": 75, "alpha_frac": 0.6142857143, "autogenerated": false, "ratio": 3.6363636363636362, "config_test": false, "has_no_ke...
from easy.visitors.base import BaseVisitor class RegisterStack(object): def __init__(self): self._all_regs = ('%eax', '%ebx', '%ecx', '%edx', '%esi', '%edi') self._free_regs = list(self._all_regs) self._caller_save = ('%eax', '%ecx', '%edx') self._callee_save = ('%ebx', '%esi', '%ed...
{ "repo_name": "helgefmi/Easy", "path": "src/easy/visitors/codegen.py", "copies": "1", "size": "6581", "license": "mit", "hash": 8824844352949107000, "line_mean": 31.1024390244, "line_max": 79, "alpha_frac": 0.5330496885, "autogenerated": false, "ratio": 3.3593670239918327, "config_test": false,...
from eat.models import EarningsPage from eat.forms import * class AppUtil(object): @classmethod def get(cls, id): return Application.applications.get(pk=id) @classmethod def get_by_user(cls, user): app = Application.applications.filter(user=user.id) return app @classmeth...
{ "repo_name": "ask5/eatuxchallenge", "path": "eat/util.py", "copies": "1", "size": "4120", "license": "mit", "hash": -7259577331670747000, "line_mean": 28.219858156, "line_max": 96, "alpha_frac": 0.5347087379, "autogenerated": false, "ratio": 4.059113300492611, "config_test": false, "has_no_k...
from ebaysdk.finding import Connection from pprint import pprint import sync import json import sys import numpy as np import time import subprocess import threading #sandbox #api = Connection(domain='svcs.sandbox.ebay.com', appid="DylanJon-BigMarke-SBX-8007cb151-1613a88c", config_file=None) #production api = Connecti...
{ "repo_name": "willzhang05/bigmarketpricer", "path": "ebay_price.py", "copies": "1", "size": "2440", "license": "mit", "hash": -3536554396114359000, "line_mean": 31.972972973, "line_max": 135, "alpha_frac": 0.5942622951, "autogenerated": false, "ratio": 3.388888888888889, "config_test": false, ...
from _ebcf_alexa import incoming_types import pytest VALID_INTENT_LAMBDA_EVENT = { "session": { "new": False, "sessionId": "SessionId.10809a6f-e431-42f6-8d02-1d71ffab2251", "application": { "applicationId": "amzn1.ask.skill.d6f2f7c4-7689-410d-9c35-8f8baae37969" }, "attributes": {}, "use...
{ "repo_name": "dmotles/ebcf-alexa", "path": "test/test_incoming_types.py", "copies": "1", "size": "8736", "license": "mit", "hash": 1369954739622774500, "line_mean": 32.8604651163, "line_max": 249, "alpha_frac": 0.5564331502, "autogenerated": false, "ratio": 3.0684931506849313, "config_test": t...
from ebcli.core.abstractcontroller import AbstractBaseController from ebcli.operations.platformops import show_platform_events from ebcli.resources.strings import strings, flag_text class GenericPlatformEventsController(AbstractBaseController): class Meta: description = strings['platformevents.info'] ...
{ "repo_name": "pralexa/awsebcli", "path": "ebcli/controllers/platform/events.py", "copies": "1", "size": "1513", "license": "apache-2.0", "hash": -1569292656385472300, "line_mean": 32.6222222222, "line_max": 115, "alpha_frac": 0.6768010575, "autogenerated": false, "ratio": 4.023936170212766, "c...
from ebcli.core import io from ebcli.core.abstractcontroller import AbstractBaseController from ebcli.objects.exceptions import NotFoundError, InvalidPlatformVersionError from ebcli.objects.platform import PlatformVersion from ebcli.operations import platformops, logsops from ebcli.core import fileoperations from ebcl...
{ "repo_name": "pralexa/awsebcli", "path": "ebcli/controllers/platform/logs.py", "copies": "1", "size": "3120", "license": "apache-2.0", "hash": 9162656273870411000, "line_mean": 37.0487804878, "line_max": 113, "alpha_frac": 0.6467948718, "autogenerated": false, "ratio": 4.382022471910112, "conf...
from ebooklib import epub from bs4 import BeautifulSoup from nltk.tokenize import RegexpTokenizer from langtools.translator.TextTranslation import TextTranslation class EPUB(object): """docstring for EPUB""" def __init__(self, book_location): book = epub.read_epub(book_location) # Filter out...
{ "repo_name": "peterFran/LanguageListCreator", "path": "langtools/translator/EPUBTranslation.py", "copies": "1", "size": "1136", "license": "mit", "hash": -5023672845107301000, "line_mean": 31.4571428571, "line_max": 82, "alpha_frac": 0.6822183099, "autogenerated": false, "ratio": 4.0571428571428...
from ebooks.auth import is_safe_url, load_saml_settings, prepare_flask_request from unittest.mock import patch import os from flask import request def test_is_safe_url_is_safe(app): with app.test_request_context(): x = is_safe_url('http://localhost/?safe') assert x is True def test_is_safe_url...
{ "repo_name": "MITLibraries/ebooks", "path": "tests/test_auth.py", "copies": "1", "size": "1547", "license": "mit", "hash": -3861841098770576400, "line_mean": 31.914893617, "line_max": 79, "alpha_frac": 0.6535229476, "autogenerated": false, "ratio": 2.9579349904397705, "config_test": true, "h...
from ebs_deploy import get, parse_env_config, parse_option_settings, upload_application_archive def add_arguments(parser): """ adds arguments for the deploy command """ parser.add_argument('-e', '--environment', help='Environment name', required=True) parser.add_argument('-w', '--dont-wait', help=...
{ "repo_name": "cfeduke/ebs-deploy", "path": "ebs_deploy/commands/deploy_command.py", "copies": "1", "size": "2637", "license": "mit", "hash": -90377384827680020, "line_mean": 40.203125, "line_max": 109, "alpha_frac": 0.6033371255, "autogenerated": false, "ratio": 4.101088646967341, "config_test...
from ebs_deploy import out, parse_env_config def add_arguments(parser): """ Args for the delete environment command """ parser.add_argument('-e', '--environment', help='Environment name', required=True) parser.add_argument('-w', '--dont-wait', help='...
{ "repo_name": "cookbrite/ebs-deploy", "path": "ebs_deploy/commands/delete_environment_command.py", "copies": "4", "size": "1410", "license": "mit", "hash": 4860926465945081000, "line_mean": 33.3902439024, "line_max": 76, "alpha_frac": 0.5510638298, "autogenerated": false, "ratio": 4.6688741721854...
from ebs import Applicator from ebs import System from Components import PolygonShape from Components import Position from Components import Orientation from Components import Color from Components import MoveSpeed from Components import TurnSpeed from Components import Health from Components import FoodSeen from Compo...
{ "repo_name": "jpinsonault/creature_sim", "path": "Systems.py", "copies": "1", "size": "2555", "license": "mit", "hash": -2925555813498945500, "line_mean": 33.527027027, "line_max": 107, "alpha_frac": 0.5925636008, "autogenerated": false, "ratio": 4.802631578947368, "config_test": false, "has...
from ebs import Entity from Components import PolygonShape from Components import Orientation from Components import MoveSpeed from Components import TurnSpeed from Components import Health from Components import FoodSeen from Components import Collider from NeuralNetwork import NeuralNetwork from ShapeUtils import get...
{ "repo_name": "jpinsonault/creature_sim", "path": "Entities.py", "copies": "1", "size": "1296", "license": "mit", "hash": -5823058592288501000, "line_mean": 34.027027027, "line_max": 72, "alpha_frac": 0.6913580247, "autogenerated": false, "ratio": 3.7241379310344827, "config_test": false, "ha...
from ebs_snapshots.s3_backup_config import S3BackupConfig import unittest import yaml import boto from moto import mock_s3 class TestS3BackupConfig(unittest.TestCase): @mock_s3 def test_can_initialize(self): # if key doesn't exist, initialization should still succeed in case key # is written a...
{ "repo_name": "Clever/ebs-snapshots", "path": "test/test_s3_backup_config.py", "copies": "1", "size": "2022", "license": "apache-2.0", "hash": -8445613341438915000, "line_mean": 33.2711864407, "line_max": 79, "alpha_frac": 0.6018793274, "autogenerated": false, "ratio": 3.4564102564102566, "conf...
from ebu_tt_live.bindings.converters.ebutt1_ebutt3 import EBUTT1EBUTT3Converter from ebu_tt_live.documents.ebutt1 import EBUTT1Document from .base import AbstractCombinedNode from ebu_tt_live.documents.ebutt3 import EBUTT3Document from ebu_tt_live.bindings.converters.timedelta_converter \ import FixedOffsetSMPTEtoT...
{ "repo_name": "bbc/ebu-tt-live-toolkit", "path": "ebu_tt_live/node/ebutt1_ebutt3_producer.py", "copies": "1", "size": "4031", "license": "bsd-3-clause", "hash": -1808779112927376100, "line_mean": 41.4315789474, "line_max": 126, "alpha_frac": 0.639791615, "autogenerated": false, "ratio": 4.0149402...
from ebu_tt_live.bindings import ttd, tt_type, body_type, d_body_type, \ div_type, d_div_type, p_type, d_p_type, span_type, d_span_type, \ br_type, d_br_type, d_head_type, d_style_type, \ d_styling_type, head_type, style_type, styling, layout, d_layout_type, \ region_type, d_region_type, ebuttdt, Styled...
{ "repo_name": "bbc/ebu-tt-live-toolkit", "path": "ebu_tt_live/bindings/converters/ebutt3_ebuttd.py", "copies": "1", "size": "27864", "license": "bsd-3-clause", "hash": -2421132075444961300, "line_mean": 39.3826086957, "line_max": 130, "alpha_frac": 0.5620872811, "autogenerated": false, "ratio": 4...
from ebu_tt_live.bindings import tt, tt1_tt_type, tt1_body_type, \ body_type, div_type, tt1_head_type, tt1_layout_type, p_type, span_type, \ br_type, head_type, style_type, styling, layout, \ region_type, load_types_for_document from ebu_tt_live.bindings._ebuttm import headMetadata_type, documentMetadata, ...
{ "repo_name": "bbc/ebu-tt-live-toolkit", "path": "ebu_tt_live/bindings/converters/ebutt1_ebutt3.py", "copies": "1", "size": "15579", "license": "bsd-3-clause", "hash": 1887123829018426600, "line_mean": 32.7939262473, "line_max": 149, "alpha_frac": 0.5961229861, "autogenerated": false, "ratio": 4....
from ebu_tt_live.bindings import tt, ttd, tt_type, d_tt_type, body_type, d_body_type, div_type, d_div_type, \ p_type, d_p_type, span_type, d_span_type, br_type, d_br_type, d_metadata_type, d_head_type, d_style_type, \ d_styling_type, head_type, style_type, styling, layout, d_layout_type, region_type, d_region_t...
{ "repo_name": "ebu/ebu-tt-live-toolkit", "path": "ebu_tt_live/bindings/converters/ebutt3_ebuttd.py", "copies": "1", "size": "14465", "license": "bsd-3-clause", "hash": 2424093295507774000, "line_mean": 38.8484848485, "line_max": 130, "alpha_frac": 0.5908745247, "autogenerated": false, "ratio": 4....
from ebu_tt_live.documents.ebutt1 import EBUTT1Document from .base import IDocumentDataAdapter from ebu_tt_live.documents import EBUTT3EBUTTDConverter, EBUTTDDocument, EBUTT3Document, EBUTTAuthorsGroupControlRequest from ebu_tt_live.clocks.media import MediaClock from ebu_tt_live.errors import UnexpectedSequenceIdentif...
{ "repo_name": "bbc/ebu-tt-live-toolkit", "path": "ebu_tt_live/adapters/document_data.py", "copies": "1", "size": "4733", "license": "bsd-3-clause", "hash": 1437554938694943700, "line_mean": 32.5673758865, "line_max": 120, "alpha_frac": 0.6606803296, "autogenerated": false, "ratio": 3.990725126475...
from ebu_tt_live.documents import EBUTT3Document, EBUTT3DocumentSequence from pytest_bdd import given, when, then, scenarios, parsers import pytest scenarios('features/validation/sequence_identical_timing_model.feature') # We cannot use a sequence fixture here like in other sequence tests because # the sequence is ...
{ "repo_name": "bbc/ebu-tt-live-toolkit", "path": "testing/bdd/test_sequence_identical_timing_model.py", "copies": "2", "size": "3811", "license": "bsd-3-clause", "hash": 2714646883490245600, "line_mean": 32.1391304348, "line_max": 79, "alpha_frac": 0.7404880609, "autogenerated": false, "ratio": 3...
from ebu_tt_live.documents import EBUTT3Document, EBUTTDDocument, \ EBUTTAuthorsGroupControlRequest from ebu_tt_live.node.encoder import EBUTTDEncoder from ebu_tt_live.carriage.interface import IProducerCarriage from ebu_tt_live.errors import UnexpectedSequenceIdentifierError from ebu_tt_live import bindings from e...
{ "repo_name": "bbc/ebu-tt-live-toolkit", "path": "ebu_tt_live/node/test/test_encoder.py", "copies": "1", "size": "9788", "license": "bsd-3-clause", "hash": 4806337530033458000, "line_mean": 37.234375, "line_max": 91, "alpha_frac": 0.5768287699, "autogenerated": false, "ratio": 4.259355961705831, ...
from ebu_tt_live.documents import EBUTT3Document from datetime import timedelta from pytest_bdd import scenarios, when, then scenarios('features/validation/time_regex_parsing.feature', example_converters=dict(trusted_timedeltas_index=int)) trusted_timedeltas = [ timedelta(hours=15), timedelta(minutes=30), ...
{ "repo_name": "ebu/ebu-tt-live-toolkit", "path": "testing/bdd/test_time_regex_parsing.py", "copies": "2", "size": "1165", "license": "bsd-3-clause", "hash": 2991684028725059000, "line_mean": 36.5806451613, "line_max": 114, "alpha_frac": 0.7536480687, "autogenerated": false, "ratio": 3.46726190476...
from ebu_tt_live.documents import EBUTT3Document from ebu_tt_live.bindings._ebuttdt import FullClockTimingType from pytest_bdd import scenarios, when, then scenarios('features/timing/elements_active_times.feature') scenarios('features/timing/elements_active_times_empty_body.feature') @when('it has timeBase <time_base...
{ "repo_name": "bbc/ebu-tt-live-toolkit", "path": "testing/bdd/test_elements_active_times.py", "copies": "1", "size": "5650", "license": "bsd-3-clause", "hash": -6262945449699298000, "line_mean": 43.8412698413, "line_max": 156, "alpha_frac": 0.7267256637, "autogenerated": false, "ratio": 3.6475145...
from ebu_tt_live.errors import SemanticValidationError from ebu_tt_live.strings import ERR_SEMANTIC_STYLE_MISSING, ERR_SEMANTIC_VALIDATION_EXPECTED, \ ERR_SEMANTIC_REGION_MISSING class SizingValidationMixin(object): """ This is meant to validate that the sizing types correspond to the tt element and head ...
{ "repo_name": "ebu/ebu-tt-live-toolkit", "path": "ebu_tt_live/bindings/validation/presentation.py", "copies": "1", "size": "8202", "license": "bsd-3-clause", "hash": -1527494527932342500, "line_mean": 41.0615384615, "line_max": 124, "alpha_frac": 0.6510607169, "autogenerated": false, "ratio": 4.5...