text stringlengths 0 1.05M | meta dict |
|---|---|
# BER decoder
from pyasn1.type import tag, base, univ, char, useful, tagmap
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import oct2int, octs2ints
from pyasn1 import debug, error
class AbstractDecoder:
protoComponent = None
def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet,
... | {
"repo_name": "wemanuel/smry",
"path": "server-auth/ls/google-cloud-sdk/.install/.backup/lib/pyasn1/codec/ber/decoder.py",
"copies": "15",
"size": "32174",
"license": "apache-2.0",
"hash": -3778075356212013000,
"line_mean": 41.8415446072,
"line_max": 290,
"alpha_frac": 0.5512836452,
"autogenerated"... |
# BER decoder
from pyasn1.type import tag, univ, char, useful, tagmap
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import oct2int, isOctetsType
from pyasn1 import debug, error
class AbstractDecoder:
protoComponent = None
def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet,
... | {
"repo_name": "ryfeus/lambda-packs",
"path": "Selenium_PhantomJS/source/pyasn1/codec/ber/decoder.py",
"copies": "160",
"size": "38266",
"license": "mit",
"hash": 5192783351126530000,
"line_mean": 44.5005945303,
"line_max": 290,
"alpha_frac": 0.5569173679,
"autogenerated": false,
"ratio": 4.491314... |
# BER decoder
import types
from pyasn1.type import tag, univ, char, useful
from pyasn1.codec.ber import eoo
from pyasn1 import error
class AbstractDecoder:
protoComponent = None
def _createComponent(self, tagSet, asn1Spec):
if asn1Spec is None:
return self.protoComponent.clone(tagSet=tagSet... | {
"repo_name": "aerissecure/rdpy",
"path": "pyasn1/v1/codec/ber/decoder.py",
"copies": "1",
"size": "20672",
"license": "mit",
"hash": 7549719377451062000,
"line_mean": 39.9346534653,
"line_max": 86,
"alpha_frac": 0.5482294892,
"autogenerated": false,
"ratio": 4.63601704418031,
"config_test": fa... |
# BER encoder
from pyasn1.type import base, tag, univ, char, useful
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import int2oct, ints2octs, null, str2octs
from pyasn1 import debug, error
class Error(Exception): pass
class AbstractItemEncoder:
supportIndefLenMode = 1
def encodeTag(self, t, isCons... | {
"repo_name": "ychen820/microblog",
"path": "y/google-cloud-sdk/.install/.backup/lib/pyasn1/codec/ber/encoder.py",
"copies": "11",
"size": "12808",
"license": "bsd-3-clause",
"hash": -5121948495350048000,
"line_mean": 37.2328358209,
"line_max": 157,
"alpha_frac": 0.5635540287,
"autogenerated": fals... |
# BER encoder
from pyasn1.type import base, tag, univ, char, useful
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import int2oct, oct2int, ints2octs, null, str2octs
from pyasn1 import debug, error
class Error(Exception): pass
class AbstractItemEncoder:
supportIndefLenMode = 1
def encodeTag(self, ... | {
"repo_name": "hexlism/xx_net",
"path": "python27/1.0/lib/noarch/pyasn1/codec/ber/encoder.py",
"copies": "8",
"size": "13581",
"license": "bsd-2-clause",
"hash": 3549615448176126500,
"line_mean": 37.4730878187,
"line_max": 220,
"alpha_frac": 0.5670421913,
"autogenerated": false,
"ratio": 3.922876... |
# BER encoder
import string
from pyasn1.type import base, tag, univ, char, useful
from pyasn1.codec.ber import eoo
from pyasn1 import error
class Error(Exception): pass
class AbstractItemEncoder:
supportIndefLenMode = 1
def _encodeTag(self, t, isConstructed):
v = t[0]|t[1]
if isConstructed:
... | {
"repo_name": "umair-gujjar/chrome-extensions-1",
"path": "crx-appengine-packager/pyasn1/codec/ber/encoder.py",
"copies": "5",
"size": "9633",
"license": "bsd-3-clause",
"hash": -6020288215434464000,
"line_mean": 36.62890625,
"line_max": 77,
"alpha_frac": 0.5652444721,
"autogenerated": false,
"ra... |
# Edited by Chris Li
# Creating and populating a database for btree.
import bsddb3 as bsddb
import random
import subprocess
import datetime as dt
DB_SIZE = 100000
DB_SEED = 10000000
def getRandom():
return random.randint(0,63)
def getRandomChar():
return chr(97+random.randint(0,25))
def CreatePop(db):
... | {
"repo_name": "C291F14/C291A2",
"path": "btreeCreatePopDB.py",
"copies": "1",
"size": "1154",
"license": "mit",
"hash": 2668681794820317000,
"line_mean": 19.9818181818,
"line_max": 91,
"alpha_frac": 0.589254766,
"autogenerated": false,
"ratio": 3.496969696969697,
"config_test": false,
"has_no... |
# Berkeley DB
# Cody Ingram
# Aaron Tse
# Chris Li
import bsddb3 as db3
import sys
import random
import datetime as dt
import subprocess
import btreeCreatePopDB
import indexfileCreatePopDB
DA_FILE = "/tmp/cdingram_db/291_db.db"
def main():
arg = sys.argv[1].lower()
inpList = ['btree', 'hash', 'indexfile']
db... | {
"repo_name": "C291F14/C291A2",
"path": "menu.py",
"copies": "1",
"size": "8622",
"license": "mit",
"hash": 952491153768943900,
"line_mean": 23.9913043478,
"line_max": 242,
"alpha_frac": 0.5301554164,
"autogenerated": false,
"ratio": 2.808469055374593,
"config_test": false,
"has_no_keywords":... |
"""Berksfile related tests."""
import unittest
FIRST_BERKS = (
"source 'https://supermarket.getchef.com'\n\n"
"cookbook 'newrelic_plugins', git: "
"'git@github.com:rackspace-cookbooks/newrelic_plugins_chef.git'\n"
"cookbook 'disable_ipv6', path: 'test/fixtures/cookbooks/disable_ipv6'\n"
"cookbook... | {
"repo_name": "rackerlabs/fastfood",
"path": "tests/test_berks.py",
"copies": "3",
"size": "4194",
"license": "apache-2.0",
"hash": -5109225225792274000,
"line_mean": 32.8225806452,
"line_max": 77,
"alpha_frac": 0.6041964711,
"autogenerated": false,
"ratio": 3.5452240067624685,
"config_test": t... |
### Bernstein Basis
import numpy as np
## Ex 4.1
from scipy.special import binom
def B1(i,n,t):
"""Restituisce il polinomio di Bernstein (i,n) valutato in t,
usando la definizione binomiale"""
if i < 0 or i > n:
return 0
return binom(n,i)* t**i * (1-t)**(n-i)
def B2(i,n,t):
"""Restituisc... | {
"repo_name": "adabrow/NumAnEx2014",
"path": "Ex02/04_Bernstein.py",
"copies": "1",
"size": "3409",
"license": "mit",
"hash": -2762310656424298000,
"line_mean": 28.3620689655,
"line_max": 70,
"alpha_frac": 0.6236054022,
"autogenerated": false,
"ratio": 2.4156028368794327,
"config_test": false,
... |
# Berri_P_Izuchaem_Programmirovanie_Na_Python_2017-67
#from datetime import datetime
#odds = [1, 3, 5, 7, 9, 11, 13, 15, 17 ,19 ,21, 23, 25, 27, 29,
# 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55,
# 57, 59]
#right_this_minute = datetime.today().minute
#if right_this_minute in odds:
# print("This... | {
"repo_name": "Foxfanmedium/python_training",
"path": "Book_courses/Berry_P/chapter_1/odd.py",
"copies": "1",
"size": "1114",
"license": "apache-2.0",
"hash": -8727866672282984000,
"line_mean": 27.5641025641,
"line_max": 122,
"alpha_frac": 0.4569120287,
"autogenerated": false,
"ratio": 3.25730994... |
"Berry is a minimal DSL for building a WSGI application."
import sys
import re
import cgi
import urlparse
import traceback
debug = False
routes = []
middlewares = []
error_handlers = {}
before_request_hooks = []
parse_qs = urlparse.parse_qs or cgi.parse_qs
def app(env, start_response):
"The WSGI application."
... | {
"repo_name": "adeel/berry",
"path": "berry.py",
"copies": "1",
"size": "7045",
"license": "mit",
"hash": 8733821800438144000,
"line_mean": 23.6328671329,
"line_max": 71,
"alpha_frac": 0.6015613911,
"autogenerated": false,
"ratio": 3.665452653485952,
"config_test": false,
"has_no_keywords": f... |
"""BERT dual encoder model for retrieval."""
import torch
from transformers.modeling_bert import BertModel, BertPreTrainedModel
class BertForRetrieval(BertPreTrainedModel):
"""BERT dual encoder model for retrieval."""
def __init__(self, config, model_attr_name='bert', model_cls=BertModel):
super().__init__(... | {
"repo_name": "google-research/xtreme",
"path": "third_party/bert.py",
"copies": "1",
"size": "2230",
"license": "apache-2.0",
"hash": 799210838417770200,
"line_mean": 32.2835820896,
"line_max": 78,
"alpha_frac": 0.6659192825,
"autogenerated": false,
"ratio": 3.323397913561848,
"config_test": f... |
"""Bert Preprocessor."""
from tqdm import tqdm
from . import units
from .chain_transform import chain_transform
from matchzoo import DataPack
from matchzoo.engine.base_preprocessor import BasePreprocessor
from .build_vocab_unit import built_bert_vocab_unit
from .build_unit_from_data_pack import build_unit_fr... | {
"repo_name": "faneshion/MatchZoo",
"path": "matchzoo/preprocessors/bert_preprocessor.py",
"copies": "1",
"size": "5781",
"license": "apache-2.0",
"hash": -3195479154698097700,
"line_mean": 39.5899280576,
"line_max": 78,
"alpha_frac": 0.5391800727,
"autogenerated": false,
"ratio": 4.2043636363636... |
# Besetzungszahloperator-Erwartungswert
import numpy as np
import matplotlib.pyplot as plt
u = np.genfromtxt('Hubb_Ham_Zeit_Lösungen/U4_E01_besetzung.txt', unpack = 'True').T # Lösung der SG, real und imaginär untereinander
N = np.round(np.shape(u)[1]/2).astype(int) # Anzahl Iterationsschritte
x = u[:,0:N] + 1j*u[:,N:... | {
"repo_name": "TIm097/Bachelorarbeit",
"path": "Unwichtig/Hubb_Ham_Zeit_Besetzung.py",
"copies": "1",
"size": "1575",
"license": "mit",
"hash": -7154544644765180000,
"line_mean": 42.5,
"line_max": 132,
"alpha_frac": 0.6347381865,
"autogenerated": false,
"ratio": 2.033766233766234,
"config_test"... |
"""Bessel type functions"""
from __future__ import print_function, division
from sympy import S, pi, I
from sympy.core.function import Function, ArgumentIndexError, expand_func
from sympy.functions.elementary.trigonometric import sin, cos, csc, cot
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.... | {
"repo_name": "lidavidm/sympy",
"path": "sympy/functions/special/bessel.py",
"copies": "3",
"size": "20252",
"license": "bsd-3-clause",
"hash": -7953753793047074000,
"line_mean": 27.2061281337,
"line_max": 99,
"alpha_frac": 0.5600434525,
"autogenerated": false,
"ratio": 3.246553382494389,
"conf... |
"""Bessel type functions"""
from sympy import S, pi, I
from sympy.core.function import Function, ArgumentIndexError
from sympy.functions.elementary.trigonometric import sin, cos
from sympy.functions.elementary.miscellaneous import sqrt
# TODO
# o Airy Ai and Bi functions
# o Scorer functions G1 and G2
# o Asymptotic ... | {
"repo_name": "srjoglekar246/sympy",
"path": "sympy/functions/special/bessel.py",
"copies": "2",
"size": "15451",
"license": "bsd-3-clause",
"hash": 1385494504231239400,
"line_mean": 26.2024647887,
"line_max": 83,
"alpha_frac": 0.565335577,
"autogenerated": false,
"ratio": 3.207598090097571,
"c... |
"""Bessel type functions"""
from sympy import S, pi
from sympy.core import sympify
from sympy.core.function import Function, ArgumentIndexError
from sympy.functions.elementary.trigonometric import sin, cos
from sympy.functions.elementary.miscellaneous import sqrt
# TODO
# o Airy Ai and Bi functions
# o Scorer functio... | {
"repo_name": "Cuuuurzel/KiPyCalc",
"path": "sympy_old/functions/special/bessel.py",
"copies": "2",
"size": "12600",
"license": "mit",
"hash": 2906175330469469700,
"line_mean": 27.4424379233,
"line_max": 83,
"alpha_frac": 0.5804761905,
"autogenerated": false,
"ratio": 3.1931069437404966,
"confi... |
bestandsnaam = raw_input("Bestandsnaam: ")
verschuiving = float(raw_input("Hoeveel seconden +/- opschuiven? "))
bestand = open(bestandsnaam, "r")
nieuwbestand = []
i=0
for regel in bestand :
nieuweregel = regel
if len(regel)>5 :
if regel[2]==":" and regel[5]==":" :
uur1=int(regel[0:2])
minuut1=int(regel[3:5]... | {
"repo_name": "rocxjo/shovu",
"path": "schuif.py",
"copies": "1",
"size": "2061",
"license": "cc0-1.0",
"hash": -1204185548788803000,
"line_mean": 26.8513513514,
"line_max": 135,
"alpha_frac": 0.627850558,
"autogenerated": false,
"ratio": 1.9461756373937678,
"config_test": false,
"has_no_keyw... |
bestandsnaam = raw_input("Dosiernomo: ")
verschuiving = float(raw_input("Shovi kiom da sekundoj +/-? "))
bestand = open(bestandsnaam, "r")
nieuwbestand = []
i=0
for regel in bestand :
nieuweregel = regel
if len(regel)>5 :
if regel[2]==":" and regel[5]==":" :
uur1=int(regel[0:2])
minuut1=int(regel[3:5])
se... | {
"repo_name": "rocxjo/shovu",
"path": "Shovu.py",
"copies": "2",
"size": "2058",
"license": "cc0-1.0",
"hash": -3467047161509160000,
"line_mean": 26.8108108108,
"line_max": 135,
"alpha_frac": 0.6258503401,
"autogenerated": false,
"ratio": 1.9215686274509804,
"config_test": false,
"has_no_keyw... |
bestandsnaam = raw_input("File name: ")
verschuiving = float(raw_input("Shove how many seconds +/-? "))
bestand = open(bestandsnaam, "r")
nieuwbestand = []
i=0
for regel in bestand :
nieuweregel = regel
if len(regel)>5 :
if regel[2]==":" and regel[5]==":" :
uur1=int(regel[0:2])
minuut1=int(regel[3:5])
sec... | {
"repo_name": "rocxjo/shovu",
"path": "shove.py",
"copies": "1",
"size": "2045",
"license": "cc0-1.0",
"hash": 775215830789568600,
"line_mean": 26.6351351351,
"line_max": 135,
"alpha_frac": 0.6239608802,
"autogenerated": false,
"ratio": 1.9550669216061185,
"config_test": false,
"has_no_keywor... |
# Best Hospitals Investigations
# These are repeated for clarity in the question answer.
# Python import to ensure HiveContext is ready
try:
sc.stop()
except NameError:
pass
from pyspark import SparkContext
sc = SparkContext()
from pyspark.sql import HiveContext
sqlContext = HiveContext(sc)
# Query th... | {
"repo_name": "bruinAlex/indoor-stomach",
"path": "exercise_1/investigations/best_hospitals/best_hospitals.py",
"copies": "1",
"size": "1622",
"license": "mit",
"hash": 2827562361402934000,
"line_mean": 69.5217391304,
"line_max": 460,
"alpha_frac": 0.7916152898,
"autogenerated": false,
"ratio": 3... |
"""best_host_mode_HD211847l.py.
Jason Neal
Started 2nd January 2017
Compare observed spectra to many different phoenix-aces spectral models to find which matches one is best fit by itself.
Need to determine the best RV offset to apply to the spectra.
Possibly bu sampling a few and then taking average value (they sho... | {
"repo_name": "jason-neal/companion_simulations",
"path": "obsolete/bhm_HD211847.py",
"copies": "1",
"size": "7989",
"license": "mit",
"hash": -8300993939015867000,
"line_mean": 37.7815533981,
"line_max": 120,
"alpha_frac": 0.6495180874,
"autogenerated": false,
"ratio": 3.1589561091340452,
"con... |
"""best_host_model.py.
Jason Neal
2nd January 2017
Compare observed spectra to many different phoenix-aces spectral models to find which matches one is best fit by itself.
Need to determine the best RV offset to apply to the spectra.
Possibly by sampling a few and then taking average value (they should be all
the sa... | {
"repo_name": "jason-neal/companion_simulations",
"path": "old_simulations/best_host_model_old.py",
"copies": "1",
"size": "7076",
"license": "mit",
"hash": 1053239183495741600,
"line_mean": 40.8698224852,
"line_max": 120,
"alpha_frac": 0.6864047484,
"autogenerated": false,
"ratio": 3.31428571428... |
"""Besting previous record"""
import pandas as pd
from pyiem.util import get_autoplot_context, get_dbconn
from pyiem.plot import figure_axes
from pyiem.exceptions import NoDataFound
PDICT = {"0": "Max Highs / Min Lows", "1": "Min Highs / Max Lows"}
PDICT2 = {
"daily": "New Daily Record",
"monthly": "New Month... | {
"repo_name": "akrherz/iem",
"path": "htdocs/plotting/auto/scripts100/p176.py",
"copies": "1",
"size": "5755",
"license": "mit",
"hash": -2404047837435632000,
"line_mean": 28.6649484536,
"line_max": 79,
"alpha_frac": 0.4877497828,
"autogenerated": false,
"ratio": 3.466867469879518,
"config_test... |
# Best parameters
#
#use_et: Whether to use ExtraTreesRegressor instead of RandomForestRegressor
#max_depth: 2,6,15,32,None
#min_samples: 1,4,16,64
#regularize(cols 0-20):
#transform_weight(cols 21-41): For stdevs, how much weight
# to give the mean transform
#transform_params: For stdevs, what coefficients to use in t... | {
"repo_name": "dream-olfaction/olfaction-prediction",
"path": "opc_python/gerkin/params.py",
"copies": "1",
"size": "4611",
"license": "mit",
"hash": 6599543083477022000,
"line_mean": 36.1935483871,
"line_max": 80,
"alpha_frac": 0.5924962047,
"autogenerated": false,
"ratio": 2.6109852774631936,
... |
# Best Time to Buy and Sell Stock III
#
# Say you have an array for which the ith element is the price of a given stock on day i.
#
# Design an algorithm to find the maximum profit. You may complete at most two transactions.
#
# Note:
# You may not engage in multiple transactions at the same time (ie, you mus... | {
"repo_name": "54lihaoxin/leetcode_python",
"path": "src/BestTimeToBuyAndSellStockIII/solution.py",
"copies": "1",
"size": "1708",
"license": "apache-2.0",
"hash": -7918904041072969000,
"line_mean": 30.2264150943,
"line_max": 114,
"alpha_frac": 0.5954332553,
"autogenerated": false,
"ratio": 3.899... |
# Be sure that you have installed Leap Motion SDK
# It must be v2.2
# On your command line, type python publisher.py
# Please compile it with Python 2.6+ (not 3 or higher.)
# sys, json, time, ssl should be pre-installed modules.
# For paho.mqtt.client, use pip to install it.
# You will need ssl for certificates.
impor... | {
"repo_name": "orhaneee/iot-robotarm",
"path": "publisher.py",
"copies": "1",
"size": "3333",
"license": "apache-2.0",
"hash": 1586465587069854000,
"line_mean": 32.33,
"line_max": 176,
"alpha_frac": 0.6360636064,
"autogenerated": false,
"ratio": 3.530720338983051,
"config_test": false,
"has_n... |
# be sure to have run ' python setup.py ' from chimp directory
# # Training DeepMind's Atari DQN with Chimp
# First, we load all the Chimp modules.
from chimp.memories import ReplayMemoryHDF5
from chimp.learners.dqn_learner import DQNLearner
from chimp.learners.chainer_backend import ChainerBackend
from chimp.sim... | {
"repo_name": "sisl/Chimp",
"path": "examples/run_atari.py",
"copies": "1",
"size": "5097",
"license": "apache-2.0",
"hash": 6695569243759341000,
"line_mean": 27.4748603352,
"line_max": 117,
"alpha_frac": 0.6696095743,
"autogenerated": false,
"ratio": 3.1737235367372354,
"config_test": false,
... |
# Be sure to install boilerpipe (pip install boilerpipe)
"""
Extract main article content from HTML with Boilerpipe
In this script, we define a function that takes a single HTML news article as
input and returns the primary textual content of the article. We create an
SFrame from a sample of HTML articles, and then we... | {
"repo_name": "dato-code/how-to",
"path": "extract_article_content_from_HTML.py",
"copies": "1",
"size": "4688",
"license": "cc0-1.0",
"hash": -5893566135674102000,
"line_mean": 42.7757009346,
"line_max": 100,
"alpha_frac": 0.6084543126,
"autogenerated": false,
"ratio": 4.020600858369098,
"conf... |
beta = 5 # "beta" value in adiabatic correction to wind profile
Cd = 840.0 # heat capacity of mineral component of soil, J/kg/K
Co = 1920.0 # heat capacity of organic component of soil, J/kg/K
Cp = 1004.67 # specific heat of dry air at constant pressure, J/kg-K
Cpd = 1004.67 # specific heat of dry air a... | {
"repo_name": "OzFlux/PyFluxPro",
"path": "scripts/constants.py",
"copies": "1",
"size": "4211",
"license": "bsd-3-clause",
"hash": -7761435943290121000,
"line_mean": 47.4137931034,
"line_max": 92,
"alpha_frac": 0.5846592258,
"autogenerated": false,
"ratio": 3.007857142857143,
"config_test": fa... |
# beta_binomial.py
import numpy as np
from scipy import stats
from matplotlib import pyplot as plt
if __name__ == "__main__":
# Create a list of the number of coin tosses ("Bernoulli trials")
number_of_trials = [0, 2, 10, 20, 50, 500]
# Conduct 500 coin tosses and output into a list of 0s and 1s
# w... | {
"repo_name": "UpSea/midProjects",
"path": "01_aat-ebook-full-source-code-20160430/chapter2/beta_binomial.py",
"copies": "1",
"size": "1836",
"license": "mit",
"hash": -6320881055923112000,
"line_mean": 37.25,
"line_max": 74,
"alpha_frac": 0.6290849673,
"autogenerated": false,
"ratio": 3.4,
"co... |
"""Beta-cristobalite surface."""
import mbuild as mb
class Betacristobalite(mb.Compound):
"""The beta-cristobalite form of SiO2.
Area per port specifies the density of attachment sites in nm^2.
The crystal is expanded to yield an area per port of 0.25 nm^2, the
typical density of alkane monolayers on... | {
"repo_name": "iModels/mbuild",
"path": "mbuild/lib/surfaces/betacristobalite.py",
"copies": "2",
"size": "1913",
"license": "mit",
"hash": 9121331404865405000,
"line_mean": 37.26,
"line_max": 80,
"alpha_frac": 0.6225823314,
"autogenerated": false,
"ratio": 3.616257088846881,
"config_test": fal... |
"""Beta distribution."""
import numpy
from scipy import special
import chaospy
from ..baseclass import SimpleDistribution, LowerUpperDistribution, ShiftScaleDistribution
class beta_(SimpleDistribution):
def __init__(self, a=1, b=1):
super(beta_, self).__init__(dict(a=a, b=b))
def _pdf(self, x, a, b... | {
"repo_name": "jonathf/chaospy",
"path": "chaospy/distributions/collection/beta.py",
"copies": "1",
"size": "8647",
"license": "mit",
"hash": -6978921376890717000,
"line_mean": 29.7722419929,
"line_max": 90,
"alpha_frac": 0.5024864115,
"autogenerated": false,
"ratio": 3.1720469552457815,
"confi... |
"""Beta Geo Beta BinomFitter."""
from __future__ import print_function
from collections import OrderedDict
import numpy as np
import pandas as pd
from numpy import log, exp, logaddexp, asarray, c_ as vconcat
from pandas import DataFrame
from scipy.special import gammaln, betaln, binom
from ..utils import _fit, _chec... | {
"repo_name": "aprotopopov/lifetimes",
"path": "lifetimes/fitters/beta_geo_beta_binom_fitter.py",
"copies": "1",
"size": "8548",
"license": "mit",
"hash": -1914624816535025400,
"line_mean": 34.6166666667,
"line_max": 79,
"alpha_frac": 0.5659803463,
"autogenerated": false,
"ratio": 3.8521856692203... |
"""Beta Geo Fitter, also known as BG/NBD model."""
from __future__ import print_function
from collections import OrderedDict
import numpy as np
from numpy import log, asarray, any as npany, c_ as vconcat, isinf, isnan, \
where, exp
from numpy import ones_like
from pandas import DataFrame
from scipy.special import ... | {
"repo_name": "aprotopopov/lifetimes",
"path": "lifetimes/fitters/beta_geo_fitter.py",
"copies": "1",
"size": "10009",
"license": "mit",
"hash": 8852125552624440000,
"line_mean": 36.9128787879,
"line_max": 80,
"alpha_frac": 0.5427115596,
"autogenerated": false,
"ratio": 3.740284005979073,
"conf... |
""" BETF Module
-----------
Implementation of a Tensor Factorization for prediction of helpfulness.
Voter, author and product are the dimensions considered in the model and
modeled as latent vectors. Interaction between author and product explain
observed rating as well. Bias of review, rater, auth... | {
"repo_name": "lucianamaroun/review_recommendation",
"path": "algo/betf/main.py",
"copies": "1",
"size": "18454",
"license": "mit",
"hash": 3648641109986860500,
"line_mean": 34.1504761905,
"line_max": 80,
"alpha_frac": 0.5675734258,
"autogenerated": false,
"ratio": 3.335261160310862,
"config_te... |
"""BET isotherm model."""
import numpy
from .base_model import IsothermBaseModel
class BET(IsothermBaseModel):
r"""
Brunauer-Emmett-Teller (BET) adsorption isotherm.
.. math::
n(p) = n_m \frac{C p}{(1 - N p)(1 - N p + C p)}
Notes
-----
Like the Langmuir model, the BET model [#]_
... | {
"repo_name": "pauliacomi/pyGAPS",
"path": "src/pygaps/modelling/bet.py",
"copies": "1",
"size": "6591",
"license": "mit",
"hash": 2394191213734289000,
"line_mean": 28.2755555556,
"line_max": 104,
"alpha_frac": 0.5518445423,
"autogenerated": false,
"ratio": 3.388374485596708,
"config_test": fal... |
"""betleague URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/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-... | {
"repo_name": "asyler/betleague",
"path": "betleague/urls.py",
"copies": "1",
"size": "1159",
"license": "mit",
"hash": 5164574382994489000,
"line_mean": 36.4193548387,
"line_max": 79,
"alpha_frac": 0.7109577222,
"autogenerated": false,
"ratio": 3.4909638554216866,
"config_test": false,
"has_... |
"""betonreddit 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... | {
"repo_name": "betonreddit/betonreddit",
"path": "betonreddit/betonreddit/urls.py",
"copies": "1",
"size": "1759",
"license": "apache-2.0",
"hash": -5408678529120486000,
"line_mean": 34.8979591837,
"line_max": 131,
"alpha_frac": 0.654349062,
"autogenerated": false,
"ratio": 3.4694280078895465,
... |
#better name for function would include describing
#we're finding the sum of all preceding numbers
#eg:
#def sum_prec_nums(num):
import time
def sum_of_num_time(num):
start = time.time()
the_sum = 0
for i in range(1, num+1):
the_sum += i
end = time.time()
return the_sum, end - start
d... | {
"repo_name": "razzius/PyClassLessons",
"path": "instructors/need-rework/19_algos_and_recursion/sum_num.py",
"copies": "3",
"size": "1736",
"license": "mit",
"hash": -7933036283158332000,
"line_mean": 16.9072164948,
"line_max": 73,
"alpha_frac": 0.6186635945,
"autogenerated": false,
"ratio": 2.88... |
"""better nigp codes
Revision ID: 27c899412dc7
Revises: 2695fc68b01d
Create Date: 2015-07-09 13:23:06.551202
"""
# revision identifiers, used by Alembic.
revision = '27c899412dc7'
down_revision = '2695fc68b01d'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():... | {
"repo_name": "codeforamerica/pittsburgh-purchasing-suite",
"path": "migrations/versions/27c899412dc7_better_nigp_codes.py",
"copies": "3",
"size": "1253",
"license": "bsd-3-clause",
"hash": 2859405925943687000,
"line_mean": 35.8529411765,
"line_max": 104,
"alpha_frac": 0.7015163607,
"autogenerated... |
# better_rot13.py
# python 3.5
# This is a tool to perform ROT-13 "encryption".
# It can handle only lower-case letters for now.
# Chris Bugg
# 3/16/17
# Imports
import os
# ROT13 Class
class ROT13:
# Constructor
def __init__(self):
while True:
# Clear screen
... | {
"repo_name": "christopherbugg/python-scripts",
"path": "better_rot13.py",
"copies": "1",
"size": "2449",
"license": "mit",
"hash": 2637308804841864000,
"line_mean": 20.6725663717,
"line_max": 77,
"alpha_frac": 0.4904042466,
"autogenerated": false,
"ratio": 4.342198581560283,
"config_test": fal... |
# BetterThanTheRest by Hjax
# http://robotgame.org/viewrobot/6684
import rg
import operator
class Robot:
turn = -1
def act(self, game):
bestEnemy = 999
bestAlly = 999
closestEnemy = (0,0)
closestAlly = (0,0)
badGuys = 0
allyDistance = 999
enemyDistance... | {
"repo_name": "andrewgailey/robogen",
"path": "robogen/rgkit/backup bots/BetterThanTheRest.py",
"copies": "1",
"size": "8278",
"license": "unlicense",
"hash": 2381596355607718000,
"line_mean": 47.6941176471,
"line_max": 119,
"alpha_frac": 0.4572360474,
"autogenerated": false,
"ratio": 4.345406824... |
"""Better tokenizing for coverage.py."""
import codecs, keyword, re, sys, token, tokenize
from coverage.backward import set # pylint: disable=W0622
from coverage.parser import generate_tokens
def phys_tokens(toks):
"""Return all physical tokens, even line continuations.
tokenize.genera... | {
"repo_name": "tmpgit/intellij-community",
"path": "python/helpers/coverage/phystokens.py",
"copies": "160",
"size": "7401",
"license": "apache-2.0",
"hash": 9098510088113213000,
"line_mean": 34.2428571429,
"line_max": 79,
"alpha_frac": 0.5411430888,
"autogenerated": false,
"ratio": 4.26570605187... |
"""Better tokenizing for coverage.py."""
import codecs, keyword, re, sys, token, tokenize
from coverage.backward import StringIO # pylint: disable=W0622
def phys_tokens(toks):
"""Return all physical tokens, even line continuations.
tokenize.generate_tokens() doesn't return a token for the backsl... | {
"repo_name": "ajohnson23/depot_tools",
"path": "third_party/coverage/phystokens.py",
"copies": "49",
"size": "7373",
"license": "bsd-3-clause",
"hash": -5987317658773472000,
"line_mean": 34.4471153846,
"line_max": 79,
"alpha_frac": 0.5406211854,
"autogenerated": false,
"ratio": 4.254472013848817... |
"""Better tokenizing for coverage.py."""
import keyword, re, token, tokenize
from coverage.backward import StringIO # pylint: disable-msg=W0622
def phys_tokens(toks):
"""Return all physical tokens, even line continuations.
tokenize.generate_tokens() doesn't return a token for the backslash t... | {
"repo_name": "nhenezi/kuma",
"path": "vendor/packages/coverage/coverage/phystokens.py",
"copies": "6",
"size": "4252",
"license": "mpl-2.0",
"hash": 8372004108433555000,
"line_mean": 38.738317757,
"line_max": 79,
"alpha_frac": 0.5032925682,
"autogenerated": false,
"ratio": 4.447698744769874,
"... |
"""Better tokenizing for coverage.py."""
import keyword, re, token, tokenize
from coverage.backward import StringIO # pylint: disable=W0622
def phys_tokens(toks):
"""Return all physical tokens, even line continuations.
tokenize.generate_tokens() doesn't return a token for the backslash that
... | {
"repo_name": "Bysmyyr/blink-crosswalk",
"path": "Tools/Scripts/webkitpy/thirdparty/coverage/phystokens.py",
"copies": "67",
"size": "4266",
"license": "bsd-3-clause",
"hash": 7152488963170986000,
"line_mean": 38.5,
"line_max": 78,
"alpha_frac": 0.5060947023,
"autogenerated": false,
"ratio": 4.40... |
"""BetterWalk, a better and faster os.walk() for Python.
BetterWalk is a somewhat better and significantly faster version of Python's
os.walk(), as well as a generator version of os.listdir(). See README.md or
https://github.com/benhoyt/betterwalk for rationale and documentation.
BetterWalk is released under the new ... | {
"repo_name": "benhoyt/betterwalk",
"path": "betterwalk.py",
"copies": "1",
"size": "11046",
"license": "bsd-3-clause",
"hash": 9200019072786517000,
"line_mean": 34.8636363636,
"line_max": 79,
"alpha_frac": 0.5924316495,
"autogenerated": false,
"ratio": 3.893549524145224,
"config_test": false,
... |
# BettyCrocker.com scraper
# Written by G.D. Wallters
# Freely released the code to recipe_scraper group
# 18 January, 2020
# =======================================================
from ._abstract import AbstractScraper
from ._utils import normalize_string
class BettyCrocker(AbstractScraper):
@classmethod
... | {
"repo_name": "hhursev/recipe-scraper",
"path": "recipe_scrapers/bettycrocker.py",
"copies": "1",
"size": "1593",
"license": "mit",
"hash": -1787063071095083300,
"line_mean": 26.4655172414,
"line_max": 79,
"alpha_frac": 0.5285624608,
"autogenerated": false,
"ratio": 4.192105263157894,
"config_t... |
"""betwit URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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-bas... | {
"repo_name": "cedlerouge/betwit",
"path": "betwit/urls.py",
"copies": "1",
"size": "3596",
"license": "apache-2.0",
"hash": 8020278055933479000,
"line_mean": 45.7012987013,
"line_max": 173,
"alpha_frac": 0.6874304783,
"autogenerated": false,
"ratio": 3.408530805687204,
"config_test": false,
... |
beverage = raw_input("What beverage is in the song?")
third_line = raw_input("What should the third line be? E.g. If one of those bottles should happen to fall,")
bottles = 99
while (bottles > 2):
print "%d bottles of %s on the wall," % (bottles, beverage)
print "%d bottles of %s." % (bottles, beverage)
print thi... | {
"repo_name": "TheHockeyist/99-bottles",
"path": "code.py",
"copies": "1",
"size": "1081",
"license": "mit",
"hash": -5178699680273229000,
"line_mean": 44.0416666667,
"line_max": 108,
"alpha_frac": 0.6771507863,
"autogenerated": false,
"ratio": 2.8372703412073492,
"config_test": false,
"has_n... |
# Beware! Only tested for non-spin-polarized case
import re
import sys
import rlcompleter
import readline
#from numpy import *
from enterfi import enterfi
from outputfi import outputfi
gridfname = enterfi("Enter VASP field data (CHGCAR, LOCPOT, etc.)")
outfname = outputfi("Enter output file name ")
gridfi = open(grid... | {
"repo_name": "skasamatsu/vaspgrid",
"path": "xav.py",
"copies": "1",
"size": "2434",
"license": "mit",
"hash": 7543738776311504000,
"line_mean": 23.5858585859,
"line_max": 72,
"alpha_frac": 0.6150369762,
"autogenerated": false,
"ratio": 2.6256742179072274,
"config_test": false,
"has_no_keywo... |
# Beware! Only tested for non-spin-polarized case
import re
import sys
import rlcompleter
import readline
from numpy import *
from enterfi import enterfi
from outputfi import outputfi
gridfname = enterfi("Enter VASP field data (CHGCAR, LOCPOT, etc.)")
outfname = outputfi("Enter output file name ")
gridfi = open(gridf... | {
"repo_name": "skasamatsu/vaspgrid",
"path": "chgxav.py",
"copies": "1",
"size": "2421",
"license": "mit",
"hash": -3466734287254508500,
"line_mean": 23.4545454545,
"line_max": 72,
"alpha_frac": 0.6332094176,
"autogenerated": false,
"ratio": 2.7202247191011235,
"config_test": false,
"has_no_k... |
"""Beware! you need PyTables >= 2.3 to run this script!"""
from __future__ import print_function
from time import time # use clock for Win
import numpy as np
import tables
# NEVENTS = 10000
NEVENTS = 20000
MAX_PARTICLES_PER_EVENT = 100
# Particle description
class Particle(tables.IsDescription):
# event_id = ... | {
"repo_name": "jennolsen84/PyTables",
"path": "examples/particles.py",
"copies": "13",
"size": "4216",
"license": "bsd-3-clause",
"hash": -818191907563498000,
"line_mean": 33.5573770492,
"line_max": 79,
"alpha_frac": 0.6088709677,
"autogenerated": false,
"ratio": 3.1794871794871793,
"config_tes... |
# Bextest.py tests binning algoritms against an existing .sbn file
#
import shapefile
from hasbeen import HasBeen
from bextree import Tree
from mapper import mapshapefile
from spatialindex import SBN
import sys
if len(sys.argv) > 1:
shpfile = sys.argv[1]
else:
print "Usage: bextest.py [shapefile]"
print "... | {
"repo_name": "drwelby/hasbeen",
"path": "bextest.py",
"copies": "1",
"size": "1357",
"license": "mit",
"hash": -487387670251731460,
"line_mean": 26.693877551,
"line_max": 98,
"alpha_frac": 0.5843773029,
"autogenerated": false,
"ratio": 3.0632054176072234,
"config_test": false,
"has_no_keywor... |
"""Bezier curve tools.
All functions in this module assume the following naming:
C1
____
/ \ P2
| \______|
P1
C2
A bezier curve is formed between two points P1 and P2, with curve direction coming from control poin... | {
"repo_name": "jshaffstall/PyPhysicsSandbox",
"path": "py2d/Bezier.py",
"copies": "1",
"size": "2985",
"license": "mit",
"hash": -4916863753731018000,
"line_mean": 24.2966101695,
"line_max": 106,
"alpha_frac": 0.6298157454,
"autogenerated": false,
"ratio": 2.308584686774942,
"config_test": fals... |
from nodebox.graphics import BezierPath, PathElement, NodeBoxError, Point
from nodebox.graphics import MOVETO, LINETO, CURVETO, CLOSE
try:
import cPathmatics
linepoint = cPathmatics.linepoint
linelength = cPathmatics.linelength
curvepoint = cPathmatics.curvepoint
curvelength = cPathmatics.curvel... | {
"repo_name": "karstenw/nodebox-pyobjc",
"path": "nodebox/graphics/bezier.py",
"copies": "1",
"size": "15634",
"license": "mit",
"hash": 2546404832428119600,
"line_mean": 30.5201612903,
"line_max": 168,
"alpha_frac": 0.558590252,
"autogenerated": false,
"ratio": 3.1634965600971268,
"config_test... |
# bezier.m - 1D Bezier curve basis functions
# RMM, 24 Feb 2021
#
# This class implements a set of basis functions based on Bezier curves:
#
# \phi_i(t) = \sum_{i=0}^n {n \choose i} (T - t)^{n-i} t^i
#
# Copyright (c) 2012 by California Institute of Technology
# All rights reserved.
#
# Redistribution and use in sou... | {
"repo_name": "murrayrm/python-control",
"path": "control/flatsys/bezier.py",
"copies": "1",
"size": "3306",
"license": "bsd-3-clause",
"hash": -1992443434347098000,
"line_mean": 38.8313253012,
"line_max": 78,
"alpha_frac": 0.6612220206,
"autogenerated": false,
"ratio": 3.8308227114716105,
"con... |
# Thanks to Prof. F. De Smedt at the Vrije Universiteit Brussel.
from context import BezierPath, PathElement, PathError, Point, MOVETO, LINETO, CURVETO, CLOSE
from math import sqrt, pow
class DynamicPathElement(PathElement):
# Not a "fixed" point in the BezierPath, but calculated with BezierPath.point().
pas... | {
"repo_name": "nodebox/nodebox-opengl",
"path": "nodebox/graphics/bezier.py",
"copies": "1",
"size": "21813",
"license": "bsd-3-clause",
"hash": -6184273355775846000,
"line_mean": 40.1566037736,
"line_max": 109,
"alpha_frac": 0.5602622289,
"autogenerated": false,
"ratio": 3.131801866475233,
"co... |
# Thanks to Prof. F. De Smedt at the Vrije Universiteit Brussel.
from nodebox.graphics.context import BezierPath, PathElement, PathError, Point, MOVETO, LINETO, CURVETO, CLOSE
from math import sqrt, pow
class DynamicPathElement(PathElement):
# Not a "fixed" point in the BezierPath, but calculated with BezierPath... | {
"repo_name": "pepsipepsi/nodebox_opengl_python3",
"path": "nodebox/graphics/bezier.py",
"copies": "1",
"size": "21733",
"license": "bsd-3-clause",
"hash": -219803709888752600,
"line_mean": 40.0056603774,
"line_max": 110,
"alpha_frac": 0.5616803939,
"autogenerated": false,
"ratio": 3.127050359712... |
# b/fac/gate.py
import os
import requests
import importlib
import datetime
import time
from autobahn.twisted.wamp import ApplicationSession
from twisted.internet.defer import inlineCallbacks
from autobahn.wamp.types import PublishOptions
from autobahn.wamp.types import SubscribeOptions
from twisted.internet import rea... | {
"repo_name": "filemakergarage/zeroclient",
"path": "f1/b/fac/gate.py",
"copies": "1",
"size": "19301",
"license": "mit",
"hash": -6737155227431969000,
"line_mean": 37.6793587174,
"line_max": 119,
"alpha_frac": 0.5552043936,
"autogenerated": false,
"ratio": 3.970582184735651,
"config_test": fal... |
# b/fac/lock.py
import importlib
class Lock:
def __init__(self, lock, gate, docker, architecture, session_id):
self.lock = lock
self.identity = self.lock['id']
self.arg = 'arg'
self.gate = gate
self.docker = docker
self.architecture = architecture
self.type... | {
"repo_name": "filemakergarage/zeroclient",
"path": "f1/b/fac/lock.py",
"copies": "1",
"size": "2136",
"license": "mit",
"hash": 1465522113361458200,
"line_mean": 29.9565217391,
"line_max": 113,
"alpha_frac": 0.5056179775,
"autogenerated": false,
"ratio": 4.16374269005848,
"config_test": false,... |
### bfi.py, the Brainfuck Interpreter
### Riley Pinkerton, 7/27/2014
import argparse
import sys
def run(code):
'''Runs a string of Brainfuck code'''
# Initialize the data array. Only allocate cells we use for speed and
# compactness
data = [0]
# Initialize the instruction array. Filter ... | {
"repo_name": "rpinkerton/dogfood",
"path": "tools/brainfuck/bfi.py",
"copies": "1",
"size": "2627",
"license": "mit",
"hash": 7827651430749023000,
"line_mean": 28.1954022989,
"line_max": 87,
"alpha_frac": 0.4609821089,
"autogenerated": false,
"ratio": 4.21669341894061,
"config_test": false,
... |
# BF JIT using the PeachPy x86-64 codegen library.
#
# Tested with Python 3.5+; PeachPy installed into a virtualenv following the
# installation steps in its README: https://github.com/Maratyszcza
#
# Eli Bendersky [http://eli.thegreenplace.net]
# This code is in the public domain.
import argparse
from collections impo... | {
"repo_name": "eliben/code-for-blog",
"path": "2017/bfjit/peachpyjit.py",
"copies": "1",
"size": "5950",
"license": "unlicense",
"hash": -5435676916470784000,
"line_mean": 36.6582278481,
"line_max": 80,
"alpha_frac": 0.571092437,
"autogenerated": false,
"ratio": 3.4856473345049794,
"config_test... |
# b_flow
# Flow constraint vector
__all__ = ["b_flow"]
def b_flow(a_vertices):
# b_flow
#
# Construct flow constraint vector
# (vector of size |V| x 1 representing the sum of flow for each vertex.
# Having removed source and drain nodes. Now require:
# L nodes = -1
# R nodes = +1
# A... | {
"repo_name": "alanaberdeen/coupled-minimum-cost-flow-track",
"path": "cmcft/tools/params/b_flow.py",
"copies": "1",
"size": "1055",
"license": "mit",
"hash": -8049469059373385000,
"line_mean": 23.5348837209,
"line_max": 75,
"alpha_frac": 0.5336492891,
"autogenerated": false,
"ratio": 3.403225806... |
# BFS
class SolutionBFS:
def numIslands(self, grid):
if grid is None or len(grid) == 0 or len(grid[0]) == 0:
return 0
m = len(grid)
n = len(grid[0])
visited = [[False for i in range(n)] for j in range(m)]
count = 0
for row in range(m):
for co... | {
"repo_name": "euccas/CodingPuzzles-Python",
"path": "leet/source/searchBFS/number_of_islands.py",
"copies": "1",
"size": "2301",
"license": "mit",
"hash": 3204876809666896000,
"line_mean": 29.2894736842,
"line_max": 100,
"alpha_frac": 0.4315514993,
"autogenerated": false,
"ratio": 3.496960486322... |
import binascii
import time
from serial.serialutil import Timeout
from Hologram.Network.Modem import Modem
from Hologram.Event import Event
from UtilClasses import ModemResult
from Exceptions.HologramError import SerialError, NetworkError
DEFAULT_BG96_TIMEOUT = 200
class BG96(Modem):
usb_ids = [('2c7c', '0296')... | {
"repo_name": "hologram-io/hologram-python",
"path": "Hologram/Network/Modem/BG96.py",
"copies": "1",
"size": "7146",
"license": "mit",
"hash": 1271462921743982800,
"line_mean": 36.7883597884,
"line_max": 87,
"alpha_frac": 0.5770092411,
"autogenerated": false,
"ratio": 3.8233404710920773,
"conf... |
# BGB protocol from https://github.com/vaguilar/pokemon-red-cable-club-hack/blob/master/py/bgb_link.py
import socket
import sys
def format_data(string):
result = 0
for c in string:
result = (result << 8) | ord(c)
return result
def send_data(sock, b1, b2, b3, b4, time):
data = ... | {
"repo_name": "V-FEXrt/Pokemon-Spoof-Plus",
"path": "CableClub/bgb_link.py",
"copies": "1",
"size": "2215",
"license": "mit",
"hash": -407117185861571300,
"line_mean": 25.3456790123,
"line_max": 102,
"alpha_frac": 0.453724605,
"autogenerated": false,
"ratio": 3.397239263803681,
"config_test": f... |
"""BGEN file reader based on PyBGEN."""
# This file is part of geneparse.
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Pharmacogenomics Centre
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the So... | {
"repo_name": "pgxcentre/geneparse",
"path": "geneparse/readers/bgen.py",
"copies": "1",
"size": "9082",
"license": "mit",
"hash": -42425414440203210,
"line_mean": 32.1459854015,
"line_max": 79,
"alpha_frac": 0.5332525875,
"autogenerated": false,
"ratio": 4.333015267175573,
"config_test": false... |
# bg is always black.
# effect is white
# func decl: red bold
# class decl: blue bold
# predefined decl: green bold
def <info descr="null" type="INFORMATION" foreground="0xff0000" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">foo</info>():
pass
class <info descr="null" type="INFORMATIO... | {
"repo_name": "supersven/intellij-community",
"path": "python/testData/highlighting/declarations.py",
"copies": "61",
"size": "1081",
"license": "apache-2.0",
"hash": -7498360845893331000,
"line_mean": 62.5882352941,
"line_max": 194,
"alpha_frac": 0.7261794635,
"autogenerated": false,
"ratio": 3.... |
# bg is always black.
# effect is white
# func decl: red bold
# class decl: blue bold
# predefined decl: green bold
def <info descr="PY.FUNC_DEFINITION" type="INFORMATION" foreground="0xff0000" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">foo</info>():
pass
class <info descr="PY.CLASS... | {
"repo_name": "ingokegel/intellij-community",
"path": "python/testData/highlighting/declarations.py",
"copies": "22",
"size": "1221",
"license": "apache-2.0",
"hash": 6209198686595075000,
"line_mean": 70.8235294118,
"line_max": 224,
"alpha_frac": 0.7395577396,
"autogenerated": false,
"ratio": 3.1... |
# bg is always black.
# effect is white
# func decl: red bold
# class decl: blue bold
# predefined decl: green bold
# predefined usage: yellow bold
<info descr="null" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">len</info>("")
len = [] # redefine... | {
"repo_name": "pwoodworth/intellij-community",
"path": "python/testData/highlighting/builtins.py",
"copies": "56",
"size": "1219",
"license": "apache-2.0",
"hash": -648572232486577500,
"line_mean": 54.4090909091,
"line_max": 205,
"alpha_frac": 0.7350287121,
"autogenerated": false,
"ratio": 3.3306... |
# bg is always black.
# effect is white
# func decl: red bold
# class decl: blue bold
# predefined decl: green bold
# predefined usage: yellow bold
<info descr="PY.BUILTIN_NAME" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">len</info>("")
len = []... | {
"repo_name": "da1z/intellij-community",
"path": "python/testData/highlighting/builtins.py",
"copies": "1",
"size": "1206",
"license": "apache-2.0",
"hash": 4266461530378647000,
"line_mean": 53.8181818182,
"line_max": 231,
"alpha_frac": 0.736318408,
"autogenerated": false,
"ratio": 3.182058047493... |
# BG note: borrowed from Stingray/HENDRICs https://github.com/StingraySoftware/HENDRICS
# This file is used to configure the behavior of pytest when using the Astropy
# test infrastructure. It needs to live inside the package in order for it to
# get picked up when running the tests inside an interpreter using
# packa... | {
"repo_name": "NuSTAR/nustar_pysolar",
"path": "nustar_pysolar/conftest.py",
"copies": "2",
"size": "2133",
"license": "mit",
"hash": -2462073224818950700,
"line_mean": 35.1694915254,
"line_max": 88,
"alpha_frac": 0.7243319269,
"autogenerated": false,
"ratio": 3.795373665480427,
"config_test": ... |
"""BGP implementation for FAUCET."""
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# Licensed under the Ap... | {
"repo_name": "byllyfish/faucet",
"path": "faucet/faucet_bgp.py",
"copies": "1",
"size": "5730",
"license": "apache-2.0",
"hash": -3763894793327878000,
"line_mean": 41.1323529412,
"line_max": 97,
"alpha_frac": 0.5842931937,
"autogenerated": false,
"ratio": 3.8716216216216215,
"config_test": fal... |
""" bgp
This module describes a YANG model for BGP protocol
configuration.It is a limited subset of all of the configuration
parameters available in the variety of vendor implementations,
hence it is expected that it would be augmented with vendor\-
specific configuration data as needed. Additional modules or
submodu... | {
"repo_name": "abhikeshav/ydk-py",
"path": "openconfig/ydk/models/openconfig/bgp.py",
"copies": "1",
"size": "895282",
"license": "apache-2.0",
"hash": 6217209297806841000,
"line_mean": 43.7193806194,
"line_max": 400,
"alpha_frac": 0.4118378343,
"autogenerated": false,
"ratio": 5.844373217048444,... |
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# cop... | {
"repo_name": "trhura/python-myanmar",
"path": "myanmar/romanizer/bgp_pgcn.py",
"copies": "1",
"size": "4162",
"license": "mit",
"hash": -2154307608630292200,
"line_mean": 33.9579831933,
"line_max": 79,
"alpha_frac": 0.6269230769,
"autogenerated": false,
"ratio": 3.466666666666667,
"config_test... |
""" bgp_policy
This module contains data definitions for BGP routing policy.
It augments the base routing\-policy module with BGP\-specific
options for conditions and actions.
"""
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
f... | {
"repo_name": "abhikeshav/ydk-py",
"path": "openconfig/ydk/models/openconfig/bgp_policy.py",
"copies": "1",
"size": "2213",
"license": "apache-2.0",
"hash": -4799166862451209000,
"line_mean": 17.7542372881,
"line_max": 79,
"alpha_frac": 0.6800723,
"autogenerated": false,
"ratio": 4.02363636363636... |
"""bgtunnel - Initiate SSH tunnels in the background
Useful when you need to connect to a database only accessible through
another ssh-enabled host. It works by opening a port forwarding ssh
connection in the background, using threads. The connection(s) are
automatically closed when the process exits, or when explicitl... | {
"repo_name": "jmagnusson/bgtunnel",
"path": "bgtunnel.py",
"copies": "1",
"size": "14260",
"license": "mit",
"hash": 4778761591836369000,
"line_mean": 30.7594654788,
"line_max": 78,
"alpha_frac": 0.5786115007,
"autogenerated": false,
"ratio": 3.9988782950084127,
"config_test": false,
"has_no... |
"""bha 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-based v... | {
"repo_name": "raptiq/BHA",
"path": "bha/urls.py",
"copies": "1",
"size": "1453",
"license": "mit",
"hash": 4500411093951906000,
"line_mean": 40.5142857143,
"line_max": 104,
"alpha_frac": 0.6971782519,
"autogenerated": false,
"ratio": 3.2799097065462752,
"config_test": false,
"has_no_keywords... |
#Bhouston script - modified Gael's script
# this script is provided as a basic guide
# most parts can be run by uncommenting them
# InMoov now can be started in modular pieces
leftPort = "COM7"
rightPort = "COM3"
i01 = Runtime.createAndStart("i01", "InMoov")
cleverbot = Runtime.createAndStart("cleverbot","CleverB... | {
"repo_name": "sstocker46/pyrobotlab",
"path": "home/bhouston/InMoov2.bhouston.py",
"copies": "3",
"size": "66077",
"license": "apache-2.0",
"hash": 1734981391774466000,
"line_mean": 34.9706042461,
"line_max": 196,
"alpha_frac": 0.6126337455,
"autogenerated": false,
"ratio": 2.3529181355268314,
... |
""" Bias Baseline
-------------
Implementation of bias baseline, in which the prediction is composed by a
sum of overall average, user bias and item bias, the last two being
variables to be fitted.
Usage:
$ python -m util.bias
"""
from math import sqrt
from sys import argv, exit
from numpy... | {
"repo_name": "lucianamaroun/review_recommendation",
"path": "util/bias.py",
"copies": "1",
"size": "8632",
"license": "mit",
"hash": 2343739736496996000,
"line_mean": 31.0892193309,
"line_max": 80,
"alpha_frac": 0.6041473587,
"autogenerated": false,
"ratio": 3.608695652173913,
"config_test": f... |
"""Bias computing hi/lo"""
import datetime
import numpy as np
import pandas as pd
import psycopg2.extras
from pyiem.plot import figure_axes
from pyiem.util import get_autoplot_context, get_dbconn
from pyiem.exceptions import NoDataFound
def get_description():
""" Return a dict describing how to call this plotter... | {
"repo_name": "akrherz/iem",
"path": "htdocs/plotting/auto/scripts/p94.py",
"copies": "1",
"size": "3424",
"license": "mit",
"hash": 5594508918567944000,
"line_mean": 32.568627451,
"line_max": 79,
"alpha_frac": 0.6057242991,
"autogenerated": false,
"ratio": 3.337231968810916,
"config_test": fal... |
""" Bias correction module
----------------------
Module for removing bias from intended targets, which can be a combination
of review, author and voter.
Usage:
Used only as a module, not directly callable.
"""
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from s... | {
"repo_name": "lucianamaroun/review_recommendation",
"path": "util/bias_correction.py",
"copies": "1",
"size": "5590",
"license": "mit",
"hash": -2865569335394255000,
"line_mean": 33.5061728395,
"line_max": 80,
"alpha_frac": 0.6751341682,
"autogenerated": false,
"ratio": 3.9814814814814814,
"co... |
"""Bias matrix and initial guess function.
"""
from __future__ import division, absolute_import
import numpy as np
from skimage.transform import resize
from skimage.io import imread
from sklearn.datasets import make_checkerboard
from pymanopt.manifolds import FixedRankEmbedded, Euclidean
def guess_func(shape, rank,... | {
"repo_name": "a378ec99/bcn",
"path": "bcn/bias.py",
"copies": "1",
"size": "6060",
"license": "mit",
"hash": -6780408135996349000,
"line_mean": 39.9459459459,
"line_max": 288,
"alpha_frac": 0.596039604,
"autogenerated": false,
"ratio": 3.8672622846202938,
"config_test": false,
"has_no_keywor... |
# bibframe
from versa import I
# use BFZ namespace to scope MARC tags that don't match transformation recipes
BFZ = I('http://bibfra.me/vocab/marcext/')
BFLC = I('http://bibframe.org/vocab/')
#A way to register services to specialize bibframe.py processing
#Maps URL to callable
g_services = {}
BF_INIT_TASK = 'http:... | {
"repo_name": "zepheira/pybibframe",
"path": "lib/__init__.py",
"copies": "1",
"size": "1327",
"license": "apache-2.0",
"hash": -1602797312789474800,
"line_mean": 33.9210526316,
"line_max": 86,
"alpha_frac": 0.713639789,
"autogenerated": false,
"ratio": 2.691683569979716,
"config_test": false,
... |
# bibframe.reader
import warnings
from amara3 import iri
from versa import I, VERSA_BASEIRI, ORIGIN, RELATIONSHIP, TARGET, ATTRIBUTES
VTYPE_REL = I(iri.absolutize('type', VERSA_BASEIRI))
#Transforms
CORE_BFLITE_TRANSFORMS = 'http://bibfra.me/tool/pybibframe/transforms#bflite'
CORE_MARC_TRANSFORMS = 'http://bibfra.m... | {
"repo_name": "zepheira/pybibframe",
"path": "lib/reader/__init__.py",
"copies": "1",
"size": "4721",
"license": "apache-2.0",
"hash": 4949117857861870000,
"line_mean": 47.6701030928,
"line_max": 169,
"alpha_frac": 0.630163101,
"autogenerated": false,
"ratio": 3.9016528925619833,
"config_test":... |
#bibframe.reader.util
#FIXME: Rename to bibframe.reader.pipeline (cf Versa) post 1.0
'''
Library of functions that take a prototype link set and generate a transformed link set
'''
import re
import sys
from itertools import product
from enum import Enum #https://docs.python.org/3.4/library/enum.html
from collections... | {
"repo_name": "zepheira/pybibframe",
"path": "lib/reader/util.py",
"copies": "1",
"size": "28098",
"license": "apache-2.0",
"hash": 5840030922495731000,
"line_mean": 45.83,
"line_max": 300,
"alpha_frac": 0.627624742,
"autogenerated": false,
"ratio": 3.838000273186723,
"config_test": false,
"h... |
# BibleBot
from __future__ import absolute_import
# Whether to use threads for concordance searches or not.
# (This is an experimental feature.)
from django.conf import settings
if settings.IM_IN_TEST_MODE:
THREADED_SEARCH = False
else:
THREADED_SEARCH = True
import datetime
import re
import time
import c... | {
"repo_name": "kiwiheretic/logos-v2",
"path": "bibleapp/bot_plugin.py",
"copies": "1",
"size": "45570",
"license": "apache-2.0",
"hash": -7117272279270721000,
"line_mean": 40.6544789762,
"line_max": 147,
"alpha_frac": 0.4877989906,
"autogenerated": false,
"ratio": 4.057880676758682,
"config_tes... |
# Bibliography entry class
# - holds all information about one bibliographic item
# - provides methods for manipulating/setting/representing that information
#
# TODO:
# __repr__ method needs to do a better job depending on the reference type,
# similar logic is required in bib2html (but it's not their either... | {
"repo_name": "tbekolay/refs",
"path": "refs/core.py",
"copies": "1",
"size": "30424",
"license": "bsd-3-clause",
"hash": 2404472335642386000,
"line_mean": 30.6586888658,
"line_max": 79,
"alpha_frac": 0.4462266632,
"autogenerated": false,
"ratio": 4.251537171604248,
"config_test": false,
"has... |
# bibliography.py
r'''
Defines the BibItem() and Bibliography() classes (both sub-classed from Node)
The Bibliography() object is initialized directly from
a .bib file using the `bibtexparser` package.
We use registry.ClassFactory for unlisted fields
'''
import os
import logging
log = logging.getLogger(__name__)
i... | {
"repo_name": "dimbyd/latextree",
"path": "latextree/parser/bibliography.py",
"copies": "1",
"size": "6260",
"license": "mit",
"hash": 6585328577393729000,
"line_mean": 36.0414201183,
"line_max": 100,
"alpha_frac": 0.5479233227,
"autogenerated": false,
"ratio": 3.9051777916406736,
"config_test"... |
"""Bibliography/references."""
anderson2010non = None
"""
**Anderson**, **J L** 2010 A non-Gaussian ensemble filter update
for data assimilation. *Monthly Weather Review*, 138(11):
4186–4198.
"""
anderson2009spatially = None
"""
**Anderson**, **J L** 2009 Spatially and temporally varying
adaptive covariance inflation... | {
"repo_name": "nansencenter/DAPPER",
"path": "docs/bib/bib.py",
"copies": "1",
"size": "10180",
"license": "mit",
"hash": -8151756412956378000,
"line_mean": 28.0720461095,
"line_max": 66,
"alpha_frac": 0.689036479,
"autogenerated": false,
"ratio": 2.7532751091703056,
"config_test": false,
"ha... |
# Biblioteca de funções para as matrizes
import random
# função para criar matriz de ordem n x m
def cria_matriz(n, m):
matriz = []
for i in range(n):
list = []
for j in range(m):
# serão inseridos valores aleatórios na matriz (entre 1 e 4)
value = random.randint(1, 4)... | {
"repo_name": "jucimarjr/IPC_2017-1",
"path": "lista08/ipc/matriz.py",
"copies": "1",
"size": "7760",
"license": "apache-2.0",
"hash": 5404477556076751000,
"line_mean": 23.144200627,
"line_max": 102,
"alpha_frac": 0.5541417814,
"autogenerated": false,
"ratio": 2.8557656655543195,
"config_test":... |
# Biblioteca de funções para os vetores
import random
# lista 1 questão 1
def exercicio_1(n):
for i in range(n):
i += 1
print ((str(i) + " " )* i)
return i
# lista 1 questao 2
def SequencialAbaixoDiagonalPrincipal(n):
res = ""
for i in range(n):
for j in range(i + 1):
... | {
"repo_name": "jucimarjr/IPC_2017-1",
"path": "lista08/ipc/vetor.py",
"copies": "1",
"size": "7545",
"license": "apache-2.0",
"hash": -2502865486999653000,
"line_mean": 22.277258567,
"line_max": 110,
"alpha_frac": 0.5938169165,
"autogenerated": false,
"ratio": 2.6868033081625313,
"config_test":... |
'''Biblioteca que contém as rotinas de coversão dos diferentes tipos
de máquinas.
Autor: Lucas Possatti
'''
import re
import collections
def mealy_to_moore(me):
'''Converte o parâmetro 'me' (que deve ser uma máquina Mealy) para
uma máquina de Moore, que é retornada.
'''
# Verifica se a máquina recebida, realemen... | {
"repo_name": "possatti/memoo",
"path": "converter.py",
"copies": "1",
"size": "6467",
"license": "mit",
"hash": -3331541746380313600,
"line_mean": 32.125,
"line_max": 165,
"alpha_frac": 0.652672956,
"autogenerated": false,
"ratio": 2.418250950570342,
"config_test": false,
"has_no_keywords": ... |
"""biblio 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')
Class-base... | {
"repo_name": "adrianborkowski/kurs_django",
"path": "biblio/urls.py",
"copies": "1",
"size": "1081",
"license": "mit",
"hash": 4687603433258671000,
"line_mean": 36.275862069,
"line_max": 77,
"alpha_frac": 0.6817761332,
"autogenerated": false,
"ratio": 3.3887147335423196,
"config_test": false,
... |
"""Biblitoteca pra implementar as chamadas ao SGBD"""
import psycopg2
# ---------------------------- FUNCTIONS ----------------------------- #
class SGBD:
"""Classe para realizar as tarefas do lado do banco de dados SQL"""
def __init__(self, dbname=None, user=None, password=None, host=None, port=None)... | {
"repo_name": "Fazendaaa/DB",
"path": "implementacao/BD/SGBD.py",
"copies": "1",
"size": "1444",
"license": "mit",
"hash": -5269345644708103000,
"line_mean": 39.1111111111,
"line_max": 112,
"alpha_frac": 0.5630193906,
"autogenerated": false,
"ratio": 3.7604166666666665,
"config_test": false,
... |
"""bibpy module setup script for distribution."""
from __future__ import with_statement
import os
from setuptools import setup
def get_version(filename):
with open(filename) as fh:
for line in fh:
if line.startswith('__version__'):
return line.split('=')[-1].strip()[1:-1]
s... | {
"repo_name": "MisanthropicBit/bibpy",
"path": "setup.py",
"copies": "1",
"size": "2266",
"license": "mit",
"hash": -1798559937528449000,
"line_mean": 30.9154929577,
"line_max": 75,
"alpha_frac": 0.5798764342,
"autogenerated": false,
"ratio": 3.789297658862876,
"config_test": false,
"has_no_k... |
"""BiBTeX helpers
"""
import re
import bibtexparser
from bibtexparser.bparser import BibTexParser
from bibtexparser.customization import convert_to_unicode
def load_bib(bib, titles):
"""Returns dict {'BibTeX ID': {record}}
"""
with open(bib) as bibtex_file:
parser = BibTexParser()
parser... | {
"repo_name": "quicklizard99/cv",
"path": "bib.py",
"copies": "1",
"size": "2781",
"license": "mit",
"hash": 4260999142934392000,
"line_mean": 32.0833333333,
"line_max": 83,
"alpha_frac": 0.5732277798,
"autogenerated": false,
"ratio": 3.5266497461928936,
"config_test": false,
"has_no_keywords... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.