text stringlengths 0 1.05M | meta dict |
|---|---|
""" Benchmark script for performance on GPUs. For example, run the file with: `python cuda_imagenet_bench.py --model='mobilenet'`. For more details about how to set up the inference environment on GPUs, please refer to NNVM Tutorial: ImageNet Inference on the GPU """
import time
import argparse
import numpy as np
impor... | {
"repo_name": "piiswrong/nnvm",
"path": "examples/benchmark/cuda_imagenet_bench.py",
"copies": "2",
"size": "2524",
"license": "apache-2.0",
"hash": 5385179827068197000,
"line_mean": 37.2424242424,
"line_max": 267,
"alpha_frac": 0.6442155309,
"autogenerated": false,
"ratio": 3.544943820224719,
... |
""" Benchmark script for performance on GPUs.
For example, run the file with:
`python gpu_imagenet_bench.py --model=mobilenet --target=cuda`.
For more details about how to set up the inference environment on GPUs,
please refer to NNVM Tutorial: ImageNet Inference on the GPU
"""
import time
import argparse
import numpy... | {
"repo_name": "imai-lm/nnvm",
"path": "examples/benchmark/gpu_imagenet_bench.py",
"copies": "1",
"size": "2866",
"license": "apache-2.0",
"hash": -54684840210843690,
"line_mean": 36.7105263158,
"line_max": 107,
"alpha_frac": 0.6325889742,
"autogenerated": false,
"ratio": 3.6186868686868685,
"co... |
""" Benchmark script for performance on Raspberry Pi. For example, run the file with:
`python rasp_imagenet_bench.py --model='modbilenet' --host='rasp0' --port=9090`. For
more details about how to set up the inference environment on Raspberry Pi, Please
refer to NNVM Tutorial: Deploy the Pretrained Model on Raspberry P... | {
"repo_name": "ZihengJiang/nnvm",
"path": "examples/benchmark/rasp_imagenet_bench.py",
"copies": "1",
"size": "2887",
"license": "apache-2.0",
"hash": -4778317174338922000,
"line_mean": 36.0128205128,
"line_max": 105,
"alpha_frac": 0.6595081399,
"autogenerated": false,
"ratio": 3.384525205158265,... |
"""Benchmark Search algorithm"""
# pylint: disable=missing-docstring, invalid-name
import netCDF4
import bench
import util
import obsoper.grid
class BenchmarkRealData(bench.Suite):
def setUp(self):
for path in ["sample_class4.nc",
"sample_prodm.nc"]:
util.grab(path)
... | {
"repo_name": "met-office-ocean/obsoper",
"path": "benchmarks/bench_real.py",
"copies": "1",
"size": "1757",
"license": "bsd-3-clause",
"hash": -3770210669813488000,
"line_mean": 34.8571428571,
"line_max": 72,
"alpha_frac": 0.640295959,
"autogenerated": false,
"ratio": 3.722457627118644,
"confi... |
""" Benchmarks for fast squashing
Run all benchmarks with::
import dipy.reconst as dire
dire.bench()
If you have doctests enabled by default in nose (with a noserc file or
environment variable), and you have a numpy version <= 1.6.1, this will also run
the doctests, let's hope they pass.
Run this benchmark... | {
"repo_name": "beni55/dipy",
"path": "dipy/reconst/benchmarks/bench_squash.py",
"copies": "11",
"size": "5185",
"license": "bsd-3-clause",
"hash": -1314010378972528000,
"line_mean": 32.6688311688,
"line_max": 80,
"alpha_frac": 0.5982642237,
"autogenerated": false,
"ratio": 3.4822028206850235,
"... |
""" Benchmarks for fast squashing
Run all benchmarks with::
import dipy.reconst as dire
dire.bench()
With Pytest, Run this benchmark with:
pytest -svv -c bench.ini /path/to/bench_squash.py
"""
from functools import reduce
import numpy as np
from dipy.core.ndindex import ndindex
from dipy.reconst.qui... | {
"repo_name": "FrancoisRheaultUS/dipy",
"path": "dipy/reconst/benchmarks/bench_squash.py",
"copies": "8",
"size": "4855",
"license": "bsd-3-clause",
"hash": 2060843500008938000,
"line_mean": 32.2534246575,
"line_max": 79,
"alpha_frac": 0.596292482,
"autogenerated": false,
"ratio": 3.4928057553956... |
""" Benchmarks for functions related to streamline
Run all benchmarks with::
import dipy.tracking as dipytracking
dipytracking.bench()
With Pytest, Run this benchmark with:
pytest -svv -c bench.ini /path/to/bench_streamline.py
"""
import numpy as np
from numpy.testing import measure
from numpy.testing ... | {
"repo_name": "FrancoisRheaultUS/dipy",
"path": "dipy/tracking/benchmarks/bench_streamline.py",
"copies": "9",
"size": "4687",
"license": "bsd-3-clause",
"hash": 5903415541887855000,
"line_mean": 36.1984126984,
"line_max": 92,
"alpha_frac": 0.6264134841,
"autogenerated": false,
"ratio": 3.6818538... |
"""Benchmarks for join methods on realworld datasets"""
import os
from py_stringmatching.tokenizer.delimiter_tokenizer import DelimiterTokenizer
import pandas as pd
from py_stringsimjoin.join.cosine_join import cosine_join
from py_stringsimjoin.join.dice_join import dice_join
from py_stringsimjoin.join.edit_distance... | {
"repo_name": "anhaidgroup/py_stringsimjoin",
"path": "benchmarks/asv_benchmarks/benchmark_join_real.py",
"copies": "1",
"size": "5315",
"license": "bsd-3-clause",
"hash": 3052744990600678000,
"line_mean": 38.3703703704,
"line_max": 83,
"alpha_frac": 0.5789275635,
"autogenerated": false,
"ratio":... |
"""Benchmarks for join methods on synthetic data"""
from py_stringmatching.tokenizer.delimiter_tokenizer import DelimiterTokenizer
from .data_generator import generate_table
from .data_generator import generate_tokens
from py_stringsimjoin.join.cosine_join import cosine_join
from py_stringsimjoin.join.dice_join imp... | {
"repo_name": "anhaidgroup/py_stringsimjoin",
"path": "benchmarks/asv_benchmarks/benchmark_join_synthetic.py",
"copies": "1",
"size": "3453",
"license": "bsd-3-clause",
"hash": -1840715786778391300,
"line_mean": 37.3666666667,
"line_max": 83,
"alpha_frac": 0.5479293368,
"autogenerated": false,
"r... |
"""Benchmarks for `numpy.lib`."""
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`.
When benchmarking the pad function it is useful to cover scenarios where
the ratio between the size of the input array and the output array differs
significantly ... | {
"repo_name": "charris/numpy",
"path": "benchmarks/benchmarks/bench_lib.py",
"copies": "8",
"size": "4974",
"license": "bsd-3-clause",
"hash": -1358183024858341000,
"line_mean": 34.7841726619,
"line_max": 79,
"alpha_frac": 0.5301568154,
"autogenerated": false,
"ratio": 3.6069615663524295,
"conf... |
"""Benchmarks for `numpy.lib`."""
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`.
When benchmarking the pad function it is useful to cover scenarios where
the ratio between the size ... | {
"repo_name": "ahaldane/numpy",
"path": "benchmarks/benchmarks/bench_lib.py",
"copies": "8",
"size": "4344",
"license": "bsd-3-clause",
"hash": 8195358425373003000,
"line_mean": 36.1282051282,
"line_max": 79,
"alpha_frac": 0.5237108656,
"autogenerated": false,
"ratio": 3.6139767054908485,
"conf... |
"""Benchmarks for Parsimonious
Run these with ``nosetests parsimonious/tests/bench.py``. They don't run during
normal test runs because they're not tests--they don't assert anything. Also,
they're a bit slow.
These differ from the ones in test_benchmarks in that these are meant to be
compared from revision to revisio... | {
"repo_name": "lucaswiman/parsimonious",
"path": "parsimonious/tests/benchmarks.py",
"copies": "4",
"size": "3239",
"license": "mit",
"hash": -9122618015670798000,
"line_mean": 33.8279569892,
"line_max": 98,
"alpha_frac": 0.5473911701,
"autogenerated": false,
"ratio": 3.907117008443908,
"config... |
""" Benchmarks for peak finding
Run all benchmarks with::
import dipy.reconst as dire
dire.bench()
If you have doctests enabled by default in nose (with a noserc file or
environment variable), and you have a numpy version <= 1.6.1, this will also run
the doctests, let's hope they pass.
Run this benchmark wi... | {
"repo_name": "samuelstjean/dipy",
"path": "dipy/reconst/benchmarks/bench_peaks.py",
"copies": "11",
"size": "1160",
"license": "bsd-3-clause",
"hash": 6698310819408343000,
"line_mean": 28,
"line_max": 80,
"alpha_frac": 0.6793103448,
"autogenerated": false,
"ratio": 3.2222222222222223,
"config_... |
"""Benchmarks for peak finding related functions."""
from .common import Benchmark, safe_import
with safe_import():
from scipy.signal import find_peaks, peak_prominences, peak_widths
from scipy.misc import electrocardiogram
class FindPeaks(Benchmark):
"""Benchmark `scipy.signal.find_peaks`.
Notes
... | {
"repo_name": "andyfaff/scipy",
"path": "benchmarks/benchmarks/peak_finding.py",
"copies": "13",
"size": "1519",
"license": "bsd-3-clause",
"hash": 8715723144285449000,
"line_mean": 26.6181818182,
"line_max": 75,
"alpha_frac": 0.6510862409,
"autogenerated": false,
"ratio": 3.4134831460674158,
"... |
"""Benchmarks for peak finding related functions."""
from __future__ import division, print_function, absolute_import
try:
from scipy.signal import find_peaks, peak_prominences, peak_widths
from scipy.misc import electrocardiogram
except ImportError:
pass
from .common import Benchmark
class FindPeaks(B... | {
"repo_name": "arokem/scipy",
"path": "benchmarks/benchmarks/peak_finding.py",
"copies": "14",
"size": "1586",
"license": "bsd-3-clause",
"hash": -1565967162530516500,
"line_mean": 25.8813559322,
"line_max": 75,
"alpha_frac": 0.6557377049,
"autogenerated": false,
"ratio": 3.4478260869565216,
"c... |
"""Benchmarks for peak finding related functions."""
try:
from scipy.signal import find_peaks, peak_prominences, peak_widths
from scipy.misc import electrocardiogram
except ImportError:
pass
from .common import Benchmark
class FindPeaks(Benchmark):
"""Benchmark `scipy.signal.find_peaks`.
Notes
... | {
"repo_name": "person142/scipy",
"path": "benchmarks/benchmarks/peak_finding.py",
"copies": "8",
"size": "1520",
"license": "bsd-3-clause",
"hash": 2386273458764969500,
"line_mean": 25.6666666667,
"line_max": 75,
"alpha_frac": 0.6506578947,
"autogenerated": false,
"ratio": 3.4234234234234235,
"... |
"""Benchmarks for polynomials over Galois fields. """
from __future__ import print_function, division
from sympy.polys.galoistools import gf_from_dict, gf_factor, gf_factor_sqf
from sympy.polys.domains import ZZ
from sympy import pi, nextprime
from sympy.core.compatibility import xrange
def gathen_poly(n, p, K):
... | {
"repo_name": "lidavidm/sympy",
"path": "sympy/polys/benchmarks/bench_galoispolys.py",
"copies": "23",
"size": "1559",
"license": "bsd-3-clause",
"hash": 3818070423964421000,
"line_mean": 22.2686567164,
"line_max": 74,
"alpha_frac": 0.6440025657,
"autogenerated": false,
"ratio": 2.259420289855072... |
"""Benchmarks for polynomials over Galois fields. """
from __future__ import print_function, division
from sympy.polys.galoistools import gf_from_dict, gf_factor_sqf
from sympy.polys.domains import ZZ
from sympy import pi, nextprime
from sympy.core.compatibility import range
def gathen_poly(n, p, K):
return gf_... | {
"repo_name": "Titan-C/sympy",
"path": "sympy/polys/benchmarks/bench_galoispolys.py",
"copies": "97",
"size": "1546",
"license": "bsd-3-clause",
"hash": 4516940236295681500,
"line_mean": 22.0746268657,
"line_max": 63,
"alpha_frac": 0.6429495472,
"autogenerated": false,
"ratio": 2.253644314868805,... |
"""Benchmarks for polynomials over Galois fields. """
from sympy.polys.galoistools import gf_from_dict, gf_factor, gf_factor_sqf
from sympy.polys.domains import ZZ
from sympy import pi, nextprime
def gathen_poly(n, p, K):
return gf_from_dict({n: K.one, 1: K.one, 0: K.one}, p, K)
def shoup_poly(n, p, K):
f ... | {
"repo_name": "amitjamadagni/sympy",
"path": "sympy/polys/benchmarks/bench_galoispolys.py",
"copies": "2",
"size": "1466",
"license": "bsd-3-clause",
"hash": 2261892914584564200,
"line_mean": 21.90625,
"line_max": 74,
"alpha_frac": 0.6336971351,
"autogenerated": false,
"ratio": 2.1913303437967113... |
""" Benchmarks for QuickBundles
Run all benchmarks with::
import dipy.segment as dipysegment
dipysegment.bench()
If you have doctests enabled by default in nose (with a noserc file or
environment variable), and you have a numpy version <= 1.6.1, this will also run
the doctests, let's hope they pass.
Run thi... | {
"repo_name": "Messaoud-Boudjada/dipy",
"path": "dipy/segment/benchmarks/bench_quickbundles.py",
"copies": "3",
"size": "3629",
"license": "bsd-3-clause",
"hash": 1972079553655023000,
"line_mean": 37.6063829787,
"line_max": 84,
"alpha_frac": 0.6814549463,
"autogenerated": false,
"ratio": 3.117697... |
""" Benchmarks for QuickBundles
Run all benchmarks with::
import dipy.segment as dipysegment
dipysegment.bench()
With Pytest, Run this benchmark with:
pytest -svv -c bench.ini /path/to/bench_quickbundles.py
"""
import numpy as np
from dipy.data import get_fnames
from dipy.io.streamline import load_tra... | {
"repo_name": "FrancoisRheaultUS/dipy",
"path": "dipy/segment/benchmarks/bench_quickbundles.py",
"copies": "9",
"size": "3385",
"license": "bsd-3-clause",
"hash": 8357850031020606000,
"line_mean": 35.0106382979,
"line_max": 77,
"alpha_frac": 0.6505169867,
"autogenerated": false,
"ratio": 3.302439... |
""" Benchmarks for sphere
Run all benchmarks with::
import dipy.core as dipycore
dipycore.bench()
With Pytest, Run this benchmark with:
pytest -svv -c bench.ini /path/to/bench_sphere.py
"""
import sys
import time
import dipy.core.sphere_stats as sphere_stats
import dipy.core.sphere as sphere
from mat... | {
"repo_name": "FrancoisRheaultUS/dipy",
"path": "dipy/core/benchmarks/bench_sphere.py",
"copies": "8",
"size": "3927",
"license": "bsd-3-clause",
"hash": -6125604339797630000,
"line_mean": 32.8534482759,
"line_max": 80,
"alpha_frac": 0.5734657499,
"autogenerated": false,
"ratio": 3.79420289855072... |
"""benchmarks for the scipy.sparse.linalg._expm_multiply module"""
from __future__ import division, print_function, absolute_import
import math
import numpy as np
try:
import scipy.linalg
from scipy.sparse.linalg import expm_multiply
except ImportError:
pass
from .common import Benchmark
def random_sp... | {
"repo_name": "aarchiba/scipy",
"path": "benchmarks/benchmarks/sparse_linalg_expm.py",
"copies": "12",
"size": "2267",
"license": "bsd-3-clause",
"hash": -8913389686218529000,
"line_mean": 28.4415584416,
"line_max": 74,
"alpha_frac": 0.6184384649,
"autogenerated": false,
"ratio": 3.20650636492220... |
"""benchmarks for the scipy.sparse.linalg._expm_multiply module"""
from __future__ import division, print_function, absolute_import
import time
import numpy as np
from numpy.testing import Tester, TestCase
import scipy.linalg
from scipy.sparse.linalg import expm_multiply
def random_sparse(m, n, nnz_per_row):
#... | {
"repo_name": "jsilter/scipy",
"path": "scipy/sparse/linalg/benchmarks/bench_expm_multiply.py",
"copies": "4",
"size": "2583",
"license": "bsd-3-clause",
"hash": -4928339210277549000,
"line_mean": 31.2875,
"line_max": 76,
"alpha_frac": 0.5598141696,
"autogenerated": false,
"ratio": 3.341526520051... |
"""benchmarks for the scipy.sparse.linalg._expm_multiply module"""
import math
import numpy as np
from .common import Benchmark, safe_import
with safe_import():
import scipy.linalg
from scipy.sparse.linalg import expm_multiply
def random_sparse_csr(m, n, nnz_per_row):
# Copied from the scipy.sparse benc... | {
"repo_name": "WarrenWeckesser/scipy",
"path": "benchmarks/benchmarks/sparse_linalg_expm.py",
"copies": "8",
"size": "2199",
"license": "bsd-3-clause",
"hash": 7774078226120516000,
"line_mean": 29.5416666667,
"line_max": 74,
"alpha_frac": 0.6143701683,
"autogenerated": false,
"ratio": 3.182344428... |
"""benchmarks for the scipy.sparse.linalg._expm_multiply module"""
import math
import numpy as np
try:
import scipy.linalg
from scipy.sparse.linalg import expm_multiply
except ImportError:
pass
from .common import Benchmark
def random_sparse_csr(m, n, nnz_per_row):
# Copied from the scipy.sparse be... | {
"repo_name": "pizzathief/scipy",
"path": "benchmarks/benchmarks/sparse_linalg_expm.py",
"copies": "8",
"size": "2201",
"license": "bsd-3-clause",
"hash": -7883570213659930000,
"line_mean": 28.3466666667,
"line_max": 74,
"alpha_frac": 0.6138119037,
"autogenerated": false,
"ratio": 3.1852387843704... |
""" Benchmarks for use with the airspeed velocity (asv) package.
(http://asv.readthedocs.io/en/latest/)
The calculate and equilibrium benchmarks were chosen from the examples for
simplicity. They may not be completely representative, but the purpose of the
benchmarks is to show how the performance changes over time. T... | {
"repo_name": "tkphd/pycalphad",
"path": "benchmarks/benchmarks.py",
"copies": "1",
"size": "23610",
"license": "mit",
"hash": -7240597539502619000,
"line_mean": 45.3850687623,
"line_max": 142,
"alpha_frac": 0.5808132147,
"autogenerated": false,
"ratio": 2.0360469127285272,
"config_test": false... |
""" Benchmarks for vec / val summation routine
Run benchmarks with::
import dipy.reconst as dire
dire.bench()
If you have doctests enabled by default in nose (with a noserc file or
environment variable), and you have a numpy version <= 1.6.1, this will also
run the doctests, let's hope they pass.
"""
import ... | {
"repo_name": "nilgoyyou/dipy",
"path": "dipy/reconst/benchmarks/bench_vec_val_sum.py",
"copies": "2",
"size": "1068",
"license": "bsd-3-clause",
"hash": -4993154212980516000,
"line_mean": 27.8648648649,
"line_max": 76,
"alpha_frac": 0.6245318352,
"autogenerated": false,
"ratio": 3.20720720720720... |
"""Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_path, lars_path_gram
from sklearn.linear_m... | {
"repo_name": "kevin-intel/scikit-learn",
"path": "benchmarks/bench_plot_lasso_path.py",
"copies": "2",
"size": "3982",
"license": "bsd-3-clause",
"hash": 3260115177108738000,
"line_mean": 33.6260869565,
"line_max": 78,
"alpha_frac": 0.5452034154,
"autogenerated": false,
"ratio": 3.69387755102040... |
"""Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_pat... | {
"repo_name": "maxlikely/scikit-learn",
"path": "benchmarks/bench_plot_lasso_path.py",
"copies": "4",
"size": "3944",
"license": "bsd-3-clause",
"hash": 320485548886661440,
"line_mean": 32.7094017094,
"line_max": 76,
"alpha_frac": 0.5418356998,
"autogenerated": false,
"ratio": 3.6825396825396823,... |
"""Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
import gc
import sys
from collections import defaultdict
from time import time
import numpy as np
from sklearn.datasets.samples_generator im... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scikit-learn-master/benchmarks/bench_plot_lasso_path.py",
"copies": "1",
"size": "3930",
"license": "mit",
"hash": -7159032529787220000,
"line_mean": 33.4736842105,
"line_max": 76,
"alpha_frac": 0.5424936387,
"autogenerated": false,
"r... |
"""Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
import gc
from time import time
import sys
import numpy as np
from collections import defaultdict
from sklearn.linear_model import lars_path
from sklearn.linear_model import lass... | {
"repo_name": "ominux/scikit-learn",
"path": "benchmarks/bench_plot_lasso_path.py",
"copies": "2",
"size": "3870",
"license": "bsd-3-clause",
"hash": -6045887020129062000,
"line_mean": 32.652173913,
"line_max": 76,
"alpha_frac": 0.5436692506,
"autogenerated": false,
"ratio": 3.7033492822966507,
... |
"""Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle
regression (:ref:`least_angle_regression`)
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
import gc
import sys
from time import time
import numpy as np
from sklearn.datasets.samples_g... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scikit-learn-master/benchmarks/bench_plot_omp_lars.py",
"copies": "1",
"size": "4446",
"license": "mit",
"hash": -7929549294478058000,
"line_mean": 35.4426229508,
"line_max": 76,
"alpha_frac": 0.5276653171,
"autogenerated": false,
"rat... |
"""Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle
regression (:ref:`least_angle_regression`)
The input data is mostly low rank but is a fat infinite tail.
"""
import gc
from time import time
import sys
import numpy as np
from sklearn.linear_model import lars_path, orthogonal_mp
from sklear... | {
"repo_name": "lucidfrontier45/scikit-learn",
"path": "benchmarks/bench_plot_omp_lars.py",
"copies": "1",
"size": "4316",
"license": "bsd-3-clause",
"hash": 5686714743878628000,
"line_mean": 34.6694214876,
"line_max": 76,
"alpha_frac": 0.5238646895,
"autogenerated": false,
"ratio": 3.4528,
"con... |
"""Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle
regression (:ref:`least_angle_regression`)
The input data is mostly low rank but is a fat infinite tail.
"""
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_path, lars_path_gram, orthogona... | {
"repo_name": "xuewei4d/scikit-learn",
"path": "benchmarks/bench_plot_omp_lars.py",
"copies": "14",
"size": "4492",
"license": "bsd-3-clause",
"hash": -886717657722620500,
"line_mean": 35.8196721311,
"line_max": 76,
"alpha_frac": 0.5258236866,
"autogenerated": false,
"ratio": 3.474091260634184,
... |
"""Benchmarks of Singular Value Decomposition (Exact and Approximate)
The data is mostly low rank but is a fat infinite tail.
"""
import gc
from collections import defaultdict
from time import time
import numpy as np
from scipy.linalg import svd
from sklearn.datasets.samples_generator import make_low_rank_matrix
from... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scikit-learn-master/benchmarks/bench_plot_svd.py",
"copies": "1",
"size": "2830",
"license": "mit",
"hash": 4790754122767280000,
"line_mean": 34.375,
"line_max": 75,
"alpha_frac": 0.5689045936,
"autogenerated": false,
"ratio": 3.773333... |
"""Benchmarks of Singular Value Decomposition (Exact and Approximate)
The data is mostly low rank but is a fat infinite tail.
"""
import gc
from time import time
import numpy as np
from collections import defaultdict
from scipy.linalg import svd
from sklearn.utils.extmath import randomized_svd
from sklearn.datasets i... | {
"repo_name": "huzq/scikit-learn",
"path": "benchmarks/bench_plot_svd.py",
"copies": "12",
"size": "2871",
"license": "bsd-3-clause",
"hash": 9202550876351333000,
"line_mean": 34.012195122,
"line_max": 75,
"alpha_frac": 0.5722744688,
"autogenerated": false,
"ratio": 3.7529411764705882,
"config_... |
"""Benchmarks of Singular Values Decomposition (Exact and Approximate)
The data is mostly low rank but is a fat infinite tail.
"""
import gc
from time import time
import numpy as np
from collections import defaultdict
from scipy.linalg import svd
from sklearn.utils.extmath import fast_svd
from sklearn.datasets.sample... | {
"repo_name": "ominux/scikit-learn",
"path": "benchmarks/bench_plot_svd.py",
"copies": "2",
"size": "2621",
"license": "bsd-3-clause",
"hash": -3164409710446459000,
"line_mean": 33.038961039,
"line_max": 80,
"alpha_frac": 0.57649752,
"autogenerated": false,
"ratio": 3.6251728907330567,
"config_... |
"""Benchmark some basic import use-cases.
The assumption is made that this benchmark is run in a fresh interpreter and
thus has no external changes made to import-related attributes in sys.
"""
from . import util
from .source import util as source_util
import decimal
import imp
import importlib
import os
import py_co... | {
"repo_name": "glwu/python-for-android",
"path": "python3-alpha/python3-src/Lib/importlib/test/benchmark.py",
"copies": "51",
"size": "5724",
"license": "apache-2.0",
"hash": 7178369578601972000,
"line_mean": 32.2790697674,
"line_max": 83,
"alpha_frac": 0.608839972,
"autogenerated": false,
"ratio... |
"""Benchmarks queue_selector implementations.
queue_selector is used to decide which queue a task worker should process
in a task processing cycle.
This provides a framework to simulate production task logs and to evaluate
different queue_selector implementation.
How it works
------------
It spawns N threads to simu... | {
"repo_name": "Nextdoor/ndkale",
"path": "kale/scripts/benchmark_queue_selector.py",
"copies": "1",
"size": "13875",
"license": "bsd-2-clause",
"hash": 8546512448828113000,
"line_mean": 35.038961039,
"line_max": 79,
"alpha_frac": 0.5904864865,
"autogenerated": false,
"ratio": 4.129464285714286,
... |
"""Benchmarks the parts of the system."""
import time
from control.command import Command
from control.simple_waypoint_generator import SimpleWaypointGenerator
from control.location_filter import LocationFilter
from control.telemetry import Telemetry
from control.test.dummy_driver import DummyDriver
from control.test... | {
"repo_name": "bskari/sparkfun-avc",
"path": "control/test/benchmark.py",
"copies": "1",
"size": "3105",
"license": "mit",
"hash": 755614114784942000,
"line_mean": 29.145631068,
"line_max": 88,
"alpha_frac": 0.6489533011,
"autogenerated": false,
"ratio": 3.866749688667497,
"config_test": false,... |
"""Benchmark summary related utilities."""
import json
from typing import Dict
def warn_sigint() -> None:
print('\x1b[1;101;92m')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('!!!! ... | {
"repo_name": "tesonet/pyhttp",
"path": "pyhttp/summary.py",
"copies": "1",
"size": "5057",
"license": "mit",
"hash": 647256459874753000,
"line_mean": 38.2015503876,
"line_max": 78,
"alpha_frac": 0.521653154,
"autogenerated": false,
"ratio": 3.6939371804236667,
"config_test": false,
"has_no_k... |
"""Benchmark the accuracy of a set of rotomaps vs a reference."""
import numpy
import mel.cmd.error
import mel.lib.common
import mel.lib.image
import mel.rotomap.detectmoles
import mel.rotomap.mask
import mel.rotomap.moles
def setup_parser(parser):
parser.add_argument(
"FROM_FRAMES",
type=mel.r... | {
"repo_name": "aevri/mel",
"path": "mel/cmddebug/benchautomark.py",
"copies": "1",
"size": "6435",
"license": "apache-2.0",
"hash": -3422012142721897500,
"line_mean": 31.175,
"line_max": 79,
"alpha_frac": 0.6076146076,
"autogenerated": false,
"ratio": 3.355057351407716,
"config_test": false,
... |
# Benchmark the calculation of Ramachandran phi/psi angles from a PDB file
import time
from Bio.PDB import PDBParser
from Bio.PDB.vectors import calc_dihedral
pdb_filepath = "data/1AKE.pdb"
parser = PDBParser()
struc = parser.get_structure("", pdb_filepath)
def ramachandran():
phi_angles = []
psi_angles = []... | {
"repo_name": "jgreener64/pdb-benchmarks",
"path": "Biopython/ramachandran.py",
"copies": "1",
"size": "1198",
"license": "mit",
"hash": 8395303759264193000,
"line_mean": 34.2352941176,
"line_max": 139,
"alpha_frac": 0.5934891486,
"autogenerated": false,
"ratio": 3.2378378378378376,
"config_tes... |
"""Benchmark the interpolation Situation Assessment algorithm
Produce Observation, Interpolation and Prediction figures
"""
# Copyright (c) 2020, CNRS-LAAS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... | {
"repo_name": "fire-rs-laas/fire-rs-saop",
"path": "python/fire_rs/monitoring/situation_assessment_interpolation_benchmark.py",
"copies": "1",
"size": "17492",
"license": "bsd-2-clause",
"hash": 8340822947772350000,
"line_mean": 46.2675675676,
"line_max": 114,
"alpha_frac": 0.657327463,
"autogenera... |
# Benchmark the pcg module of PySparse implementing
# a preconditioned conjugate gradient.
# Compare different preconditioners.
from pysparse.sparse import spmatrix
from pysparse.itsolvers.krylov import pcg
from pysparse.precon import precon
import numpy as np
import resource
import sys
import os
def usage():
pro... | {
"repo_name": "optimizers/pysparse",
"path": "examples/demo_pcg.py",
"copies": "1",
"size": "4382",
"license": "bsd-2-clause",
"hash": 1147145797202276400,
"line_mean": 30.0780141844,
"line_max": 98,
"alpha_frac": 0.556595162,
"autogenerated": false,
"ratio": 2.9789259007477904,
"config_test": ... |
"""Benchmark the scaling of alphacsc algorithm with multiple channels.
This script needs the following packages:
conda install pandas
conda install -c conda-forge pyfftw
pip install alphacsc/other/sporco
This script performs the computations and save the results in a pickled file
`figures/methods_scaling_... | {
"repo_name": "alphacsc/alphacsc",
"path": "benchmarks/scaling_channels_run.py",
"copies": "1",
"size": "8514",
"license": "bsd-3-clause",
"hash": -4449001629049968600,
"line_mean": 34.1818181818,
"line_max": 80,
"alpha_frac": 0.6075875029,
"autogenerated": false,
"ratio": 3.2645705521472395,
"... |
"""Benchmark the scaling of alphacsc algorithm with multiple channels.
This script requires `pandas` which can be installed with `pip install pandas`.
This script plots the results saved by the script scaling_channels_run.py,
which should be run beforehand.
"""
import matplotlib
import matplotlib.pyplot as plt
import... | {
"repo_name": "alphacsc/alphacsc",
"path": "benchmarks/scaling_channels_plot.py",
"copies": "1",
"size": "5965",
"license": "bsd-3-clause",
"hash": 3667693234373986000,
"line_mean": 35.3719512195,
"line_max": 79,
"alpha_frac": 0.5904442582,
"autogenerated": false,
"ratio": 3.4360599078341014,
"... |
"""Benchmark the solve_toeplitz solver (Levinson recursion)
"""
from __future__ import division, absolute_import, print_function
import numpy as np
try:
import scipy.linalg
except ImportError:
pass
from .common import Benchmark
class SolveToeplitz(Benchmark):
params = (
('float64', 'complex128'... | {
"repo_name": "sriki18/scipy",
"path": "benchmarks/benchmarks/linalg_solve_toeplitz.py",
"copies": "106",
"size": "1170",
"license": "bsd-3-clause",
"hash": 660097537348038300,
"line_mean": 24.4347826087,
"line_max": 65,
"alpha_frac": 0.5692307692,
"autogenerated": false,
"ratio": 3.3524355300859... |
"""Benchmark the solve_toeplitz solver (Levinson recursion)
"""
from __future__ import division, print_function, absolute_import
import time
import numpy as np
from numpy.testing import assert_array_almost_equal
import scipy.linalg
def bench_solve_toeplitz():
random = np.random.RandomState(1234)
print()
... | {
"repo_name": "dch312/scipy",
"path": "scipy/linalg/benchmarks/bench_solve_toeplitz.py",
"copies": "2",
"size": "1825",
"license": "bsd-3-clause",
"hash": -3014958931602242000,
"line_mean": 34.7843137255,
"line_max": 76,
"alpha_frac": 0.4849315068,
"autogenerated": false,
"ratio": 3.8100208768267... |
"""Benchmark the solve_toeplitz solver (Levinson recursion)
"""
import numpy as np
from .common import Benchmark, safe_import
with safe_import():
import scipy.linalg
class SolveToeplitz(Benchmark):
params = (
('float64', 'complex128'),
(100, 300, 1000),
('toeplitz', 'generic')
)
... | {
"repo_name": "scipy/scipy",
"path": "benchmarks/benchmarks/linalg_solve_toeplitz.py",
"copies": "13",
"size": "1102",
"license": "bsd-3-clause",
"hash": 773360547513393400,
"line_mean": 25.8780487805,
"line_max": 65,
"alpha_frac": 0.558076225,
"autogenerated": false,
"ratio": 3.309309309309309,
... |
"""Benchmark the solve_toeplitz solver (Levinson recursion)
"""
import numpy as np
try:
import scipy.linalg
except ImportError:
pass
from .common import Benchmark
class SolveToeplitz(Benchmark):
params = (
('float64', 'complex128'),
(100, 300, 1000),
('toeplitz', 'generic')
)... | {
"repo_name": "e-q/scipy",
"path": "benchmarks/benchmarks/linalg_solve_toeplitz.py",
"copies": "8",
"size": "1104",
"license": "bsd-3-clause",
"hash": 5885640453492301000,
"line_mean": 24.0909090909,
"line_max": 65,
"alpha_frac": 0.5570652174,
"autogenerated": false,
"ratio": 3.315315315315315,
... |
"""Benchmark the turnaround time starting a debugger and run to the breakpoint with lldb vs. gdb."""
from __future__ import print_function
import sys
import lldb
from lldbsuite.test.lldbbench import *
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import configurati... | {
"repo_name": "apple/llvm-project",
"path": "lldb/test/API/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py",
"copies": "8",
"size": "4103",
"license": "apache-2.0",
"hash": -7200556962026947000,
"line_mean": 30.5615384615,
"line_max": 100,
"alpha_frac": 0.5632464051,
"autogenerated": ... |
"""Benchmark the warping/fusion Situation Assessment algorithm
Produce Observation, Interpolation and Prediction figures
"""
# Copyright (c) 2020, CNRS-LAAS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following cond... | {
"repo_name": "fire-rs-laas/fire-rs-saop",
"path": "python/fire_rs/monitoring/situation_assessment_warping_benchmark.py",
"copies": "1",
"size": "30837",
"license": "bsd-2-clause",
"hash": 7038248234785909000,
"line_mean": 47.0218068536,
"line_max": 114,
"alpha_frac": 0.5919234512,
"autogenerated":... |
# Benchmark three methods of using PyTables with multiple processes, where data
# is read from a PyTables file in one process and then sent to another
#
# 1. using multiprocessing.Pipe
# 2. using a memory mapped file that's shared between two processes, passed as
# out argument to tables.Array.read.
# 3. using a Uni... | {
"repo_name": "cpcloud/PyTables",
"path": "examples/multiprocess_access_benchmarks.py",
"copies": "1",
"size": "9329",
"license": "bsd-3-clause",
"hash": -3220285190543884000,
"line_mean": 38.8717948718,
"line_max": 80,
"alpha_frac": 0.6540893986,
"autogenerated": false,
"ratio": 3.92965459140690... |
"""Benchmark timing class"""
__author__ = "Keith Hughitt and Steven Christe"
__email__ = "keith.hughitt@nasa.gov"
import time
import datetime
import platform
import math
from optparse import OptionParser
from optparse import IndentedHelpFormatter
class BenchmarkTimer:
"""A simple benchmark timer class"""
def ... | {
"repo_name": "mjm159/sunpy",
"path": "benchmarks/benchmark.py",
"copies": "2",
"size": "2473",
"license": "bsd-2-clause",
"hash": -4910677060551514000,
"line_mean": 31.9733333333,
"line_max": 79,
"alpha_frac": 0.5487262434,
"autogenerated": false,
"ratio": 4.040849673202614,
"config_test": tru... |
"""Benchmark to help choosing the best chunksize so as to optimize the access
time in random lookups."""
from __future__ import print_function
from time import time
import os
import subprocess
import numpy
import tables
# Constants
NOISE = 1e-15 # standard deviation of the noise compared with actual values
rdm_co... | {
"repo_name": "tp199911/PyTables",
"path": "bench/lookup_bench.py",
"copies": "13",
"size": "7930",
"license": "bsd-3-clause",
"hash": 8236686059255879000,
"line_mean": 31.9045643154,
"line_max": 137,
"alpha_frac": 0.5407313997,
"autogenerated": false,
"ratio": 3.6815227483751163,
"config_test"... |
__author__ = 'Suryajith Chillara'
__license__ = 'Modified BSD licence'
import sys
import urllib
import urllib2
from ConfigParser import ConfigParser
def main() :
if len(sys.argv) == 2 :
filename = sys.argv[1]
config = ConfigParser()
config.read(['../project_config'])
url = con... | {
"repo_name": "ankeshanand/benchmark",
"path": "scripts/benchmark_upload.py",
"copies": "1",
"size": "2614",
"license": "bsd-2-clause",
"hash": 6034693573365166000,
"line_mean": 28.7045454545,
"line_max": 73,
"alpha_frac": 0.681331293,
"autogenerated": false,
"ratio": 4.116535433070866,
"config... |
#bench n_queens(9)
#runas n_queens(6)
#pythran export n_queens(int)
# Pure-Python implementation of itertools.permutations().
def permutations(iterable, r=None):
"""permutations(range(3), 2) --> (0,1) (0,2) (1,0) (1,2) (2,0) (2,1)"""
pool = tuple(iterable)
n = len(pool)
if r is None:
r = n
... | {
"repo_name": "serge-sans-paille/pythran",
"path": "pythran/tests/cases/nqueens.py",
"copies": "1",
"size": "1624",
"license": "bsd-3-clause",
"hash": 2803440134372240400,
"line_mean": 30.8431372549,
"line_max": 80,
"alpha_frac": 0.5350985222,
"autogenerated": false,
"ratio": 3.3484536082474228,
... |
"""bencook_info 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')
Clas... | {
"repo_name": "blcook223/bencook.info",
"path": "bencook_info/urls.py",
"copies": "1",
"size": "1396",
"license": "isc",
"hash": 5611727957558174000,
"line_mean": 33.0487804878,
"line_max": 77,
"alpha_frac": 0.6919770774,
"autogenerated": false,
"ratio": 3.49874686716792,
"config_test": false,
... |
"""ben-csv - Export campaign CSV
Usage:
ben-csv [-v | -vv] [-l LOGFILE] [-o CSVFILE] [-f FIELDS] CAMPAIGN-DIR
ben-csv [-v | -vv] -p CAMPAIGN-DIR
ben-csv (-h | --help)
ben-csv --version
Options:
-o --output=CSVFILE CSV file
-f --fields=FIELDS comma-separated list of fields that should be output
... | {
"repo_name": "tristan0x/hpcbench",
"path": "hpcbench/cli/bencsv.py",
"copies": "1",
"size": "1112",
"license": "mit",
"hash": 3690908542307731000,
"line_mean": 30.7714285714,
"line_max": 78,
"alpha_frac": 0.6106115108,
"autogenerated": false,
"ratio": 3.57556270096463,
"config_test": false,
... |
"""ben-doc - Generate a campaign report
Usage:
ben-doc [-t TEMPLATE] [-o FILE] [-v | -vv] [-l LOGFILE] CAMPAIGN-DIR
ben-doc (-h | --help)
ben-doc --version
Options:
-o, --output FILE Write report to specified file
instead of standard output
-t, --template TEMPLATE Specify a c... | {
"repo_name": "tristan0x/hpcbench",
"path": "hpcbench/cli/bendoc.py",
"copies": "1",
"size": "1128",
"license": "mit",
"hash": -1306770943645181400,
"line_mean": 30.3333333333,
"line_max": 70,
"alpha_frac": 0.6223404255,
"autogenerated": false,
"ratio": 3.863013698630137,
"config_test": false,
... |
""" bends with grating couplers inside the spiral
maybe: need to add grating coupler loopback as well
"""
from typing import Optional, Tuple
import numpy as np
from numpy import float64
import pp
from pp.cell import cell
from pp.component import Component
from pp.components import straight
from pp.components.bend_cir... | {
"repo_name": "gdsfactory/gdsfactory",
"path": "pp/components/spiral_external_io.py",
"copies": "1",
"size": "4754",
"license": "mit",
"hash": 3971186031992811500,
"line_mean": 29.0886075949,
"line_max": 85,
"alpha_frac": 0.6024400505,
"autogenerated": false,
"ratio": 2.9058679706601467,
"confi... |
""" bends with grating couplers inside the spiral
maybe: need to add grating coupler loopback as well
"""
import numpy as np
import pp
from pp.components.bend_circular import bend_circular
from pp.components.bend_circular import bend_circular180
from pp.components.euler.bend_euler import bend_euler90, bend_euler180
fr... | {
"repo_name": "psiq/gdsfactory",
"path": "pp/components/spiral_inner_io.py",
"copies": "1",
"size": "11189",
"license": "mit",
"hash": 4188840998119846400,
"line_mean": 28.9973190349,
"line_max": 90,
"alpha_frac": 0.5805702029,
"autogenerated": false,
"ratio": 2.8021537690959177,
"config_test":... |
# Ben Eggers <ben.eggers36@gmail.com>
#
# A simple, gradient-descent-based linear system solver. The idea is as follows:
#
# We are given a matrix A and a vector b, and want to find x such that Ax = b.
#
# We turn this into an optimization problem, with our objective function f(x) =
# the A-norm of the error (Ax - b). ... | {
"repo_name": "BenedictEggers/gradient_descent",
"path": "solver.py",
"copies": "1",
"size": "2333",
"license": "mit",
"hash": 6963847684945444000,
"line_mean": 30.527027027,
"line_max": 80,
"alpha_frac": 0.6108015431,
"autogenerated": false,
"ratio": 2.9053549190535493,
"config_test": false,
... |
# Ben Eggers
# Much of this code was borrowed, which means you can steal it, too.
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol
from twisted.python import log
import time, sys
class Yobot(irc.IRCClient):
nickname = "yobot"
def __init__(self):
self.... | {
"repo_name": "BenedictEggers/yobot",
"path": "yobot.py",
"copies": "1",
"size": "1543",
"license": "mit",
"hash": -5736422677408402000,
"line_mean": 25.1525423729,
"line_max": 69,
"alpha_frac": 0.6221646144,
"autogenerated": false,
"ratio": 3.588372093023256,
"config_test": false,
"has_no_ke... |
"""Bengali is an Indic language which uses Bengali script, closely related to Devanagri script, both
deriving from Brahmi script. Bengali script is also used to write other languages, including
Assamese, Daphla, Garo, Hallam, Khasi, Manipuri, Mizo, Munda, Naga, Rian and Santali
Bengali character set is divided into 21... | {
"repo_name": "TylerKirby/cltk",
"path": "cltk/corpus/bengali/alphabet.py",
"copies": "2",
"size": "1305",
"license": "mit",
"hash": 560313027472249150,
"line_mean": 48.7826086957,
"line_max": 186,
"alpha_frac": 0.6104803493,
"autogenerated": false,
"ratio": 1.8801313628899836,
"config_test": f... |
"""
The common Django settings for the Bengfort.com site
Django settings for bengfort project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://doc... | {
"repo_name": "bbengfort/bengfort.com",
"path": "bengfort/settings/base.py",
"copies": "1",
"size": "8277",
"license": "apache-2.0",
"hash": -3358275759905467000,
"line_mean": 29.8843283582,
"line_max": 81,
"alpha_frac": 0.5730337079,
"autogenerated": false,
"ratio": 4.180303030303031,
"config_... |
"""
Django settings for Bengfort.com in development
"""
##########################################################################
## Imports
##########################################################################
import os
from .base import *
#####################################################################... | {
"repo_name": "bbengfort/bengfort.com",
"path": "bengfort/settings/development.py",
"copies": "1",
"size": "1463",
"license": "apache-2.0",
"hash": -5964778996522165000,
"line_mean": 27.6862745098,
"line_max": 74,
"alpha_frac": 0.4846206425,
"autogenerated": false,
"ratio": 4.168091168091168,
"... |
"""
Testing settings to enable testing on Travis with Django tests.
"""
##########################################################################
## Imports
##########################################################################
import os
from .base import *
#####################################################... | {
"repo_name": "bbengfort/bengfort.com",
"path": "bengfort/settings/testing.py",
"copies": "1",
"size": "1826",
"license": "apache-2.0",
"hash": -7984288150650009000,
"line_mean": 30.4827586207,
"line_max": 78,
"alpha_frac": 0.5120481928,
"autogenerated": false,
"ratio": 4.33729216152019,
"confi... |
"""
Global tags for use across the Bengfort.com project
"""
##########################################################################
## Imports and Module Constants
##########################################################################
from django import template
# Create hook to template library
register = t... | {
"repo_name": "bbengfort/bengfort.com",
"path": "home/templatetags/bengfort_tags.py",
"copies": "1",
"size": "1765",
"license": "apache-2.0",
"hash": 7392218662314534000,
"line_mean": 31.0909090909,
"line_max": 74,
"alpha_frac": 0.5144475921,
"autogenerated": false,
"ratio": 4.479695431472082,
... |
"""
Test the project level utilities and helper functions.
"""
##########################################################################
## Imports
##########################################################################
import unittest
from bengfort.utils import *
#############################################... | {
"repo_name": "bbengfort/bengfort.com",
"path": "bengfort/tests/test_utils.py",
"copies": "1",
"size": "1668",
"license": "apache-2.0",
"hash": 6158692801238374000,
"line_mean": 26.3442622951,
"line_max": 92,
"alpha_frac": 0.4856115108,
"autogenerated": false,
"ratio": 3.8256880733944953,
"conf... |
"""
Application URL definition and routers.
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... | {
"repo_name": "bbengfort/bengfort.com",
"path": "bengfort/urls.py",
"copies": "1",
"size": "2888",
"license": "apache-2.0",
"hash": 5402260850262493000,
"line_mean": 30.3913043478,
"line_max": 80,
"alpha_frac": 0.5709833795,
"autogenerated": false,
"ratio": 4.349397590361446,
"config_test": fal... |
# Benjamin Chu
# Python Script - Test Case #2
# Using the World of Warcraft Item Set Web API,
# retrieve data for 'Finkle's Lava Dredger' and
# confirm that request and response time with the API is acceptable.
import requests
import json
item_id = 18803 # Finkle's Lava Dredger Item ID
# API Urls for individual reg... | {
"repo_name": "blenderben/wowapitest",
"path": "testcase2.py",
"copies": "1",
"size": "3311",
"license": "mit",
"hash": 7505662065549079000,
"line_mean": 28.3097345133,
"line_max": 79,
"alpha_frac": 0.7019027484,
"autogenerated": false,
"ratio": 2.6831442463533226,
"config_test": true,
"has_n... |
# Benjamin Chu
# Python Script - Test Case #3
# Using the World of Warcraft Item Set Web API,
# retrieve data for 'Finkle's Lava Dredger' 10,000+
# times to confirm throttling.
import requests
import json
item_id = 18803 # Finkle's Lava Dredger Item ID
# API Urls for individual regions
api_us_url = "http://us.battl... | {
"repo_name": "blenderben/wowapitest",
"path": "testcase3.py",
"copies": "1",
"size": "1710",
"license": "mit",
"hash": -6032845729046494000,
"line_mean": 24.9090909091,
"line_max": 93,
"alpha_frac": 0.7011695906,
"autogenerated": false,
"ratio": 2.7759740259740258,
"config_test": false,
"has... |
# Benjamin Chu
# Python Script - Test Case #4
# Using the World of Warcraft Item Set Web API,
# retrieve data for a non-existent item and
# confirm the API fails gracefully.
import requests
import json
item_id = 1 # non-existant item id / item
# API Urls for individual regions
api_us_url = "http://us.battle.net/api... | {
"repo_name": "blenderben/wowapitest",
"path": "testcase4.py",
"copies": "1",
"size": "1260",
"license": "mit",
"hash": 7574877871278711000,
"line_mean": 24.7346938776,
"line_max": 71,
"alpha_frac": 0.6865079365,
"autogenerated": false,
"ratio": 2.763157894736842,
"config_test": false,
"has_n... |
# Benjamin Chu
# Python Script - Test Case #5
# Using the World of Warcraft Item Set Web API,
# retrieve data for a non-existent item and
# confirm the API fails gracefully.
import requests
import json
item_id = 123456789012345678901234567890 # item id out of unsigned integer bounds
# API Urls for individual region... | {
"repo_name": "blenderben/wowapitest",
"path": "testcase5.py",
"copies": "1",
"size": "1331",
"license": "mit",
"hash": -1354218090945082400,
"line_mean": 24.1320754717,
"line_max": 81,
"alpha_frac": 0.7002253944,
"autogenerated": false,
"ratio": 2.8501070663811565,
"config_test": false,
"has... |
# Benjamin Chu
# Python Script - Test Case #6
# Using the World of Warcraft Item Set Web API,
# retrieve the item ids for all items in the
# "Deep Earth Vestments" set and verify that
# the item id for each item matches that which
# is returned by the Item Web API.
import requests
import json
setitem_id = 1060 # ite... | {
"repo_name": "blenderben/wowapitest",
"path": "testcase6.py",
"copies": "1",
"size": "2003",
"license": "mit",
"hash": -8174334848158223000,
"line_mean": 35.4363636364,
"line_max": 87,
"alpha_frac": 0.6944583125,
"autogenerated": false,
"ratio": 2.8092566619915846,
"config_test": false,
"has... |
#Benjamin Ramirez August 9, 2016
#making class to keep track of encoder ticks on wheels
import RPi.GPIO as GPIO
class Encoder(object):
def __init__ (self, a_pin_num, b_pin_num):
self.a_pin = a_pin_num
self.b_pin = b_pin_num
GPIO.setmode(GPIO.BCM)
GPIO.setup(s... | {
"repo_name": "benji-b-rmz/rpi_robot",
"path": "sensors/encoders.py",
"copies": "1",
"size": "1344",
"license": "mit",
"hash": 3908169103302383600,
"line_mean": 24.8461538462,
"line_max": 74,
"alpha_frac": 0.5595238095,
"autogenerated": false,
"ratio": 3.27007299270073,
"config_test": false,
... |
#Benjamin Ramirez
#August 4, 2016
#Writing a class for the HC_SRO4 ultrasonic range finder
#Datasheet: http://www.micropik.com/PDF/HCSR04.pdf
import time
import RPi.GPIO as GPIO
import atexit
"""Creating a range detecting object for use with HC-SRO4 module """
class ranger(object):
def __init__(self, trig_pi... | {
"repo_name": "benji-b-rmz/rpi_robot",
"path": "sensors/rangers.py",
"copies": "1",
"size": "1758",
"license": "mit",
"hash": -8882545670497726000,
"line_mean": 29.8421052632,
"line_max": 104,
"alpha_frac": 0.5961319681,
"autogenerated": false,
"ratio": 3.8300653594771243,
"config_test": false,... |
#Benjamin Ramirez
#August 9, 2016
#using the encoders for odometry, pose(x, y, theta)
import sys, os, time
from actuators import dcmotors
from sensors import encoders
import RPi.GPIO as GPIO
import math
FORWARD = 1
BACK = 2
left = 0.0
right = 1000.0
bottom = 0.0
top = 1000.0
#important robot dimensions
TPR = 1632.67... | {
"repo_name": "benji-b-rmz/rpi_robot",
"path": "dead_reckoning.py",
"copies": "1",
"size": "1903",
"license": "mit",
"hash": -8216967549723792000,
"line_mean": 27.4029850746,
"line_max": 113,
"alpha_frac": 0.5848660011,
"autogenerated": false,
"ratio": 3.1663893510815306,
"config_test": false,
... |
# Benjamin Shih benjshih@gmail.com
# Incorporated one-dimensional damping using closed form differential equation solutions.
# Original mass-spring vibration.py code by Stefan van der Walt <stefan@sun.ac.za>, 2013
# License: CC0
# https://github.com/stefanv/vibrations/blob/master/vibrations.py
from __future__ import ... | {
"repo_name": "janMaha/CompanionCube_SAC2015",
"path": "dockingAnim1.py",
"copies": "1",
"size": "8000",
"license": "mit",
"hash": -4830584606730413000,
"line_mean": 33.7826086957,
"line_max": 137,
"alpha_frac": 0.573375,
"autogenerated": false,
"ratio": 2.888086642599278,
"config_test": false,... |
# Ben Jones bjones99@gatech.edu
# Georgia Tech Fall 2014
#
# tcpdump.py: interface to tcpdump to stop and start captures and do
# second passes over existing pcaps
from base64 import b64encode
import logging
import os
import tempfile
# local imports
import centinel
from centinel import command
class Tcpdump():
... | {
"repo_name": "Ashish1805/centinel",
"path": "centinel/primitives/tcpdump.py",
"copies": "4",
"size": "2806",
"license": "mit",
"hash": 8571910394591309000,
"line_mean": 32.0117647059,
"line_max": 75,
"alpha_frac": 0.6033499644,
"autogenerated": false,
"ratio": 3.9745042492917846,
"config_test"... |
# Ben Jones
# Fall 2013
# htpt
# frame.py: ensure in-order delivery of frames for the htpt project
import threading
import struct
#from random import randint
from buffers import Buffer
from constants import *
class FramingException(Exception):
pass
class SeqNumber():
# initialize this to -1 so that the first ... | {
"repo_name": "ben-jones/facade",
"path": "htpt/frame.py",
"copies": "2",
"size": "7528",
"license": "mit",
"hash": -6463894716996455000,
"line_mean": 27.5151515152,
"line_max": 132,
"alpha_frac": 0.6865037194,
"autogenerated": false,
"ratio": 3.9187922956793337,
"config_test": false,
"has_no... |
# Ben Jones
# Georgia Tech Fall 2013
# url-encode.py: collection of functions to hide small chunks of data in urls
from base64 import urlsafe_b64encode, urlsafe_b64decode
import binascii
import numpy as np
from random import choice, randint
import re
from scipy.stats import entropy
AVAILABLE_TYPES=['market', 'baidu',... | {
"repo_name": "ben-jones/facade",
"path": "htpt/urlEncode.py",
"copies": "1",
"size": "18591",
"license": "mit",
"hash": -3444538245262834000,
"line_mean": 29.0339256866,
"line_max": 95,
"alpha_frac": 0.6636544565,
"autogenerated": false,
"ratio": 3.407441348973607,
"config_test": false,
"has... |
# Ben Jones
# Georgia Tech Fall 2013
# url-encode.py: collection of functions to hide small chunks of data in urls
import binascii
import re
from base64 import urlsafe_b64encode, urlsafe_b64decode
from random import choice, randint
AVAILABLE_TYPES=['market', 'baidu', 'google']
BYTES_PER_COOKIE=30
LOOKUP_TABLE = ['a',... | {
"repo_name": "gsathya/htpt",
"path": "htpt/urlEncode.py",
"copies": "1",
"size": "13455",
"license": "mit",
"hash": 2644744325238767000,
"line_mean": 28.9,
"line_max": 95,
"alpha_frac": 0.6709773318,
"autogenerated": false,
"ratio": 3.523173605655931,
"config_test": false,
"has_no_keywords":... |
#Ben Reichert, 1/25/13, 1:51am,
#irc handle: benji
#simple bot with little to no functionality
#but demonstrates a simple python bot
import socket
network = 'iss.cat.pdx.edu'
port = 6667
irc = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
irc.connect ( ( network, port ) )
print irc.recv ( 4096 )
irc.send ( '... | {
"repo_name": "benjipdx/benjibot",
"path": "benjibot.py",
"copies": "2",
"size": "1141",
"license": "mit",
"hash": -3256093405955925500,
"line_mean": 37.0333333333,
"line_max": 114,
"alpha_frac": 0.6231375986,
"autogenerated": false,
"ratio": 2.5640449438202246,
"config_test": false,
"has_no_... |
"""ben-sh - Execute a campaign
Usage:
ben-sh [-v | -vv] [-r TAG] [-e NODES] [-n HOST] [-o OUTDIR] [-l LOGFILE]
[--campaign-path-fd FD]
[-g] CAMPAIGN_FILE
ben-sh (-h | --help)
ben-sh --version
Options:
-n HOST Specify node name. Default is localhost
-o --output-dir=OUTDIR ... | {
"repo_name": "tristan0x/hpcbench",
"path": "hpcbench/cli/bensh.py",
"copies": "1",
"size": "2206",
"license": "mit",
"hash": 8820275004607866000,
"line_mean": 35.1639344262,
"line_max": 79,
"alpha_frac": 0.577969175,
"autogenerated": false,
"ratio": 3.9182948490230904,
"config_test": false,
... |
""" Benstalkd Worker class
An easy way to develop scripts for handling jobs put on a beanstalkd work queue server.
Beanstalk is a simple, fast workqueue service. Its interface is generic,
but was originally designed for reducing the latency of page views in high-volume
web applications by running time-consuming ta... | {
"repo_name": "andreisavu/beanstalkw",
"path": "beanstalkw.py",
"copies": "1",
"size": "3771",
"license": "apache-2.0",
"hash": -3197329993047785000,
"line_mean": 26.7279411765,
"line_max": 95,
"alpha_frac": 0.6170776982,
"autogenerated": false,
"ratio": 4.0811688311688314,
"config_test": false... |
# The problem this program tries to solve is from the page:
# http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/
# Description: The program Bentley asked Knuth to write:
# Read a file of text, determine the n most frequently
# used words, and print out a sorted list of those words
# along with their fre... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578851_BentleyKnuth_problem/recipe-578851.py",
"copies": "1",
"size": "2041",
"license": "mit",
"hash": -6429758952071349000,
"line_mean": 24.5125,
"line_max": 81,
"alpha_frac": 0.6727094561,
"autogenerated": false,
"ratio": 2.685526315789... |
# BentleyOttmann sweep-line implementation
# (for finding all intersections in a set of line segments)
__all__ = (
"isect_segments",
"isect_polygon",
# same as above but includes segments with each intersections
"isect_segments_include_segments",
"isect_polygon_include_segments",
# for testin... | {
"repo_name": "aleju/ImageAugmenter",
"path": "imgaug/external/poly_point_isect_py2py3.py",
"copies": "2",
"size": "42628",
"license": "mit",
"hash": 2004718613281537800,
"line_mean": 31.8919753086,
"line_max": 113,
"alpha_frac": 0.513465328,
"autogenerated": false,
"ratio": 3.800641940085592,
... |
"""ben-tpl Generate HPCBench related templates
Usage:
ben-tpl [-v | -vv ] [-l LOGFILE] (benchmark) [-i ] [-g|-o DIR] <FILE>
ben-tpl (-h | --help)
ben-tpl --version
Options:
-g Generate configuration template
-i, --interactive
-h --help Show this screen
-o <DIR>, --output-dir <DIR>... | {
"repo_name": "tristan0x/hpcbench",
"path": "hpcbench/cli/bentpl.py",
"copies": "1",
"size": "1318",
"license": "mit",
"hash": 3730510710674496000,
"line_mean": 28.2888888889,
"line_max": 87,
"alpha_frac": 0.6092564492,
"autogenerated": false,
"ratio": 3.7443181818181817,
"config_test": false,
... |
# BENUTZUNG:
#
# python chrome_dl.py "<AuswahlKl>" "<optional: AbwahlKurseJG11>"
# AuswahlKl: Inhalt des Cookies "AuswahlKl" (einsehbar unter Firefox: SHIFT + F5 -> Storage -> Cookies -> Value des Cookies 'AuswahlKl')
# AbwahlKurseJG11: Inhalt des Cookies "AuswahlKl" (einsehbar unter Firefox: SHIFT + F5 -> Storage -> C... | {
"repo_name": "t0simon/vp-readable",
"path": "chrome_dl.py",
"copies": "1",
"size": "1883",
"license": "mit",
"hash": 119519606998006510,
"line_mean": 34.5283018868,
"line_max": 148,
"alpha_frac": 0.7169410515,
"autogenerated": false,
"ratio": 2.6372549019607843,
"config_test": false,
"has_no... |
# BENUTZUNG:
#
# python firefox_dl.py "<AuswahlKl>" "<optional: AbwahlKurseJG11>"
# AuswahlKl: Inhalt des Cookies "AuswahlKl" (einsehbar unter Firefox: SHIFT + F5 -> Storage -> Cookies -> Value des Cookies 'AuswahlKl')
# AbwahlKurseJG11: Inhalt des Cookies "AuswahlKl" (einsehbar unter Firefox: SHIFT + F5 -> Storage -> ... | {
"repo_name": "t0simon/vp-readable",
"path": "firefox_dl.py",
"copies": "1",
"size": "1766",
"license": "mit",
"hash": -7859595914380811000,
"line_mean": 33.6274509804,
"line_max": 148,
"alpha_frac": 0.7066817667,
"autogenerated": false,
"ratio": 2.552023121387283,
"config_test": false,
"has_... |
"""ben-wait - Wait for asynchronous processes
Usage:
ben-wait [-v | -vv] [--interval=<seconds>] [-l LOGFILE]
[--silent] [--format=<format>]
CAMPAIGN-DIR
ben-wait (-h | --help)
ben-wait --version
Options:
-l --log=LOGFILE Specify an option logfile to write to.
-n <sec... | {
"repo_name": "tristan0x/hpcbench",
"path": "hpcbench/cli/benwait.py",
"copies": "1",
"size": "4727",
"license": "mit",
"hash": 2426477409022789000,
"line_mean": 31.6,
"line_max": 85,
"alpha_frac": 0.5798603766,
"autogenerated": false,
"ratio": 4.168430335097002,
"config_test": false,
"has_no... |
#Beolvasni a filet
f = open('sample.txt', 'r').readlines() # Megnyitja a filet
# Szevenciankent beolvas
l = []
s = ""
for i in range (len(f)):
if i != 0:
if f[i][0] == ">":
l.append(s)
s = ""
else:
s += f[i]
if i == len(f)-1:
l.append... | {
"repo_name": "amidoimidazol/bio_info",
"path": "Rosalind.info Problems/Finding a shared motif.py",
"copies": "1",
"size": "1374",
"license": "mit",
"hash": 1004907572381342700,
"line_mean": 19.8181818182,
"line_max": 60,
"alpha_frac": 0.4861717613,
"autogenerated": false,
"ratio": 2.904862579281... |
"""Beo's famous dance"""
from time import sleep
from Movements import Movements
from Eyes import Eyes
from Audio import Audio
from SensorTouch import SensorTouch
SENSORTOUCH = SensorTouch()
AUDIO = Audio()
EYES = Eyes()
MOVEMENTS = Movements()
def update_touch(dancing):
"""Checks to see if the sensor is being tou... | {
"repo_name": "CruyeEblon/Programming_Classes",
"path": "Dance/dance.py",
"copies": "1",
"size": "1552",
"license": "mit",
"hash": -4870304205712078000,
"line_mean": 25.7586206897,
"line_max": 54,
"alpha_frac": 0.5766752577,
"autogenerated": false,
"ratio": 3.2605042016806722,
"config_test": fa... |
"""BePitchAndPutt 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')
Cl... | {
"repo_name": "Rogercapcas/BePitchAndPutt",
"path": "BePitchAndPutt/BePitchAndPutt/urls.py",
"copies": "1",
"size": "3481",
"license": "apache-2.0",
"hash": 3508657589382640600,
"line_mean": 36.4301075269,
"line_max": 145,
"alpha_frac": 0.6282677392,
"autogenerated": false,
"ratio": 3.22912801484... |
# Be quiet!
yumLoggers = ['yum.filelogging.RPMInstallCallback',
'yum.verbose.Repos',
'yum.verbose.plugin',
'yum.Depsolve',
'yum.verbose',
'yum.plugin',
'yum.Repos',
'yum',
'yum.verbose.YumBase',
... | {
"repo_name": "tanzr/himlar",
"path": "profile/files/applications/report/el/check_updates.py",
"copies": "3",
"size": "1062",
"license": "apache-2.0",
"hash": 843271038729526500,
"line_mean": 24.9024390244,
"line_max": 59,
"alpha_frac": 0.5075329567,
"autogenerated": false,
"ratio": 3.96268656716... |
# 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, isOctetsType
from pyasn1 import debug, error
class AbstractDecoder:
protoComponent = None
def valueDecoder(self, fullSubstrate, substrate, asn1Spec, ... | {
"repo_name": "Suwmlee/XX-Net",
"path": "lib/noarch/pyasn1/codec/ber/decoder.py",
"copies": "8",
"size": "36421",
"license": "bsd-2-clause",
"hash": -2190928542789985800,
"line_mean": 44.0754950495,
"line_max": 290,
"alpha_frac": 0.565497927,
"autogenerated": false,
"ratio": 4.458440445586975,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.