text stringlengths 0 1.05M | meta dict |
|---|---|
"""A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example,
the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.
A number n is called deficient if the sum of its proper divisors is less than n and it i... | {
"repo_name": "mmax5/project-euler",
"path": "Problem 23.py",
"copies": "1",
"size": "1712",
"license": "apache-2.0",
"hash": 2441513419158981000,
"line_mean": 36.2391304348,
"line_max": 117,
"alpha_frac": 0.6857476636,
"autogenerated": false,
"ratio": 3.465587044534413,
"config_test": false,
... |
# A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the
# proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.
#
# A number n is called deficient if the sum of its proper divisors is less than n and ... | {
"repo_name": "shultzd/Euler",
"path": "problem_23.py",
"copies": "1",
"size": "2444",
"license": "cc0-1.0",
"hash": -4025699234838310000,
"line_mean": 34.4202898551,
"line_max": 132,
"alpha_frac": 0.55400982,
"autogenerated": false,
"ratio": 3.9355877616747184,
"config_test": false,
"has_no_... |
# A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.
# A number n is called deficient if the sum of its proper divisors is less than n and it i... | {
"repo_name": "ledbutter/ProjectEulerPython",
"path": "Problem23.py",
"copies": "1",
"size": "2922",
"license": "mit",
"hash": -1915235241607143400,
"line_mean": 28.4583333333,
"line_max": 478,
"alpha_frac": 0.6413415469,
"autogenerated": false,
"ratio": 2.9396378269617705,
"config_test": false... |
# A perfect number is a number for which the sum of its proper divisors is exactly equal to the number.
# For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means
# that 28 is a perfect number.
# A number n is called deficient if the sum of its proper divisors is less than n and ... | {
"repo_name": "doctoryes/project_euler",
"path": "prob23.py",
"copies": "1",
"size": "1319",
"license": "mit",
"hash": -4871649984462744000,
"line_mean": 49.7307692308,
"line_max": 110,
"alpha_frac": 0.7300985595,
"autogenerated": false,
"ratio": 3.633608815426997,
"config_test": false,
"has_... |
# A perfect number is a number for which the sum of its proper divisors is
# exactly equal to the number. For example, the sum of the proper divisors
# of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect
# number.
# A number n is called deficient if the sum of its proper divisors is less
# than n ... | {
"repo_name": "cloudzfy/euler",
"path": "src/23.py",
"copies": "1",
"size": "1418",
"license": "mit",
"hash": 5083962561342053000,
"line_mean": 33.5853658537,
"line_max": 77,
"alpha_frac": 0.7038081805,
"autogenerated": false,
"ratio": 3.3053613053613056,
"config_test": false,
"has_no_keyword... |
"""A perfect number is a number for which the sum of its proper divisors is
exactly equal to the number. For example, the sum of the proper divisors of 28
would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number. A
number n is called deficient if the sum of its proper divisors is less than n
and it is ... | {
"repo_name": "piohhmy/euler",
"path": "p023.py",
"copies": "1",
"size": "1823",
"license": "mit",
"hash": -5813735864642950000,
"line_mean": 37,
"line_max": 79,
"alpha_frac": 0.7229840922,
"autogenerated": false,
"ratio": 3.3821892393320963,
"config_test": false,
"has_no_keywords": false,
... |
"""A perfect power is a classification of positive integers:
In mathematics, a perfect power is a positive integer that can be expressed as an integer power of another positive integer. More formally, n is a perfect power if there exist natural numbers m > 1, and k > 1 such that mk = n.
Your task is to check wheter a ... | {
"repo_name": "Copenbacon/code-katas",
"path": "katas/perfectpower.py",
"copies": "1",
"size": "1075",
"license": "mit",
"hash": -4551573001248893000,
"line_mean": 43.8333333333,
"line_max": 229,
"alpha_frac": 0.6465116279,
"autogenerated": false,
"ratio": 3.4455128205128207,
"config_test": fal... |
"""A performance profiling suite for a variety of SQLAlchemy use cases.
Each suite focuses on a specific use case with a particular performance
profile and associated implications:
* bulk inserts
* individual inserts, with or without transactions
* fetching large numbers of rows
* running lots of short queries
All s... | {
"repo_name": "monetate/sqlalchemy",
"path": "examples/performance/__init__.py",
"copies": "3",
"size": "14210",
"license": "mit",
"hash": -3862619600632018400,
"line_mean": 31.0767494357,
"line_max": 132,
"alpha_frac": 0.587825475,
"autogenerated": false,
"ratio": 4.104563835932987,
"config_te... |
# A permutation, also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with S itself. A string of length n has n! permutation.
# Source: Mathword(http://mathworld.wolfram.com/Permutation.html)
# Below are the permutations of string ABC.
... | {
"repo_name": "nakayamaqs/PythonModule",
"path": "Algorithm/permutation.py",
"copies": "2",
"size": "1264",
"license": "mit",
"hash": 8014354477882882000,
"line_mean": 31.2051282051,
"line_max": 209,
"alpha_frac": 0.6313694268,
"autogenerated": false,
"ratio": 2.835214446952596,
"config_test": ... |
# A permutation of a string s is a string t in which each character of s appears
# once and only once in t
# s = aab, then t = aba is a permutation.
# s = xyz, then t = zxy is a permutation.
#
# Problem:
# given a string, construct a list of all possible permutations of that string.
#
# Example:
# given ABC we want the... | {
"repo_name": "sshastry/intro-to-computing-103",
"path": "src/09-permutations.py",
"copies": "1",
"size": "1668",
"license": "mit",
"hash": 903702428301336000,
"line_mean": 29.3272727273,
"line_max": 81,
"alpha_frac": 0.6510791367,
"autogenerated": false,
"ratio": 3.3971486761710796,
"config_te... |
# A persistent cache of pre-compiled formulas
import os
import stat
import cPickle
import hashlib
class TimeStampedObject:
"An object and the last time it was updated"
def __init__(self,obj,time,file=None):
self.time = time
self.obj = obj
self.cache_file = file
class T:
de... | {
"repo_name": "ericchill/gnofract4d",
"path": "fract4d/cache.py",
"copies": "1",
"size": "2353",
"license": "bsd-3-clause",
"hash": 8465099323660242000,
"line_mean": 25.7386363636,
"line_max": 67,
"alpha_frac": 0.5397365066,
"autogenerated": false,
"ratio": 3.729001584786054,
"config_test": fal... |
"""Aperture Load Balancer.
Based on work from finagle's aperture load balancer.
See https://github.com/twitter/finagle/blob/master/finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/Aperture.scala
The aperture balancer attempts to keep the average load going into the underlying
server set between a load band... | {
"repo_name": "steveniemitz/scales",
"path": "scales/loadbalancer/aperture.py",
"copies": "1",
"size": "8636",
"license": "mit",
"hash": -2087603574710530800,
"line_mean": 34.393442623,
"line_max": 126,
"alpha_frac": 0.6779759148,
"autogenerated": false,
"ratio": 3.6255247691015953,
"config_tes... |
"""aperturesynth - a tool for registering and combining series of photographs.
Usage:
aperturesynth combine [--no-transform] [--out FILE] [--windows FILE] <images>...
aperturesynth choose_windows <base_image> <window_file>
Options:
-h --help Show this help screen.
--out FILE Optio... | {
"repo_name": "SamHames/aperturesynth",
"path": "aperturesynth/synthesise.py",
"copies": "1",
"size": "5285",
"license": "mit",
"hash": -7464353572382036000,
"line_mean": 32.8782051282,
"line_max": 84,
"alpha_frac": 0.6418164617,
"autogenerated": false,
"ratio": 4.490229396771453,
"config_test"... |
APESECTION = "APE"
MODULES_SECTION = 'MODULES'
FILE_TIMESTAMP = "%Y_%m_%d_%I:%M:%S_%p"
VERSION = "2014.12.28"
SUBCOMMAND_GROUP = 'theape.subcommands'
# these imports mean users of the parts of the ape need to have all dependencies installed
# even if the part they use doesn't need it...
from infrastructure.baseclass... | {
"repo_name": "rsnakamura/theape",
"path": "theape/__init__.py",
"copies": "1",
"size": "1527",
"license": "mit",
"hash": 631591242278560300,
"line_mean": 41.4166666667,
"line_max": 105,
"alpha_frac": 0.6430910282,
"autogenerated": false,
"ratio": 3.5022935779816513,
"config_test": false,
"ha... |
def template_test_class():
return '''/**
* @author {author}
*/
@isTest
private class {class_name}Test {{
{class_body}
}}
'''
# Apex Test Method Template
def template_test_method():
return '''
/**
* This is a test method for {function_name}
*/
static testMethod void test_{function_name}() {{
... | {
"repo_name": "exiahuang/SalesforceXyTools",
"path": "template.py",
"copies": "1",
"size": "23996",
"license": "apache-2.0",
"hash": -1032512850101457000,
"line_mean": 28.5295566502,
"line_max": 206,
"alpha_frac": 0.4688464426,
"autogenerated": false,
"ratio": 3.771904986628913,
"config_test": ... |
"A phenotype holder"
import pandas as pd
class Phenotypes(object):
"""
A container for the set of phenotypes and exposures associated with an
Individual in a population
"""
def __init__(self, data=None):
self.data = dict(data) if data is not None else dict()
def __contains__(self, ke... | {
"repo_name": "jameshicks/pydigree",
"path": "pydigree/phenotypes.py",
"copies": "1",
"size": "1986",
"license": "apache-2.0",
"hash": -1407523365795396600,
"line_mean": 25.8378378378,
"line_max": 75,
"alpha_frac": 0.6022155086,
"autogenerated": false,
"ratio": 3.956175298804781,
"config_test":... |
"""A Phi accrual failure detector."""
import decimal
import logging
import math
import sys
import time
class AccrualFailureDetector(object):
""" Python implementation of 'The Phi Accrual Failure Detector'
by Hayashibara et al.
* Taken from https://github.com/rschildmeijer/elastica/blob/
a41f9427f80b5207891... | {
"repo_name": "tomwilkie/awesomation",
"path": "src/common/detector.py",
"copies": "1",
"size": "3389",
"license": "mit",
"hash": 6679678616858333000,
"line_mean": 29.2589285714,
"line_max": 73,
"alpha_frac": 0.668338743,
"autogenerated": false,
"ratio": 3.659827213822894,
"config_test": false,... |
'''A (PHP) Docblock generator plugin for Coda'''
import cp_actions as cp
from Docblock import Docblock
def act(controller, bundle, options):
'''
Required action method
Supplying a lang option will override the automatic language guessing
(which might not be such a bad thing...)
'''
c... | {
"repo_name": "bobthecow/CodaDocblock",
"path": "src/Support/Scripts/GenerateDocblock.py",
"copies": "1",
"size": "1446",
"license": "mit",
"hash": 6478677454306442000,
"line_mean": 27.3725490196,
"line_max": 98,
"alpha_frac": 0.59197787,
"autogenerated": false,
"ratio": 3.8870967741935485,
"co... |
"""API and implementations for loading templates from different data
sources.
"""
import importlib.util
import os
import sys
import typing as t
import weakref
import zipimport
from collections import abc
from hashlib import sha1
from importlib import import_module
from types import ModuleType
from .exceptions import T... | {
"repo_name": "pallets/jinja",
"path": "src/jinja2/loaders.py",
"copies": "1",
"size": "22350",
"license": "bsd-3-clause",
"hash": -4806619699705855000,
"line_mean": 33.8130841121,
"line_max": 88,
"alpha_frac": 0.5983892617,
"autogenerated": false,
"ratio": 4.3952802359882,
"config_test": false... |
"""API and implementations for loading templates from different data
sources.
"""
import importlib.util
import os
import sys
import weakref
import zipimport
from collections import abc
from hashlib import sha1
from importlib import import_module
from types import ModuleType
from .exceptions import TemplateNotFound
fro... | {
"repo_name": "mitsuhiko/jinja2",
"path": "src/jinja2/loaders.py",
"copies": "3",
"size": "19892",
"license": "bsd-3-clause",
"hash": 2879844534511713000,
"line_mean": 34.1448763251,
"line_max": 83,
"alpha_frac": 0.6089885381,
"autogenerated": false,
"ratio": 4.557159221076747,
"config_test": f... |
""" API annotations and assorted wrappers. """
import json, traceback, bson
import api
from api.common import WebSuccess, WebError, WebException, InternalException, SevereInternalException
from datetime import datetime
from functools import wraps
from flask import session, request, abort
write_logs_to_db = False # D... | {
"repo_name": "stuyCTF/stuyCTF-Platform",
"path": "api/api/annotations.py",
"copies": "1",
"size": "4732",
"license": "mit",
"hash": 224814695286586720,
"line_mean": 26.8352941176,
"line_max": 103,
"alpha_frac": 0.5845308538,
"autogenerated": false,
"ratio": 4.169162995594713,
"config_test": fa... |
""" API annotations and assorted wrappers. """
import json, traceback
import api
from api.common import WebSuccess, WebError, WebException, InternalException, SevereInternalException
from datetime import datetime
from functools import wraps
from flask import session, request, abort
write_logs_to_db = False # Default... | {
"repo_name": "PATechmasters/techmaster-ctf",
"path": "api/api/annotations.py",
"copies": "9",
"size": "4700",
"license": "mit",
"hash": -8689923633381090000,
"line_mean": 26.6470588235,
"line_max": 103,
"alpha_frac": 0.5829787234,
"autogenerated": false,
"ratio": 4.1852181656277825,
"config_te... |
"""API Approval
Presents the revised policy created by Security Fairy,
and waits for the user to Approve or Cancel the policy
change.
"""
from __future__ import print_function
import string
import json
import boto3
from requests.utils import unquote
from botocore.exceptions import ProfileNotFound
try:
SESSION =... | {
"repo_name": "1Strategy/security-fairy",
"path": "api_missing_permissions.py",
"copies": "1",
"size": "6459",
"license": "apache-2.0",
"hash": -2986150212167216000,
"line_mean": 34.2950819672,
"line_max": 220,
"alpha_frac": 0.5215977706,
"autogenerated": false,
"ratio": 4.323293172690763,
"con... |
"""API around S3, SQS, and MK64 database"""
import boto
import json
import multiprocessing
import os
import requests
import time
import uuid
import syslog
from subprocess import call
from boto.sqs.message import Message
from boto.sqs.message import RawMessage
from boto.exception import *
import boto.utils
from const ... | {
"repo_name": "kartyboyz/n64-img-processing",
"path": "api.py",
"copies": "1",
"size": "4768",
"license": "mit",
"hash": 6379815850740521000,
"line_mean": 31.4353741497,
"line_max": 81,
"alpha_frac": 0.5652265101,
"autogenerated": false,
"ratio": 3.7425431711145998,
"config_test": false,
"has... |
apiAttachAvailable = u'API disponibile'
apiAttachNotAvailable = u'Non disponibile'
apiAttachPendingAuthorization = u'In attesa di autorizzazione'
apiAttachRefused = u'Rifiutato'
apiAttachSuccess = u'Riuscito'
apiAttachUnknown = u'Sconosciuto'
budDeletedFriend = u"Eliminato dall'elenco amici"
budFriend = u'Amico'
budNev... | {
"repo_name": "iandev/HarvestMood",
"path": "Skype4Py/Skype4Py/lang/it.py",
"copies": "23",
"size": "7088",
"license": "mit",
"hash": -5589727896447491000,
"line_mean": 36.9037433155,
"line_max": 81,
"alpha_frac": 0.8045993228,
"autogenerated": false,
"ratio": 2.6077998528329656,
"config_test":... |
apiAttachAvailable = u'API dispon\xedvel'
apiAttachNotAvailable = u'N\xe3o dispon\xedvel'
apiAttachPendingAuthorization = u'Autoriza\xe7\xe3o pendente'
apiAttachRefused = u'Recusado'
apiAttachSuccess = u'Sucesso'
apiAttachUnknown = u'Desconhecido'
budDeletedFriend = u'Exclu\xeddo da lista de amigos'
budFriend = ... | {
"repo_name": "djw8605/htcondor",
"path": "src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/pt.py",
"copies": "10",
"size": "7484",
"license": "apache-2.0",
"hash": 8144147113815494000,
"line_mean": 38.0213903743,
"line_max": 99,
"alpha_frac": 0.779529663... |
apiAttachAvailable = u'API el\xe9rheto'
apiAttachNotAvailable = u'Nem el\xe9rheto'
apiAttachPendingAuthorization = u'F\xfcggoben l\xe9vo visszaigazol\xe1s'
apiAttachRefused = u'Elutas\xedtva'
apiAttachSuccess = u'Siker\xfclt'
apiAttachUnknown = u'Ismeretlen'
budDeletedFriend = u'T\xf6r\xf6lve a bar\xe1tok list\xe1j\xe1... | {
"repo_name": "pokutnik/skype4py",
"path": "Skype4Py/lang/hu.py",
"copies": "23",
"size": "7624",
"license": "bsd-3-clause",
"hash": 8056354652551004000,
"line_mean": 39.7700534759,
"line_max": 99,
"alpha_frac": 0.795383001,
"autogenerated": false,
"ratio": 2.154889768230639,
"config_test": fal... |
apiAttachAvailable = u'API forefindes'
apiAttachNotAvailable = u'Optaget'
apiAttachPendingAuthorization = u'Afventer godkendelse'
apiAttachRefused = u'Afvist'
apiAttachSuccess = u'Succes'
apiAttachUnknown = u'Ukendt'
budDeletedFriend = u'Slettet fra liste over kontaktpersoner'
budFriend = u'Ven'
budNeverBeenFriend = u'... | {
"repo_name": "pokutnik/skype4py",
"path": "Skype4Py/lang/da.py",
"copies": "23",
"size": "6833",
"license": "bsd-3-clause",
"hash": 2958249102553904000,
"line_mean": 35.5401069519,
"line_max": 75,
"alpha_frac": 0.8015512952,
"autogenerated": false,
"ratio": 2.47124773960217,
"config_test": fal... |
apiAttachAvailable = u'API forefindes'
apiAttachNotAvailable = u'Optaget'
apiAttachPendingAuthorization = u'Afventer godkendelse'
apiAttachRefused = u'Afvist'
apiAttachSuccess = u'Succes'
apiAttachUnknown = u'Ukendt'
budDeletedFriend = u'Slettet fra liste over kontaktpersoner'
budFriend = u'Ven'
budNeverBeenFri... | {
"repo_name": "bbockelm/htcondor",
"path": "src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/da.py",
"copies": "10",
"size": "7020",
"license": "apache-2.0",
"hash": 2381023731831515600,
"line_mean": 35.5401069519,
"line_max": 75,
"alpha_frac": 0.78019943... |
apiAttachAvailable = u'API je k dispozici'
apiAttachNotAvailable = u'Nedostupn\xfd'
apiAttachPendingAuthorization = u'Nevyr\xedzen\xe1 autorizace'
apiAttachRefused = u'Odm\xedtnuto'
apiAttachSuccess = u'\xdaspech'
apiAttachUnknown = u'Nezn\xe1m\xfd'
budDeletedFriend = u'Odstranen ze seznamu pr\xe1tel'
budFriend = u'Pr\... | {
"repo_name": "james-huang/sk_skype_bot",
"path": "Skype4Py/lang/cs.py",
"copies": "23",
"size": "7855",
"license": "mit",
"hash": -634809563427037800,
"line_mean": 41.0053475936,
"line_max": 98,
"alpha_frac": 0.7882877148,
"autogenerated": false,
"ratio": 2.2208085948543963,
"config_test": fal... |
apiAttachAvailable = u'API Kullanilabilir'
apiAttachNotAvailable = u'Kullanilamiyor'
apiAttachPendingAuthorization = u'Yetkilendirme Bekliyor'
apiAttachRefused = u'Reddedildi'
apiAttachSuccess = u'Basarili oldu'
apiAttachUnknown = u'Bilinmiyor'
budDeletedFriend = u'Arkadas Listesinden Silindi'
budFriend = u'Arka... | {
"repo_name": "djw8605/htcondor",
"path": "src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/tr.py",
"copies": "10",
"size": "7343",
"license": "apache-2.0",
"hash": 6630143884859975000,
"line_mean": 37.2673796791,
"line_max": 89,
"alpha_frac": 0.786463298... |
apiAttachAvailable = u'API saatavilla'
apiAttachNotAvailable = u'Ei saatavilla'
apiAttachPendingAuthorization = u'Odottaa valtuutusta'
apiAttachRefused = u'Ev\xe4tty'
apiAttachSuccess = u'Onnistui'
apiAttachUnknown = u'Tuntematon'
budDeletedFriend = u'Poistettu yst\xe4v\xe4listasta'
budFriend = u'Yst\xe4v\xe4'
... | {
"repo_name": "mambelli/osg-bosco-marco",
"path": "src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/fi.py",
"copies": "10",
"size": "7319",
"license": "apache-2.0",
"hash": -6067636774727020000,
"line_mean": 37.1390374332,
"line_max": 99,
"alpha_frac": 0.... |
apiAttachAvailable = u'API tilgjengelig'
apiAttachNotAvailable = u'Ikke tilgjengelig'
apiAttachPendingAuthorization = u'Venter p\xe5 \xe5 bli godkjent'
apiAttachRefused = u'Avsl\xe5tt'
apiAttachSuccess = u'Vellykket'
apiAttachUnknown = u'Ukjent'
budDeletedFriend = u'Slettet fra kontaktlisten'
budFriend = u'Venn'
budNev... | {
"repo_name": "donjordano/skype4py",
"path": "Skype4Py/lang/no.py",
"copies": "23",
"size": "6713",
"license": "bsd-3-clause",
"hash": 1055551957546794400,
"line_mean": 34.8983957219,
"line_max": 81,
"alpha_frac": 0.8000893788,
"autogenerated": false,
"ratio": 2.4473204520597887,
"config_test":... |
apiAttachAvailable = u'API tillg\xe4ngligt'
apiAttachNotAvailable = u'Inte tillg\xe4ngligt'
apiAttachPendingAuthorization = u'Godk\xe4nnande avvaktas'
apiAttachRefused = u'Nekades'
apiAttachSuccess = u'Det lyckades'
apiAttachUnknown = u'Ok\xe4nd'
budDeletedFriend = u'Borttagen fr\xe5n kontaktlistan'
budFriend = ... | {
"repo_name": "djw8605/htcondor",
"path": "src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/sv.py",
"copies": "10",
"size": "7128",
"license": "apache-2.0",
"hash": -5837045650603632000,
"line_mean": 36.1176470588,
"line_max": 83,
"alpha_frac": 0.77918069... |
apiAttachAvailable = u'API \u05d6\u05de\u05d9\u05df'
apiAttachNotAvailable = u'\u05d0\u05d9\u05e0\u05d5 \u05d6\u05de\u05d9\u05df'
apiAttachPendingAuthorization = u'\u05de\u05de\u05ea\u05d9\u05df \u05dc\u05d0\u05d9\u05e9\u05d5\u05e8'
apiAttachRefused = u'\u05e0\u05d3\u05d7\u05d4'
apiAttachSuccess = u'\u05d4\u05e6\u05dc\... | {
"repo_name": "aodag/skype4py",
"path": "Skype4Py/lang/he.py",
"copies": "23",
"size": "13652",
"license": "bsd-3-clause",
"hash": 1903925072101460000,
"line_mean": 72.0053475936,
"line_max": 225,
"alpha_frac": 0.7917521242,
"autogenerated": false,
"ratio": 1.5693757903207266,
"config_test": fa... |
apiAttachAvailable = u'API\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f'
apiAttachNotAvailable = u'\u7121\u52b9'
apiAttachPendingAuthorization = u'\u8a8d\u8a3c\u5f85\u3061'
apiAttachRefused = u'\u62d2\u5426\u3055\u308c\u307e\u3057\u305f'
apiAttachSuccess = u'\u6210\u529f'
apiAttachUnknown = u'\u4e0d\u660e'
budDelete... | {
"repo_name": "sorenmalling/skype4py",
"path": "Skype4Py/lang/ja.py",
"copies": "23",
"size": "10544",
"license": "bsd-3-clause",
"hash": -4623542917846343000,
"line_mean": 55.385026738,
"line_max": 171,
"alpha_frac": 0.7959028832,
"autogenerated": false,
"ratio": 1.7130787977254265,
"config_te... |
apiAttachAvailable = u'API\u53ef\u4f9b\u4f7f\u7528'
apiAttachNotAvailable = u'\u4e0d\u4f9b\u4f7f\u7528'
apiAttachPendingAuthorization = u'\u5f85\u6388\u6743'
apiAttachRefused = u'\u62d2\u7edd'
apiAttachSuccess = u'\u6210\u529f'
apiAttachUnknown = u'\u4e0d\u8be6'
budDeletedFriend = u'\u5df2\u4ece\u670b\u53cb\u540d\u5355... | {
"repo_name": "gastounage/skype4py3",
"path": "Skype4Py3/lang/x1.py",
"copies": "23",
"size": "8466",
"license": "bsd-3-clause",
"hash": 4331082215040959500,
"line_mean": 44.2727272727,
"line_max": 99,
"alpha_frac": 0.7863217576,
"autogenerated": false,
"ratio": 1.834850455136541,
"config_test"... |
apiAttachAvailable = u'API \uc0ac\uc6a9\uac00\ub2a5'
apiAttachNotAvailable = u'\uc678\ucd9c \uc911'
apiAttachPendingAuthorization = u'\uc2b9\uc778 \ubcf4\ub958 \uc911'
apiAttachRefused = u'\ud1b5\ud654 \uac70\ubd80'
apiAttachSuccess = u'\uc131\uacf5'
apiAttachUnknown = u'\uc54c \uc218 \uc5c6\uc74c'
budDeletedFriend = u... | {
"repo_name": "aodag/skype4py",
"path": "Skype4Py/lang/ko.py",
"copies": "23",
"size": "9973",
"license": "bsd-3-clause",
"hash": -8338516115995871000,
"line_mean": 52.3315508021,
"line_max": 146,
"alpha_frac": 0.7761957285,
"autogenerated": false,
"ratio": 2.0042202572347265,
"config_test": fa... |
apiAttachAvailable = u'\u0414\u043e\u0441\u0442\u044a\u043f\u0435\u043d \u0447\u0440\u0435\u0437 API'
apiAttachNotAvailable = u'\u041d\u0435\u0434\u043e\u0441\u0442\u044a\u043f\u0435\u043d'
apiAttachPendingAuthorization = u'\u0427\u0430\u043a\u0430 \u0441\u0435 \u043e\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u... | {
"repo_name": "neurodebian/htcondor",
"path": "src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/bg.py",
"copies": "10",
"size": "18721",
"license": "apache-2.0",
"hash": 7167740046204979000,
"line_mean": 98.1122994652,
"line_max": 267,
"alpha_frac": 0.793... |
"""API Blueprint
This is a subclass of Flask's Blueprint
It provides added features:
- Decorators to specify Marshmallow schema for view functions I/O
- API documentation registration
Documentation process works in several steps:
- At import time
- When a MethodView or a view function is decorated, relevant in... | {
"repo_name": "Nobatek/flask-rest-api",
"path": "flask_rest_api/blueprint.py",
"copies": "1",
"size": "12064",
"license": "mit",
"hash": -5977737212997988000,
"line_mean": 39.0797342193,
"line_max": 79,
"alpha_frac": 0.5640749337,
"autogenerated": false,
"ratio": 5.0120481927710845,
"config_tes... |
# API call for all players in Premier League
import pandas as pd
import numpy as np
import json, requests
from time import sleep
################################################################################
# Will start by pulling data for each player from 1 through 543 (see range below)
df = pd.DataFrame()
typ... | {
"repo_name": "seamus-mckinsey/fpl",
"path": "historical_api_call.py",
"copies": "1",
"size": "4207",
"license": "mit",
"hash": 1784495480922656500,
"line_mean": 31.3615384615,
"line_max": 109,
"alpha_frac": 0.5398145947,
"autogenerated": false,
"ratio": 3.5087572977481236,
"config_test": false... |
"""API calls for RingPlus."""
from __future__ import print_function
from ringplus.parsers import ModelParser
from ringplus.binder import bind_api
class API(object):
"""A python wrapper for the RingPlus API.
:reference: https://docs.ringplus.net/
"""
def __init__(self, auth_handler=None,
... | {
"repo_name": "Shatnerz/ringplus",
"path": "ringplus/api.py",
"copies": "1",
"size": "18878",
"license": "mit",
"hash": -2782194268749250000,
"line_mean": 32.590747331,
"line_max": 79,
"alpha_frac": 0.5595402055,
"autogenerated": false,
"ratio": 4.768375852488002,
"config_test": false,
"has_n... |
"""API calls for the Flask application"""
import os
import gevent
from flask import Response, request, render_template, send_from_directory, jsonify
from gevent.queue import Queue
from bcbio_monitor import app
from bcbio_monitor import parser as ps
#############################################
# controllers and st... | {
"repo_name": "guillermo-carrasco/bcbio-nextgen-monitor",
"path": "bcbio_monitor/api/__init__.py",
"copies": "1",
"size": "3121",
"license": "mit",
"hash": -5017185750685911000,
"line_mean": 24.1693548387,
"line_max": 88,
"alpha_frac": 0.5892342198,
"autogenerated": false,
"ratio": 3.595622119815... |
import requests # pip install requests if you don't have it
import json
def grade_request(f):
# makes the request to the theia interface and returns the grade of that image.
# if there is something wrong, it returns -1
# argument - file object
# Get the key from external file
try:
... | {
"repo_name": "derbedhruv/openDR",
"path": "modules/theia.py",
"copies": "1",
"size": "1160",
"license": "mit",
"hash": -5563606920903026000,
"line_mean": 31.1428571429,
"line_max": 83,
"alpha_frac": 0.6327586207,
"autogenerated": false,
"ratio": 3.504531722054381,
"config_test": false,
"has_... |
"""api_cats URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | {
"repo_name": "OscaRoa/api-cats",
"path": "api_cats/urls.py",
"copies": "1",
"size": "1184",
"license": "mit",
"hash": -164974865076207940,
"line_mean": 32.8285714286,
"line_max": 79,
"alpha_frac": 0.6765202703,
"autogenerated": false,
"ratio": 3.441860465116279,
"config_test": false,
"has_no... |
"""API checking module.
This module serves as a library of API checks used as assertions during
constructing the computational graph.
"""
from typing import List, Optional
import tensorflow as tf
class CheckingException(Exception):
pass
def assert_shape(tensor: tf.Tensor,
expected_shape: List... | {
"repo_name": "ufal/neuralmonkey",
"path": "neuralmonkey/checking.py",
"copies": "1",
"size": "2397",
"license": "bsd-3-clause",
"hash": -6101260454197517000,
"line_mean": 32.7605633803,
"line_max": 79,
"alpha_frac": 0.5748852733,
"autogenerated": false,
"ratio": 3.8912337662337664,
"config_tes... |
"""API checking module.
This module serves as a library of API checks used as assertions during
constructing the computational graph.
"""
from typing import List, Optional, Iterable
import tensorflow as tf
from neuralmonkey.logging import log, debug
from neuralmonkey.dataset import Dataset
from neuralmonkey.runner... | {
"repo_name": "juliakreutzer/bandit-neuralmonkey",
"path": "neuralmonkey/checking.py",
"copies": "1",
"size": "4402",
"license": "bsd-3-clause",
"hash": 4435057747071704000,
"line_mean": 35.3801652893,
"line_max": 79,
"alpha_frac": 0.5411176738,
"autogenerated": false,
"ratio": 4.049678012879485,... |
"""A pickleable wrapper for sharing NumPy ndarrays between processes using POSIX shared memory."""
import mmap
import sys
import numpy as np
import shared_memory
MINIMUMSHMSIZE = sys.getsizeof(np.array([]))
class SharedNDArray:
"""Creates a new SharedNDArray, a pickleable wrapper for sharing NumPy ndarrays be... | {
"repo_name": "applio/proto_shmem",
"path": "shared_ndarray/shared_ndarray/shared_ndarray.py",
"copies": "1",
"size": "3808",
"license": "mit",
"hash": -1492378960571723800,
"line_mean": 33.6181818182,
"line_max": 99,
"alpha_frac": 0.6394432773,
"autogenerated": false,
"ratio": 4.283464566929134,... |
"""A pickleable wrapper for sharing NumPy ndarrays between processes using POSIX shared memory."""
import mmap
import numpy as np
import posix_ipc
class SharedNDArray:
"""Creates a new SharedNDArray, a pickleable wrapper for sharing NumPy ndarrays between
processes using POSIX shared memory.
SharedNDAr... | {
"repo_name": "crowsonkb/shared_ndarray",
"path": "shared_ndarray/shared_ndarray.py",
"copies": "1",
"size": "3191",
"license": "mit",
"hash": 336968430974514050,
"line_mean": 33.311827957,
"line_max": 99,
"alpha_frac": 0.6436853651,
"autogenerated": false,
"ratio": 4.395316804407713,
"config_t... |
"""A pickle-based caching core for cachier."""
# This file is part of Cachier.
# https://github.com/shaypal5/cachier
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2016, Shay Palachy <shaypal5@gmail.com>
import os
import pickle # for local caching
from datetime im... | {
"repo_name": "shaypal5/cachier",
"path": "cachier/pickle_core.py",
"copies": "1",
"size": "7277",
"license": "mit",
"hash": 2973518793015874600,
"line_mean": 32.380733945,
"line_max": 100,
"alpha_frac": 0.5375841693,
"autogenerated": false,
"ratio": 4.1323111868256674,
"config_test": false,
... |
"""API client classes"""
import logging
import requests
from collections import namedtuple
from urllib import parse
from ticketpy.query import (
AttractionQuery,
ClassificationQuery,
EventQuery,
VenueQuery
)
from ticketpy.model import Page
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
sh... | {
"repo_name": "arcward/ticketpy",
"path": "ticketpy/client.py",
"copies": "1",
"size": "8797",
"license": "mit",
"hash": -1518361176928971000,
"line_mean": 32.8346153846,
"line_max": 78,
"alpha_frac": 0.581448221,
"autogenerated": false,
"ratio": 4.031622364802933,
"config_test": false,
"has_... |
"API Client Tests"
import unittest
import fmapi
import logging
def enable_logging():
"Turn on debug logging"
try:
import http.client as http_client
except ImportError:
# Python 2
import httplib as http_client
http_client.HTTPConnection.debuglevel = 1
# You must initializ... | {
"repo_name": "FoundationMercury/fmpyapi",
"path": "fmapi/test.py",
"copies": "1",
"size": "3620",
"license": "mit",
"hash": 2416524580785028600,
"line_mean": 25.231884058,
"line_max": 73,
"alpha_frac": 0.5439226519,
"autogenerated": false,
"ratio": 3.6863543788187374,
"config_test": true,
"h... |
"""API client wrapper.
"""
from functools import partial
from .urlpath import URLPath
class API(URLPath):
"""Add URL generation to an HTTP request client. Requires that the `client`
support HTTP verbs as lowercase methods. An example client would be the one
from Requests package.
"""
__attrs__ =... | {
"repo_name": "dgilland/ladder",
"path": "ladder/api.py",
"copies": "1",
"size": "1435",
"license": "mit",
"hash": 2467282833135233000,
"line_mean": 27.137254902,
"line_max": 79,
"alpha_frac": 0.5358885017,
"autogenerated": false,
"ratio": 4.442724458204334,
"config_test": false,
"has_no_keyw... |
# api code for the reviewboard extension, inspired/copied from reviewboard
# post-review code.
import cookielib
import getpass
import mimetools
import os
import urllib2
import simplejson
import mercurial.ui
from urlparse import urljoin, urlparse
class APIError(Exception):
pass
class ReviewBoardError(Exception):
... | {
"repo_name": "windix/mercurial-reviewboard",
"path": "reviewboard.py",
"copies": "1",
"size": "16400",
"license": "mit",
"hash": -5573626314460165000,
"line_mean": 33.6723044397,
"line_max": 82,
"alpha_frac": 0.5474390244,
"autogenerated": false,
"ratio": 4.170905391658189,
"config_test": fals... |
"""API creation module."""
from flask_restful import Api
from backend import resources
root_resources = set([resources.EditionResource,
resources.MetacardResource,
resources.PrintingResource,
resources.PartyResource,
resources.Tran... | {
"repo_name": "mkarppan/RESTful-MtG",
"path": "backend/restful.py",
"copies": "1",
"size": "2082",
"license": "mit",
"hash": 6205232764023187000,
"line_mean": 36.8545454545,
"line_max": 75,
"alpha_frac": 0.5408261287,
"autogenerated": false,
"ratio": 5.507936507936508,
"config_test": false,
"... |
"""API data feature
Generates JSON for available information.
"""
import flask
import json
from database_setup import Category
from database_setup import Item
from flask import abort
from flask import jsonify
from sqlalchemy import asc, desc
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm.exc import N... | {
"repo_name": "novastorm/udacity-item-catalog",
"path": "vagrant/catalog/routes/api_v1.py",
"copies": "1",
"size": "3362",
"license": "bsd-2-clause",
"hash": 5428661264353907000,
"line_mean": 29.5636363636,
"line_max": 90,
"alpha_frac": 0.6653777513,
"autogenerated": false,
"ratio": 4.12009803921... |
'''API Definition for HART Manager XML API'''
import ApiDefinition
import xmlutils
import re
# Add a log handler for the HART Manager
import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('HartManager')
log.setLevel(logging.INFO)
log.addHandler(NullHand... | {
"repo_name": "twatteyne/dustlink_academy",
"path": "SmartMeshSDK/ApiDefinition/HartMgrDefinition.py",
"copies": "3",
"size": "79712",
"license": "bsd-3-clause",
"hash": -822044396181852900,
"line_mean": 39.380952381,
"line_max": 401,
"alpha_frac": 0.3646753312,
"autogenerated": false,
"ratio": 4... |
"""api_demo_site URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | {
"repo_name": "BFriedland/api-demo",
"path": "api_demo_site/urls.py",
"copies": "1",
"size": "1057",
"license": "mit",
"hash": 3648863426549177000,
"line_mean": 35.4482758621,
"line_max": 77,
"alpha_frac": 0.6868495743,
"autogenerated": false,
"ratio": 3.546979865771812,
"config_test": false,
... |
"""API Discovery api.
The AXIS API Discovery service makes it possible to retrieve information about APIs supported on their products.
"""
import attr
from .api import APIItem, APIItems, Body
URL = "/axis-cgi/apidiscovery.cgi"
API_DISCOVERY_ID = "api-discovery"
API_VERSION = "1.0"
class ApiDiscovery(APIItems):
... | {
"repo_name": "Kane610/axis",
"path": "axis/api_discovery.py",
"copies": "1",
"size": "1840",
"license": "mit",
"hash": 5116531372514992000,
"line_mean": 26.0588235294,
"line_max": 112,
"alpha_frac": 0.5679347826,
"autogenerated": false,
"ratio": 4.043956043956044,
"config_test": false,
"has_... |
# api_dividebatur.py
# Ronald L. Rivest
# July 31, 2016
# python3
"""
This is a draft API as a possible interface between the
Bayesian audit code (or other audit code) and the implementation
of the STV social choice function by Grahame Bowland.
"""
import copy
import hashlib
import os
import random
# Add parent dire... | {
"repo_name": "ron-rivest/2016-aus-senate-audit",
"path": "rivest/api_dividebatur.py",
"copies": "1",
"size": "12551",
"license": "apache-2.0",
"hash": 477775727614217100,
"line_mean": 39.6181229773,
"line_max": 151,
"alpha_frac": 0.6207473508,
"autogenerated": false,
"ratio": 4.12183908045977,
... |
"""API Doc generator for the server side API."""
from hydrus.hydraspec.doc_writer import HydraDoc, HydraClass, HydraClassProp, HydraClassOp
import json
def doc_gen(API: str, BASE_URL: str) -> HydraDoc:
"""Generate API Doc for server."""
# Main API Doc
api_doc = HydraDoc(API,
"API D... | {
"repo_name": "xadahiya/hydrus",
"path": "examples/drones/doc_gen.py",
"copies": "1",
"size": "11478",
"license": "mit",
"hash": -6635439770086230000,
"line_mean": 51.4109589041,
"line_max": 110,
"alpha_frac": 0.4960794564,
"autogenerated": false,
"ratio": 4.582035928143712,
"config_test": fals... |
"""API Doc generator for the server side API."""
import json
from hydra_python_core.doc_writer import (HydraClass, HydraClassOp,
HydraClassProp, HydraDoc,
HydraStatus, HydraCollection)
def doc_gen(API: str, BASE_URL: str) -> HydraDo... | {
"repo_name": "HTTP-APIs/hydrus",
"path": "examples/drones/doc_gen.py",
"copies": "1",
"size": "12115",
"license": "mit",
"hash": 2262051825291629300,
"line_mean": 42.5791366906,
"line_max": 110,
"alpha_frac": 0.5902600083,
"autogenerated": false,
"ratio": 3.918175937904269,
"config_test": fals... |
# API docs: http://anilist-api.readthedocs.org/en/latest/
from logging import debug, info, warning, error
import re
from .. import AbstractInfoHandler
from data.models import UnprocessedShow, ShowType
class InfoHandler(AbstractInfoHandler):
_show_link_base = "http://anilist.co/anime/{id}"
_show_link_matcher = "htt... | {
"repo_name": "TheEnigmaBlade/holo",
"path": "src/services/info/anilist.py",
"copies": "2",
"size": "1564",
"license": "mit",
"hash": -4915715992756173000,
"line_mean": 26.4385964912,
"line_max": 87,
"alpha_frac": 0.6777493606,
"autogenerated": false,
"ratio": 2.9343339587242028,
"config_test":... |
# API docs: https://kitsu.docs.apiary.io
from logging import debug, info, warning, error
import re
from .. import AbstractInfoHandler
from data.models import UnprocessedShow, ShowType
class InfoHandler(AbstractInfoHandler):
_show_link_base = "https://kitsu.io/anime/{slug}"
_show_link_matcher = "https?://kitsu\.io/... | {
"repo_name": "andrewhillcode/holo",
"path": "src/services/info/kitsu.py",
"copies": "2",
"size": "3320",
"license": "mit",
"hash": -7062429695393677000,
"line_mean": 27.3760683761,
"line_max": 126,
"alpha_frac": 0.6578313253,
"autogenerated": false,
"ratio": 2.9537366548042705,
"config_test": ... |
# A piece of code to get the list of registered endpoints on keystone
# can be filtered by service id if it is specified
# Execution example: python listAllRegisteredEPs.py -u [USERNAME] -p [PASSWORD] -t [TENANT_NAME] -a [AUTH_URL] -s [SERVICE_ID]
__author__ = 'Mohammad'
import sys
import getopt
from keystoneclient... | {
"repo_name": "MobileCloudNetworking/dssaas",
"path": "dss-side-scripts/listAllRegisteredEPs.py",
"copies": "1",
"size": "2428",
"license": "apache-2.0",
"hash": -797558676089607300,
"line_mean": 31.8108108108,
"line_max": 205,
"alpha_frac": 0.5514827018,
"autogenerated": false,
"ratio": 3.391061... |
# A piece of code to get the list of registered services on keystone
# Execution example: python delRegisteredEP.py -e <ENDPOINT_ID> -u [USERNAME] -p [PASSWORD] -t [TENANT_NAME] -a [AUTH_URL]
__author__ = 'Mohammad'
import sys
import getopt
from keystoneclient.v2_0 import client
def main(argv):
try:
op... | {
"repo_name": "MobileCloudNetworking/dssaas",
"path": "dss-side-scripts/delRegisteredEP.py",
"copies": "1",
"size": "1976",
"license": "apache-2.0",
"hash": -1880547038697404200,
"line_mean": 27.2285714286,
"line_max": 128,
"alpha_frac": 0.5607287449,
"autogenerated": false,
"ratio": 3.4186851211... |
# A piece of code to get the list of registered services on keystone
# Execution example: python delRegisteredService.py -s <SERVICE_ID> -u [USERNAME] -p [PASSWORD] -t [TENANT_NAME] -a [AUTH_URL]
__author__ = 'Mohammad'
import sys
import getopt
from keystoneclient.v2_0 import client
def main(argv):
try:
... | {
"repo_name": "MobileCloudNetworking/dssaas",
"path": "dss-side-scripts/delRegisteredService.py",
"copies": "1",
"size": "2005",
"license": "apache-2.0",
"hash": 2569133459635980000,
"line_mean": 27.6428571429,
"line_max": 132,
"alpha_frac": 0.566084788,
"autogenerated": false,
"ratio": 3.4568965... |
# A piece of code to get the list of registered services on keystone
# Execution example: python listAllRegisteredServices.py -u [USERNAME] -p [PASSWORD] -t [TENANT_NAME] -a [AUTH_URL] -s [SERVICE_NAME]
# SERVICE_NAME parameter can be just a part of the service name.
# For example -s dss can return results that have ds... | {
"repo_name": "MobileCloudNetworking/dssaas",
"path": "dss-side-scripts/listAllRegisteredServices.py",
"copies": "1",
"size": "2556",
"license": "apache-2.0",
"hash": -8662053742193196000,
"line_mean": 31.3544303797,
"line_max": 154,
"alpha_frac": 0.5661189358,
"autogenerated": false,
"ratio": 3.... |
"""API endpoint for the AsciiPic API."""
import cherrypy
from cherrypy import tools
from asciipic.api import base as base_api
from asciipic.db.managers import user
from asciipic.tasks import base as base_task
from asciipic.tasks import echo_task
class EchoEndpoint(base_api.BaseAPI):
"""Action related to users.... | {
"repo_name": "micumatei/asciipic",
"path": "asciipic/api/api_endpoint/echo/__init__.py",
"copies": "1",
"size": "1581",
"license": "mit",
"hash": -4969057752802292000,
"line_mean": 26.2586206897,
"line_max": 74,
"alpha_frac": 0.5572422517,
"autogenerated": false,
"ratio": 3.923076923076923,
"c... |
"""API Endpoint
Validates inputs to the Security Fairy tool,
then creates and executes the State Machine
which orchestrates the Security Fairy
Lambda functions.
"""
import json
import re
import os
import string
import boto3
from botocore.exceptions import ProfileNotFound
from aws_entity import AWSEntity
try:
S... | {
"repo_name": "1Strategy/security-fairy",
"path": "api_endpoint.py",
"copies": "1",
"size": "8262",
"license": "apache-2.0",
"hash": 674863282986904700,
"line_mean": 30.534351145,
"line_max": 212,
"alpha_frac": 0.5884773663,
"autogenerated": false,
"ratio": 3.8285449490268766,
"config_test": fa... |
""" API endpoints for admin controls """
import gzip
import json
from paste.httpheaders import CONTENT_DISPOSITION # pylint: disable=E0611
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.response import FileIter
from pyramid.view import view_config, view_defaults
from pyramid_duh import argify
from six ... | {
"repo_name": "a-tal/pypicloud",
"path": "pypicloud/views/admin.py",
"copies": "1",
"size": "7051",
"license": "mit",
"hash": 5785213240279692000,
"line_mean": 39.7572254335,
"line_max": 82,
"alpha_frac": 0.6149482343,
"autogenerated": false,
"ratio": 4.152532391048292,
"config_test": true,
"... |
"""API endpoints for bookmarks."""
from flask import url_for, g
from flask.views import MethodView
from flask_login import login_required
from flask_smorest import Blueprint, abort
from bookmarks import csrf
from bookmarks.models import Bookmark
from bookmarks.logic import _get, _post, _put, _delete
from .pagination... | {
"repo_name": "ev-agelos/Python-bookmarks",
"path": "bookmarks/api/bookmarks.py",
"copies": "1",
"size": "3229",
"license": "mit",
"hash": -7096757027590723000,
"line_mean": 28.623853211,
"line_max": 88,
"alpha_frac": 0.6262000619,
"autogenerated": false,
"ratio": 3.9282238442822384,
"config_te... |
"""API endpoints for users."""
from flask import g, url_for, request
from flask.views import MethodView
from flask_login import login_required
from flask_smorest import abort, Blueprint
from bookmarks import db, csrf
from bookmarks import utils
from bookmarks.users.models import User
from .schemas import UserPUTSche... | {
"repo_name": "ev-agelos/Python-bookmarks",
"path": "bookmarks/api/users.py",
"copies": "1",
"size": "3278",
"license": "mit",
"hash": 2982480249049388500,
"line_mean": 36.25,
"line_max": 93,
"alpha_frac": 0.6070774863,
"autogenerated": false,
"ratio": 3.95416164053076,
"config_test": false,
... |
"""API endpoints for votes."""
from flask import url_for, g
from flask.views import MethodView
from flask_login import login_required
from flask_smorest import Blueprint, abort
from bookmarks import csrf
from bookmarks.models import Bookmark, Vote
from .schemas import VoteSchema, VotePOSTSchema, VotePUTSchema
from ..... | {
"repo_name": "ev-agelos/Python-bookmarks",
"path": "bookmarks/api/votes.py",
"copies": "1",
"size": "2659",
"license": "mit",
"hash": -5881221931589563000,
"line_mean": 30.6547619048,
"line_max": 93,
"alpha_frac": 0.5979691613,
"autogenerated": false,
"ratio": 3.602981029810298,
"config_test":... |
## API End Points
CREATE_USER = "/createuser"
CREDENTIALS = "/auth/credentials"
GET_PLAYER = "/getplayer"
GET_FRIENDS = "/getfriends"
SELECT_INIT_CHARACTER = "/selectinitialcharacter"
UNLOCK_STAGE = "/unlockstagegoo"
FINISH_TUTORIAL = "/finishTutorial"
STAGE_START = "/stagestart"
STAGE_INFO = "/stageinfo"
STAGE_CLEAR =... | {
"repo_name": "liaogz82/locust-fabric-deployment",
"path": "settings.py",
"copies": "2",
"size": "1516",
"license": "mit",
"hash": -6524322928298273000,
"line_mean": 24.7118644068,
"line_max": 109,
"alpha_frac": 0.731530343,
"autogenerated": false,
"ratio": 2.2359882005899707,
"config_test": fa... |
"""API endpoints"""
import os
import json
import requests
import jwt
from datetime import datetime, timedelta
from urlparse import parse_qsl
from flask import Flask, request, jsonify, make_response, render_template
from checkit.backend import users, todo_lists, setup_stores
app = Flask(__name__, static_url_path='... | {
"repo_name": "guillermo-carrasco/checkit",
"path": "checkit/server/api.py",
"copies": "1",
"size": "6173",
"license": "mit",
"hash": 6593753135540023000,
"line_mean": 29.865,
"line_max": 88,
"alpha_frac": 0.6167179653,
"autogenerated": false,
"ratio": 3.4621424565339316,
"config_test": false,
... |
""" API endpoints related to home operations. """
import logging
from pyramid.security import NO_PERMISSION_REQUIRED
from pyramid.view import view_config
LOG = logging.getLogger(__name__)
@view_config(route_name='unlock', request_method='POST', permission='unlock')
def unlock(request):
""" Unlock the gate for a... | {
"repo_name": "stevearc/stiny",
"path": "stiny/home.py",
"copies": "1",
"size": "1442",
"license": "mit",
"hash": -5255315134429649000,
"line_mean": 37.972972973,
"line_max": 78,
"alpha_frac": 0.6865464632,
"autogenerated": false,
"ratio": 3.765013054830287,
"config_test": false,
"has_no_keyw... |
"""Api endpoints to interactions for the Image ndb model
"""
# local imports
from app.base.handlers import AdminAjaxHandler
from app.handlers.apis.mixins import ListCreateMixin
from app.handlers.apis.mixins import OrderMixin
from app.handlers.apis.mixins import RetrieveUpdateDeleteMixin
from app.forms.events import Ev... | {
"repo_name": "mjmcconnell/sra",
"path": "src-server/app/handlers/apis/events.py",
"copies": "1",
"size": "1139",
"license": "apache-2.0",
"hash": 4081892569596422000,
"line_mean": 28.2051282051,
"line_max": 68,
"alpha_frac": 0.6707638279,
"autogenerated": false,
"ratio": 3.784053156146179,
"co... |
"""Api endpoints to interactions for the Image ndb model
"""
# third-party imports
from google.appengine.api import mail
# local imports
from app import config
from app.base.handlers import BaseAjaxHandler
from app.base.handlers import AdminAjaxHandler
from app.handlers.apis.mixins import ListCreateMixin
from app.hand... | {
"repo_name": "mjmcconnell/sra",
"path": "src-server/app/handlers/apis/workshops.py",
"copies": "1",
"size": "2687",
"license": "apache-2.0",
"hash": 7155740049462739000,
"line_mean": 31.3734939759,
"line_max": 77,
"alpha_frac": 0.6319315221,
"autogenerated": false,
"ratio": 4.0589123867069485,
... |
"""Api endpoints to interactions for the Page ndb model
"""
# local imports
from app.base.handlers import AdminAjaxHandler
from app.handlers.apis.mixins import ListMixin
from app.handlers.apis.mixins import OrderMixin
from app.handlers.apis.mixins import RetrieveMixin
from app.handlers.apis.mixins import UpdateMixin
fr... | {
"repo_name": "mjmcconnell/sra",
"path": "src-server/app/handlers/apis/pages.py",
"copies": "1",
"size": "1406",
"license": "apache-2.0",
"hash": 1629649959023111200,
"line_mean": 28.2916666667,
"line_max": 68,
"alpha_frac": 0.667140825,
"autogenerated": false,
"ratio": 4.051873198847262,
"conf... |
#api en python y kivy
#api example
#josue de leon
from kivy.app import App #importing the app class so as
#to run the damn application
from kivy.uix.boxlayout import BoxLayout #importing BoxLayout widget since i don't
#want to create a dynamic class
from kivy.properties import ObjectProperty,ListPr... | {
"repo_name": "JOSUEXLION/prog3-uip",
"path": "investigaciones/API.py",
"copies": "1",
"size": "4685",
"license": "mit",
"hash": 2177486657253594400,
"line_mean": 40.4601769912,
"line_max": 132,
"alpha_frac": 0.7545357524,
"autogenerated": false,
"ratio": 3.460118168389956,
"config_test": false... |
"""API example script: Create an order from a given form.
NOTE: You need to change several variables to make this work. See below.
NOTE: This uses the third-party 'requests' module, which is better than
the standard 'urllib' module.
"""
import simplejson as json # XXX Python 3 kludge
# Third-party package: ht... | {
"repo_name": "pekrau/OrderPortal",
"path": "orderportal/scripts/api_create_order.py",
"copies": "1",
"size": "1034",
"license": "mit",
"hash": 7967340446153292000,
"line_mean": 34.6551724138,
"line_max": 77,
"alpha_frac": 0.7330754352,
"autogenerated": false,
"ratio": 3.152439024390244,
"confi... |
"""API example script: Edit an order; fields, title, tags and history.
NOTE: You need to change several variables to make this work. See below.
NOTE: This uses the third-party 'requests' module, which is better than
the standard 'urllib' module.
"""
import simplejson as json # XXX Python 3 kludge
# Third-part... | {
"repo_name": "pekrau/OrderPortal",
"path": "orderportal/scripts/api_edit_order.py",
"copies": "1",
"size": "1455",
"license": "mit",
"hash": -3369908776884650000,
"line_mean": 39.4166666667,
"line_max": 77,
"alpha_frac": 0.6281786942,
"autogenerated": false,
"ratio": 3.4642857142857144,
"confi... |
"""API example script: Submit the order.
NOTE: You need to change several variables to make this work. See below.
NOTE: This uses the third-party 'requests' module, which is better than
the standard 'urllib' module.
"""
import sys
import simplejson as json # XXX Python 3 kludge
# Third-party package: http://... | {
"repo_name": "pekrau/OrderPortal",
"path": "orderportal/scripts/api_submit_order.py",
"copies": "1",
"size": "1565",
"license": "mit",
"hash": 6138662363612158000,
"line_mean": 33.0217391304,
"line_max": 77,
"alpha_frac": 0.7067092652,
"autogenerated": false,
"ratio": 3.508968609865471,
"confi... |
"""API example script: Uploading the order report.
NOTE: The upload operation URL requires the IUID for the order;
the order identifier (NMI00603 in this case) won't work for this call.
NOTE: You need to change several variables to make this work. See below.
NOTE: This uses the third-party 'requests' module, w... | {
"repo_name": "pekrau/OrderPortal",
"path": "orderportal/scripts/api_upload_report.py",
"copies": "1",
"size": "1252",
"license": "mit",
"hash": -4215652917473734700,
"line_mean": 35.8235294118,
"line_max": 77,
"alpha_frac": 0.7092651757,
"autogenerated": false,
"ratio": 3.3386666666666667,
"co... |
"""Api extension initialization"""
import warnings
from webargs.flaskparser import abort # noqa
from .spec import APISpecMixin
from .blueprint import Blueprint # noqa
from .pagination import Page # noqa
from .error_handler import ErrorHandlerMixin
__version__ = '0.17.1'
warnings.warn(
"flask-rest-api has b... | {
"repo_name": "Nobatek/flask-rest-api",
"path": "flask_rest_api/__init__.py",
"copies": "1",
"size": "3000",
"license": "mit",
"hash": -3024706197750398500,
"line_mean": 31.2580645161,
"line_max": 79,
"alpha_frac": 0.6746666667,
"autogenerated": false,
"ratio": 4.225352112676056,
"config_test":... |
"""API field validators."""
import re
from django.core.exceptions import ValidationError
from django.db.models import Model
from django.utils.deconstruct import deconstructible
from django.utils.translation import ugettext_lazy as _
from django.utils.six import string_types
from rest_framework.exceptions import Valida... | {
"repo_name": "mdn/browsercompat",
"path": "webplatformcompat/validators.py",
"copies": "2",
"size": "4727",
"license": "mpl-2.0",
"hash": 9029685751938997000,
"line_mean": 39.0593220339,
"line_max": 79,
"alpha_frac": 0.5936111699,
"autogenerated": false,
"ratio": 4.70816733067729,
"config_test... |
"""Api file for the pet example API.
"""
pet = {
'category': {
'id': 42,
'name': 'string'
},
'status': 'string',
'name': 'doggie',
'tags': [
{
'id': 42,
'name': 'string'
}
],
'photoUrls': [
'string',
'string2'
],
... | {
"repo_name": "Trax-air/swagger-tester",
"path": "tests/api.py",
"copies": "1",
"size": "1693",
"license": "mit",
"hash": -7580248740013144000,
"line_mean": 12.8770491803,
"line_max": 43,
"alpha_frac": 0.5469580626,
"autogenerated": false,
"ratio": 3.146840148698885,
"config_test": false,
"ha... |
"""API filters for the Contribution App."""
from django.utils import dateparse, timezone
from rest_framework import filters
from bulbs.content.filters import Published
class ESPublishedFilterBackend(filters.BaseFilterBackend):
"""
Used for elasticsearch publish queries in reporting.
Rounds values to th... | {
"repo_name": "theonion/django-bulbs",
"path": "bulbs/contributions/filters.py",
"copies": "1",
"size": "4249",
"license": "mit",
"hash": -8529987678297016000,
"line_mean": 40.6568627451,
"line_max": 95,
"alpha_frac": 0.625558955,
"autogenerated": false,
"ratio": 4.266064257028113,
"config_test... |
# API for accessing the core plugin of SublimePapyrus
import sublime, sublime_plugin, sys, os, json, threading, time
PYTHON_VERSION = sys.version_info
SUBLIME_VERSION = None
if PYTHON_VERSION[0] == 2:
SUBLIME_VERSION = int(sublime.version())
import imp
root, module = os.path.split(os.getcwd())
coreModule = "Sublime... | {
"repo_name": "Kapiainen/SublimePapyrus",
"path": "Source/Modules/Skyrim/Plugin.py",
"copies": "1",
"size": "170027",
"license": "mit",
"hash": 1783732215646973400,
"line_mean": 34.1731485312,
"line_max": 231,
"alpha_frac": 0.6760102807,
"autogenerated": false,
"ratio": 2.8612031973075305,
"con... |
"""API for backpopulating the db from reddit"""
from datetime import datetime, timezone
import logging
from django.conf import settings
from django.contrib.auth import get_user_model
from channels import api, utils
from channels.constants import (
LINK_TYPE_LINK,
LINK_TYPE_SELF,
EXTENDED_POST_TYPE_ARTICLE... | {
"repo_name": "mitodl/open-discussions",
"path": "channels/backpopulate_api.py",
"copies": "1",
"size": "2848",
"license": "bsd-3-clause",
"hash": -2390468703220812300,
"line_mean": 31.3636363636,
"line_max": 103,
"alpha_frac": 0.6797752809,
"autogenerated": false,
"ratio": 4,
"config_test": fa... |
"""API for bootcamp applications app"""
from django.contrib.contenttypes.models import ContentType
from django.db import transaction
from applications.constants import (
AppStates,
REVIEW_STATUS_REJECTED,
REVIEW_STATUS_PENDING,
SUBMISSION_VIDEO,
)
from applications.models import (
ApplicationStepSu... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "applications/api.py",
"copies": "1",
"size": "5227",
"license": "bsd-3-clause",
"hash": 3401688433125379600,
"line_mean": 34.801369863,
"line_max": 118,
"alpha_frac": 0.6850966137,
"autogenerated": false,
"ratio": 4.184947958366694,
"config_te... |
""" API for center """
import datetime
import time
import grpc
import functools
from django.db import connection
from django.utils import timezone
from django.dispatch import receiver
from django.db.models.signals import post_save
from django.conf import settings
from application import restapi
from application.resour... | {
"repo_name": "rkojedzinszky/thermo-center",
"path": "center/restapi.py",
"copies": "1",
"size": "6341",
"license": "bsd-3-clause",
"hash": 5363852612892150000,
"line_mean": 39.6474358974,
"line_max": 106,
"alpha_frac": 0.7019397571,
"autogenerated": false,
"ratio": 4.018377693282636,
"config_t... |
"""API for channels"""
from django.contrib.auth.models import Group
from django.db import transaction
from guardian.core import ObjectPermissionChecker
from guardian.shortcuts import assign_perm, remove_perm
def create_channel_groups(channel_name):
"""
Create the moderator and contributor groups for a channel... | {
"repo_name": "mitodl/open-discussions",
"path": "discussions/api/channels.py",
"copies": "1",
"size": "2149",
"license": "bsd-3-clause",
"hash": -4819507895044230000,
"line_mean": 29.2676056338,
"line_max": 94,
"alpha_frac": 0.6728711028,
"autogenerated": false,
"ratio": 4.093333333333334,
"co... |
"""API for choices that appear as parts of forms, in drop-dpwn menus."""
from google.appengine.ext import ndb
from protorpc import message_types
from protorpc import messages
from protorpc import remote
from protorpc.wsgi import service
import base_api
import ndb_models
package = 'rooms'
class Site(messages.Messa... | {
"repo_name": "babybunny/rebuildingtogethercaptain",
"path": "gae/room/choices_api.py",
"copies": "1",
"size": "3865",
"license": "apache-2.0",
"hash": 1756094793566068700,
"line_mean": 34.4587155963,
"line_max": 150,
"alpha_frac": 0.7042690815,
"autogenerated": false,
"ratio": 3.4355555555555557... |
"""API for communicating with twitch"""
from __future__ import absolute_import
import functools
import logging
import os
import threading
import m3u8
import oauthlib.oauth2
import requests
import requests.utils
import requests_oauthlib
from pytwitcherapi.chat import client
from . import constants, exceptions, model... | {
"repo_name": "Pytwitcher/pytwitcherapi",
"path": "src/pytwitcherapi/session.py",
"copies": "1",
"size": "22538",
"license": "bsd-3-clause",
"hash": 8644238967886432000,
"line_mean": 34.7179080824,
"line_max": 94,
"alpha_frac": 0.5796432691,
"autogenerated": false,
"ratio": 4.123307720453714,
"... |
"""API for converting notebooks between versions.
Authors:
* Jonathan Frederic
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distr... | {
"repo_name": "omni5cience/django-inlineformfield",
"path": ".tox/py27/lib/python2.7/site-packages/IPython/nbformat/convert.py",
"copies": "5",
"size": "2732",
"license": "mit",
"hash": 1889385691755160800,
"line_mean": 36.9444444444,
"line_max": 83,
"alpha_frac": 0.5479502196,
"autogenerated": fal... |
"""API for converting notebooks between versions."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from . import versions
from .reader import get_version
def convert(nb, to_version):
"""Convert a notebook node object to a specific version. Assumes that
... | {
"repo_name": "mattvonrocketstein/smash",
"path": "smashlib/ipy3x/nbformat/converter.py",
"copies": "1",
"size": "2089",
"license": "mit",
"hash": 1547452902976355600,
"line_mean": 36.9818181818,
"line_max": 88,
"alpha_frac": 0.6596457635,
"autogenerated": false,
"ratio": 4.6114790286975715,
"c... |
"""API for creating a contract and configuring the mock service."""
from __future__ import unicode_literals
import fnmatch
import os
from subprocess import Popen
from .constants import BROKER_CLIENT_PATH
import logging
log = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
class Broker():
"""... | {
"repo_name": "pact-foundation/pact-python",
"path": "pact/broker.py",
"copies": "1",
"size": "3886",
"license": "mit",
"hash": 4044650490175195600,
"line_mean": 39.9052631579,
"line_max": 108,
"alpha_frac": 0.6276376737,
"autogenerated": false,
"ratio": 4.27032967032967,
"config_test": false,
... |
"""API for creating a contract and configuring the mock service."""
from __future__ import unicode_literals
import json
import os
from subprocess import Popen
from .broker import Broker
from .constants import MESSAGE_PATH
class MessagePact(Broker):
"""
Represents a contract between a consumer and provider u... | {
"repo_name": "pact-foundation/pact-python",
"path": "pact/message_pact.py",
"copies": "1",
"size": "7511",
"license": "mit",
"hash": -3083549231720489500,
"line_mean": 34.9377990431,
"line_max": 94,
"alpha_frac": 0.6113699907,
"autogenerated": false,
"ratio": 4.444378698224852,
"config_test": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.