text stringlengths 0 1.05M | meta dict |
|---|---|
__all__ = ['Evaluable']
class Evaluable(object):
"""
A mixin class for types inherited from SymPy that may carry nested
unevaluated arguments.
This mixin is used to implement lazy evaluation of expressions.
"""
@classmethod
def _evaluate_maybe_nested(cls, maybe_evaluable):
if is... | {
"repo_name": "opesci/devito",
"path": "devito/types/lazy.py",
"copies": "1",
"size": "1611",
"license": "mit",
"hash": 1564296845042596600,
"line_mean": 31.8775510204,
"line_max": 90,
"alpha_frac": 0.5896958411,
"autogenerated": false,
"ratio": 4.184415584415585,
"config_test": false,
"has_n... |
__all__ = ['EventEmitter', 'on', 'once']
import types
class ListenerWrapper(object):
def __init__(self, listener, is_once=False):
self.listener = listener
self.is_once = is_once
def __call__(self, *args, **kwargs):
self.listener(*args, **kwargs)
def __eq__(self, other):
... | {
"repo_name": "etissieres/PyEventEmitter",
"path": "event_emitter/events.py",
"copies": "1",
"size": "1995",
"license": "mit",
"hash": 1080353870556972800,
"line_mean": 26.3287671233,
"line_max": 85,
"alpha_frac": 0.5839598997,
"autogenerated": false,
"ratio": 4.071428571428571,
"config_test": ... |
__all__ = ['Event','EventDispatcher']
class Event(object):
def __init__(self):
self.handlers = list()
def handle(self, handler):
self.handlers.append(handler)
return self
def unhandle(self, handler):
try:
self.handlers.remove(handler)
except:
... | {
"repo_name": "rocktavious/pyul",
"path": "pyul/coreUtils/event.py",
"copies": "1",
"size": "1049",
"license": "mit",
"hash": 174686829210697540,
"line_mean": 22.8409090909,
"line_max": 90,
"alpha_frac": 0.5672068637,
"autogenerated": false,
"ratio": 3.988593155893536,
"config_test": false,
"... |
__all__ = ("Event", "EventManager", "VERSION")
VERSION = ("0", "7")
class Event(list):
"""This objects represents an event.
Can be provided with *args on init. This list should be a list of handlers.
It simply iterates thru a list of handlers once it's fired.
If a handler raises StopIterat... | {
"repo_name": "dkkline/EventManager",
"path": "EventManager/EventManager.py",
"copies": "1",
"size": "4211",
"license": "mit",
"hash": -2693124640173185500,
"line_mean": 34.6173913043,
"line_max": 79,
"alpha_frac": 0.5732605082,
"autogenerated": false,
"ratio": 4.427970557308097,
"config_test":... |
__all__ = ['eventhandler', 'send_event', '_connect_event']
import asyncio
import functools
import inspect
from .asyncio_loop import loop
from .log import logger
_registered_events = {} # dict of all registered events
# @evenhandler decorator
def eventhandler(event):
def eventhandler_decorator(func):
... | {
"repo_name": "juergenz/pie",
"path": "src/pie/events.py",
"copies": "1",
"size": "1959",
"license": "mit",
"hash": 6447212452673710000,
"line_mean": 26.9857142857,
"line_max": 106,
"alpha_frac": 0.5461970393,
"autogenerated": false,
"ratio": 4.277292576419214,
"config_test": false,
"has_no_k... |
__all__ = ['EventKeys']
class EventKeys(object):
"""Defines event keys for TFSnippet."""
# (TrainLoop) Enter the train loop.
ENTER_LOOP = 'enter_loop'
# (TrainLoop) Exit the train loop.
EXIT_LOOP = 'exit_loop'
# (TrainLoop) When metrics (except time metrics) have been collected.
METRICS_... | {
"repo_name": "korepwx/tfsnippet",
"path": "tfsnippet/scaffold/event_keys.py",
"copies": "1",
"size": "1776",
"license": "mit",
"hash": -4137169072059834000,
"line_mean": 28.1147540984,
"line_max": 73,
"alpha_frac": 0.6745495495,
"autogenerated": false,
"ratio": 3.3893129770992365,
"config_test... |
__all__ = ('EVENT_SCHEDULER_START', 'EVENT_SCHEDULER_SHUTDOWN',
'EVENT_SCHEDULER_JOB_ADDED', 'EVENT_SCHEDULER_JOB_REMOVED',
'EVENT_JOB_EXECUTED', 'EVENT_JOB_ERROR', 'EVENT_JOB_MISSED',
'EVENT_ALL', 'SchedulerEvent', 'JobEvent')
EVENT_SCHEDULER_START = 1 # The scheduler was star... | {
"repo_name": "ecdpalma/napscheduler",
"path": "napscheduler/events.py",
"copies": "1",
"size": "1921",
"license": "mit",
"hash": 1900687860288430300,
"line_mean": 40.7608695652,
"line_max": 77,
"alpha_frac": 0.6574700677,
"autogenerated": false,
"ratio": 3.7156673114119925,
"config_test": fals... |
__all__ = ['EventSource']
class EventSource(object):
"""
An object that may trigger events.
This class is designed to either be the parent of another class,
or be a member of another object. For example::
def event_handler(**kwargs):
print('event triggered: args {}, kwargs {}'.f... | {
"repo_name": "korepwx/tfsnippet",
"path": "tfsnippet/utils/events.py",
"copies": "1",
"size": "4673",
"license": "mit",
"hash": -5804295705750285000,
"line_mean": 32.8623188406,
"line_max": 79,
"alpha_frac": 0.5566017548,
"autogenerated": false,
"ratio": 4.194793536804309,
"config_test": false... |
"""All events related tests."""
import pytest
import transaction
from mock import MagicMock
from pyramid import testing
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPFound
from sqlalchemy.orm.exc import NoResultFound
from pytest_pyramid import factories
from velruse import AuthenticationCo... | {
"repo_name": "fizyk/pyramid_fullauth",
"path": "tests/views/test_events.py",
"copies": "1",
"size": "22756",
"license": "mit",
"hash": -668314288264065400,
"line_mean": 34.7798742138,
"line_max": 117,
"alpha_frac": 0.7083846019,
"autogenerated": false,
"ratio": 3.7098141506358004,
"config_test... |
__all__ = ['ewsum', 'ewsum_back', 'softmax_back', 'rectify_back']
import os
import math
import numpy
import pycuda.gpuarray as gpuarray
import pycuda.autoinit
from pycuda.compiler import SourceModule
from .matrix import matrix_addition
from .utils import gpu_func
from .enums import MAX_BLOCK_SIZE, CUR_DIR, CACHE_DIR
... | {
"repo_name": "Captricity/sciguppy",
"path": "sciguppy/misc.py",
"copies": "1",
"size": "3415",
"license": "mit",
"hash": 9149195806412461000,
"line_mean": 36.9444444444,
"line_max": 101,
"alpha_frac": 0.6483162518,
"autogenerated": false,
"ratio": 2.697472353870458,
"config_test": false,
"ha... |
__all__ = ['example']
# Don't look below, you wont understand this Python code :) I don't.
from js2py.pyjs import *
# setting scope
var = Scope( JS_BUILTINS )
set_global_object(var)
# Code follows:
var.registers([u'sayHello', u'someVariable', u'Rectangle', u'$nonPyName'])
@Js
def PyJsHoisted_sayHello_(name, this, ar... | {
"repo_name": "PiotrDabkowski/Js2Py",
"path": "examples/example.py",
"copies": "1",
"size": "1875",
"license": "mit",
"hash": -2208926157842314200,
"line_mean": 35.7843137255,
"line_max": 86,
"alpha_frac": 0.6688,
"autogenerated": false,
"ratio": 2.5614754098360657,
"config_test": false,
"has... |
"""All exceptions are available directly from `mal_scraper.x`"""
import logging
from enum import Enum, unique
logger = logging.getLogger(__name__)
class MalScraperError(Exception):
"""Parent to all exceptions raised by this library."""
class RequestError(MalScraperError):
"""An error making the request.
... | {
"repo_name": "QasimK/mal-scraper",
"path": "src/mal_scraper/exceptions.py",
"copies": "1",
"size": "2043",
"license": "mit",
"hash": 1393112096072415000,
"line_mean": 26.6081081081,
"line_max": 74,
"alpha_frac": 0.6392559961,
"autogenerated": false,
"ratio": 4.283018867924528,
"config_test": f... |
"""All exceptions for Simple Salesforce"""
class SalesforceError(Exception):
"""Base Salesforce API exception"""
message = u'Unknown error occurred for {url}. Response content: {content}'
def __init__(self, url, status, resource_name, content):
"""Initialize the SalesforceError exception
... | {
"repo_name": "kawamon/hue",
"path": "desktop/core/ext-py/simple-salesforce-0.74.2/simple_salesforce/exceptions.py",
"copies": "3",
"size": "3406",
"license": "apache-2.0",
"hash": 4161865901540369400,
"line_mean": 31.4380952381,
"line_max": 78,
"alpha_frac": 0.6559013506,
"autogenerated": false,
... |
"""All exceptions for speedcurve library."""
class SpeedCurveError(Exception):
"""The base exception class."""
def __init__(self, response):
super(SpeedCurveError, self).__init__(response)
self.response = response
self.code = response.status_code
self.errors = []
try:... | {
"repo_name": "itsmemattchung/speedcurve.py",
"path": "speedcurve/exceptions.py",
"copies": "1",
"size": "1160",
"license": "mit",
"hash": -4325208963408728000,
"line_mean": 19,
"line_max": 57,
"alpha_frac": 0.6672413793,
"autogenerated": false,
"ratio": 4.218181818181818,
"config_test": false,... |
"""All exceptions used in the Cookiecutter code base are defined here."""
class CookiecutterException(Exception):
"""
Base exception class.
All Cookiecutter-specific exceptions should subclass this class.
"""
class NonTemplatedInputDirException(CookiecutterException):
"""
Exception for when... | {
"repo_name": "audreyr/cookiecutter",
"path": "cookiecutter/exceptions.py",
"copies": "2",
"size": "3902",
"license": "bsd-3-clause",
"hash": 7685118689428905000,
"line_mean": 22.9386503067,
"line_max": 76,
"alpha_frac": 0.696053306,
"autogenerated": false,
"ratio": 4.449258836944128,
"config_t... |
__all__ = ['EXECUTABLE', 'DIALOUGE_PIECES', 'ANNABEL_LEE']
import os
import sys
import shutil
ANNABEL_LEE = '''It was many and many a year ago,
In a kingdom by the sea,
That a maiden there lived whom you may know
By the name of ANNABEL LEE;--
And this maiden she lived with no other thought
Than to love and be loved b... | {
"repo_name": "shlomihod/scenario",
"path": "scenario/tests/consts.py",
"copies": "1",
"size": "2390",
"license": "mit",
"hash": 3194287369291795000,
"line_mean": 23.8958333333,
"line_max": 73,
"alpha_frac": 0.5715481172,
"autogenerated": false,
"ratio": 3.1488801054018447,
"config_test": false... |
__all__ = ["ExecuteAlertCommand", \
"ExecuteAcceptAlert"]
from browser.web_view_impl import WebViewImpl
from browser.status import *
from base.log import VLOG
def ExecuteAlertCommand(alert_command, session, params, value):
web_view = WebViewImpl("fake_id", 0, None)
# update web_view
status = session.... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "command/alert_commands.py",
"copies": "1",
"size": "1060",
"license": "bsd-3-clause",
"hash": -1648255248518075100,
"line_mean": 30.1764705882,
"line_max": 107,
"alpha_frac": 0.7367924528,
"autogenerated": false,
"ratio": 3.68055... |
__all__ = ["ExecuteAsync"]
import re
import subprocess
import threading
from status import *
""" since python' subprocess module does not support manual
timeout setting. This class binds the wanted commands and post
the task to another thread which can be under control in timeout
setting calling thread.join(timeout) ... | {
"repo_name": "weibohit/tools",
"path": "utility/execute_async.py",
"copies": "1",
"size": "1723",
"license": "mit",
"hash": -6586615137757989000,
"line_mean": 28.7068965517,
"line_max": 79,
"alpha_frac": 0.6546720836,
"autogenerated": false,
"ratio": 3.7868131868131867,
"config_test": false,
... |
__all__ = ["ExecuteElementCommand", \
"ExecuteFindChildElement", \
"ExecuteFindChildElements", \
"ExecuteGetElementText", \
"ExecuteGetElementTagName", \
"ExecuteIsElementSelected", \
"ExecuteIsElementEnabled", \
"ExecuteIsElementDisplayed", \... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "command/element_commands.py",
"copies": "1",
"size": "12082",
"license": "bsd-3-clause",
"hash": 7907071839350697000,
"line_mean": 37.6006389776,
"line_max": 129,
"alpha_frac": 0.7151133918,
"autogenerated": false,
"ratio": 3.697... |
__all__ = ["ExecuteGetSessionCapabilities", \
"ExecuteImplicitlyWait", \
"ExecuteSetTimeout", \
"ExecuteSetScriptTimeout", \
"ExecuteGetCurrentWindowHandle", \
"ExecuteIsLoading", \
"ExecuteGetBrowserOrientation", \
"ExecuteGetLocation", \
... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "command/session_commands.py",
"copies": "1",
"size": "9351",
"license": "bsd-3-clause",
"hash": 6061691009510177000,
"line_mean": 32.1595744681,
"line_max": 103,
"alpha_frac": 0.6909421452,
"autogenerated": false,
"ratio": 3.5923... |
__all__ = ["ExecuteWindowCommand", \
"ExecuteGetTitle", \
"ExecuteRefresh", \
"ExecuteGetCurrentUrl", \
"ExecuteGetPageSource", \
"ExecuteIsBrowserOnline", \
"ExecuteGet", \
"ExecuteGoBack", \
"ExecuteGoForward", \
"Execu... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "command/window_commands.py",
"copies": "1",
"size": "11605",
"license": "bsd-3-clause",
"hash": -3803343867028671000,
"line_mean": 30.9696969697,
"line_max": 135,
"alpha_frac": 0.6611805256,
"autogenerated": false,
"ratio": 3.633... |
__all__ = ['expit', 'expit_back', 'exp']
import os
import math
import numpy
import pycuda.gpuarray as gpuarray
import pycuda.cumath as cumath
import pycuda.autoinit
from pycuda.compiler import SourceModule
from .utils import gpu_func
from .enums import MathModes, MAX_BLOCK_SIZE, CUR_DIR, CACHE_DIR
mod = SourceModule... | {
"repo_name": "Captricity/sciguppy",
"path": "sciguppy/expit.py",
"copies": "1",
"size": "1925",
"license": "mit",
"hash": 3034321986296887000,
"line_mean": 32.7719298246,
"line_max": 94,
"alpha_frac": 0.6571428571,
"autogenerated": false,
"ratio": 2.718926553672316,
"config_test": false,
"ha... |
__all__ = ['extract_ssi', 'extract_ssi_to_file',
'extract_eta', 'extract_eta_to_file',
'extract_Q_channel', 'extract_Q_down',
'extract_overland_volume', 'extract_overland_volume_to_file']
from datetime import timedelta
from configparser import SafeConfigParser
import h5py
import numpy... | {
"repo_name": "scottza/PyTOPKAPI",
"path": "pytopkapi/results_analysis/sim_result_tools.py",
"copies": "2",
"size": "14176",
"license": "bsd-3-clause",
"hash": -8875523243643214000,
"line_mean": 29.5517241379,
"line_max": 78,
"alpha_frac": 0.6129373589,
"autogenerated": false,
"ratio": 3.69840855... |
__all__ = ['eye']
from ..core.numeric import zeros
def eye(N, M=None, k=0, dtype=float):
"""
Return a 2-D array with ones on the diagonal and zeros elsewhere.
Parameters
----------
N : int
Number of rows in the output.
M : int, optional
Number of columns in the output. If None, de... | {
"repo_name": "bussiere/pypyjs",
"path": "website/demo/home/rfk/repos/pypy/lib_pypy/numpypy/lib/twodim_base.py",
"copies": "2",
"size": "1334",
"license": "mit",
"hash": -4786133914286648000,
"line_mean": 23.7037037037,
"line_max": 74,
"alpha_frac": 0.5254872564,
"autogenerated": false,
"ratio": ... |
__all__ = ('EyesError', 'EyesIllegalArgument', 'OutOfBoundsError', 'TestFailedError', 'NewTestError',
'DiffsFoundError')
class EyesError(Exception):
"""
Applitools Eyes Exception.
"""
class EyesIllegalArgument(EyesError):
"""
Raise when parameter with wrong type passed to function
... | {
"repo_name": "applitools/eyes.selenium.python",
"path": "applitools/core/errors.py",
"copies": "1",
"size": "1339",
"license": "apache-2.0",
"hash": -3985664554509709000,
"line_mean": 24.75,
"line_max": 101,
"alpha_frac": 0.6482449589,
"autogenerated": false,
"ratio": 3.881159420289855,
"confi... |
__all__ = ('FacebookAPI', 'GraphAPI', 'FacebookClientError',
'FacebookAuthError', 'FacebookAPIError', 'GraphAPIError')
""" Requests-Facebook """
__author__ = 'Mike Helmick <mikehelmick@me.com>'
__version__ = '0.4.2'
import requests
try:
from urllib.parse import urlencode
except ImportError: # Python... | {
"repo_name": "michaelhelmick/requests-facebook",
"path": "facebook.py",
"copies": "1",
"size": "6057",
"license": "bsd-2-clause",
"hash": -6754626745171765000,
"line_mean": 30.2216494845,
"line_max": 100,
"alpha_frac": 0.5745418524,
"autogenerated": false,
"ratio": 4.134470989761092,
"config_t... |
__all__ = ('FboFloatLayout', )
from kivy.graphics import Color, Rectangle, Canvas, ClearBuffers, ClearColor
from kivy.graphics.fbo import Fbo
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ObjectProperty, NumericProperty
class FboFloatLayout(FloatLayout):
texture = ObjectProperty(None,... | {
"repo_name": "JohnHowland/kivy",
"path": "examples/canvas/clearbuffers.py",
"copies": "20",
"size": "2471",
"license": "mit",
"hash": 3496770374543944000,
"line_mean": 27.0795454545,
"line_max": 76,
"alpha_frac": 0.616349656,
"autogenerated": false,
"ratio": 3.5656565656565657,
"config_test": ... |
__all__ = ('FeedFilter')
import re
import csv
import socket
import sqlite3
import sys
from bulkwhois.cymru import BulkWhoisCymru
from async_dns import AsyncResolver
from publicsuffix import PublicSuffixList
#import tldextract
import httplib2
import tempfile
import logging
import time
class NetObjectRepo:
db = Non... | {
"repo_name": "csirtfoundry/netgrep",
"path": "netgrep/feedfilter.py",
"copies": "1",
"size": "13908",
"license": "mit",
"hash": -3496848507795460000,
"line_mean": 36.3870967742,
"line_max": 135,
"alpha_frac": 0.5366695427,
"autogenerated": false,
"ratio": 3.8114551932036176,
"config_test": fal... |
__all__ = ['fetch_arxiv', 'arxiv_re']
import re
import time
from urllib import urlopen
import xml.etree.ElementTree as ET
_url_base = 'http://export.arxiv.org/api/query?'
_prefix = '{http://www.w3.org/2005/Atom}'
_arxiv_re = re.compile(r'\d{4}\.\d{4,5}|[a-z-]+(?:\.[A-Za-z-]+)?\/\d{7}')
arxiv_re = _arxiv_re
class arx... | {
"repo_name": "yymao/slackbots",
"path": "fetch_arxiv.py",
"copies": "1",
"size": "2013",
"license": "mit",
"hash": 8636349152416474000,
"line_mean": 29.9692307692,
"line_max": 78,
"alpha_frac": 0.5434674615,
"autogenerated": false,
"ratio": 3.6868131868131866,
"config_test": false,
"has_no_k... |
__all__ = ['fftshift', 'ifftshift', 'fftfreq', 'rfftfreq']
from numpy import arange
from numpy.fft.helper import fftshift, ifftshift, fftfreq
def rfftfreq(n, d=1.0):
"""DFT sample frequencies (for usage with rfft, irfft).
The returned float array contains the frequency bins in
cycles/unit (with zero at t... | {
"repo_name": "teoliphant/scipy",
"path": "scipy/fftpack/helper.py",
"copies": "1",
"size": "1291",
"license": "bsd-3-clause",
"hash": -8170169336249610000,
"line_mean": 29.023255814,
"line_max": 86,
"alpha_frac": 0.5530596437,
"autogenerated": false,
"ratio": 2.888143176733781,
"config_test": ... |
__all__=['Fiddle']
from IPython.display import HTML, display, clear_output
import uuid
from jinja2 import (Template, DebugUndefined)
import lesscpy
from six import StringIO
class Fiddle(object):
def __init__(self, html='', css='', div_css='', js='', jslibs=tuple(), csslibs=tuple(),
extra_vars=... | {
"repo_name": "rdhyee/nbfiddle",
"path": "nbfiddle/__init__.py",
"copies": "1",
"size": "2463",
"license": "apache-2.0",
"hash": 7677391554610668000,
"line_mean": 24.9263157895,
"line_max": 113,
"alpha_frac": 0.4839626472,
"autogenerated": false,
"ratio": 3.5851528384279474,
"config_test": fals... |
__all__ = ['fiducial_deconvolute']
import os
import numpy as np
import numpy.ctypeslib as C
# define types
_double_ctype = C.ndpointer(np.float64, ndim=1, flags='C')
# load the c library
here = os.path.abspath(os.path.dirname(__file__))
_C_LIB = C.load_library('fiducial_deconvolute', here)
_C_LIB.convolved_fit.restyp... | {
"repo_name": "manodeep/yymao-abundancematching",
"path": "AbundanceMatching/fiducial_deconv_wrapper.py",
"copies": "1",
"size": "1091",
"license": "mit",
"hash": 3568967562265203000,
"line_mean": 33.09375,
"line_max": 89,
"alpha_frac": 0.6214482126,
"autogenerated": false,
"ratio": 2.74811083123... |
'''All fields described
'''
import lighty.validators
from .functor import BaseField, NumericField, SequenceField
def add_validator(validator, options):
'''Helper function for adding validator into the validator's list inside
options dictionary. Written to make some field types constructor shorter.
'''
... | {
"repo_name": "GrAndSE/lighty",
"path": "lighty/db/fields.py",
"copies": "1",
"size": "15911",
"license": "bsd-3-clause",
"hash": 321841072293282940,
"line_mean": 34.2013274336,
"line_max": 79,
"alpha_frac": 0.6185029225,
"autogenerated": false,
"ratio": 4.455614673760851,
"config_test": false,... |
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org>
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.fields.related import add_lazy_relation
from django.db.models.fields.subclassing import Creator
from django.db.utils import IntegrityError
fro... | {
"repo_name": "kavdev/djangotoolbox",
"path": "djangotoolbox/fields.py",
"copies": "1",
"size": "16758",
"license": "bsd-3-clause",
"hash": -6807843032986078000,
"line_mean": 36.9140271493,
"line_max": 125,
"alpha_frac": 0.6277002029,
"autogenerated": false,
"ratio": 4.423970432946145,
"config_... |
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org>
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.fields.subclassing import Creator
from django.db.utils import IntegrityError
from django.utils.importlib import import_module
__all__ = ('Ra... | {
"repo_name": "wd5/jangr",
"path": "djangotoolbox/fields.py",
"copies": "1",
"size": "16241",
"license": "bsd-3-clause",
"hash": -3968221534638436400,
"line_mean": 36.5949074074,
"line_max": 125,
"alpha_frac": 0.6259466782,
"autogenerated": false,
"ratio": 4.464266080263881,
"config_test": fals... |
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org>
from django.core.exceptions import ValidationError
from django.utils.importlib import import_module
from django.db import models
from django.db.models.fields.subclassing import Creator
from django.db.utils import IntegrityError
from django.db.m... | {
"repo_name": "Laimiux/mydeatree",
"path": "djangotoolbox/fields.py",
"copies": "1",
"size": "17034",
"license": "bsd-3-clause",
"hash": -5847117290310126000,
"line_mean": 36.9376391982,
"line_max": 125,
"alpha_frac": 0.6272161559,
"autogenerated": false,
"ratio": 4.434782608695652,
"config_tes... |
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org>
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.importlib import import_module
__all__ = ('RawField', 'ListField', 'DictField', 'SetField',
'BlobField', 'EmbeddedModelField')
class ... | {
"repo_name": "viniciusgama/blog_gae",
"path": "djangotoolbox/fields.py",
"copies": "6",
"size": "11104",
"license": "bsd-3-clause",
"hash": 5930454212293020000,
"line_mean": 38.6571428571,
"line_max": 90,
"alpha_frac": 0.6316642651,
"autogenerated": false,
"ratio": 4.166604127579737,
"config_t... |
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org>
from django.db import models
from django.core.exceptions import ValidationError
__all__ = ('RawField', 'ListField', 'DictField', 'SetField', 'BlobField')
class _HandleAssignment(object):
"""
A placeholder class that provides a way to ... | {
"repo_name": "gimler/techism2",
"path": "djangotoolbox/fields.py",
"copies": "2",
"size": "6347",
"license": "apache-2.0",
"hash": -9196883060828752000,
"line_mean": 36.5562130178,
"line_max": 90,
"alpha_frac": 0.6376240744,
"autogenerated": false,
"ratio": 4.1080906148867316,
"config_test": f... |
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org>
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.importlib import import_module
__all__ = ('RawField', 'ListField', 'DictField', 'SetField',
'BlobField', 'EmbeddedModelField')
... | {
"repo_name": "rimbalinux/MSISDNArea",
"path": "djangotoolbox/fields.py",
"copies": "3",
"size": "11027",
"license": "bsd-3-clause",
"hash": 6752567719843808000,
"line_mean": 38.9925650558,
"line_max": 90,
"alpha_frac": 0.6164868051,
"autogenerated": false,
"ratio": 4.267414860681114,
"config_t... |
__all__ = ['FileChar', 'FileCharRange']
import attr
@attr.s(frozen=True)
class FileChar(object):
"""
Encodes the location of a given character in a source code file.
"""
"""The name of the file to which this character belongs."""
filename = attr.ib(type=str)
"""The number of characters that... | {
"repo_name": "squaresLab/RepairBox",
"path": "bugzoo/core/filechar.py",
"copies": "3",
"size": "1387",
"license": "mit",
"hash": -2194638100631474700,
"line_mean": 26.1960784314,
"line_max": 75,
"alpha_frac": 0.5825522711,
"autogenerated": false,
"ratio": 4.103550295857988,
"config_test": fals... |
__all__ = ["FileFetcher", "ImageCrawlerLoaderTest"]
from abc import ABC, abstractmethod
from collections import OrderedDict
from http.client import HTTPResponse
from os.path import join as path_join
from pathlib import Path
from typing import Dict, Tuple, Type, Union
from unittest import TestCase
from urllib.parse imp... | {
"repo_name": "k4cg/nichtparasoup",
"path": "nichtparasoup/testing/imagecrawler.py",
"copies": "1",
"size": "4461",
"license": "mit",
"hash": 456110105430331400,
"line_mean": 34.125984252,
"line_max": 100,
"alpha_frac": 0.630576104,
"autogenerated": false,
"ratio": 3.8690372940156115,
"config_t... |
__all__ = ["File", "FileData"]
import json
from flask import current_app
from sqlalchemy.ext.mutable import Mutable
from sqlalchemy.types import TypeDecorator, Unicode
from zeus.utils.imports import import_string
from zeus.utils.sentry import span
class FileData(Mutable):
def __init__(self, data=None, default_... | {
"repo_name": "getsentry/zeus",
"path": "zeus/db/types/file.py",
"copies": "1",
"size": "4474",
"license": "apache-2.0",
"hash": 4910951525360080000,
"line_mean": 30.2867132867,
"line_max": 83,
"alpha_frac": 0.5435851587,
"autogenerated": false,
"ratio": 4.356377799415774,
"config_test": false,... |
__all__ = ['file', 'ftp', 'imap', 'irc', 'smtp']
import ssl
from urllib.parse import urlparse
from urllib.parse import parse_qs as urlqueryparse
from urllib.parse import unquote as urldecode
class Method(object):
"""
self.url: parsed url for this method
selfremoteurl: parsed url for the other method
... | {
"repo_name": "Leryan/check_delivery",
"path": "check_delivery/delivery/__init__.py",
"copies": "1",
"size": "3293",
"license": "mit",
"hash": 6584544229409920000,
"line_mean": 26.2148760331,
"line_max": 90,
"alpha_frac": 0.5982386881,
"autogenerated": false,
"ratio": 4.184243964421855,
"config... |
__all__ = ['FileManager']
import os
from kivy.core.image import Image as CoreImage
from kivy.cache import Cache
# static class for accessing game paths and os methods
class FileManager:
_tag = "[FileManager] "
_initialized = False
IMAGE_FORMAT = ".png"
# to be set diectly after creation
root = {"game": None, "i... | {
"repo_name": "herrschr/pocket-throne",
"path": "pocketthrone/managers/filemanager.py",
"copies": "2",
"size": "3738",
"license": "bsd-2-clause",
"hash": 1965128167719563500,
"line_mean": 25.5106382979,
"line_max": 71,
"alpha_frac": 0.682718031,
"autogenerated": false,
"ratio": 3.216867469879518,... |
import os, re, sys
# Http2d Project:
# Error generation and check
#
# This script loads a error definition file, and generates .h and .c
# from it. It also checks whether all the errors are actually being
# used, look for undefined errors, and check that the number of
# parameters matches between the error definition... | {
"repo_name": "http2d/SPDY_test",
"path": "src/errors.py",
"copies": "1",
"size": "10323",
"license": "bsd-2-clause",
"hash": -640135865516899600,
"line_mean": 31.3605015674,
"line_max": 134,
"alpha_frac": 0.5728954761,
"autogenerated": false,
"ratio": 3.861952861952862,
"config_test": false,
... |
__all__ = ["FileSpec"]
import os
import time
from panda3d.core import Filename, HashVal, VirtualFileSystem
class FileSpec:
""" This class represents a disk file whose hash and size
etc. were read from an xml file. This class provides methods to
verify whether the file on disk matches the version demanded... | {
"repo_name": "chandler14362/panda3d",
"path": "direct/src/p3d/FileSpec.py",
"copies": "9",
"size": "8783",
"license": "bsd-3-clause",
"hash": 6287939664230332000,
"line_mean": 34.7032520325,
"line_max": 91,
"alpha_frac": 0.5852214505,
"autogenerated": false,
"ratio": 4.3523290386521305,
"confi... |
__all__ = ['FIND', 'FIND_WUSER', 'CREATE', 'NAME_EXISTS', 'EXISTS', 'FOLLOW', 'UNFOLLOW',
'FOLLOWING', 'FOLLOWERS', 'FIND_ALL_BY_USER', 'SEARCH_BEGINNING_WITH',
'FIND_ALL_BY_USERNAME', 'COUNT_ALL_BY_USER', 'COUNT_ALL_BY_USERNAME',
'SEARCH_BEGINNING_WITH_WUSER', '... | {
"repo_name": "mayconbordin/boardhood",
"path": "server_app/api/boardhood/sql/interests.py",
"copies": "1",
"size": "5475",
"license": "mit",
"hash": -7424711039920535000,
"line_mean": 32.3841463415,
"line_max": 136,
"alpha_frac": 0.6042009132,
"autogenerated": false,
"ratio": 3.324225865209472,
... |
__all__ = ['findHTMLMeta', 'MetaNotFound']
from html.parser import HTMLParser, HTMLParseError
import html.entities
import re
from openid.yadis.constants import YADIS_HEADER_NAME
# Size of the chunks to search at a time (also the amount that gets
# read at a time)
CHUNK_SIZE = 1024 * 16 # 16 KB
class ParseDone(Exc... | {
"repo_name": "vivianli32/TravelConnect",
"path": "flask/lib/python3.4/site-packages/openid/yadis/parsehtml.py",
"copies": "4",
"size": "5903",
"license": "mit",
"hash": 3255330285023337000,
"line_mean": 27.9362745098,
"line_max": 76,
"alpha_frac": 0.506352702,
"autogenerated": false,
"ratio": 3.... |
__all__ = ['findHTMLMeta', 'MetaNotFound']
from HTMLParser import HTMLParser, HTMLParseError
import htmlentitydefs
import re
from openid.yadis.constants import YADIS_HEADER_NAME
# Size of the chunks to search at a time (also the amount that gets
# read at a time)
CHUNK_SIZE = 1024 * 16 # 16 KB
class ParseDone(Excep... | {
"repo_name": "ccellis/WHACK2016",
"path": "flask/lib/python2.7/site-packages/openid/yadis/parsehtml.py",
"copies": "167",
"size": "5850",
"license": "bsd-3-clause",
"hash": -4376288822586797600,
"line_mean": 28.6954314721,
"line_max": 76,
"alpha_frac": 0.5054700855,
"autogenerated": false,
"rati... |
__all__ = ['findHTMLMeta', 'MetaNotFound']
from html.parser import HTMLParser
import html.entities
import re
import sys
from openid.yadis.constants import YADIS_HEADER_NAME
# Size of the chunks to search at a time (also the amount that gets
# read at a time)
CHUNK_SIZE = 1024 * 16 # 16 KB
class ParseDone(Exceptio... | {
"repo_name": "IKholopov/HackUPC2017",
"path": "hackupc/env/lib/python3.5/site-packages/openid/yadis/parsehtml.py",
"copies": "13",
"size": "6061",
"license": "apache-2.0",
"hash": -7996668829391029000,
"line_mean": 28.2801932367,
"line_max": 76,
"alpha_frac": 0.5080019799,
"autogenerated": false,
... |
__all__ = ['findLagrangianVolume']
import numpy as np
from readGadgetSnapshot import readGadgetSnapshot
from findSpheresInSnapshots import getParticlesWithinSphere
from mvee import mvee
def findLagrangianVolume(c, r, snapshot_prefix, ic_prefix, snapshot_edges=None,
id_int64=None, rec_only=False):
ids_all =... | {
"repo_name": "manodeep/yymao-helpers",
"path": "helpers/findLagrangianVolume.py",
"copies": "1",
"size": "2386",
"license": "mit",
"hash": -995040306558588800,
"line_mean": 34.6119402985,
"line_max": 79,
"alpha_frac": 0.5884325231,
"autogenerated": false,
"ratio": 3.0629011553273426,
"config_t... |
__all__ = ["fit_bspline_displacement_field"]
import numpy as np
from ..core import ants_image as iio
from .. import core
from .. import utils
def fit_bspline_displacement_field(displacement_field=None,
displacement_weight_image=None,
displacement... | {
"repo_name": "ANTsX/ANTsPy",
"path": "ants/utils/fit_bspline_displacement_field.py",
"copies": "1",
"size": "8108",
"license": "apache-2.0",
"hash": 4744438135431193000,
"line_mean": 40.5794871795,
"line_max": 139,
"alpha_frac": 0.6428219043,
"autogenerated": false,
"ratio": 4.3150612027674295,
... |
__all__ = ["fit_bspline_object_to_scattered_data"]
import numpy as np
from ..core import ants_image as iio
from .. import utils
def fit_bspline_object_to_scattered_data(scattered_data,
parametric_data,
parametric_domain_origin,
... | {
"repo_name": "ANTsX/ANTsPy",
"path": "ants/utils/fit_bspline_object_to_scattered_data.py",
"copies": "1",
"size": "8235",
"license": "apache-2.0",
"hash": -4388597969903938000,
"line_mean": 41.0153061224,
"line_max": 110,
"alpha_frac": 0.6201578628,
"autogenerated": false,
"ratio": 3.79668049792... |
__all__ = ["fit_transform_to_paired_points"]
import os
import numpy as np
from tempfile import mktemp
from .apply_transforms import apply_transforms
from ..core import ants_image_io as iio
from ..core import ants_transform_io as txio
def fit_transform_to_paired_points(
moving_points, fixed_points, transform_typ... | {
"repo_name": "ANTsX/ANTsPy",
"path": "ants/registration/landmark_transforms.py",
"copies": "1",
"size": "2581",
"license": "apache-2.0",
"hash": -5487409831206645000,
"line_mean": 31.6708860759,
"line_max": 87,
"alpha_frac": 0.6094537001,
"autogenerated": false,
"ratio": 3.3005115089514065,
"c... |
__all__ = ["Fixtures"]
from datetime import datetime
from uuid import uuid4
from freight.config import db
from freight.constants import PROJECT_ROOT
from freight.models import (
App,
Repository,
Task,
DeploySequence,
Deploy,
TaskStatus,
User,
TaskConfig,
TaskConfigType,
)
class F... | {
"repo_name": "getsentry/freight",
"path": "freight/testutils/fixtures.py",
"copies": "1",
"size": "3066",
"license": "apache-2.0",
"hash": -8205142257454481000,
"line_mean": 25.8947368421,
"line_max": 88,
"alpha_frac": 0.5260926288,
"autogenerated": false,
"ratio": 4.171428571428572,
"config_t... |
__all__ = ['fkdict']
__author__ = 'George Sakkis <george.sakkis AT gmail DOT com>'
import UserDict
from itertools import chain,izip
class fkdict(object):
'''A dict-like class for mappings with fixed keys.
The main feature of this class is memory efficiency in the scenario of
having many dicts with the s... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/499373_Fixed_keys_mapping_type/recipe-499373.py",
"copies": "1",
"size": "4584",
"license": "mit",
"hash": -1751400529715616000,
"line_mean": 30.1836734694,
"line_max": 80,
"alpha_frac": 0.557591623,
"autogenerated": false,
"ratio": 4.0602... |
__all__ = ['Flags']
__version__ = 0.1
import sys
class Flag(object):
def __init__(self, flag, help, value, opt, coll):
self.flag = flag
self.help = help
self.value = value
self.opt = opt
self.coll = coll
class Positional(object):
def __init__(self, name, help, opt, col... | {
"repo_name": "kirbyfan64/pyflags",
"path": "flags.py",
"copies": "1",
"size": "8872",
"license": "mit",
"hash": 3515175403680843000,
"line_mean": 32.6060606061,
"line_max": 82,
"alpha_frac": 0.4570559062,
"autogenerated": false,
"ratio": 4.394254581475979,
"config_test": false,
"has_no_keywo... |
"""All Flask blueprints for the entire application.
All blueprints for all views go here. They shall be imported by the views themselves and by application.py. Blueprint
URL paths are defined here as well.
"""
from flask import Blueprint
def _factory(partial_module_string, url_prefix):
"""Generates blueprint ob... | {
"repo_name": "Robpol86/Flask-Large-Application-Example",
"path": "pypi_portal/blueprints.py",
"copies": "1",
"size": "1220",
"license": "mit",
"hash": 2091000013973038000,
"line_mean": 34.8823529412,
"line_max": 117,
"alpha_frac": 0.7295081967,
"autogenerated": false,
"ratio": 3.973941368078176,... |
"""All Flask blueprints for the entire application.
All blueprints for all views go here. They shall be imported by the views themselves and by application.py. Blueprint
URL paths are defined here as well.
"""
from flask import Blueprint
def blueprint_factory(partial_module_string, url_prefix):
"""Gen... | {
"repo_name": "thijsmie/imp_flask",
"path": "imp_flask/blueprints.py",
"copies": "1",
"size": "1532",
"license": "mit",
"hash": 6226727953987790000,
"line_mean": 39.4054054054,
"line_max": 117,
"alpha_frac": 0.7154046997,
"autogenerated": false,
"ratio": 3.9081632653061225,
"config_test": false... |
__all__ = ['flatten_dict', 'unflatten_dict']
import collections
def flatten_dict(dct):
"""
Take a nested dictionary and "flatten" it::
{
'aaa': {
'A1': 'Foo',
'A2': 'Bar',
},
'bbb': {
'B1': {'B11': 'foo'},
... | {
"repo_name": "opendatatrentino/opendata-harvester",
"path": "harvester/utils/flattening.py",
"copies": "1",
"size": "2005",
"license": "bsd-2-clause",
"hash": -9062755230239045000,
"line_mean": 19.6701030928,
"line_max": 54,
"alpha_frac": 0.3581047382,
"autogenerated": false,
"ratio": 3.76879699... |
__all__ = [ 'FlatTextInput', 'FlatButton', 'RaisedButton', 'FloatingAction' ]
"""
Please refer to Google's Material UI guidelines :
http://www.google.com/design
Guidelines for buttons :
http://www.google.com/design/spec/components/buttons.html
"""
import sys
sys.path.append( '..' )
from kivy.animation import Animat... | {
"repo_name": "Cuuuurzel/kivy-material-ui",
"path": "material_ui/flatui/flatui.py",
"copies": "1",
"size": "7419",
"license": "mit",
"hash": -6400910947235387000,
"line_mean": 26.4777777778,
"line_max": 92,
"alpha_frac": 0.6140989352,
"autogenerated": false,
"ratio": 3.5979631425800194,
"config... |
__all__ = ['FlowStation']
from os.path import dirname, join
from openmdao.main.api import VariableTree
from openmdao.lib.datatypes.api import Float, VarTree, Enum
from Cantera import *
import pycycle #used to find file paths
GAS_CONSTANT = 0.0685592 #BTU/lbm-R
#secant solver with a limit on overall step size
def ... | {
"repo_name": "kishenr12/pyCycle",
"path": "src/pycycle/flowstation.py",
"copies": "3",
"size": "16038",
"license": "apache-2.0",
"hash": 3962038984062622000,
"line_mean": 36.6478873239,
"line_max": 122,
"alpha_frac": 0.5505674024,
"autogenerated": false,
"ratio": 2.9661549842796373,
"config_te... |
__all__ = ["FontBuilder"]
"""
This module is *experimental*, meaning it still may evolve and change.
The `FontBuilder` class is a convenient helper to construct working TTF or
OTF fonts from scratch.
Note that the various setup methods cannot be called in arbitrary order,
due to various interdependencies between Ope... | {
"repo_name": "google/material-design-icons",
"path": "update/venv/lib/python3.9/site-packages/fontTools/fontBuilder.py",
"copies": "5",
"size": "31000",
"license": "apache-2.0",
"hash": -1183972799543810800,
"line_mean": 31.7349524815,
"line_max": 104,
"alpha_frac": 0.623,
"autogenerated": false,
... |
__all__ = ['Formatter', 'NamespacedFormatter', 'FormatterMixin']
class Formatter(object):
"""\
A formatter is used to format the internal representation of a key or token.
This is useful for Redis and SQL databases, which often need to prefix keys
and columns in order to avoid clashes.
.. admonition... | {
"repo_name": "clibc/shorten",
"path": "shorten/formatter.py",
"copies": "1",
"size": "1489",
"license": "mit",
"hash": 4141860844120873000,
"line_mean": 24.2372881356,
"line_max": 80,
"alpha_frac": 0.6272666219,
"autogenerated": false,
"ratio": 3.7888040712468194,
"config_test": false,
"has_... |
"""All formatters from this pacakge should be easily mixed whith default ones using this pattern:
>>> from code_formatter.base import formatters
>>> from code_formatter import extras
>>> custom_formatters = formatters.copy()
>>> custom_formatters.register(extras.UnbreakableTupleFormatter,
... | {
"repo_name": "paluh/code-formatter",
"path": "code_formatter/extras/__init__.py",
"copies": "1",
"size": "12919",
"license": "bsd-3-clause",
"hash": 5538142410787569000,
"line_mean": 51.0927419355,
"line_max": 139,
"alpha_frac": 0.5620404056,
"autogenerated": false,
"ratio": 5.3494824016563145,
... |
__all__ = ('ForwardRefPolicy', 'TypeHintWarning', 'typechecked', 'check_return_type',
'check_argument_types', 'check_type', 'TypeWarning', 'TypeChecker',
'typeguard_ignore')
import collections.abc
import gc
import inspect
import sys
import threading
from collections import OrderedDict
from enum i... | {
"repo_name": "glenngillen/dotfiles",
"path": ".vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/jedilsp/typeguard/__init__.py",
"copies": "1",
"size": "46364",
"license": "mit",
"hash": 1142207847428083500,
"line_mean": 39.3867595819,
"line_max": 99,
"alpha_frac": 0.5997541196,
... |
"""All foxx related methods."""
from .action import DatabaseAction
class Foxx:
"""A generic foxx function executor."""
def __init__(self, database):
"""Initialise database and its services."""
self.database = database
self.services = []
self.mounts = {}
def service(self, ... | {
"repo_name": "tariqdaouda/pyArango",
"path": "pyArango/foxx.py",
"copies": "1",
"size": "1593",
"license": "apache-2.0",
"hash": -8721384319168592000,
"line_mean": 26,
"line_max": 90,
"alpha_frac": 0.5756434401,
"autogenerated": false,
"ratio": 4.412742382271468,
"config_test": false,
"has_n... |
__all__ = ["FrameTracker"]
from devtools_event_listener import DevToolsEventListener
from status import *
import json
# Tracks execution context creation.
class FrameTracker(DevToolsEventListener):
def __init__(self, client):
DevToolsEventListener.__init__(self)
self.frame_to_context_map = {}
client.Ad... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "browser/frame_tracker.py",
"copies": "1",
"size": "1666",
"license": "bsd-3-clause",
"hash": -4042786569207896600,
"line_mean": 35.2173913043,
"line_max": 100,
"alpha_frac": 0.6836734694,
"autogenerated": false,
"ratio": 3.645514... |
__all__ = ['fread_csv', 'read_csv', 'fwrite_csv', 'write_csv']
import csv
import collections
import autos.constants as constants
def iterlists(fp, **kwargs):
yield from csv.reader(fp, **kwargs)
def itertuples(fp, **kwargs):
'''Iterate over CSV rows and yields namedtuple for each row.
Fieldnames need ... | {
"repo_name": "hans-t/autos",
"path": "autos/utils/csv.py",
"copies": "1",
"size": "3211",
"license": "mit",
"hash": -7683370219736241000,
"line_mean": 29.2924528302,
"line_max": 92,
"alpha_frac": 0.6645904703,
"autogenerated": false,
"ratio": 3.791027154663518,
"config_test": false,
"has_no_... |
__all__ = ['Fridge']
__version__ = '0.2'
import json
import errno
class Fridge(dict):
"""
Fridge is a subclass of :class:`dict` and thus fully conforms to its interface.
Fridge keeps an open file until it's closed, so you have to call :meth:`close`
when you're done using it.
Fridge implements :... | {
"repo_name": "swarmer/fridge",
"path": "fridge.py",
"copies": "1",
"size": "4372",
"license": "mit",
"hash": -7045466559556542000,
"line_mean": 29.7887323944,
"line_max": 88,
"alpha_frac": 0.5725068618,
"autogenerated": false,
"ratio": 4.236434108527132,
"config_test": false,
"has_no_keyword... |
__all__ = ["from_databroker"]
from ._data import Data
def from_databroker(run, dataset="primary"):
"""Import a dataset from a bluesky run into the WrightTools Data format.
Parameters
----------
run: BlueskyRun
The bluesky run as returned by e.g. catalog["<uid>"]
dataset: str
The ... | {
"repo_name": "wright-group/WrightTools",
"path": "WrightTools/data/_databroker.py",
"copies": "1",
"size": "1245",
"license": "mit",
"hash": 3515474857955063300,
"line_mean": 30.9230769231,
"line_max": 91,
"alpha_frac": 0.6024096386,
"autogenerated": false,
"ratio": 3.8190184049079754,
"config... |
__all__ = ['fromMaybe', 'Maybe', 'Just', 'Nothing']
def fromMaybe( default, m ):
if( m.isJust( ) ):
return m.get( )
else:
return default
class Maybe:
def __init__( self, m ):
self.isjust = m.isJust( )
self.value = fromMaybe( 0, m )
def get( self ):
return self.... | {
"repo_name": "DweebsUnited/CodeMonkey",
"path": "QualityBreeze/Maybe.py",
"copies": "1",
"size": "1859",
"license": "bsd-3-clause",
"hash": -3116613851039125000,
"line_mean": 25.1830985915,
"line_max": 85,
"alpha_frac": 0.5072619688,
"autogenerated": false,
"ratio": 3.6379647749510764,
"config... |
__all__ = ['fsvd']
import numpy as np
def fsvd(A, k, i, usePowerMethod=False):
"""
FSVD Fast Singular Value Decomposition
[U,S,V] = FSVD(A,k,i,usePowerMethod) computes the truncated singular
value decomposition of the input matrix A up to rank k using i levels of
Krylov method as given in [1], p... | {
"repo_name": "aasensio/pyiacsun",
"path": "pyiacsun/linalg/fsvd.py",
"copies": "1",
"size": "3055",
"license": "mit",
"hash": 1943865829431899100,
"line_mean": 29.2475247525,
"line_max": 76,
"alpha_frac": 0.5934533552,
"autogenerated": false,
"ratio": 3.0039331366764994,
"config_test": false,
... |
__all__ = ['fsvd']
import numpy as np
def fsvd(A, k, i, usePowerMethod=False):
#function [U,S,V] = fsvd(A, k, i, usePowerMethod)
# FSVD Fast Singular Value Decomposition
#
# [U,S,V] = FSVD(A,k,i,usePowerMethod) computes the truncated singular
# value decomposition of the input matrix A upto rank k using i level... | {
"repo_name": "aasensio/pyAndres",
"path": "fsvd.py",
"copies": "1",
"size": "2897",
"license": "mit",
"hash": 4012535678350259700,
"line_mean": 26.5904761905,
"line_max": 75,
"alpha_frac": 0.6344494304,
"autogenerated": false,
"ratio": 2.4447257383966243,
"config_test": false,
"has_no_keywor... |
"""All fuel shares of the base year for the
different technologies are defined in this file.
"""
from energy_demand.initalisations import helpers
def assign_by_fuel_tech_p(
enduses,
sectors,
fueltypes,
fueltypes_nr
):
"""Assigning fuel share per enduse for different technologies... | {
"repo_name": "nismod/energy_demand",
"path": "energy_demand/assumptions/fuel_shares.py",
"copies": "1",
"size": "13596",
"license": "mit",
"hash": -7506671172259957000,
"line_mean": 36.2383561644,
"line_max": 129,
"alpha_frac": 0.5760741613,
"autogenerated": false,
"ratio": 2.8381708081019004,
... |
''' All functions acting on the hits of one DUT are listed here'''
from __future__ import division
import logging
import os.path
import re
import tables as tb
import numpy as np
from scipy.ndimage import median_filter
from pixel_clusterizer.clusterizer import HitClusterizer
from testbeam_analysis.tools import smc
fr... | {
"repo_name": "SiLab-Bonn/testbeam_analysis",
"path": "testbeam_analysis/hit_analysis.py",
"copies": "2",
"size": "18424",
"license": "mit",
"hash": -3716936009864800000,
"line_mean": 48.3941018767,
"line_max": 293,
"alpha_frac": 0.5716456795,
"autogenerated": false,
"ratio": 3.98701579744644,
... |
# all functions are based on http://aerosols.wustl.edu/AAARworkshop08/software/AEROCALC-11-3-03.xls
import numpy as np
import warnings
from atmPy.aerosols import tools
def loss_in_a_T_junction(temperature=293.15,
pressure=65.3,
particle_diameter=2.5,
... | {
"repo_name": "mtat76/atm-py",
"path": "build/lib/atmPy/aerosols/sampling_efficiency.py",
"copies": "3",
"size": "12616",
"license": "mit",
"hash": -2773366266132271600,
"line_mean": 43.8540925267,
"line_max": 162,
"alpha_frac": 0.4973817836,
"autogenerated": false,
"ratio": 3.606294706723891,
... |
# all functions are based on http://aerosols.wustl.edu/AAARworkshop08/software/AEROCALC-11-3-03.xls
import numpy as np
import warnings
def test_flow_type_in_tube(tube_diameter, tube_air_velocity, temperature, pressure, verbose=False):
rey_num = flow_reynolds_number(tube_diameter, tube_air_velocity, temperature, ... | {
"repo_name": "mtat76/atm-py",
"path": "build/lib/atmPy/aerosols/tools.py",
"copies": "4",
"size": "7294",
"license": "mit",
"hash": -2197643134375301600,
"line_mean": 39.2762430939,
"line_max": 143,
"alpha_frac": 0.5998628258,
"autogenerated": false,
"ratio": 3.4747378455672067,
"config_test":... |
# all functions are based on http://aerosols.wustl.edu/AAARworkshop08/software/AEROCALC-11-3-03.xls
import warnings
import numpy as np
import pandas as pd
from atmPy.aerosols.physics import _tools_sampling_efficiency
def loss_in_a_T_junction(temperature=293.15,
pressure=65.3,
... | {
"repo_name": "hagne/atm-py",
"path": "atmPy/aerosols/physics/sampling_efficiency.py",
"copies": "1",
"size": "18101",
"license": "mit",
"hash": 6516389514747485000,
"line_mean": 45.0229007634,
"line_max": 181,
"alpha_frac": 0.4925637198,
"autogenerated": false,
"ratio": 3.574505928853755,
"con... |
''' All functions creating results (e.g. efficiency, residuals, track density) from fitted tracks are listed here.'''
from __future__ import division
import logging
import re
from collections import Iterable
import os.path
import tables as tb
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages
fro... | {
"repo_name": "YannickDieter/testbeam_analysis",
"path": "testbeam_analysis/result_analysis.py",
"copies": "1",
"size": "104146",
"license": "mit",
"hash": 5332964350258174000,
"line_mean": 67.0692810458,
"line_max": 373,
"alpha_frac": 0.5197415167,
"autogenerated": false,
"ratio": 4.065344679522... |
# all functions related to user accounts
import hashlib
from models import *
from base64 import b64decode, b64encode
import json
import requests
from search_helpers import get_article_object
GET = requests.get
async def create_pmid(handler, user, repo_name, pmid, github_token):
""" Create a file for this PMID... | {
"repo_name": "OpenNeuroLab/brainspell-neo",
"path": "brainspell/user_account_helpers.py",
"copies": "2",
"size": "10928",
"license": "mit",
"hash": -4011764996796839400,
"line_mean": 32.9378881988,
"line_max": 84,
"alpha_frac": 0.6009333821,
"autogenerated": false,
"ratio": 4.022083179977916,
... |
__all__ = ('GameButton')
import string
from kivy.properties import *
from kivy.uix.image import Image
from kivy.core.image import Image as CoreImage
from kivy.graphics import Rectangle
from kivy.core.window import Window
from kivy.core.text import Label as CoreLabel
from pocketthrone.managers.pipe import L
from pock... | {
"repo_name": "herrschr/prey-game",
"path": "pocketthrone/widgets/gamebutton.py",
"copies": "2",
"size": "4047",
"license": "bsd-2-clause",
"hash": -6211700491131788000,
"line_mean": 28.1151079137,
"line_max": 127,
"alpha_frac": 0.7044724487,
"autogenerated": false,
"ratio": 3.255832662912309,
... |
__all__ = ('GameLabel')
from kivy.graphics import Rectangle, Color
from kivy.core.text import Label as CoreLabel
from kivy.uix.label import Label
from pocketthrone.managers.pipe import L
from pocketthrone.managers.eventmanager import EventManager
from pocketthrone.managers.filemanager import FileManager
from pocketth... | {
"repo_name": "herrschr/prey-game",
"path": "pocketthrone/widgets/gamelabel.py",
"copies": "2",
"size": "3311",
"license": "bsd-2-clause",
"hash": -7531994545574267000,
"line_mean": 25.7016129032,
"line_max": 89,
"alpha_frac": 0.7212322561,
"autogenerated": false,
"ratio": 3.171455938697318,
"c... |
# All game related code
import json
import random
import card_parser
class Game:
def __init__(self):
self.players = {}
self.picked_cards = []
def add_player(self, conn, data):
player = Player(conn, data, self.picked_cards)
self.players[player.get_name()] = player
con... | {
"repo_name": "HPI-Hackathon/cartets",
"path": "backend/game.py",
"copies": "1",
"size": "4587",
"license": "mit",
"hash": 4229776447937971700,
"line_mean": 30.2040816327,
"line_max": 86,
"alpha_frac": 0.5713974275,
"autogenerated": false,
"ratio": 3.995644599303136,
"config_test": false,
"ha... |
__all__ = [ "gamma_matrix", "gamma_matrix_pass"]
import numpy as np
def gamma_matrix(rm, tm, dta=1.0, dd=0.05):
'''Compute matrix of gammma indices.
:param rm: reference matrix (relative values assumed)
:param tm: tested matrix (relative values assumed)
:param dta: maximum distance-to-agreement (in... | {
"repo_name": "janpipek/gamma_index",
"path": "gamma_index/__init__.py",
"copies": "1",
"size": "4857",
"license": "mit",
"hash": 8531389207002892000,
"line_mean": 30.3419354839,
"line_max": 114,
"alpha_frac": 0.6396952852,
"autogenerated": false,
"ratio": 3.481720430107527,
"config_test": fals... |
__all__ = ["GatekeeperException", "Report", "Bounce", "Ban", "create_embed"]
import datetime
import discord
from lifesaver.utils import human_delta
class GatekeeperException(RuntimeError):
"""An exception thrown during Gatekeeper processes."""
class CheckFailure(GatekeeperException):
"""An exception throw... | {
"repo_name": "sliceofcode/dogbot",
"path": "dog/ext/gatekeeper/core.py",
"copies": "2",
"size": "1390",
"license": "mit",
"hash": -7146194055101655000,
"line_mean": 27.9583333333,
"line_max": 91,
"alpha_frac": 0.7050359712,
"autogenerated": false,
"ratio": 3.904494382022472,
"config_test": fal... |
__all__ = ['GaussianKernel']
import numpy as np
import sympy as sym
from functools import wraps
from gp.ext import gaussian_c
from . import Kernel
DTYPE = np.float64
EPS = np.finfo(DTYPE).eps
class GaussianKernel(Kernel):
r"""
Gaussian kernel function.
Parameters
----------
h : float
O... | {
"repo_name": "jhamrick/gaussian_processes",
"path": "gp/kernels/gaussian.py",
"copies": "1",
"size": "3867",
"license": "mit",
"hash": -8352020878438381000,
"line_mean": 25.8541666667,
"line_max": 98,
"alpha_frac": 0.5314197052,
"autogenerated": false,
"ratio": 3,
"config_test": false,
"has_... |
__all__ = ['GaussianProcess']
import numpy as np
import matplotlib.pyplot as pl
from . import cholInvert
import numpy.core.umath_tests
import scipy.optimize as opt
class GaussianProcess:
def __init__(self, xInput, lambdaGPInitial=1.0, sigmaGPInitial=1.0):
self.lambdaGP = lambdaGPInitial
self.sigmaGP = sigma... | {
"repo_name": "aasensio/pyAndres",
"path": "gpAndres.py",
"copies": "1",
"size": "2810",
"license": "mit",
"hash": -6662630494104640000,
"line_mean": 26.0192307692,
"line_max": 117,
"alpha_frac": 0.6647686833,
"autogenerated": false,
"ratio": 2.5475974614687216,
"config_test": false,
"has_no_... |
__all__ = ['GaussianProcess']
import numpy as np
import matplotlib.pyplot as pl
from ..linalg import cholInvert
import numpy.core.umath_tests
import scipy.optimize as opt
class GaussianProcess:
"""
Gaussian process
"""
def __init__(self, xInput, lambdaGPInitial=1.0, sigmaGPInitial=1.0):
self.lambdaGP = lambd... | {
"repo_name": "aasensio/pyiacsun",
"path": "pyiacsun/machinelearn/gpAndres.py",
"copies": "1",
"size": "3103",
"license": "mit",
"hash": 8192556024779039000,
"line_mean": 28.2735849057,
"line_max": 117,
"alpha_frac": 0.6703190461,
"autogenerated": false,
"ratio": 2.579384871155445,
"config_test... |
__all__ = ['gauss_numerical_integration', 'sample_function']
import numpy as np
# coefficients from https://pomax.github.io/bezierinfo/legendre-gauss.html
gauss0 = [
[1.0000000000000000, -0.5773502691896257],
[1.0000000000000000, 0.5773502691896257]
]
gauss10 = [
[0.2955242247147529, -0.1488743389816312... | {
"repo_name": "ucl-exoplanets/pylightcurve",
"path": "pylightcurve/analysis/numerical_integration.py",
"copies": "1",
"size": "10872",
"license": "mit",
"hash": -7850884599787367000,
"line_mean": 40.6551724138,
"line_max": 101,
"alpha_frac": 0.7193708609,
"autogenerated": false,
"ratio": 2.146071... |
__all__ = ['GbxProtocol']
import asyncio
from xmlrpc.client import dumps, loads, Fault
from .log import logger
class GbxProtocol(asyncio.Protocol):
def __init__(self, loop, handle_callback):
self.loop = loop
self.handle_callback = handle_callback
self.transport = None
self.che... | {
"repo_name": "juergenz/pie",
"path": "src/pie/gbx_protocol.py",
"copies": "1",
"size": "5011",
"license": "mit",
"hash": 2048693090173621200,
"line_mean": 28.6568047337,
"line_max": 92,
"alpha_frac": 0.5142686091,
"autogenerated": false,
"ratio": 4.3422876949740035,
"config_test": false,
"ha... |
__all__ = ["GenerateId", \
"InitSessionParams", \
"ExecuteInitSession", \
"ExecuteQuit", \
"ExecuteGetStatus"]
import random
import os
from misc.capabilities import Capabilities
from misc.xwalk_launcher import LaunchXwalk
from browser.status import *
from browser.version imp... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "command/init_session_commands.py",
"copies": "1",
"size": "4884",
"license": "bsd-3-clause",
"hash": 1095098220295913100,
"line_mean": 32.6827586207,
"line_max": 100,
"alpha_frac": 0.674037674,
"autogenerated": false,
"ratio": 3.... |
__all__ = ['generate', 'verify']
decimal_decoder = lambda s: int(s, 10)
decimal_encoder = lambda i: str(i)
def luhn_sum_mod_base(string, base=10, decoder=decimal_decoder):
# Adapted from http://en.wikipedia.org/wiki/Luhn_algorithm
digits = list(map(decoder, string))
return (sum(digits[::-2]) +
su... | {
"repo_name": "benhodgson/baluhn",
"path": "src/baluhn.py",
"copies": "1",
"size": "2975",
"license": "unlicense",
"hash": 4172818675821686300,
"line_mean": 34.4166666667,
"line_max": 80,
"alpha_frac": 0.683697479,
"autogenerated": false,
"ratio": 3.8736979166666665,
"config_test": false,
"ha... |
__all__ = [ 'Generator' ]
import numpy as np
import molecules
a0 = 0.52917721092
class Generator( dict ):
"""
Used to create molecules, write dalton .mol files
using -param for study with use_calculator.py
water currently implemented only
plans to implement methanol
"""
def __init__... | {
"repo_name": "fishstamp82/moltools",
"path": "moltools/generator.py",
"copies": "1",
"size": "18121",
"license": "mit",
"hash": -5328535197113275000,
"line_mean": 24.8871428571,
"line_max": 142,
"alpha_frac": 0.4625020694,
"autogenerated": false,
"ratio": 2.914281119330975,
"config_test": fals... |
__all__ = ["generic", "boinc", "condor", "ganga", "mpi", "multicore"]
from .generic import *
import sys
from optparse import OptionParser
for interface in __all__:
from pymw.interfaces import interface
def parse_options(parser=None, args=None):
"""Parses the standard options associated with a PyMW appl... | {
"repo_name": "auxten/pymw",
"path": "pymw/interfaces/__init__.py",
"copies": "2",
"size": "2511",
"license": "mit",
"hash": -1631532286107788000,
"line_mean": 34.3913043478,
"line_max": 83,
"alpha_frac": 0.6837913182,
"autogenerated": false,
"ratio": 3.402439024390244,
"config_test": false,
... |
__all__ = ["generic"]
from types import ClassType, InstanceType
classtypes = type, ClassType
# This is version 0.6 of Philip J. Eby's simplegeneric module
# (http://cheeseshop.python.org/pypi/simplegeneric) patched to work
# with Python 2.3 (which doesn't support assigning to __name__)
def generic(func):
"""Crea... | {
"repo_name": "santisiri/popego",
"path": "envs/ALPHA-POPEGO/lib/python2.5/site-packages/ipython-0.8.2-py2.5.egg/IPython/external/simplegeneric.py",
"copies": "1",
"size": "2669",
"license": "bsd-3-clause",
"hash": -5792710187480624000,
"line_mean": 19.5307692308,
"line_max": 74,
"alpha_frac": 0.5140... |
__all__ = ['gen_marked_value', 'MarkedValue']
try:
from __builtin__ import unicode
except ImportError:
unicode = str
def gen_new(cls):
def __new__(arg_cls, value, mark):
r = super(arg_cls, arg_cls).__new__(arg_cls, value)
r.mark = mark
r.value = value
return r
return __new__
class MarkedUnicode(unicod... | {
"repo_name": "wezhang/vim-setup",
"path": "bundle/powerline/powerline/lint/markedjson/markedvalue.py",
"copies": "1",
"size": "2387",
"license": "apache-2.0",
"hash": -3459524816231421000,
"line_mean": 23.6082474227,
"line_max": 118,
"alpha_frac": 0.6501885212,
"autogenerated": false,
"ratio": 3... |
__all__ = ["GeolocationOverrideManager"]
from devtools_event_listener import DevToolsEventListener
from misc.geoposition import Geoposition
from status import *
import copy
# Overrides the geolocation, if requested, for the duration of the
# given |DevToolsClient|'s lifetime.
class GeolocationOverrideManager(DevTools... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "browser/geolocation_override_manager.py",
"copies": "1",
"size": "1361",
"license": "bsd-3-clause",
"hash": -7070247220797021000,
"line_mean": 33.025,
"line_max": 73,
"alpha_frac": 0.7457751653,
"autogenerated": false,
"ratio": 3... |
__all__ = ('GestureDatabase', 'GestureDatabaseItem')
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import NumericProperty, StringProperty
from kivy.properties import ListProperty, ObjectProperty
from kivy.uix.gridlayout import GridLayout
from kivy.uix.floatlayout import FloatLayout
fr... | {
"repo_name": "inclement/kivy",
"path": "examples/demo/multistroke/gesturedatabase.py",
"copies": "21",
"size": "6097",
"license": "mit",
"hash": 5288151034312363000,
"line_mean": 32.8722222222,
"line_max": 77,
"alpha_frac": 0.596358865,
"autogenerated": false,
"ratio": 3.633492252681764,
"conf... |
__all__ = ('GestureHistoryManager', 'GestureVisualizer')
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.graphics import ... | {
"repo_name": "kivy/kivy",
"path": "examples/demo/multistroke/historymanager.py",
"copies": "25",
"size": "9418",
"license": "mit",
"hash": -6461181286350109000,
"line_mean": 33.1231884058,
"line_max": 79,
"alpha_frac": 0.6177532385,
"autogenerated": false,
"ratio": 3.7838489353153877,
"config_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.