text
stringlengths
0
1.05M
meta
dict
from functools import wraps import atexit import requests from bs4 import BeautifulSoup HEADERS = {'User-Agent': 'Pinote-Better.py'} class PinoteError(Exception): @staticmethod def error_handler(msg=''): def error_handler_decorator(func): @wraps(func) def func_wrapper(*args, ...
{ "repo_name": "HyShai/PinoteBetter", "path": "pinote.py", "copies": "1", "size": "4423", "license": "mit", "hash": -5297122452093000000, "line_mean": 33.2868217054, "line_max": 92, "alpha_frac": 0.5369658603, "autogenerated": false, "ratio": 3.9632616487455197, "config_test": false, "has_no_k...
from functools import wraps import base64 import json from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from simpleoncall.api import APIResponse from simpleoncall.models import TeamMember, APIKey from simpleoncall.internal import InternalResponse def require_authentication(re...
{ "repo_name": "simpleoncall/simpleoncall", "path": "simpleoncall/decorators.py", "copies": "1", "size": "3260", "license": "mit", "hash": 543894152811791800, "line_mean": 31.2772277228, "line_max": 81, "alpha_frac": 0.5564417178, "autogenerated": false, "ratio": 4.690647482014389, "config_test"...
from functools import wraps import base64 from django.http import HttpResponse from django.contrib.auth import authenticate, login from django.conf import settings from ping.defaults import PING_BASIC_AUTH def http_basic_auth(func): """ Attempts to login user with u/p provided in HTTP_AUTHORIZATION header. ...
{ "repo_name": "gpennington/django-ping", "path": "ping/decorators.py", "copies": "2", "size": "1580", "license": "mit", "hash": -1756463748971201500, "line_mean": 38.525, "line_max": 81, "alpha_frac": 0.6050632911, "autogenerated": false, "ratio": 4.463276836158192, "config_test": false, "has...
from functools import wraps import base import counters def count(name=None, auto_add_counter=counters.EventCounter): """ A shortcut decorator to count the number times a function is called. Uses the :obj:`counters.EventCounter` counter by default. If the parameter name is not supplied events are ...
{ "repo_name": "prismskylabs/pycounters", "path": "src/pycounters/shortcuts.py", "copies": "1", "size": "3961", "license": "apache-2.0", "hash": 5936524676374575000, "line_mean": 40.6947368421, "line_max": 144, "alpha_frac": 0.6632163595, "autogenerated": false, "ratio": 4.0091093117408905, "con...
from functools import wraps import bsddb3 as bsddb import json import pdb from sqlalchemy import create_engine, engine from db import * def get_cache(): eng = db_connect('cache') db = eng.connect() try: db.execute("create table cache(key varchar, val text)") except: pass return eng, db def make...
{ "repo_name": "sirrice/dbwipes", "path": "dbwipes/summary.py", "copies": "1", "size": "11293", "license": "mit", "hash": 7347302531560040000, "line_mean": 26.3438256659, "line_max": 142, "alpha_frac": 0.5644204374, "autogenerated": false, "ratio": 3.308819220627014, "config_test": false, "has...
from functools import wraps import certifi from flask import session from grano.core import oauth, app from grano.lib.serialisation import jsonify class Stub(): """ A stub authorization handler to sit in for auth methods that are not currently enabled. """ def __init__(self, name): self.name = ...
{ "repo_name": "4bic/grano", "path": "grano/providers.py", "copies": "4", "size": "2563", "license": "mit", "hash": 3720114015045215000, "line_mean": 32.2857142857, "line_max": 75, "alpha_frac": 0.6394849785, "autogenerated": false, "ratio": 3.6354609929078014, "config_test": true, "has_no_key...
from functools import wraps import click from botocore.exceptions import ClientError from commands import command import listobj def handle_not_subscribed(user, address, list_address): if user == address: click.echo( 'You are not subscribed to {}.'.format(list_address), err...
{ "repo_name": "ilg/LambdaMLM", "path": "lambda/control/list_commands.py", "copies": "1", "size": "8395", "license": "mit", "hash": -6882759350887754000, "line_mean": 38.0465116279, "line_max": 181, "alpha_frac": 0.6719475878, "autogenerated": false, "ratio": 3.6723534558180226, "config_test": f...
from functools import wraps import collections import crontab import django from django.core.management import get_commands, load_command_class try: from importlib import import_module except ImportError: from django.utils.importlib import import_module from kronos.settings import PROJECT_MODULE, KRONOS_PYTHO...
{ "repo_name": "joshblum/django-kronos", "path": "kronos/__init__.py", "copies": "1", "size": "4153", "license": "mit", "hash": 172252014169007330, "line_mean": 25.9675324675, "line_max": 82, "alpha_frac": 0.5870455093, "autogenerated": false, "ratio": 3.8704566635601116, "config_test": false, ...
from functools import wraps import copy import os import inspect import math import maya.cmds as cmds import pymel.core as pm import pymel.core.datatypes as dt import maya.mel as mm versionList=['v',0.2,2017,10,1] version= ".".join([str(o) for o in versionList]) #################### Global Variable sceneUnit= pm.curr...
{ "repo_name": "josephkirk/PipelineTools", "path": "core/anim_utils.py", "copies": "1", "size": "22245", "license": "bsd-2-clause", "hash": 1846385856873144800, "line_mean": 37.0890410959, "line_max": 228, "alpha_frac": 0.6223251214, "autogenerated": false, "ratio": 3.482154038822793, "config_te...
from functools import wraps import core import pickle import os AX_NAME_REPLACERS = (("",""),("Definition","Def"), ('EdgeCode','Edgecode')) def Ax(sp): """ converts a smartpointer (objects prefixed with SP) object to a AxObject. if sp is not a smartpointer the object is returned as is...
{ "repo_name": "markreidvfx/pyaaf_old", "path": "pyaaf/util.py", "copies": "1", "size": "3774", "license": "mit", "hash": 5096783859494318000, "line_mean": 25.7730496454, "line_max": 85, "alpha_frac": 0.5582935877, "autogenerated": false, "ratio": 3.6080305927342256, "config_test": false, "has...
from functools import wraps import core AX_NAME_REPLACERS = (("",""),("Definition","Def"),('EdgeCode','Edgecode')) def Ax(sp): """ converts smartpointer(SP) object to corresponding AxObject. if sp does not have the a method named GetClassName the object is returned as is """ if not hasattr(sp...
{ "repo_name": "DIT-Tools/pyaaf", "path": "pyaaf/util.py", "copies": "1", "size": "3265", "license": "mit", "hash": 3081121906868445000, "line_mean": 26.2166666667, "line_max": 84, "alpha_frac": 0.5473200613, "autogenerated": false, "ratio": 3.7702078521939955, "config_test": false, "has_no_ke...
from functools import wraps import datetime from requests import cookies import json import re import requests from requests import structures import sys try: import urlparse except ImportError: import urllib.parse as urlparse if sys.version_info >= (3, 0, 0): basestring = str class Headers(object): ...
{ "repo_name": "mbylstra/django-wham", "path": "wham/httmock.py", "copies": "1", "size": "5941", "license": "mit", "hash": 703179664096848000, "line_mean": 31.2880434783, "line_max": 80, "alpha_frac": 0.5556303653, "autogenerated": false, "ratio": 4.497350492051476, "config_test": false, "has_...
from functools import wraps import datetime import json import os import re import urlparse from flask import Flask, flash, g, redirect, request, render_template, Response from flask.ext.babel import Babel import postmark import pymongo import requests LANGUAGES = ('en', 'es') EMPTY_BLOCK = """<br><br>""" POSTMARK_K...
{ "repo_name": "sunlightlabs/openingparliament", "path": "web.py", "copies": "2", "size": "6872", "license": "bsd-3-clause", "hash": 3251991926618207000, "line_mean": 22.2162162162, "line_max": 155, "alpha_frac": 0.6143771828, "autogenerated": false, "ratio": 3.525910723447922, "config_test": fa...
#from functools import wraps #import datetime #import logging from flask import Flask, current_app, request, jsonify, g from flask_restful import Resource, Api, reqparse, HTTPException from flask_mysqldb import MySQL import jwt import bcrypt from api.controllers.base import BaseController from api.controllers.user i...
{ "repo_name": "rwolande/wapi", "path": "app.py", "copies": "1", "size": "1176", "license": "mit", "hash": -2616772197639104500, "line_mean": 24.0212765957, "line_max": 65, "alpha_frac": 0.7270408163, "autogenerated": false, "ratio": 3.458823529411765, "config_test": false, "has_no_keywords": ...
from functools import wraps import errno import os import signal import getpass import unittest from sshaolin.client import SSHClient class BaseTestCase(unittest.TestCase): username = getpass.getuser() @classmethod def setUpClass(cls): super(BaseTestCase, cls).setUpClass() cls.client = S...
{ "repo_name": "bucknerns/sshaolin", "path": "tests/base_test.py", "copies": "1", "size": "1206", "license": "apache-2.0", "hash": 7614402637451429000, "line_mean": 20.9272727273, "line_max": 64, "alpha_frac": 0.644278607, "autogenerated": false, "ratio": 4.1020408163265305, "config_test": true,...
from functools import wraps import errno import os import signal import time class TimeoutError(Exception): pass def timeout(seconds, error_message=os.strerror(errno.ETIME)): def decorator(func): def _handle_timeout(signum, frame): raise TimeoutError(error_message) def wrapper(*...
{ "repo_name": "skjindal93/Ultimate-Tic-Tac-Toe", "path": "timeout.py", "copies": "1", "size": "1096", "license": "apache-2.0", "hash": 4557387805126981600, "line_mean": 22.8260869565, "line_max": 61, "alpha_frac": 0.5428832117, "autogenerated": false, "ratio": 4.248062015503876, "config_test": ...
from functools import wraps import errno import os import signal #============================================================================== # Variables #============================================================================== # Some descriptive variables #name = "virtdc" #version ...
{ "repo_name": "dineshappavoo/virtdc", "path": "simulation/timeout.py", "copies": "2", "size": "1183", "license": "mit", "hash": -1858173311888884700, "line_mean": 30.1315789474, "line_max": 123, "alpha_frac": 0.4759087067, "autogenerated": false, "ratio": 5.07725321888412, "config_test": false,...
from functools import wraps import errno import os import sys import signal #Signal module doesn't work if sys.platform=='win32': import wtimeout class TimeoutError(Exception): pass def timeout(seconds=2147483647, error_message='Timer Expired'): def decorator(func): if sys.platform=='win32': ...
{ "repo_name": "fugue/emulambda", "path": "emulambda/timeout.py", "copies": "1", "size": "1359", "license": "apache-2.0", "hash": -3821085345849352000, "line_mean": 26.18, "line_max": 63, "alpha_frac": 0.4981604121, "autogenerated": false, "ratio": 4.978021978021978, "config_test": false, "has...
from functools import wraps import glob import os import sys import threading import uuid try: from redis import Redis from redis.client import pairs_to_dict from redis.client import zset_score_pairs from redis.exceptions import ConnectionError from redis.exceptions import TimeoutError except Impor...
{ "repo_name": "coleifer/walrus", "path": "walrus/database.py", "copies": "1", "size": "15164", "license": "mit", "hash": 8934847825753778000, "line_mean": 31.9652173913, "line_max": 79, "alpha_frac": 0.5941044579, "autogenerated": false, "ratio": 4.370028818443804, "config_test": false, "has_...
from functools import wraps import glob import os import threading import uuid try: from redis import Redis except ImportError: Redis = object from walrus.autocomplete import Autocomplete from walrus.cache import Cache from walrus.containers import Array from walrus.containers import Hash from walrus.containe...
{ "repo_name": "johndlong/walrus", "path": "walrus/database.py", "copies": "1", "size": "10841", "license": "mit", "hash": 8555139882802138000, "line_mean": 30.1522988506, "line_max": 77, "alpha_frac": 0.5744857485, "autogenerated": false, "ratio": 4.389068825910932, "config_test": false, "has...
from functools import wraps import hashlib from hashlib import sha256 import re import six if six.PY3: long = int def ensure_bytes(data): if not isinstance(data, six.binary_type): return data.encode('utf-8') return data def ensure_str(data): if isinstance(data, six.binary_type): re...
{ "repo_name": "BlockIo/multimerchant-python", "path": "multimerchant/wallet/utils.py", "copies": "2", "size": "1730", "license": "mit", "hash": -9147594990519714000, "line_mean": 24.0724637681, "line_max": 76, "alpha_frac": 0.6317919075, "autogenerated": false, "ratio": 3.4257425742574257, "con...
from functools import wraps import hashlib import datetime import mimetypes import random from bson import ObjectId from flask import jsonify, Response, url_for from flask_jwt import jwt_required, current_user from flask_restful import reqparse, abort import pymongo import werkzeug from werkzeug.utils import secure_fi...
{ "repo_name": "SillentTroll/rascam_server", "path": "wsgi/camera_api.py", "copies": "1", "size": "8578", "license": "apache-2.0", "hash": 8801335565332977000, "line_mean": 35.6581196581, "line_max": 118, "alpha_frac": 0.5606201912, "autogenerated": false, "ratio": 3.850089766606822, "config_tes...
from functools import wraps import hashlib import pickle import sys import threading import time try: from Queue import Queue # Python 2 except ImportError: from queue import Queue # Python 3 from walrus.utils import decode from walrus.utils import encode from walrus.utils import PY3 if PY3: imap = map ...
{ "repo_name": "coleifer/walrus", "path": "walrus/cache.py", "copies": "1", "size": "10016", "license": "mit", "hash": 7708376526262107000, "line_mean": 30.4968553459, "line_max": 79, "alpha_frac": 0.5405351438, "autogenerated": false, "ratio": 4.406511218653762, "config_test": false, "has_no_...
from functools import wraps import hashlib import pickle from wrapt import ObjectProxy class CacheMissError(RuntimeError): """ Exception thrown when memorized object is not found in cache and error_on_miss is set to True. """ pass class MemorizedObject(ObjectProxy): """ Thin wrapper aro...
{ "repo_name": "chuckharmston/ghosttown", "path": "app/memorize.py", "copies": "1", "size": "3947", "license": "mpl-2.0", "hash": 8090964513126626000, "line_mean": 30.0787401575, "line_max": 79, "alpha_frac": 0.5877881936, "autogenerated": false, "ratio": 3.907920792079208, "config_test": false,...
from functools import wraps import hashlib import time import os from flask import current_app, Response, request from werkzeug.http import parse_authorization_header from radiocrepe.storage import DistributedStorage nonce_registry = {} def with_hub_db(f): @wraps(f) def _wrapper(*args, **kwargs): st...
{ "repo_name": "pferreir/radiocrepe", "path": "radiocrepe/web/util.py", "copies": "1", "size": "2908", "license": "mit", "hash": 1729710253519627800, "line_mean": 38.8356164384, "line_max": 137, "alpha_frac": 0.5842503439, "autogenerated": false, "ratio": 3.9618528610354224, "config_test": false...
from functools import wraps import hashlib from django.conf import settings from django.core.cache import cache from django.utils.decorators import decorator_from_middleware, available_attrs def get_cache_key(request, key_prefix, key_generator=None): """ The cache is keyed by md5 of full request path includin...
{ "repo_name": "shaunsephton/djanginxed", "path": "djanginxed/decorators/cache.py", "copies": "1", "size": "1814", "license": "bsd-3-clause", "hash": 3281553517619224600, "line_mean": 44.35, "line_max": 113, "alpha_frac": 0.7056229327, "autogenerated": false, "ratio": 4.288416075650118, "config_...
from functools import wraps import heapq from annoying.functions import get_object_or_None from django.http import HttpResponseRedirect, HttpResponseNotFound from django.conf import settings from django.utils import timezone from django.utils.module_loading import import_string from schedule.conf.settings import ( ...
{ "repo_name": "Gustavosdo/django-scheduler", "path": "schedule/utils.py", "copies": "2", "size": "8845", "license": "bsd-3-clause", "hash": 8639920163481174000, "line_mean": 36.3248945148, "line_max": 124, "alpha_frac": 0.6252119842, "autogenerated": false, "ratio": 4.172169811320755, "config_t...
from functools import wraps import hmac import hashlib import time import warnings import logging import requests logger = logging.getLogger(__name__) class BitstampError(Exception): pass class TransRange(object): """ Enum like object used in transaction method to specify time range from which to g...
{ "repo_name": "kmadac/bitstamp-python-client", "path": "bitstamp/client.py", "copies": "1", "size": "20246", "license": "mit", "hash": -4918496093026124000, "line_mean": 33.1993243243, "line_max": 106, "alpha_frac": 0.5674207251, "autogenerated": false, "ratio": 4.200414937759336, "config_test"...
from functools import wraps import hmac from flask import request, make_response, g, current_app, Response permissions = ['r', 'w', 'u'] def _secret_key(key=None): if key is None: key = current_app.config['SECRET_KEY'] if isinstance(key, unicode): # pragma: no cover key = key.encode('lati...
{ "repo_name": "nrudenko/anarcho", "path": "anarchoApp/anarcho/access_manager.py", "copies": "1", "size": "3131", "license": "mit", "hash": 6645208918513681000, "line_mean": 30.9591836735, "line_max": 109, "alpha_frac": 0.5927818588, "autogenerated": false, "ratio": 4.019255455712452, "config_te...
from functools import wraps import importlib import logging from google.appengine.ext.webapp import template import webapp2 class AdminApplication(webapp2.WSGIApplication): ''' The Application Admin is the central element in the admin framework. It keeps references and reverse references to AdminModel cl...
{ "repo_name": "sminteractive/ndb-gae-admin", "path": "smadmin/core/app.py", "copies": "1", "size": "5073", "license": "apache-2.0", "hash": 2499360666341212700, "line_mean": 31.3121019108, "line_max": 79, "alpha_frac": 0.5980682042, "autogenerated": false, "ratio": 4.489380530973452, "config_te...
from functools import wraps import inspect from itertools import chain import logging from django.conf import settings from django.contrib import messages from django.core import cache from django.http import HttpRequest, HttpResponse from django.utils import translation from cachecow.cache import set_cache, make_key...
{ "repo_name": "aehlke/django-cachecow", "path": "cachecow/decorators.py", "copies": "1", "size": "11169", "license": "bsd-3-clause", "hash": 9104367011049402000, "line_mean": 39.6145454545, "line_max": 84, "alpha_frac": 0.6306741875, "autogenerated": false, "ratio": 4.1675373134328355, "config_...
from functools import wraps import inspect from textwrap import dedent from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union import warnings from pandas._libs.properties import cache_readonly # noqa def deprecate( name: str, alternative: Callable, version: str, alt_name: Optiona...
{ "repo_name": "toobaz/pandas", "path": "pandas/util/_decorators.py", "copies": "2", "size": "11438", "license": "bsd-3-clause", "hash": -1336472687813775400, "line_mean": 33.1432835821, "line_max": 85, "alpha_frac": 0.5959083756, "autogenerated": false, "ratio": 4.188209447088979, "config_test"...
from functools import wraps import inspect from textwrap import dedent from typing import Any, Callable, List, Mapping, Optional, Tuple, Type, Union, cast import warnings from pandas._libs.properties import cache_readonly # noqa from pandas._typing import F def deprecate( name: str, alternative: Callable[.....
{ "repo_name": "gfyoung/pandas", "path": "pandas/util/_decorators.py", "copies": "2", "size": "17021", "license": "bsd-3-clause", "hash": 6662914865063588000, "line_mean": 34.0948453608, "line_max": 85, "alpha_frac": 0.5954996769, "autogenerated": false, "ratio": 4.29281210592686, "config_test":...
from functools import wraps import inspect from textwrap import dedent import warnings from pandas._libs.properties import cache_readonly # noqa from pandas.compat import PY2, callable, signature def deprecate(name, alternative, version, alt_name=None, klass=None, stacklevel=2, msg=None): """Retur...
{ "repo_name": "GuessWhoSamFoo/pandas", "path": "pandas/util/_decorators.py", "copies": "1", "size": "12597", "license": "bsd-3-clause", "hash": -7086385044083773000, "line_mean": 34.7869318182, "line_max": 79, "alpha_frac": 0.5812495039, "autogenerated": false, "ratio": 4.300785250938887, "conf...
from functools import wraps import inspect from textwrap import dedent import warnings from pandas._libs.properties import cache_readonly # noqa from pandas.compat import PY2, signature def deprecate(name, alternative, version, alt_name=None, klass=None, stacklevel=2, msg=None): """ Return a n...
{ "repo_name": "MJuddBooth/pandas", "path": "pandas/util/_decorators.py", "copies": "1", "size": "12592", "license": "bsd-3-clause", "hash": 8748035394769752000, "line_mean": 34.671388102, "line_max": 79, "alpha_frac": 0.5808449809, "autogenerated": false, "ratio": 4.300546448087432, "config_tes...
from functools import wraps import inspect from textwrap import dedent import warnings from pandas._libs.properties import cache_readonly # noqa def deprecate(name, alternative, version, alt_name=None, klass=None, stacklevel=2, msg=None): """ Return a new function that emits a deprecation warn...
{ "repo_name": "cbertinato/pandas", "path": "pandas/util/_decorators.py", "copies": "1", "size": "11617", "license": "bsd-3-clause", "hash": -5527246498491193000, "line_mean": 35.1900311526, "line_max": 79, "alpha_frac": 0.5853490574, "autogenerated": false, "ratio": 4.362373263236951, "config_t...
from functools import wraps import inspect import collections import warnings import types import sys from ._dummy_key import _CmpDummyKey as _CmpDummyKey RED_BLACK_TREE = 0 """ Red-black tree algorithm indicator; good for general use. """ SPLAY_TREE = 1 """ Splay tree algorithm indicator; good for temporal loca...
{ "repo_name": "pyannote/pyannote-banyan", "path": "banyan/_common_base.py", "copies": "2", "size": "1906", "license": "bsd-3-clause", "hash": -5718820225957598000, "line_mean": 25.1095890411, "line_max": 112, "alpha_frac": 0.5939139559, "autogenerated": false, "ratio": 3.7299412915851273, "conf...
from functools import wraps import inspect import logging as log import requests import time import sys from qubell.api.private.exceptions import ApiError, api_http_code_errors log.getLogger("requests.packages.urllib3.connectionpool").setLevel(log.ERROR) _routes_stat = {} def route(route_str): # decorator param ...
{ "repo_name": "netvl/contrib-python-qubell-client", "path": "qubell/api/provider/__init__.py", "copies": "1", "size": "4941", "license": "apache-2.0", "hash": 7370980527609340000, "line_mean": 36.4393939394, "line_max": 176, "alpha_frac": 0.5674964582, "autogenerated": false, "ratio": 4.017073170...
from functools import wraps import inspect import logging getargspec = None if getattr(inspect, 'getfullargspec', None): getargspec = inspect.getfullargspec else: # this one is deprecated in Python 3, but available in Python 2 getargspec = inspect.getargspec class _Namespace: pass class Merry(objec...
{ "repo_name": "miguelgrinberg/merry", "path": "src/merry/__init__.py", "copies": "1", "size": "4756", "license": "mit", "hash": -4257574610880254500, "line_mean": 31.1351351351, "line_max": 79, "alpha_frac": 0.4993692178, "autogenerated": false, "ratio": 4.959332638164755, "config_test": false,...
from functools import wraps import inspect import random import copy from axelrod import Actions, flip_action from .game import DefaultGame C, D = Actions.C, Actions.D # Strategy classifiers def is_basic(s): """ Defines criteria for a strategy to be considered 'basic' """ stochastic = s.classifier...
{ "repo_name": "marcharper/Axelrod", "path": "axelrod/player.py", "copies": "1", "size": "4889", "license": "mit", "hash": 6629637244913780000, "line_mean": 30.3397435897, "line_max": 132, "alpha_frac": 0.6205768051, "autogenerated": false, "ratio": 4.125738396624473, "config_test": false, "ha...
from functools import wraps import inspect import re from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.decorators import user_passes_test from django.core.exceptions import PermissionDenied from django.db.models import Model, get_model from django.http import...
{ "repo_name": "surajssd/kuma", "path": "kuma/core/decorators.py", "copies": "13", "size": "6063", "license": "mpl-2.0", "hash": 8322105994741524000, "line_mean": 37.3734177215, "line_max": 79, "alpha_frac": 0.6394524163, "autogenerated": false, "ratio": 4.0285714285714285, "config_test": false,...
from functools import wraps import inspect import sys from .dogpile import cache_get from .dogpile import cache_set PY3 = sys.version_info[0] == 3 def default_key_fun_impl(fun, *args, **kwargs): name = fun.__name__ mod = fun.__module__ call_args = inspect.getcallargs(fun, *args, **kwargs) return "%...
{ "repo_name": "ryankanno/django-utilities", "path": "django_utilities/cache/decorators.py", "copies": "1", "size": "1310", "license": "mit", "hash": -4278481537653593000, "line_mean": 25.2, "line_max": 76, "alpha_frac": 0.5290076336, "autogenerated": false, "ratio": 3.569482288828338, "config_t...
from functools import wraps import inspect from .annotate import Annotate, ObjDescr, Cache, Set class Observable: """ Observable mixing so others can subscribe to an object """ def __init__(self, *args, **kws): super().__init__(*args, **kws) self.observers = [] def notify(self, event): ...
{ "repo_name": "wabu/pyadds", "path": "pyadds/observe.py", "copies": "1", "size": "3979", "license": "mit", "hash": 3836000373971468000, "line_mean": 26.6319444444, "line_max": 105, "alpha_frac": 0.506157326, "autogenerated": false, "ratio": 4.0560652395514785, "config_test": false, "has_no_ke...
from functools import wraps import inspect from django.apps import apps from django.contrib.auth import REDIRECT_FIELD_NAME from django.db.models import Model from django.http import HttpResponseForbidden, HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.utils.decorators import available...
{ "repo_name": "anushbmx/kitsune", "path": "kitsune/access/decorators.py", "copies": "1", "size": "6230", "license": "bsd-3-clause", "hash": -3773355657351788500, "line_mean": 38.9358974359, "line_max": 79, "alpha_frac": 0.6110754414, "autogenerated": false, "ratio": 4.375, "config_test": false,...
from functools import wraps import inspect from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.decorators import user_passes_test from django.core.exceptions import PermissionDenied from django.db.models import Model, get_model from django.http import HttpResponseForbidden, HttpResponseRedirec...
{ "repo_name": "chirilo/kuma", "path": "kuma/core/decorators.py", "copies": "13", "size": "5296", "license": "mpl-2.0", "hash": 6766798111961048000, "line_mean": 37.3768115942, "line_max": 79, "alpha_frac": 0.6378398792, "autogenerated": false, "ratio": 4.061349693251533, "config_test": false, ...
from functools import wraps import inspect from django.contrib.auth import REDIRECT_FIELD_NAME from django.db.models import Model, get_model from django.http import HttpResponseForbidden, HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.utils.decorators import available_attrs from django...
{ "repo_name": "dbbhattacharya/kitsune", "path": "kitsune/access/decorators.py", "copies": "1", "size": "6167", "license": "bsd-3-clause", "hash": -7837029995147165000, "line_mean": 40.1133333333, "line_max": 79, "alpha_frac": 0.6173179828, "autogenerated": false, "ratio": 4.291579679888657, "co...
from functools import wraps import inspect from peeringdb.resource import RESOURCES_BY_TAG def reftag_to_cls(fn): """ decorator that checks function arguments for `concrete` and `resource` and will properly set them to class references if a string (reftag) is passed as the value """ spec = in...
{ "repo_name": "peeringdb/peeringdb-py", "path": "peeringdb/backend.py", "copies": "1", "size": "11779", "license": "apache-2.0", "hash": 5302282113664410000, "line_mean": 22.7002012072, "line_max": 80, "alpha_frac": 0.5731386366, "autogenerated": false, "ratio": 5.020886615515772, "config_test"...
from functools import wraps import inspect class PreconditionError (TypeError): pass def preconditions(*precs): stripped_source = lambda obj: inspect.getsource(obj).strip() if not precs: # This edge case makes ``@preconditions()`` efficiently delegate # to the wrapped function, which I ...
{ "repo_name": "nejucomo/preconditions", "path": "preconditions.py", "copies": "1", "size": "2859", "license": "mit", "hash": -3726849062343543000, "line_mean": 33.8658536585, "line_max": 85, "alpha_frac": 0.4470094439, "autogenerated": false, "ratio": 4.6792144026186575, "config_test": false, ...
from functools import wraps import itertools import os import datetime import logging from beaker.cache import cache_region from rezoirclogs.utils import LogLine log = logging.getLogger(__name__) class Base(object): """Base resource object, useful for debugging""" __name__ = '' __parent__ = None def ...
{ "repo_name": "supelec-rezo/rezoirclogs", "path": "rezoirclogs/resources.py", "copies": "1", "size": "5193", "license": "isc", "hash": 6911226804130822000, "line_mean": 28.1741573034, "line_max": 159, "alpha_frac": 0.5748122473, "autogenerated": false, "ratio": 3.5447098976109217, "config_test"...
from functools import wraps import json as json_reader def get_objects(json): try: objects = json if objects is None: objects = False return objects except AttributeError: raise Exception('Invalid JSON = "%s"' % json) # Decorators def disable_for_loaddata(signal_...
{ "repo_name": "cdelguercio/slothauth", "path": "slothauth/tests/utils.py", "copies": "1", "size": "3048", "license": "apache-2.0", "hash": -510687038420975700, "line_mean": 25.0512820513, "line_max": 99, "alpha_frac": 0.5567585302, "autogenerated": false, "ratio": 3.795765877957659, "config_tes...
from functools import wraps import json from corehq import privileges from corehq.apps.accounting.models import DefaultProductPlan from django.http import HttpResponse from corehq.const import USER_DATE_FORMAT from django_prbac.decorators import requires_privilege from django_prbac.exceptions import PermissionDenied ...
{ "repo_name": "qedsoftware/commcare-hq", "path": "corehq/apps/accounting/decorators.py", "copies": "1", "size": "5026", "license": "bsd-3-clause", "hash": 2744651253475444000, "line_mean": 38.8888888889, "line_max": 98, "alpha_frac": 0.5829685635, "autogenerated": false, "ratio": 4.77756653992395...
from functools import wraps import json from django.contrib import messages from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django.utils.translation import ugettext from corehq import privileges from corehq.apps.accounting.models import DefaultProductPlan from django.h...
{ "repo_name": "puttarajubr/commcare-hq", "path": "corehq/apps/accounting/decorators.py", "copies": "1", "size": "5308", "license": "bsd-3-clause", "hash": -3320427301677467600, "line_mean": 38.9097744361, "line_max": 98, "alpha_frac": 0.5892991711, "autogenerated": false, "ratio": 4.7949412827461...
from functools import wraps import json from django.db.models.query import ValuesQuerySet from django.http import HttpResponseBadRequest, HttpResponse, HttpResponseForbidden from devilry.defaults.encoding import CHARSET class SerializableResult(object): """ Stores Python objects for serialization with :class:`dev...
{ "repo_name": "vegarang/devilry-django", "path": "devilry/restful/serializers.py", "copies": "1", "size": "4059", "license": "bsd-3-clause", "hash": 1314081677700295700, "line_mean": 40, "line_max": 116, "alpha_frac": 0.6644493718, "autogenerated": false, "ratio": 4.6020408163265305, "config_te...
from functools import wraps import json from functools import update_wrapper from flask import Response from flask import make_response, request, current_app from ifsApprover import db def check_auth(username, password): """This function is called to check if a username / password combination is valid. ...
{ "repo_name": "ktt-ol/ifs-approver", "path": "backend/ifsApprover/web/helper.py", "copies": "1", "size": "2645", "license": "mit", "hash": 6319484061007921000, "line_mean": 29.4137931034, "line_max": 101, "alpha_frac": 0.6223062382, "autogenerated": false, "ratio": 4.252411575562701, "config_te...
from functools import wraps import json from werkzeug.wrappers import Response from flask import request import trafaret as t def check_data(trafaret): """ Check request with trafaret Visitor instance """ def check_data_(method): @wraps(method) def method_with_check(self, *a, **kw): ...
{ "repo_name": "Deepwalker/Flask-Bundle", "path": "flask_bundle/utils.py", "copies": "1", "size": "1976", "license": "bsd-3-clause", "hash": -4657894230963616000, "line_mean": 29.875, "line_max": 85, "alpha_frac": 0.5774291498, "autogenerated": false, "ratio": 4.240343347639485, "config_test": f...
from functools import wraps import json import base64 from urllib import unquote_plus from oauth2client.client import OAuth2WebServerFlow from oauth2client.client import AccessTokenRefreshError from oauth2client.django_orm import Storage from oauth2client import xsrfutil from django.http import HttpResponseRedirect fr...
{ "repo_name": "Fl0r14n/django_googleapi", "path": "gdrive/gapi.py", "copies": "1", "size": "4667", "license": "mit", "hash": 4157803400491723300, "line_mean": 39.9385964912, "line_max": 108, "alpha_frac": 0.5731733448, "autogenerated": false, "ratio": 4.796505652620761, "config_test": false, ...
from functools import wraps import json import flask from flask import session from dataactbroker.handlers.aws.session import LoginSession from dataactbroker.handlers.userHandler import UserHandler from dataactbroker.handlers.interfaceHolder import InterfaceHolder def permissions_check(f=None,permissionList=[]): ...
{ "repo_name": "fedspendingtransparency/data-act-broker", "path": "dataactbroker/permissions.py", "copies": "1", "size": "2073", "license": "cc0-1.0", "hash": -4166909762013207600, "line_mean": 38.8653846154, "line_max": 72, "alpha_frac": 0.5701881331, "autogenerated": false, "ratio": 4.9239904988...
from functools import wraps import json import inspect from django.db.models import Q from django.http import Http404 from django.http.response import ( HttpResponse, HttpResponseBadRequest, ) from django.shortcuts import ( get_object_or_404, render, ) from django.views.decorators.http import require_h...
{ "repo_name": "mniemela/kirppu", "path": "kirppu/app/checkout/api.py", "copies": "1", "size": "14825", "license": "mit", "hash": 8813514621929916000, "line_mean": 28.4731610338, "line_max": 108, "alpha_frac": 0.6328499157, "autogenerated": false, "ratio": 3.6044249939217115, "config_test": fals...
from functools import wraps import json import logging import os import shutil import sys import click import yaml from . import clipboard, completion, config, checkers, importers from .crypt import create_keys, encrypt, decrypt from .database import Database from .table import Table from .utils import genpass, ensur...
{ "repo_name": "scorphus/passpie", "path": "passpie/cli.py", "copies": "1", "size": "20612", "license": "mit", "hash": -2365399118738421000, "line_mean": 37.241187384, "line_max": 97, "alpha_frac": 0.607364642, "autogenerated": false, "ratio": 4.1758508914100485, "config_test": true, "has_no_k...
from functools import wraps import json import logging import traceback from django.core.urlresolvers import reverse as _reverse from django.utils.http import urlencode from dimagi.utils.web import get_url_base from django import http from django.conf import settings from django.core.exceptions import PermissionDenied...
{ "repo_name": "puttarajubr/commcare-hq", "path": "corehq/util/view_utils.py", "copies": "2", "size": "4030", "license": "bsd-3-clause", "hash": -4565501469507325000, "line_mean": 31.5, "line_max": 80, "alpha_frac": 0.5771712159, "autogenerated": false, "ratio": 4.5027932960893855, "config_test"...
from functools import wraps import json import logging from django.contrib.auth import ( authenticate, get_user_model, ) from django.db import transaction from channels import Group from core.models import ( Device, DeviceGroup, Zone, ) from django.utils import timezone class CommandError(Except...
{ "repo_name": "kirberich/phoebe", "path": "phoebe/core/commands.py", "copies": "1", "size": "6483", "license": "mit", "hash": -4025875509762329000, "line_mean": 29.7251184834, "line_max": 104, "alpha_frac": 0.604349838, "autogenerated": false, "ratio": 4.072236180904523, "config_test": false, ...
from functools import wraps import json import os import traceback import validators from jinja2 import Environment, PackageLoader from notebook.utils import url_path_join from notebook.base.handlers import IPythonHandler import requests from requests.auth import HTTPBasicAuth env = Environment( loader=PackageLo...
{ "repo_name": "saagie/jupyter-saagie-plugin", "path": "saagie/server_extension.py", "copies": "1", "size": "16090", "license": "apache-2.0", "hash": 8740069840236345000, "line_mean": 31.9713114754, "line_max": 133, "alpha_frac": 0.6113735239, "autogenerated": false, "ratio": 3.5971383858707804, ...
from functools import wraps import json import os from django.shortcuts import render, render_to_response from django import forms from django import VERSION as DJANGO_VERSION from django.template import RequestContext from django.db.models import signals as signalmodule from django.http import HttpResponse from djang...
{ "repo_name": "kabakchey/django-annoying", "path": "annoying/decorators.py", "copies": "1", "size": "7182", "license": "bsd-3-clause", "hash": 7466009084729810000, "line_mean": 31.4977375566, "line_max": 107, "alpha_frac": 0.6069340017, "autogenerated": false, "ratio": 4.43059839605182, "config...
from functools import wraps import json import os from dotenv import Dotenv from flask import Flask from flask import redirect from flask import render_template from flask import request, Response from flask import send_from_directory from flask import session import requests import constants import subprocess env = ...
{ "repo_name": "sanikasudhalkar/Projects", "path": "StaticAnalysisTools/main.py", "copies": "1", "size": "5274", "license": "mit", "hash": -2485740649010356000, "line_mean": 33.6973684211, "line_max": 113, "alpha_frac": 0.6338642397, "autogenerated": false, "ratio": 3.4493132766514063, "config_t...
from functools import wraps import json import pdb from core.db.manager import DataHubManager from django.db import connection from util import pick def get_cache(username): try: manager = DataHubManager(user=username) manager.execute_sql( "create table _dbwipes_cache(key varchar, val text)") ex...
{ "repo_name": "RogerTangos/datahub-stub", "path": "src/apps/dbwipes/summary.py", "copies": "1", "size": "8173", "license": "mit", "hash": 3274024851033349600, "line_mean": 25.4498381877, "line_max": 130, "alpha_frac": 0.5771442555, "autogenerated": false, "ratio": 3.1938257131692067, "config_te...
from functools import wraps import json import sys import traceback from copy import deepcopy from flask.ext import restful from flask import make_response, request, Markup, g, current_app from werkzeug.exceptions import HTTPException from hoops.status import library as status_library from hoops.response import APIRes...
{ "repo_name": "jfillmore/hoops", "path": "hoops/restful.py", "copies": "1", "size": "8252", "license": "mit", "hash": 2706278128881264000, "line_mean": 37.0276497696, "line_max": 143, "alpha_frac": 0.6177896268, "autogenerated": false, "ratio": 3.825683820120538, "config_test": false, "has_no...
from functools import wraps import json from core.db.manager import DataHubManager from util import pick dbwipes_repo = 'dbwipes_cache' dbwipes_table = 'dbwipes_cache' def does_cache_exist(repo_base): """ check to see if the cache exists for the repo base""" manager = DataHubManager(repo_base) repo_exi...
{ "repo_name": "anantb/datahub", "path": "src/apps/dbwipes/summary.py", "copies": "2", "size": "10196", "license": "mit", "hash": 6970746650246567000, "line_mean": 30.0853658537, "line_max": 79, "alpha_frac": 0.5201059239, "autogenerated": false, "ratio": 3.659727207465901, "config_test": false,...
from functools import wraps import json from django.contrib.auth.models import (AnonymousUser, User, check_password) from django.core.urlresolvers import reverse from django.http import HttpResponse from django.shortcuts import render fro...
{ "repo_name": "BILS/agda", "path": "agda/agda/views.py", "copies": "1", "size": "6916", "license": "mit", "hash": -8088865649991437000, "line_mean": 25.6, "line_max": 111, "alpha_frac": 0.6609311741, "autogenerated": false, "ratio": 4.082644628099174, "config_test": false, "has_no_keywords": ...
from functools import wraps import json from django.http import JsonResponse, HttpResponseNotAllowed from django.utils.decorators import available_attrs def methods(method_list): def decorator(func): @wraps(func, assigned=available_attrs(func)) def inner(request, *args, **kw): if requ...
{ "repo_name": "baby5/Django-httpbin", "path": "httpbin/bin/helpers.py", "copies": "1", "size": "1339", "license": "mit", "hash": -19246178545450010, "line_mean": 28.1086956522, "line_max": 78, "alpha_frac": 0.5922330097, "autogenerated": false, "ratio": 4.09480122324159, "config_test": false, ...
from functools import wraps import json from django import http from django.conf import settings from django.core.exceptions import PermissionDenied def ssl_required(view_func): """A view decorator that enforces HTTPS. If settings.SESSION_COOKIE_SECURE is False, it won't enforce anything.""" @wraps(view...
{ "repo_name": "dbbhattacharya/kitsune", "path": "kitsune/sumo/decorators.py", "copies": "1", "size": "3408", "license": "bsd-3-clause", "hash": 8443421191597048000, "line_mean": 33.4242424242, "line_max": 79, "alpha_frac": 0.576584507, "autogenerated": false, "ratio": 4.478318002628121, "config...
from functools import wraps import json try: # Python 3 imports from urllib.parse import urljoin except ImportError: # Python 2 imports from urlparse import urljoin from collections import defaultdict from threading import Thread from twisted.internet import reactor, ssl from twisted.internet.defer import De...
{ "repo_name": "resin-io/resin-sdk-python", "path": "balena/logs.py", "copies": "1", "size": "5351", "license": "apache-2.0", "hash": -2619902831493143600, "line_mean": 26.725388601, "line_max": 115, "alpha_frac": 0.6144645861, "autogenerated": false, "ratio": 4.43698175787728, "config_test": fa...
from functools import wraps import locale from datetime import datetime import json import markdown2 as markdown from flask import Flask, render_template, request, redirect, url_for, g, abort, Response, session from sqlalchemy.orm import sessionmaker, scoped_session from sqlalchemy import create_engine from sqlalchemy...
{ "repo_name": "verbit/wagner", "path": "run.py", "copies": "1", "size": "5070", "license": "mit", "hash": 8755259666981940000, "line_mean": 31.9220779221, "line_max": 97, "alpha_frac": 0.6710059172, "autogenerated": false, "ratio": 3.059746529873265, "config_test": false, "has_no_keywords": f...
from functools import wraps import logging from celery import task from django.db import IntegrityError from django_facebook.utils import get_class_for from django_facebook.signals import facebook_token_extend_finished logger = logging.getLogger(__name__) @task.task(ignore_result=True) def extend_access_token(profil...
{ "repo_name": "christer155/Django-facebook", "path": "django_facebook/tasks.py", "copies": "25", "size": "4751", "license": "bsd-3-clause", "hash": 4391083167781703700, "line_mean": 30.4635761589, "line_max": 86, "alpha_frac": 0.6966954325, "autogenerated": false, "ratio": 3.8626016260162603, "...
from functools import wraps import logging from datetime import datetime def timethis(message = None, logit = lambda *args: logging.info(*args), store = lambda _:_): """This can decorate functions or methods. It times the execution of the decorated object. One may specify two arguments: i) a message: ...
{ "repo_name": "wilkeraziz/chisel", "path": "python/chisel/util/logtools.py", "copies": "1", "size": "1303", "license": "apache-2.0", "hash": -1576994431009951000, "line_mean": 42.4333333333, "line_max": 93, "alpha_frac": 0.6577129701, "autogenerated": false, "ratio": 4.23051948051948, "config_t...
from functools import wraps import logging from encryption.security import decrypt_obj from encryption.store.s3 import S3Provider from conf.appconfig import ENCRYPTION logger = logging.getLogger(__name__) def get_s3_store(): return S3Provider(ENCRYPTION['s3']['bucket'], keys_base=ENCRYPTION...
{ "repo_name": "totem/cluster-orchestrator", "path": "orchestrator/services/security.py", "copies": "2", "size": "1107", "license": "mit", "hash": -4393428559922297000, "line_mean": 32.5454545455, "line_max": 78, "alpha_frac": 0.6233062331, "autogenerated": false, "ratio": 4.130597014925373, "co...
from functools import wraps import logging import flask import utils import models.base from thirdparty.containerize import ContainerizeExceptionBase class Blueprint(flask.Blueprint): def __init__(self, *args, **kwargs): flask.Blueprint.__init__(self, *args, **kwargs) self.app = None def reg...
{ "repo_name": "HunanTV/redis-ctl", "path": "app/bpbase.py", "copies": "1", "size": "1989", "license": "mit", "hash": -3940304513312469000, "line_mean": 35.1636363636, "line_max": 77, "alpha_frac": 0.4881850176, "autogenerated": false, "ratio": 4.713270142180095, "config_test": false, "has_no_...
from functools import wraps import logging import json from datetime import timedelta from demands import HTTPServiceError from django.shortcuts import render, redirect, resolve_url from django.utils.decorators import available_attrs from django.utils.six.moves.urllib.parse import urlparse from django.contrib.auth imp...
{ "repo_name": "praekelt/seed-control-interface", "path": "ci/views.py", "copies": "1", "size": "46608", "license": "bsd-3-clause", "hash": 390333104834868600, "line_mean": 36.3461538462, "line_max": 99, "alpha_frac": 0.5829900446, "autogenerated": false, "ratio": 4.180089686098655, "config_test...
from functools import wraps import logging import os from random import random import sys import time import structlog LOG_FORMAT = '%(message)s' DEFAULT_STREAM = sys.stdout WRAPPED_DICT_CLASS = structlog.threadlocal.wrap_dict(dict) ENV_APIG_REQUEST_ID = '_FLEECE_APIG_REQUEST_ID' ENV_LAMBDA_REQUEST_ID = '_FLEECE_LAMB...
{ "repo_name": "racker/fleece", "path": "fleece/log.py", "copies": "1", "size": "7350", "license": "apache-2.0", "hash": 940165198477439500, "line_mean": 34.8536585366, "line_max": 77, "alpha_frac": 0.6428571429, "autogenerated": false, "ratio": 4.126895002807411, "config_test": false, "has_no...
from functools import wraps import logging import os import resource from tcpy import TCPClient try: from memwatchconfig import PROFILER_HOST except: from defaultconfig import PROFILER_HOST try: from memwatchconfig import PROFILER_PORT except: from defaultconfig import PROFILER_PORT logging.basicConfi...
{ "repo_name": "ptbrodie/memwatch", "path": "memwatch/memwatch.py", "copies": "1", "size": "3835", "license": "mit", "hash": 3371701312084093400, "line_mean": 31.5, "line_max": 86, "alpha_frac": 0.6028683181, "autogenerated": false, "ratio": 3.901322482197355, "config_test": false, "has_no_key...
from functools import wraps import logging import os from . import process from .utils import which, tempdir from ._compat import FileExistsError def ensure_git(return_value=None): def decorator(func): @wraps(func) def wrapper(*args, **kwargs): if which('git'): return ...
{ "repo_name": "scorphus/passpie", "path": "passpie/history.py", "copies": "2", "size": "2814", "license": "mit", "hash": 260786851480267460, "line_mean": 28.0103092784, "line_max": 75, "alpha_frac": 0.5572139303, "autogenerated": false, "ratio": 3.683246073298429, "config_test": false, "has_n...
from functools import wraps import logging import pickle import sys import types from hoplite import client from hoplite.exceptions import JobFailedError from globals import HopliteClientSettings def remotify(module_name, functions=None, add_documentation=True): """ Decorator which can be used to add remote ...
{ "repo_name": "ni/hoplite", "path": "hoplite/remote_enabler.py", "copies": "1", "size": "35192", "license": "mit", "hash": -1014597316116008100, "line_mean": 43.4343434343, "line_max": 91, "alpha_frac": 0.5964992044, "autogenerated": false, "ratio": 4.568609632610671, "config_test": true, "ha...
from functools import wraps import logging import random import string from django.db import connections from django.db import models from django.db.models import EmailField from django.db.models.signals import pre_migrate from django.dispatch import receiver # Credit: http://stackoverflow.com/questions/15624817/hav...
{ "repo_name": "cdelguercio/slothauth", "path": "slothauth/utils.py", "copies": "1", "size": "4328", "license": "apache-2.0", "hash": 7978956299909692000, "line_mean": 33.3492063492, "line_max": 174, "alpha_frac": 0.6282347505, "autogenerated": false, "ratio": 4.117982873453854, "config_test": f...
from functools import wraps import logging import re import time import six from .exceptions import LcdCommandError logger = logging.getLogger(__name__) COMMANDS = {} def command(fn): @wraps(fn) def wrapped(*args): self = args[0] logger.debug( 'Executing %s%s', fn...
{ "repo_name": "coddingtonbear/twoline", "path": "twoline/lcd.py", "copies": "1", "size": "9333", "license": "mit", "hash": 8197905847075881000, "line_mean": 27.1963746224, "line_max": 74, "alpha_frac": 0.5220186435, "autogenerated": false, "ratio": 3.880665280665281, "config_test": false, "ha...
from functools import wraps import logging import re import traceback from django.http import HttpResponseForbidden from django.views.decorators.csrf import csrf_exempt from watchman import settings logger = logging.getLogger('watchman') def check(func): """ Decorator which wraps checks and returns an erro...
{ "repo_name": "JBKahn/django-watchman", "path": "watchman/decorators.py", "copies": "1", "size": "4028", "license": "bsd-3-clause", "hash": 4631627798513763000, "line_mean": 29.5151515152, "line_max": 90, "alpha_frac": 0.5752234359, "autogenerated": false, "ratio": 4.118609406952965, "config_te...
from functools import wraps import logging import requests from celery import shared_task from collections import Counter from django.conf import settings from django.contrib.auth.models import User from django.core.cache import cache from django.db import transaction from django.template.loader import render_to_stri...
{ "repo_name": "mathjazz/pontoon", "path": "pontoon/sync/core.py", "copies": "2", "size": "16254", "license": "bsd-3-clause", "hash": 8727507165413039000, "line_mean": 35.28125, "line_max": 107, "alpha_frac": 0.6499938477, "autogenerated": false, "ratio": 4.181631077952148, "config_test": true, ...
from functools import wraps import logging import requests from collections import Counter from celery import shared_task from django.contrib.auth.models import User from django.core.cache import cache from django.db import transaction from django.template.loader import render_to_string from pontoon.base.models imp...
{ "repo_name": "mastizada/pontoon", "path": "pontoon/sync/core.py", "copies": "1", "size": "14126", "license": "bsd-3-clause", "hash": 1853000041828639500, "line_mean": 37.8076923077, "line_max": 99, "alpha_frac": 0.6519184483, "autogenerated": false, "ratio": 4.163277335691129, "config_test": t...
from functools import wraps import logging import struct import capstone as cs from .abstractcpu import Abi, Cpu, Interruption, Operand, RegisterFile, SyscallAbi from .abstractcpu import instruction as abstract_instruction from .bitwise import * from .register import Register from ...core.smtlib import Operators, Bit...
{ "repo_name": "montyly/manticore", "path": "manticore/native/cpu/arm.py", "copies": "1", "size": "57246", "license": "apache-2.0", "hash": 1055243491017341300, "line_mean": 34.358863496, "line_max": 120, "alpha_frac": 0.5630437061, "autogenerated": false, "ratio": 3.6071833648393197, "config_te...
from functools import wraps import logging import sys from etcd import client from conf.appconfig import HEALTH_OK, HEALTH_FAILED, TOTEM_ETCD_SETTINGS from deployer.services.storage.factory import get_store from deployer.tasks.common import ping from deployer.util import timeout HEALTH_TIMEOUT_SECONDS = 10 log = logg...
{ "repo_name": "totem/cluster-deployer", "path": "deployer/services/health.py", "copies": "1", "size": "2353", "license": "mit", "hash": -8482059612215861000, "line_mean": 24.3010752688, "line_max": 74, "alpha_frac": 0.6298342541, "autogenerated": false, "ratio": 4.0017006802721085, "config_test...
from functools import wraps import logging import threading import logging.config import abc import os from amberdriver.common import drivermsg_pb2 from amberdriver.common.amber_pipes import AmberPipes __author__ = 'paoolo' LOGGER_NAME = 'MessageHandler' pwd = os.path.dirname(os.path.abspath(__file__)) logging.con...
{ "repo_name": "showmen15/testEEE", "path": "src/amberdriver/common/message_handler.py", "copies": "1", "size": "3571", "license": "mit", "hash": -4160240774888401400, "line_mean": 29.2711864407, "line_max": 96, "alpha_frac": 0.6317558107, "autogenerated": false, "ratio": 4.133101851851852, "con...
from functools import wraps import logging import threading import logging.config import time import abc import os from amberdriver.common import drivermsg_pb2 from amberdriver.common.amber_pipes import AmberPipes __author__ = 'paoolo' pwd = os.path.dirname(os.path.abspath(__file__)) logging.config.fileConfig('%s/...
{ "repo_name": "project-capo/amber-python-drivers", "path": "src/amberdriver/common/message_handler.py", "copies": "1", "size": "3769", "license": "mit", "hash": -7773805269012487000, "line_mean": 28.453125, "line_max": 96, "alpha_frac": 0.6272220748, "autogenerated": false, "ratio": 4.10566448801...
from functools import wraps import logging import time from fabric.tasks import WrappedCallableTask from dogapi import dog_http_api logger = logging.getLogger("fabric") MAX_ARGS_LEN = 256 def setup(api_key, application_key=None): global dog_http_api dog_http_api.api_key = api_key if application_key is n...
{ "repo_name": "DataDog/dogapi", "path": "src/dogapi/fab.py", "copies": "1", "size": "3259", "license": "bsd-3-clause", "hash": -8636410532286773000, "line_mean": 30.9509803922, "line_max": 145, "alpha_frac": 0.5323718932, "autogenerated": false, "ratio": 3.6130820399113084, "config_test": false...
from functools import wraps import logging from collections import Counter from celery import shared_task from django.contrib.auth.models import User from django.core.cache import cache from django.db import transaction from django.template.loader import render_to_string from pontoon.base.models import ( Entity...
{ "repo_name": "participedia/pontoon", "path": "pontoon/sync/core.py", "copies": "1", "size": "9151", "license": "bsd-3-clause", "hash": -1823828266417518300, "line_mean": 38.2746781116, "line_max": 114, "alpha_frac": 0.6669216479, "autogenerated": false, "ratio": 3.996069868995633, "config_test...
from functools import wraps import logging from django.conf import settings from django.contrib.gis.geos import Point from molly.conf import get_app from molly.utils import haversine from molly.geolocation.models import Geocode __all__ = ['geocode', 'reverse_geocode'] logger = logging.getLogger(__name__) def _...
{ "repo_name": "mollyproject/mollyproject", "path": "molly/geolocation/__init__.py", "copies": "1", "size": "2807", "license": "apache-2.0", "hash": -4829905433721100000, "line_mean": 35.9342105263, "line_max": 112, "alpha_frac": 0.5632347702, "autogenerated": false, "ratio": 4.134020618556701, ...
from functools import wraps import logging from django.conf.urls import include, patterns, url from django.contrib import auth, messages from django.contrib.auth.forms import AuthenticationForm from django.core.exceptions import ValidationError from django.core.urlresolvers import get_callable, reverse from django.for...
{ "repo_name": "armicron/plata", "path": "plata/shop/views.py", "copies": "3", "size": "22496", "license": "bsd-3-clause", "hash": 1394221042862476300, "line_mean": 32.6766467066, "line_max": 78, "alpha_frac": 0.5683677098, "autogenerated": false, "ratio": 4.64026402640264, "config_test": false,...
from functools import wraps import logging from django.contrib.auth.models import User from django.core.paginator import Paginator, InvalidPage, EmptyPage from django.db.models import Count from django.http import HttpResponse, Http404 from django.shortcuts import render_to_response from django.template import Request...
{ "repo_name": "markpasc/giraffe", "path": "giraffe/publisher/views.py", "copies": "1", "size": "4753", "license": "mit", "hash": 4608632564520997000, "line_mean": 31.1148648649, "line_max": 133, "alpha_frac": 0.6482221755, "autogenerated": false, "ratio": 3.9575353871773524, "config_test": fals...
from functools import wraps import logging from django import forms from django.contrib import auth, messages from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.urlresolvers import get_callable, revers...
{ "repo_name": "allink/plata", "path": "plata/shop/views.py", "copies": "1", "size": "18228", "license": "bsd-3-clause", "hash": 8086783992078865000, "line_mean": 35.3832335329, "line_max": 107, "alpha_frac": 0.5895874479, "autogenerated": false, "ratio": 4.575301204819277, "config_test": false,...
from functools import wraps import logging from flask import abort from flask import Flask from flask import jsonify from flask import make_response from flask import request from flask import Response from flask import url_for from flask.views import MethodView from peewee import * from playhouse.flask_utils import g...
{ "repo_name": "coleifer/scout", "path": "scout/views.py", "copies": "1", "size": "15537", "license": "mit", "hash": 262707142590612600, "line_mean": 31.9173728814, "line_max": 79, "alpha_frac": 0.5770097187, "autogenerated": false, "ratio": 4.387743575261226, "config_test": false, "has_no_key...
from functools import wraps import logging from flask import Blueprint, render_template, request, redirect, url_for, flash, g, jsonify from flask.ext.login import login_required # Project 5: adjusted imports to the minimal subset after model separation. from talent_match import db from ..models.talentInfo import Cate...
{ "repo_name": "jordan-wright/talent-match", "path": "talent_match/views/categories.py", "copies": "1", "size": "4347", "license": "mit", "hash": 1486204595815537400, "line_mean": 33.5, "line_max": 111, "alpha_frac": 0.637221072, "autogenerated": false, "ratio": 4.0664172123479885, "config_test"...
from functools import wraps import logging from flask import request, Response, Flask, jsonify, render_template from tsg.search import search from tsg.config import DICTIONARY_PATH, INDEXINFO_PATH, RANKER_K from tsg.frontend.base import generate_detailed_list app = Flask(__name__) def check_auth(username, passwor...
{ "repo_name": "moritzschaefer/the-search-engine", "path": "tsg/frontend/__init__.py", "copies": "1", "size": "2362", "license": "mit", "hash": -8730286575539771000, "line_mean": 27.8048780488, "line_max": 73, "alpha_frac": 0.6265876376, "autogenerated": false, "ratio": 3.9630872483221475, "conf...
from functools import wraps import logging from . import process from .utils import which, tempdir from ._compat import * def ensure_git(return_value=None): def decorator(func): @wraps(func) def wrapper(*args, **kwargs): if which('git'): return func(*args, **kwargs) ...
{ "repo_name": "eiginn/passpie", "path": "passpie/history.py", "copies": "1", "size": "2665", "license": "mit", "hash": -454008621583621900, "line_mean": 27.3510638298, "line_max": 75, "alpha_frac": 0.5500938086, "autogenerated": false, "ratio": 3.6657496561210454, "config_test": false, "has_n...