text
stringlengths
0
1.05M
meta
dict
__author__ = 'jdaniel' # TODO (JLD): Design test cases # TODO (JLD): Performance testing, identify crossover for model evaluation time # TODO (JLD): Wrap this in a simple GUI from algorithm import Algorithm from common import WintermuteException from common import WintermuteLogger class Wintermute(object): """...
{ "repo_name": "jldaniel/Wintermute", "path": "wintermute.py", "copies": "1", "size": "1306", "license": "apache-2.0", "hash": -7875843336955316000, "line_mean": 24.1153846154, "line_max": 79, "alpha_frac": 0.5972434916, "autogenerated": false, "ratio": 4.503448275862069, "config_test": false, ...
__author__ = 'jdaniel' # TODO (JLD): Find some models with equality constraints # TODO (JLD): Get 15 total models implemented from model_base import ModelBase from math import sqrt from math import sin from math import cos from math import pi from math import exp from math import atan2 from functools import reduce f...
{ "repo_name": "jldaniel/Athena", "path": "AthenaOpt/models.py", "copies": "1", "size": "33891", "license": "mit", "hash": -8290609199654779000, "line_mean": 26.1780272654, "line_max": 97, "alpha_frac": 0.5498214865, "autogenerated": false, "ratio": 4.18304122438904, "config_test": true, "has_...
__author__ = 'Jean-Bernard Ratte - jean.bernard.ratte@unary.ca' __version__ = '0.1' import os import sys from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand class Tox(TestCommand): user_options = [('tox-args=', 'a', "Arguments to pass to tox")] def initialize_...
{ "repo_name": "nap/plexcleaner", "path": "setup.py", "copies": "1", "size": "2284", "license": "apache-2.0", "hash": 1778401162400787700, "line_mean": 33.0895522388, "line_max": 103, "alpha_frac": 0.6085814361, "autogenerated": false, "ratio": 3.631160572337043, "config_test": true, "has_no_k...
__author__ = "jeanlouis.mbaka" import csv import sys import pandas as pd import numpy as np class Pareto(): def __init__(self): pass def read_data(self, filename): """ Read data from filename """ results = read_csv(filename) self.header = results[0] self.raw_data = results[1] self.data = self.raw...
{ "repo_name": "jlmbaka/pareto", "path": "pareto.py", "copies": "1", "size": "4769", "license": "mit", "hash": 1795785438979910700, "line_mean": 23.587628866, "line_max": 104, "alpha_frac": 0.6550639547, "autogenerated": false, "ratio": 2.8420738974970203, "config_test": false, "has_no_keyword...
__author__ = 'jeanlouis.mbaka' import dirsize import matplotlib.pyplot as plt import unittest import sys, getopt def draw_pie_chart(data_dict): """ Display directories and files sizes in pie chart. :param data_dict: diction of {} """ labels = [key for key in data_dict.keys()] values = [value for value in data...
{ "repo_name": "jlmbaka/directory-pie", "path": "pie.py", "copies": "1", "size": "1242", "license": "mit", "hash": -2133022246634476800, "line_mean": 22.9038461538, "line_max": 99, "alpha_frac": 0.6618357488, "autogenerated": false, "ratio": 2.9501187648456058, "config_test": false, "has_no_ke...
__author__ = 'jeanlouis.mbaka' import re if __name__ == '__main__': split_test_str = 'abc 123\n\ndef 456\n\n\tbonjour\nca va?' print(split_test_str.split('\n\n')) text = "1\n00:01:37,880 --> 00:01:41,726\nBack then, not sleeping,\nI'd lay awake thinking about women.\n\n" seq = '10\n2\n 00:01:37,880...
{ "repo_name": "jlmbaka/subs-sync", "path": "spike.py", "copies": "1", "size": "1378", "license": "mit", "hash": 2168814984341090800, "line_mean": 35.2894736842, "line_max": 118, "alpha_frac": 0.523222061, "autogenerated": false, "ratio": 2.4695340501792113, "config_test": false, "has_no_keywo...
__author__ = 'jeanlouis.mbaka' import sys, getopt import os import re import time from dateutil import parser from datetime import datetime from datetime import timedelta class Subtitle(): """ Subtitle model - Represents an .srt file unit subtitle it is presented as follows: sequence_no\n start -...
{ "repo_name": "jlmbaka/subs-sync", "path": "sub-sync.py", "copies": "1", "size": "5084", "license": "mit", "hash": 8594809565800561000, "line_mean": 27.5674157303, "line_max": 119, "alpha_frac": 0.5676632573, "autogenerated": false, "ratio": 3.4774281805745555, "config_test": false, "has_no_k...
import numpy as np from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_equal, assert_allclose, assert_array_less) import pytest from mne import create_info, EpochsArray from mne.fixes import is_regressor, is_classifier from mne.utils import requires_sklearn, req...
{ "repo_name": "larsoner/mne-python", "path": "mne/decoding/tests/test_base.py", "copies": "12", "size": "15702", "license": "bsd-3-clause", "hash": -8536151634660363000, "line_mean": 35.7728337237, "line_max": 79, "alpha_frac": 0.6296013247, "autogenerated": false, "ratio": 3.443421052631579, "...
import numpy as np from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_equal) import pytest from mne.fixes import is_regressor, is_classifier from mne.utils import requires_version, check_version from mne.decoding.base import (_get_inverse_funcs, LinearModel, ge...
{ "repo_name": "adykstra/mne-python", "path": "mne/decoding/tests/test_base.py", "copies": "3", "size": "9277", "license": "bsd-3-clause", "hash": -5867384064424200000, "line_mean": 35.23828125, "line_max": 79, "alpha_frac": 0.6213215479, "autogenerated": false, "ratio": 3.4308431952662723, "con...
"""Generates 3 random 3D coordinates from a known 6x6 grid. Show how the grid position, rotate and bending can be inferred using `ModelSurface`. """ import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from ecoggui import ModelSurface n_samples = 6 ** 2 # Generate a curved surfa...
{ "repo_name": "kingjr/ecoggui", "path": "examples/model_surface.py", "copies": "1", "size": "2078", "license": "bsd-2-clause", "hash": 5983188043772853000, "line_mean": 35.4561403509, "line_max": 78, "alpha_frac": 0.6953801732, "autogenerated": false, "ratio": 2.985632183908046, "config_test": ...
import numpy as np from scipy import optimize from scipy.spatial.distance import squareform, pdist from sklearn.preprocessing import PolynomialFeatures class ModelDisplacement(object): """Transformer to fit rigid object rotation + translation. It 1) centers the data, 2) rotates it with SVD, and 3) fits trans...
{ "repo_name": "kingjr/ecoggui", "path": "ecoggui/models.py", "copies": "1", "size": "7446", "license": "bsd-2-clause", "hash": -5338760259147845000, "line_mean": 30.8205128205, "line_max": 79, "alpha_frac": 0.5350523771, "autogenerated": false, "ratio": 3.5643848731450456, "config_test": false,...
from nose.tools import assert_true import numpy as np from numpy.testing import assert_array_equal from jr.stats import fast_mannwhitneyu def _parallel_scorer(y_true, y_pred, func, n_jobs=1): from nose.tools import assert_true from mne.parallel import parallel_func, check_n_jobs # check dimensionality ...
{ "repo_name": "kingjr/jr-tools", "path": "jr/gat/scorers.py", "copies": "1", "size": "3617", "license": "bsd-2-clause", "hash": 4950215744732763000, "line_mean": 32.8037383178, "line_max": 76, "alpha_frac": 0.6112800664, "autogenerated": false, "ratio": 2.8706349206349207, "config_test": false,...
import numpy as np from .mixin import TransformerMixin from .base import BaseEstimator from ..time_frequency.tfr import _compute_tfr, _check_tfr_param from ..utils import fill_doc, _check_option @fill_doc class TimeFrequency(TransformerMixin, BaseEstimator): """Time frequency transformer. Time-frequency tra...
{ "repo_name": "pravsripad/mne-python", "path": "mne/decoding/time_frequency.py", "copies": "12", "size": "5163", "license": "bsd-3-clause", "hash": 407682331306757700, "line_mean": 33.8851351351, "line_max": 78, "alpha_frac": 0.5785396088, "autogenerated": false, "ratio": 4.011655011655011, "co...
import numpy as np from .mixin import TransformerMixin from .base import BaseEstimator from ..time_frequency.tfr import _compute_tfr, _check_tfr_param class TimeFrequency(TransformerMixin, BaseEstimator): """Time frequency transformer. Time-frequency transform of times series along the last axis. Param...
{ "repo_name": "teonlamont/mne-python", "path": "mne/decoding/time_frequency.py", "copies": "5", "size": "5436", "license": "bsd-3-clause", "hash": -1860586918291573500, "line_mean": 35, "line_max": 78, "alpha_frac": 0.5820456218, "autogenerated": false, "ratio": 4.038632986627043, "config_test"...
import numpy as np from sklearn.preprocessing import StandardScaler def _stand_mad(a, median): """ Fast sandard MAD Parameters ---------- a : np.array, shape(n_samples, n_dims) median : np.array, shape(n_dims) Returns ------- mad : np.array, shape(n_dims) Adapted from based on st...
{ "repo_name": "kingjr/jr-tools", "path": "jr/gat/scalers.py", "copies": "1", "size": "3121", "license": "bsd-2-clause", "hash": 7769670387214806000, "line_mean": 30.21, "line_max": 77, "alpha_frac": 0.5655238706, "autogenerated": false, "ratio": 3.526553672316384, "config_test": false, "has_n...
import numpy as np from .mixin import TransformerMixin from .base import BaseEstimator, _check_estimator, _make_scorer from ..parallel import parallel_func class _SearchLight(BaseEstimator, TransformerMixin): """Search Light. Fit, predict and score a series of models to each subset of the dataset along...
{ "repo_name": "nicproulx/mne-python", "path": "mne/decoding/search_light.py", "copies": "2", "size": "25213", "license": "bsd-3-clause", "hash": 6286692624536107000, "line_mean": 37.2015151515, "line_max": 114, "alpha_frac": 0.5820013485, "autogenerated": false, "ratio": 3.989398734177215, "con...
import numpy as np from .mixin import TransformerMixin from .base import BaseEstimator, _check_estimator from ..fixes import _get_check_scoring from ..parallel import parallel_func from ..utils import (_validate_type, array_split_idx, ProgressBar, verbose, fill_doc) @fill_doc class SlidingEstim...
{ "repo_name": "larsoner/mne-python", "path": "mne/decoding/search_light.py", "copies": "6", "size": "27438", "license": "bsd-3-clause", "hash": 7925074879826343000, "line_mean": 38.6502890173, "line_max": 114, "alpha_frac": 0.5855383045, "autogenerated": false, "ratio": 3.966748590429377, "conf...
import numpy as np from .mixin import TransformerMixin from .base import BaseEstimator, _check_estimator from ..parallel import parallel_func from ..utils import (_validate_type, array_split_idx, ProgressBar, verbose, fill_doc) @fill_doc class SlidingEstimator(BaseEstimator, TransformerMixin): ...
{ "repo_name": "adykstra/mne-python", "path": "mne/decoding/search_light.py", "copies": "2", "size": "27578", "license": "bsd-3-clause", "hash": 1472279237485979000, "line_mean": 38.6235632184, "line_max": 114, "alpha_frac": 0.5849952861, "autogenerated": false, "ratio": 3.9829578278451763, "con...
import numpy as np from .mixin import TransformerMixin from .base import BaseEstimator, _check_estimator from ..parallel import parallel_func from ..utils import _validate_type class SlidingEstimator(BaseEstimator, TransformerMixin): """Search Light. Fit, predict and score a series of models to each subset...
{ "repo_name": "teonlamont/mne-python", "path": "mne/decoding/search_light.py", "copies": "2", "size": "25852", "license": "bsd-3-clause", "hash": 4954441744005651000, "line_mean": 38.1104387292, "line_max": 114, "alpha_frac": 0.5943060498, "autogenerated": false, "ratio": 3.980292532717475, "co...
import numpy as np from .mixin import TransformerMixin from .base import BaseEstimator, _check_estimator from ..parallel import parallel_func class SearchLight(BaseEstimator, TransformerMixin): """Search Light. Fit, predict and score a series of models to each subset of the dataset along the last dimen...
{ "repo_name": "jniediek/mne-python", "path": "mne/decoding/search_light.py", "copies": "3", "size": "22756", "license": "bsd-3-clause", "hash": 6229437265381120000, "line_mean": 36.7379767828, "line_max": 121, "alpha_frac": 0.5803304623, "autogenerated": false, "ratio": 3.985987038010159, "conf...
import numpy as np from .mixin import TransformerMixin from .base import BaseEstimator, _check_estimator from ..parallel import parallel_func class SlidingEstimator(BaseEstimator, TransformerMixin): """Search Light. Fit, predict and score a series of models to each subset of the dataset along the last ...
{ "repo_name": "jaeilepp/mne-python", "path": "mne/decoding/search_light.py", "copies": "1", "size": "24632", "license": "bsd-3-clause", "hash": 3063907341713613000, "line_mean": 37.7295597484, "line_max": 114, "alpha_frac": 0.5943894121, "autogenerated": false, "ratio": 3.9569477911646587, "con...
import numpy as np from numpy.testing import assert_array_equal from nose.tools import assert_raises, assert_true, assert_equal from mne.utils import requires_sklearn_0_15 from mne.decoding.search_light import SlidingEstimator, GeneralizingEstimator from mne.decoding.transformer import Vectorizer def make_data(): ...
{ "repo_name": "jaeilepp/mne-python", "path": "mne/decoding/tests/test_search_light.py", "copies": "1", "size": "7787", "license": "bsd-3-clause", "hash": -8401442645401183000, "line_mean": 34.0765765766, "line_max": 79, "alpha_frac": 0.6182098369, "autogenerated": false, "ratio": 3.13234111021721...
import numpy as np from numpy.testing import assert_array_equal from nose.tools import assert_raises, assert_true, assert_equal from ...utils import requires_sklearn_0_15 from ..search_light import _SearchLight, _GeneralizationLight from .. import Vectorizer def make_data(): n_epochs, n_chan, n_time = 50, 32, 1...
{ "repo_name": "nicproulx/mne-python", "path": "mne/decoding/tests/test_search_light.py", "copies": "2", "size": "7681", "license": "bsd-3-clause", "hash": -7253952039357416000, "line_mean": 33.7556561086, "line_max": 79, "alpha_frac": 0.6026559042, "autogenerated": false, "ratio": 3.1376633986928...
import numpy as np from numpy.testing import assert_array_equal from nose.tools import assert_raises, assert_true, assert_equal from ...utils import requires_sklearn from ..search_light import SearchLight, GeneralizationLight from .. import Vectorizer def make_data(): n_epochs, n_chan, n_time = 50, 32, 10 X...
{ "repo_name": "alexandrebarachant/mne-python", "path": "mne/decoding/tests/test_search_light.py", "copies": "1", "size": "4657", "license": "bsd-3-clause", "hash": -5564103177497216000, "line_mean": 31.3402777778, "line_max": 77, "alpha_frac": 0.6126261542, "autogenerated": false, "ratio": 3.1530...
import numpy as np from numpy.testing import assert_array_equal from nose.tools import assert_raises from mne.utils import requires_sklearn from mne.decoding.time_frequency import TimeFrequency @requires_sklearn def test_timefrequency(): from sklearn.base import clone # Init n_freqs = 3 frequencies ...
{ "repo_name": "jaeilepp/mne-python", "path": "mne/decoding/tests/test_time_frequency.py", "copies": "6", "size": "1237", "license": "bsd-3-clause", "hash": 2346812245129341000, "line_mean": 29.1707317073, "line_max": 76, "alpha_frac": 0.6628940986, "autogenerated": false, "ratio": 2.9452380952380...
import numpy as np from numpy.testing import assert_array_equal import pytest from mne.utils import requires_sklearn from mne.decoding.time_frequency import TimeFrequency @requires_sklearn def test_timefrequency(): """Test TimeFrequency.""" from sklearn.base import clone # Init n_freqs = 3 freq...
{ "repo_name": "bloyl/mne-python", "path": "mne/decoding/tests/test_time_frequency.py", "copies": "14", "size": "1199", "license": "bsd-3-clause", "hash": -6808131594306882000, "line_mean": 26.8837209302, "line_max": 76, "alpha_frac": 0.6455379483, "autogenerated": false, "ratio": 2.88915662650602...
import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.colors as col from matplotlib.colors import LinearSegmentedColormap from ..utils import logcenter from ..stats import median_abs_deviation RdPuBu = col.LinearSegmentedColormap.from_list('RdPuBu', ['b', 'r']) def alpha_cmap(cmap='...
{ "repo_name": "kingjr/jr-tools", "path": "jr/plot/base.py", "copies": "1", "size": "13359", "license": "bsd-2-clause", "hash": -9001882996455082000, "line_mean": 31.662591687, "line_max": 79, "alpha_frac": 0.5480200614, "autogenerated": false, "ratio": 3.10025527964725, "config_test": false, ...
__author__ = 'jeddy' import sys, os, re, argparse, time """generateBatchSubmitParams This script is used to generate a batch submit file for Globus Genomics Galaxy, with all parameters specified for the selected Workflow for each library (sample). Inputs: -u / --unalignedDir : directory with unaligned FASTQs fro...
{ "repo_name": "jaeddy/bripipetools", "path": "scripts/_deprecated/generate_batch_submit_params.py", "copies": "1", "size": "11059", "license": "mit", "hash": -4913519357383324000, "line_mean": 38.4964285714, "line_max": 101, "alpha_frac": 0.6048467312, "autogenerated": false, "ratio": 3.833275563...
__author__ = 'jeddy' import sys, os, re, argparse, time """generate_fc_batch_submit This script is used to generate a batch submit file for Globus Genomics Galaxy, with all parameters specified for the selected Workflow for each library (sample). Inputs: -u / --unalignedDir : directory with unaligned FASTQs from...
{ "repo_name": "jaeddy/bripipetools", "path": "scripts/_deprecated/generate_fc_batch_submit.py", "copies": "1", "size": "16066", "license": "mit", "hash": 1942194530735209000, "line_mean": 40.5142118863, "line_max": 121, "alpha_frac": 0.577492842, "autogenerated": false, "ratio": 3.673068129858253...
__author__ = 'jedi' from controller.cocheController import * import sys import re sys.path.insert(0, '../model') class DbController: def __init__(self, pathToDbCoches="../database/coches.txt", pathToDbClientes="../database/coches.txt", pathToDbTransacciones="../database/coches.txt"): self.pathToDbCoches ...
{ "repo_name": "nejogaro/carruajes_barbie", "path": "controller/dbController.py", "copies": "1", "size": "1946", "license": "apache-2.0", "hash": -1890861996541742300, "line_mean": 35.0185185185, "line_max": 155, "alpha_frac": 0.5956790123, "autogenerated": false, "ratio": 3.272727272727273, "co...
__author__ = 'jedi' import sys sys.path.insert(0, '../controller') from controller.dbController import * from datetime import datetime class Alquileres: def __init__(self, matricula, nif, fechaalquiler, fecharetorno, importe, compleatada): self.matricula = matricula self.nif = nif self.fe...
{ "repo_name": "nejogaro/carruajes_barbie", "path": "model/alquileres.py", "copies": "1", "size": "1198", "license": "apache-2.0", "hash": 6304530593967764000, "line_mean": 29.7179487179, "line_max": 90, "alpha_frac": 0.6611018364, "autogenerated": false, "ratio": 3.0876288659793816, "config_tes...
__author__ = "Jeff Nelson" __copyright__ = "Copyright 2015, Cinchapi Inc." __license__ = "Apache, Version 2.0" from thrift import Thrift from thrift.transport import TSocket from thriftapi import ConcourseService from thriftapi.shared.ttypes import * from utils import * from collections import OrderedDict import ujson...
{ "repo_name": "prateek135/concourse", "path": "concourse-driver-python/concourse/concourse.py", "copies": "7", "size": "49719", "license": "apache-2.0", "hash": -4488985652129412600, "line_mean": 53.8169790518, "line_max": 121, "alpha_frac": 0.6391922605, "autogenerated": false, "ratio": 4.593827...
__author__ = "Jeff Nelson" __copyright__ = "Copyright 2015, Cinchapi, Inc." __license__ = "Apache, Version 2.0" from thrift import Thrift from thrift.transport import TSocket from thriftapi import ConcourseService from thriftapi.shared.ttypes import * from utils import * import ujson class Concourse(object): """...
{ "repo_name": "mAzurkovic/concourse", "path": "concourse-driver-python/concourse/concourse.py", "copies": "2", "size": "23365", "license": "apache-2.0", "hash": -4882017675951950000, "line_mean": 42.5914179104, "line_max": 120, "alpha_frac": 0.6213995292, "autogenerated": false, "ratio": 4.583169...
__author__ = 'Jeff Nelson' # # The MIT License (MIT) # # Copyright (c) 2013-2016 Cinchapi Inc. # # 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 limitat...
{ "repo_name": "kylycht/concourse", "path": "examples/quickstart/python/utils.py", "copies": "4", "size": "1661", "license": "apache-2.0", "hash": 7174430099093112000, "line_mean": 32.24, "line_max": 79, "alpha_frac": 0.7182420229, "autogenerated": false, "ratio": 4.081081081081081, "config_test...
__author__ = 'Jeff Nelson' # # The MIT License (MIT) # # Copyright (c) 2013-2017 Cinchapi Inc. # # 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 limitat...
{ "repo_name": "dubex/concourse", "path": "examples/quickstart/python/utils.py", "copies": "2", "size": "1661", "license": "apache-2.0", "hash": -1892514470561715700, "line_mean": 32.24, "line_max": 79, "alpha_frac": 0.7182420229, "autogenerated": false, "ratio": 4.081081081081081, "config_test"...
__author__ = 'Jeff Nelson' # # The MIT License (MIT) # # Copyright (c) 2015 Cinchapi Inc. # # 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 t...
{ "repo_name": "hcuffy/concourse", "path": "examples/quickstart/python/utils.py", "copies": "1", "size": "1656", "license": "apache-2.0", "hash": 1381186296613207000, "line_mean": 32.14, "line_max": 79, "alpha_frac": 0.7179951691, "autogenerated": false, "ratio": 4.088888888888889, "config_test"...
__author__ = 'jeff' from abc import ABCMeta, abstractmethod, abstractproperty import subprocess, os class ToolboxPlugin(object): """ Abstract base class for an Toolbox plugin """ __metaclass__ = ABCMeta name = None description = None @abstractmethod def prepare_parser(self, parser): ...
{ "repo_name": "jeff-99/toolbox", "path": "toolbox/plugin.py", "copies": "1", "size": "4245", "license": "isc", "hash": -1937592033911492900, "line_mean": 27.4899328859, "line_max": 97, "alpha_frac": 0.6124852768, "autogenerated": false, "ratio": 4.644420131291028, "config_test": false, "has_n...
__author__ = 'jeff' from .plugin import ToolboxPlugin from .mixins import RegistryMixin, ConfigMixin, LogMixin from .config import ConfigManager import importlib, inspect, logging class NoPluginException(Exception): pass class Registry(object): """ Registry of all available plugins Setup the config ...
{ "repo_name": "jeff-99/toolbox", "path": "toolbox/registry.py", "copies": "1", "size": "4603", "license": "isc", "hash": -3494148414318483500, "line_mean": 33.8712121212, "line_max": 103, "alpha_frac": 0.6124266783, "autogenerated": false, "ratio": 4.5574257425742575, "config_test": true, "ha...
__author__ = 'jeff' import os import re from .renderer import ALIASES class Parser(object): def __init__(self, template_dir, dest_dir, args): self.template_dir = template_dir self.dest_dir = dest_dir self.args = args def resolve_key(self, match): """ Resolve the matche...
{ "repo_name": "jeff-99/toolbox", "path": "toolbox/contrib/create/parser.py", "copies": "1", "size": "2276", "license": "isc", "hash": 3622082948719634400, "line_mean": 29.3466666667, "line_max": 114, "alpha_frac": 0.5711775044, "autogenerated": false, "ratio": 4.035460992907802, "config_test": ...
__author__ = 'jeff' import pkgutil import re import os import sys def find_contrib_modules(): """ Find all core modules in the contrib package and return a list of importable packages :return: A list of importable packages :rtype: list """ contrib_dir = os.path.join( os.path.dirname(os...
{ "repo_name": "jeff-99/toolbox", "path": "toolbox/scanner.py", "copies": "1", "size": "1615", "license": "isc", "hash": -4610528536217598000, "line_mean": 25.4754098361, "line_max": 89, "alpha_frac": 0.6235294118, "autogenerated": false, "ratio": 3.8822115384615383, "config_test": false, "has...
__author__ = 'Jeff' import re import os import zipfile import smtplib import getpass from email import encoders from email.mime.base import MIMEBase from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart userEmail = '' toEmail = '' while 1: userEmail = input("Please enter your email ...
{ "repo_name": "jregistr/Academia", "path": "CSC344-Programming-Languages/A5-Python/csc344/a5/a5Python.py", "copies": "1", "size": "7280", "license": "mit", "hash": -8046319550130659000, "line_mean": 29.5882352941, "line_max": 108, "alpha_frac": 0.5677197802, "autogenerated": false, "ratio": 3.623...
__author__ = 'jeff' from energetic import EnergeticNetwork import numpy as np import math class BoltzmannMachine(EnergeticNetwork): def __init__(self, neuron_count): super(BoltzmannMachine, self).__init__(neuron_count) # The current temperature of the neural network. The higher the # temp...
{ "repo_name": "JPMoresmau/aifh", "path": "vol3/vol3-python-examples/lib/aifh/boltzmann.py", "copies": "1", "size": "3070", "license": "apache-2.0", "hash": -1236250327910696400, "line_mean": 29.396039604, "line_max": 84, "alpha_frac": 0.5583061889, "autogenerated": false, "ratio": 3.8664987405541...
__author__ = 'jeff' from toolbox.plugin import ToolboxPlugin from toolbox.mixins import ConfigMixin, RegistryMixin from toolbox.utils import generate_name from .parser import Parser import os, tempfile, zipfile, shutil class CreatePlugin(RegistryMixin, ConfigMixin, ToolboxPlugin): name = 'create' description...
{ "repo_name": "jeff-99/toolbox", "path": "toolbox/contrib/create/create.py", "copies": "1", "size": "2428", "license": "isc", "hash": 5636337552002174000, "line_mean": 34.1884057971, "line_max": 75, "alpha_frac": 0.5189456343, "autogenerated": false, "ratio": 4.529850746268656, "config_test": f...
__author__ = 'jeff' from toolbox.plugin import ToolboxPlugin from toolbox.mixins import RegistryMixin from toolbox.scanner import find_modules from terminaltables import AsciiTable class ListPlugin(RegistryMixin, ToolboxPlugin): name = 'list' description = 'List all plugins' def prepare_parser(self, par...
{ "repo_name": "jeff-99/toolbox", "path": "toolbox/contrib/list/list.py", "copies": "1", "size": "1679", "license": "isc", "hash": 7210080269583072000, "line_mean": 33.2653061224, "line_max": 76, "alpha_frac": 0.5372245384, "autogenerated": false, "ratio": 4.650969529085873, "config_test": false...
__author__ = 'jeff' import json class BucketAlreadyExists(Exception): @property def response(self): return json.dumps(dict(error={ "errors": [ { "domain": "global", "reason": "conflict", "message": "You already ow...
{ "repo_name": "sir-wiggles/moogle", "path": "moogle/storage/errors.py", "copies": "1", "size": "1813", "license": "apache-2.0", "hash": -424314801739311700, "line_mean": 24.9142857143, "line_max": 89, "alpha_frac": 0.4070601213, "autogenerated": false, "ratio": 5.050139275766017, "config_test":...
__author__ = 'jeff' import numpy as np from energetic import EnergeticNetwork class HopfieldNetwork(EnergeticNetwork): def __init__(self, neuron_count): super(HopfieldNetwork, self).__init__(neuron_count) self.input_count = neuron_count self.output_count = neuron_count self.activat...
{ "repo_name": "JPMoresmau/aifh", "path": "vol3/vol3-python-examples/lib/aifh/hopfield.py", "copies": "1", "size": "4835", "license": "apache-2.0", "hash": 5414791547444788000, "line_mean": 32.3448275862, "line_max": 98, "alpha_frac": 0.5604963806, "autogenerated": false, "ratio": 3.87109687750200...
__author__ = 'jeff' import numpy as np class EnergeticNetwork: """ The energetic network forms the base class for Hopfield and Boltzmann machines. """ def __init__(self, neuron_count): """ Construct the network with the specified neuron count. :param neuron_count: The number o...
{ "repo_name": "JPMoresmau/aifh", "path": "vol3/vol3-python-examples/lib/aifh/energetic.py", "copies": "1", "size": "3697", "license": "apache-2.0", "hash": 4054352349920913000, "line_mean": 31.7168141593, "line_max": 120, "alpha_frac": 0.5609954017, "autogenerated": false, "ratio": 3.970998925886...
__author__ = 'jeff' import re from jinja2 import Template from .models import gcs_backend from .errors import * # https://www.googleapis.com/ # storage/v1beta2/b/<bucket>/o/<object> # ?project=mock_project&alt=json BASE_RE = re.compile("(?:/upload)?/storage/v1beta2/b/?(?P<bucket>[0-9a-zA-Z_-]+)?(?:/o/?(?P<object>[...
{ "repo_name": "sir-wiggles/moogle", "path": "moogle/storage/responses.py", "copies": "1", "size": "5835", "license": "apache-2.0", "hash": -7381851207829086000, "line_mean": 32.7283236994, "line_max": 141, "alpha_frac": 0.5904027421, "autogenerated": false, "ratio": 3.412280701754386, "config_t...
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_array_almost_equal, assert_array_equal, \ assert_allclose from scipy.signal import dlsim, dstep, dimpulse...
{ "repo_name": "sargas/scipy", "path": "scipy/signal/tests/test_dltisys.py", "copies": "4", "size": "9922", "license": "bsd-3-clause", "hash": 2768271142162465000, "line_mean": 37.3088803089, "line_max": 78, "alpha_frac": 0.4694618021, "autogenerated": false, "ratio": 2.9733293377284986, "config...
from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy.testing import (TestCase, run_module_suite, assert_equal, assert_array_almost_equal, assert_array_equal, assert_allclose, assert_, assert_raises, ...
{ "repo_name": "DailyActie/Surrogate-Model", "path": "01-codes/scipy-master/scipy/signal/tests/test_dltisys.py", "copies": "1", "size": "24143", "license": "mit", "hash": 7480495294300126000, "line_mean": 35.1422155689, "line_max": 78, "alpha_frac": 0.5201093485, "autogenerated": false, "ratio": 3...
import numpy as np from numpy.testing import (assert_equal, assert_array_almost_equal, assert_array_equal, assert_allclose, assert_, assert_almost_equal, suppress_warnings) from pytest import raises as assert_raises from scipy.signal impo...
{ "repo_name": "WarrenWeckesser/scipy", "path": "scipy/signal/tests/test_dltisys.py", "copies": "12", "size": "21558", "license": "bsd-3-clause", "hash": -9150498401333489000, "line_mean": 35.0501672241, "line_max": 78, "alpha_frac": 0.5143334261, "autogenerated": false, "ratio": 3.059174116645381...
__author__ = 'jeffrey creighton & anand patel' import random import Player import Message class JCAPPlayer(Player.Player): def __init__(self): self.name = "JCAP" self.moves = [0, 0, 0] self.pre_smart = 3 self.decrementing = 45 # Decide to make a smart or random move and #...
{ "repo_name": "geebzter/game-framework", "path": "JCAPPlayer.py", "copies": "1", "size": "2351", "license": "apache-2.0", "hash": -2628894994493330400, "line_mean": 28.7594936709, "line_max": 77, "alpha_frac": 0.5614632071, "autogenerated": false, "ratio": 3.8477905073649756, "config_test": fal...
__author__ = 'jeffrey creighton & anand patel' # Purpose: to collect and store scores from all players and matches import ScoreKeeperHistoryItem import ScoreKeeperListItem class ScoreKeeper(object): """ Consisting of two lists, will track all players and their scores as well as each match and their ou...
{ "repo_name": "geebzter/game-framework", "path": "ScoreKeeper.py", "copies": "1", "size": "4081", "license": "apache-2.0", "hash": 5448344656816630000, "line_mean": 28.7883211679, "line_max": 96, "alpha_frac": 0.6086743445, "autogenerated": false, "ratio": 4.160040774719674, "config_test": fals...
__author__ = 'jeffrey creighton & anand patel' # Purpose: to collect and store scores from all players and matches import ScorekeeperHistoryItem import ScoreKeeperListItem class Scorekeeper: leader_board = [] match_history = [] def __init__(self): self.leader_board = [] self.match_histor...
{ "repo_name": "PaulieC/sprint1_Council_a", "path": "Scorekeeper.py", "copies": "2", "size": "2202", "license": "apache-2.0", "hash": 8972126061509615000, "line_mean": 32.3787878788, "line_max": 98, "alpha_frac": 0.6285195277, "autogenerated": false, "ratio": 3.7900172117039586, "config_test": f...
_author__ = 'jeff roy' from mi.core.log import get_logger log = get_logger() from mi.idk.config import Config import unittest import os from mi.dataset.driver.ctdbp_p.dcl.ctdbp_p_dcl_recovered_driver import parse from mi.dataset.dataset_driver import ParticleDataHandler class DriverTest(unittest.TestCase): d...
{ "repo_name": "JeffRoy/mi-dataset", "path": "mi/dataset/driver/ctdbp_p/dcl/test/test_ctdbp_p_dcl_recovered_driver.py", "copies": "1", "size": "1092", "license": "bsd-2-clause", "hash": 143350989086735180, "line_mean": 25.0238095238, "line_max": 99, "alpha_frac": 0.6016483516, "autogenerated": false...
# Import the cscCommonScript utility module which, in turn, imports the # standard library modules and imports arcpy #EXPECTS 3 PARAMETERS, input bathy and output grid and neighborhood # If running in PythonWin use C:\arcgis\data\BTM_Data\crml_bth C:\arcgis\data\mypig3 Annulus 1 3 CELL import arcpy,sys, trac...
{ "repo_name": "EsriOceans/btm", "path": "legacy/10.0/scripts_ags10/CreatePosIndexGrid.py", "copies": "1", "size": "3236", "license": "mpl-2.0", "hash": 4136667055698592000, "line_mean": 30.7070707071, "line_max": 101, "alpha_frac": 0.6983930779, "autogenerated": false, "ratio": 3.8341232227488153...
__author__ = 'JennyYueJin' import json, sys reload(sys) sys.setdefaultencoding('UTF-8') from pprint import pprint import os import re import shutil import requests import urlparse from bs4 import BeautifulSoup import json def get_soup(url): """ :param url: link to the page :return: soup object """ ...
{ "repo_name": "jennyyuejin/projectFox", "path": "nonWebCode/crawlBBS/crawl.py", "copies": "1", "size": "5292", "license": "unlicense", "hash": -2995566967285780500, "line_mean": 27.9234972678, "line_max": 128, "alpha_frac": 0.585978836, "autogenerated": false, "ratio": 3.3095684803001877, "conf...
__author__ = 'Jens Nevens' from railfetcher import railtimeFetcher from database import railDB import pickle from datetime import timedelta, date, datetime def toUnix(timestamp): if timestamp is None: return None else: stamp = timestamp[6 : len(timestamp)-2] (unix, tz) = stamp.split('+') unix = float(unix) ...
{ "repo_name": "JensNevens/Bachelorproject", "path": "railSQL/rail.py", "copies": "1", "size": "4608", "license": "mit", "hash": -1446887470269852200, "line_mean": 25.6358381503, "line_max": 216, "alpha_frac": 0.6293402778, "autogenerated": false, "ratio": 2.996098829648895, "config_test": false...
__author__ = 'Jens Nevens' import pymysql import uuid import json json_data = open('oAuth') oAuth = json.load(json_data) class railDB(): def __init__(self, period='new'): if period is 'new': self.conn = pymysql.connect(host='localhost', port=3306, user=oAuth['USER'], passwd=oAuth['PASSWD'], db='newrailDB') ...
{ "repo_name": "JensNevens/Bachelorproject", "path": "railSQL/database.py", "copies": "1", "size": "4374", "license": "mit", "hash": 1626786406300383200, "line_mean": 30.4676258993, "line_max": 159, "alpha_frac": 0.443301326, "autogenerated": false, "ratio": 3.969147005444646, "config_test": fal...
__author__ = 'Jens Nevens' import time import json from twython import Twython from pymongo import MongoClient json_data = open('oAuth') oAuth = json.load(json_data) CONSUMER_KEY = oAuth['CONS_KEY'] CONSUMER_SECRET = oAuth['CONS_SECRET'] ACCESS_TOKEN_KEY = oAuth['TOKEN_KEY'] ACCESS_TOKEN_SECRET = oAuth['TOKEN_SECRET...
{ "repo_name": "JensNevens/Bachelorproject", "path": "twitter/tweet_mining.py", "copies": "1", "size": "3503", "license": "mit", "hash": 5169491154471578000, "line_mean": 32.6826923077, "line_max": 156, "alpha_frac": 0.686554382, "autogenerated": false, "ratio": 3.0674255691768826, "config_test"...
__author__ = "Jens Thomas, Felix Simkovic & Adam Simpkin" __date__ = "10 June 2019" __version__ = "1.0" import argparse import os from ample.modelling.multimer_definitions import MULTIMER_MODES from pyjob.factory import TASK_PLATFORMS class BoolAction(argparse.Action): """Class to set a boolean value either form...
{ "repo_name": "rigdenlab/ample", "path": "ample/util/argparse_util.py", "copies": "1", "size": "26506", "license": "bsd-3-clause", "hash": -6199217811404720000, "line_mean": 42.1693811075, "line_max": 187, "alpha_frac": 0.6482305893, "autogenerated": false, "ratio": 3.8825252673209314, "config_...
__author__ = "Jens Thomas & Felix Simkovic" __date__ = "10 June 2019" __version__ = "1.0" import argparse import os from ample.modelling.multimer_definitions import MULTIMER_MODES class BoolAction(argparse.Action): """Class to set a boolean value either form a string or just from the use of the command-line flag...
{ "repo_name": "linucks/ample", "path": "ample/util/argparse_util.py", "copies": "1", "size": "25356", "license": "bsd-3-clause", "hash": -3824050381052637700, "line_mean": 41.7588532884, "line_max": 187, "alpha_frac": 0.6580690961, "autogenerated": false, "ratio": 3.8250113139236688, "config_te...
__author__ = "Jens Thomas" import glob import logging import os import shutil import tarfile import zipfile import iotbx.pdb from ample.util import ample_util, exit_util, pdb_edit, sequence_util logger = logging.getLogger(__name__) class CheckModelsResult: def __init__(self): self.created_updated_mode...
{ "repo_name": "linucks/ample", "path": "ample/util/process_models.py", "copies": "2", "size": "14356", "license": "bsd-3-clause", "hash": 1885631828696821500, "line_mean": 40.8542274052, "line_max": 163, "alpha_frac": 0.6134020619, "autogenerated": false, "ratio": 3.9482948294829483, "config_te...
__author__ = 'jeremiahd' import curses import redis import argparse import sys import datetime DEFAULT_TEXT = 0 GREEN_TEXT = 1 RED_TEXT = 2 class RedisList: def __init__(self, display_name, key_name): self.display_name = display_name self.key_name = key_name self.size = 0 self.la...
{ "repo_name": "dangler/rlisty", "path": "rlisty/main.py", "copies": "1", "size": "5150", "license": "apache-2.0", "hash": 870158369562503200, "line_mean": 30.4024390244, "line_max": 120, "alpha_frac": 0.5980582524, "autogenerated": false, "ratio": 3.428761651131824, "config_test": false, "has...
import sys def read_file(file_str): """ Return file lines for a file """ file_obj = open(file_str, "r") file_lines = file_obj.readlines() return file_lines def extract_column_names(file_lines): """ Return a list of tuples containing column names and its respective index. Mutates the file lines list by extrac...
{ "repo_name": "jlant/readmeasurements", "path": "read_measurements.py", "copies": "1", "size": "3537", "license": "mit", "hash": -6212130393804891000, "line_mean": 30.8738738739, "line_max": 163, "alpha_frac": 0.7028555273, "autogenerated": false, "ratio": 3.287174721189591, "config_test": fals...
"""Cards, hand and deck models. A hand contains 2 or more cards. A deck contains a multiple of 52 cards.""" import random SUITLIST = ('heart', 'diamond', 'spade', 'club') RANKLIST = ('A ', '2 ', '3 ', '4 ', '5 ', '6 ', '7 ', '8 ', '9 ', '10', 'J ', 'Q ', 'K ') VALUEMAP = {'A ':1, '2 ':2, '3 ':3, '4 ':4, '5...
{ "repo_name": "jercoh/pyBlackJack", "path": "cards.py", "copies": "1", "size": "5235", "license": "mit", "hash": -5527588919997746000, "line_mean": 30.9207317073, "line_max": 107, "alpha_frac": 0.4660936008, "autogenerated": false, "ratio": 3.480718085106383, "config_test": false, "has_no_key...
"""pyBlackJack main file""" from cards import Deck from players import Player, Dealer import asciiArts import utils ##################################################### class BlackJack: """Main class of pyBlackJack. Define a BlackJack game with a 6-deck shoe, one player and one dealer.""" def __init__(self): # C...
{ "repo_name": "jercoh/pyBlackJack", "path": "pyblackjack.py", "copies": "1", "size": "6812", "license": "mit", "hash": 3907384833485959700, "line_mean": 26.0317460317, "line_max": 110, "alpha_frac": 0.6285965942, "autogenerated": false, "ratio": 3.0698512843623256, "config_test": false, "has_...
"""User model. PLayer and Dealer class inherits from User.""" from cards import Hand ##################################################### class User: """Define a User""" def __init__(self, deck): self.deck = deck def hit(self): """The user takes a hit. Add a card to user's hand.""" ...
{ "repo_name": "jercoh/pyBlackJack", "path": "players.py", "copies": "1", "size": "2965", "license": "mit", "hash": -6218941051146210000, "line_mean": 28.3564356436, "line_max": 123, "alpha_frac": 0.5365935919, "autogenerated": false, "ratio": 3.911609498680739, "config_test": false, "has_no_k...
"""Various utility functions for handling prompt messages and console prints.""" def read_integer(message): """Prompt message until the user types an integer""" while True: user_input = raw_input(message) try: return int(user_input) except ValueError: continue def read_integer_in_range(message, min, max...
{ "repo_name": "jercoh/pyBlackJack", "path": "utils.py", "copies": "1", "size": "1057", "license": "mit", "hash": -9216233960880478000, "line_mean": 28.3611111111, "line_max": 80, "alpha_frac": 0.6773888363, "autogenerated": false, "ratio": 3.546979865771812, "config_test": false, "has_no_keyw...
__author__ = "Jeremy Carbaugh (jcarbaugh@sunlightfoundation.com)" __version__ = "0.1" __copyright__ = "Copyright (c) 2008 Sunlight Labs" __license__ = "BSD" from django.conf import settings from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.sites....
{ "repo_name": "uclastudentmedia/django-gatekeeper", "path": "gatekeeper/__init__.py", "copies": "1", "size": "7984", "license": "bsd-3-clause", "hash": 6271360302482584000, "line_mean": 42.8736263736, "line_max": 191, "alpha_frac": 0.622745491, "autogenerated": false, "ratio": 3.99799699549324, ...
__author__ = "Jeremy Carbaugh (jcarbaugh@sunlightfoundation.com)" __version__ = "0.1" __copyright__ = "Copyright (c) 2010 Sunlight Labs" __license__ = "BSD" import sys if sys.version_info[0] == 3: from urllib.parse import urlencode, urljoin from urllib.request import urlopen from urllib.error import HTTPE...
{ "repo_name": "aaronsw/python-transparencydata", "path": "transparencydata.py", "copies": "1", "size": "3571", "license": "bsd-3-clause", "hash": -4877899059528567000, "line_mean": 30.3245614035, "line_max": 100, "alpha_frac": 0.5527863344, "autogenerated": false, "ratio": 4.236061684460261, "c...
__author__ = "Jeremy Carbaugh (jcarbaugh@sunlightfoundation.com)" __version__ = "0.4.0a" __copyright__ = "Copyright (c) 2010 Sunlight Labs" __license__ = "BSD" from django.conf import settings from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core.mail i...
{ "repo_name": "sunlightlabs/django-gatekeeper", "path": "gatekeeper/__init__.py", "copies": "1", "size": "9293", "license": "bsd-3-clause", "hash": 6029347955654389000, "line_mean": 38.2109704641, "line_max": 127, "alpha_frac": 0.6282147853, "autogenerated": false, "ratio": 3.8850334448160537, ...
__author__="JeremyNelson, Mike Stabile" import argparse import datetime import requests import rdflib import json from elasticsearch import Elasticsearch from elasticsearch import helpers from sparql.general import* from sparql.languages import workflow as languages from sparql.subjects import workflow as subjects fro...
{ "repo_name": "KnowledgeLinks/graph-utilities", "path": "run.py", "copies": "1", "size": "11973", "license": "apache-2.0", "hash": -8376886935261175000, "line_mean": 37.8733766234, "line_max": 124, "alpha_frac": 0.5841476656, "autogenerated": false, "ratio": 4.023185483870968, "config_test": fa...
__author__ = "Jeremy Nelson, Mike Stabile" import os import sys import unittest from rdfframework.validators import * from rdfframework.processors import csv_to_multi_prop_processor, \ email_verification_processor, password_processor, run_processor,\ salt_processor ## ## ## ##class Test_email_verificati...
{ "repo_name": "KnowledgeLinks/rdfframework", "path": "tests/test_validators.py", "copies": "1", "size": "4180", "license": "mit", "hash": 5923503884397710000, "line_mean": 30.6666666667, "line_max": 104, "alpha_frac": 0.5488038278, "autogenerated": false, "ratio": 3.2939322301024427, "config_te...
{ "repo_name": "KnowledgeLinks/rdfframework", "path": "tests/test_rdfclass.py", "copies": "1", "size": "4114", "license": "mit", "hash": 5280747529036805000, "line_mean": 33.8644067797, "line_max": 104, "alpha_frac": 0.5269810404, "autogenerated": false, "ratio": 3.2470402525651143, "config_test...
__author__ = "Jeremy Nelson" from instance import config from collections import OrderedDict import requests PREFIX = """PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX bf: <http://id.loc.gov/ontologies/bibframe/> PREFIX schema: <http://schema.org/...
{ "repo_name": "KnowledgeLinks/dpla-service-hub", "path": "reports/__init__.py", "copies": "1", "size": "2912", "license": "apache-2.0", "hash": 722498185623610400, "line_mean": 33.2588235294, "line_max": 109, "alpha_frac": 0.6212225275, "autogenerated": false, "ratio": 3.599505562422744, "confi...
__author__ = "Jeremy Nelson" import argparse import datetime import logging import pymarc import sys from rda_enhancement import pcc_conversion logging.basicConfig( filename='error.log', format='%(asctime)s %(message)s', level=logging.ERROR) def convert(input_mrc_filename, output_mrc_filename): """F...
{ "repo_name": "Tutt-Library/rda-enhancement", "path": "run.py", "copies": "1", "size": "2416", "license": "mit", "hash": 2310226674400042000, "line_mean": 31.2133333333, "line_max": 80, "alpha_frac": 0.565397351, "autogenerated": false, "ratio": 4.151202749140894, "config_test": false, "has_n...
__author__ = "Jeremy Nelson" import datetime import os import sys import requests import click from zipfile import ZipFile, ZIP_DEFLATED from multiprocessing import Pool import bibcat.rml.processor as processor BF2MAP4 = processor.SPARQLBatchProcessor( rml_rules=['bf-to-map4-alt.ttl'], triplestore_url='') C...
{ "repo_name": "KnowledgeLinks/dpla-service-hub", "path": "output.py", "copies": "1", "size": "3510", "license": "apache-2.0", "hash": 8368740396271991000, "line_mean": 31.2018348624, "line_max": 80, "alpha_frac": 0.6, "autogenerated": false, "ratio": 3.5240963855421685, "config_test": false, ...
import os import jinja2 import csv TEMPLATE_FILENAME = 'cisco.j2' CSVDATA_FILENAME = 'hosts_data.csv' ## --------------------------------------------------------------------------- ## define a function that will transform the "vlan_name_<n>" and "vlan_id_<n>" ## into a new dictionary called 'vlans' ## -------------...
{ "repo_name": "jeremyschulman/demo_host_csv_template_render", "path": "render.py", "copies": "1", "size": "3083", "license": "mit", "hash": -8769440057608319000, "line_mean": 40.1066666667, "line_max": 78, "alpha_frac": 0.5870904963, "autogenerated": false, "ratio": 4.166216216216216, "config_t...
__author__ = 'jerickson' import netCDF4 import shutil import types import os import uuid import time ### PRMS File representation class PRMSFile: def __init__(self, basefile): self.basefile = basefile self.workingscenario = None def begin_scenario(self, scenarioname): ''' Star...
{ "repo_name": "ruiwu1990/fire_simulation_education", "path": "app/api/PRMSCoverageTool.py", "copies": "1", "size": "5316", "license": "bsd-3-clause", "hash": -4319937112369216000, "line_mean": 36.4436619718, "line_max": 138, "alpha_frac": 0.574303988, "autogenerated": false, "ratio": 3.8521739130...
__author__ = 'jerickson' # Lookup table for snow_intcp variable def lookup_snow_intcp(covtype): snow_intcp = [0.01, 0.01, 0.002, 0.01, 0.0] return snow_intcp[covtype] lookup_snow_intcp_ref = lookup_snow_intcp # Lookup table for srain_intcp variable def lookup_srain_intcp(covtype): srain_intcp = [0.05, 0.0...
{ "repo_name": "ruiwu1990/fire_simulation_education", "path": "app/api/PRMSLookup.py", "copies": "1", "size": "2560", "license": "bsd-3-clause", "hash": -3721779543451168300, "line_mean": 32.2597402597, "line_max": 75, "alpha_frac": 0.6265625, "autogenerated": false, "ratio": 2.622950819672131, ...
__author__ = 'Jernej' from camera import camera from elevons import elevons from motor_handler import motor_handler from sensors import sensors import commands as c MODE="M" CONTROL="C" HOLD="H" ALT="T" AUTO="A" CAMERA="S" RECORD="R" MANUAL="m" STABILIZED="s" RESQUE="r" DISCONNECT = "X" SERVO_INIT = "SI" SERVO_LI...
{ "repo_name": "jeryfast/piflyer", "path": "piflyer/old/commander.py", "copies": "1", "size": "4610", "license": "apache-2.0", "hash": 2531574690891434500, "line_mean": 28.5512820513, "line_max": 99, "alpha_frac": 0.5436008677, "autogenerated": false, "ratio": 3.489780469341408, "config_test": f...
__author__ = 'Jernej' from commander import commander from comm import comm import threading import time class mainserver(): def __init__(self): self.client=comm() self.commander=commander() #self.sendThread=dataSendingThread(self.client, self.commander) #self.sendThread = m.Process...
{ "repo_name": "jeryfast/piflyer", "path": "piflyer/old/mainserver.py", "copies": "1", "size": "2075", "license": "apache-2.0", "hash": 4384593151617850000, "line_mean": 29.0724637681, "line_max": 88, "alpha_frac": 0.578313253, "autogenerated": false, "ratio": 3.929924242424242, "config_test": f...
__author__ = 'Jernej' import number_range as n import time import Adafruit_PCA9685 import delays MIN=0 MAX=100 # Initialise the PWM device using the default address pwm = Adafruit_PCA9685.PCA9685(0x41) # Note if you'd like more debug output you can instead run: # pwm = PWM(0x40, debug=True) # Set frequency to 60 Hz ...
{ "repo_name": "jeryfast/piflyer", "path": "piflyer/motor_handler.py", "copies": "1", "size": "1901", "license": "apache-2.0", "hash": -1911645288464448300, "line_mean": 25.7746478873, "line_max": 99, "alpha_frac": 0.6449237244, "autogenerated": false, "ratio": 3.468978102189781, "config_test": ...
__author__ = 'Jernej' import os BITRATE_MAX=17000000 HEIGHT_MAX=1080 class streamer: def __init__(self,ip): self.height=720 self.width=1080 self.fps=25 self.bitrate=8000000 self.ipAddress=ip def run(self): os.system("raspivid -t 0 -h "+self.height+" -w "+self.wi...
{ "repo_name": "jeryfast/piflyer", "path": "piflyer/old/draft/streamer.py", "copies": "1", "size": "1096", "license": "apache-2.0", "hash": 5326636074673150000, "line_mean": 28.6216216216, "line_max": 254, "alpha_frac": 0.5711678832, "autogenerated": false, "ratio": 3.2046783625730995, "config_t...
__author__ = 'Jernej' import socket from piflyer.commander import commander import piflyer.commands as c TCP_PORT = 13000 BUFFER_SIZE = 20 # Normally 1024, but we want fast response class mainserver: def __init__(self): self.conn="" self.addr="" def run(self): #create an INET, STREA...
{ "repo_name": "jeryfast/piflyer", "path": "piflyer/old/draft/mainserver.py", "copies": "1", "size": "1160", "license": "apache-2.0", "hash": -2861965244931458600, "line_mean": 25.976744186, "line_max": 67, "alpha_frac": 0.5905172414, "autogenerated": false, "ratio": 3.7419354838709675, "config_...
__author__ = "Jerome Kieffer" __license__ = "MIT" __copyright__ = "2017, ESRF" import numpy from math import log from .collections import GOF from ._cormap import measure_longest class LongestRunOfHeads(object): """Implements the "longest run of heads" by Mark F. Schilling The College Mathematics Journal, V...
{ "repo_name": "kif/freesas", "path": "freesas/cormap.py", "copies": "1", "size": "4026", "license": "mit", "hash": 2966892423137648000, "line_mean": 32, "line_max": 106, "alpha_frac": 0.5705414804, "autogenerated": false, "ratio": 3.528483786152498, "config_test": false, "has_no_keywords": fa...
__author__ = 'jerrico' from datetime import date import arrow from phishnetpy.exceptions import * from phishnetpy.decorators import check_api_key, check_authorized_user import requests class PhishNetAPI(object): DEFAULT_VERSION = '2.0' DEFAULT_RETRY = 3 FORMAT = 'json' def __init__(self, api_key=N...
{ "repo_name": "meg2208/phishnetpy", "path": "phishnetpy/phishnet_api.py", "copies": "2", "size": "27027", "license": "mit", "hash": -6920461131981221000, "line_mean": 44.4235294118, "line_max": 127, "alpha_frac": 0.6143856144, "autogenerated": false, "ratio": 4.20065278209512, "config_test": fa...
import random,string,hashlib import requests from urllib import request import urllib from bs4 import BeautifulSoup def haslib(): a = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(10)) print (a) b = hashlib.md5("".join("str_args").encode('utf-8')).hexdigest()...
{ "repo_name": "tencrance/cool-config", "path": "python3/playground.py", "copies": "1", "size": "1091", "license": "mit", "hash": 3687607227569992000, "line_mean": 21.7291666667, "line_max": 68, "alpha_frac": 0.5783684693, "autogenerated": false, "ratio": 3.1623188405797102, "config_test": false...
from urllib import request import morse_talk as mtalk from bs4 import BeautifulSoup from requests_toolbelt import MultipartEncoder import requests def get0(): m = MultipartEncoder( fields={'field0': 'value', 'field1': 'value', 'field2': ('filename', open('/Users/yang/Desktop/Screen Shot 2...
{ "repo_name": "niasand/cool-config", "path": "python_tricks/playground.py", "copies": "1", "size": "1331", "license": "mit", "hash": 7292362919999146000, "line_mean": 23.6481481481, "line_max": 129, "alpha_frac": 0.5927873779, "autogenerated": false, "ratio": 3.0318906605922553, "config_test": ...
__author__ = 'Jerry' import os, imp def preBuild(channel, project, client): path = os.path.join(client, 'channelinfo', channel, 'script') if not os.path.exists(os.path.join(path, 'build.py')): pass else: fp, pathname, description = imp.find_module('build', [path]) try: m...
{ "repo_name": "ucloud/chameleon", "path": "client/tools/buildtool/chameleon_tool/chameleon_script.py", "copies": "3", "size": "1267", "license": "mit", "hash": -6685826988733499000, "line_mean": 34.2222222222, "line_max": 71, "alpha_frac": 0.5382794002, "autogenerated": false, "ratio": 3.91049382...
__author__ = 'jerry' import os, sys import codecs TOKEN_START = 'STARTCHAR' TOKEN_UNICODE = 'U_' TOKEN_ENCODING = 'ENCODING' TOKEN_UNICODE_START = 'STARTCHAR U_' TOKEN_BITMAP = 'BITMAP' TOKEN_END = 'ENDCHAR' class BDFReader(object): def load(self): if not os.path.exists(self.bdffile): raise Exc...
{ "repo_name": "jerryshang/led", "path": "loveapp/modules/bdfreader.py", "copies": "1", "size": "3210", "license": "mit", "hash": 9031032965185641000, "line_mean": 32.8, "line_max": 98, "alpha_frac": 0.4919003115, "autogenerated": false, "ratio": 4.058154235145386, "config_test": false, "has_n...
__author__ = 'jerry' import cStringIO import contextlib import logging import pstats import time @contextlib.contextmanager def measure_time(label=None, logger=None, loglevel=logging.INFO, precision=2): """ Measure how much time has passed between beginning and end of a block """ start = time.clock() tr...
{ "repo_name": "MillionIntegrals/ESL", "path": "common/profiling.py", "copies": "1", "size": "1511", "license": "mit", "hash": 6323895909069897000, "line_mean": 22.9841269841, "line_max": 82, "alpha_frac": 0.6101919259, "autogenerated": false, "ratio": 4.280453257790368, "config_test": false, ...
__author__ = 'Jerry' import os, sys, shutil, zipfile, re from optparse import OptionParser def merge(dir1, dir2, difflist): print('difflist: ', difflist) for d in difflist: if d.endswith('.dex') or d.endswith('.arsc'): return joind1 = os.path.join(dir1, d) joind2 = os.path....
{ "repo_name": "uclouddotcn/chameleon", "path": "client/tools/buildtool/chameleon_tool/diff_file.py", "copies": "3", "size": "2355", "license": "mit", "hash": -3908297395942522000, "line_mean": 29.6438356164, "line_max": 86, "alpha_frac": 0.6079570854, "autogenerated": false, "ratio": 2.8424396442...
__author__ = 'jerry' import sys,urllib import time def get_title(page): title_pos = page.find("article-header") title = page[title_pos + 43 + len(url):] return title[:title.find("</h1>")] def get_content(page): content_pos = page.find("article-content") content = page[content_pos:] content = c...
{ "repo_name": "jerrynlp/Linear_Models", "path": "Data_Sets/Crawler.py", "copies": "1", "size": "1423", "license": "apache-2.0", "hash": -4269289182336668000, "line_mean": 28.6666666667, "line_max": 99, "alpha_frac": 0.6170063247, "autogenerated": false, "ratio": 3.0934782608695652, "config_test...
__author__ = 'Jerry' #!/usr/bin/env python import zipfile, sys, os, shutil from optparse import OptionParser BASEDIR = os.path.split(os.path.realpath(__file__))[0] APK_TOOL_PATH = os.path.join(BASEDIR, 'apktool') DIFF_TOOL_PATH = os.path.join(BASEDIR, 'diff_file.py') unzipPath = 'unzipPath' apktoolPath = 'apktoolPat...
{ "repo_name": "uclouddotcn/chameleon", "path": "client/tools/buildtool/chameleon_tool/build_channel_new.py", "copies": "3", "size": "3887", "license": "mit", "hash": -3531329843229568000, "line_mean": 29.6062992126, "line_max": 103, "alpha_frac": 0.576794443, "autogenerated": false, "ratio": 3.52...
__author__ = 'jerzydem' def stripNonAlphaNum(text): import re return re.compile(r'\W+', re.UNICODE).split(text) def contains_digits(d): # DUPLICATE FUNCTION IN extractor.py # TODO - remove duplication import re _digits = re.compile('\d') return bool(_digits.search(d)) def get_csv_heade...
{ "repo_name": "DigitalHistorians/bs_scraper", "path": "cleaner.py", "copies": "1", "size": "15700", "license": "mit", "hash": -8337668112393296000, "line_mean": 31.6857749469, "line_max": 153, "alpha_frac": 0.4945433286, "autogenerated": false, "ratio": 2.8318616629874906, "config_test": false,...
__author__ = 'jerzydem' EXTRA_COLUMNS_HEADERS = [ 'osoba', 'daty-zycia', 'rok-urodzenia', 'miejsce-i-rok-urodzenia', 'rok-smierci', 'miejsce-i-rok-smierci', 'baza' ] def contains_digits(d): import re _digits = re.compile('\d') return bool(_digits.search(d)) def containsAny(...
{ "repo_name": "DigitalHistorians/bs_scraper", "path": "extractor.py", "copies": "1", "size": "7744", "license": "mit", "hash": 1529244611820446700, "line_mean": 26.6428571429, "line_max": 126, "alpha_frac": 0.5414136193, "autogenerated": false, "ratio": 3.8445106805762546, "config_test": false,...
__author__ = 'jerzydem' # TODO # def get_image def prepare_page_url(name): import urllib refine_name = name.replace('?', ' ').replace('-', ' ').replace('(', ' ').replace(')', ' '); # add name values to table names_table = refine_name.split() # prepare url query name_query = '' for token...
{ "repo_name": "DigitalHistorians/bs_scraper", "path": "get_files.py", "copies": "1", "size": "4214", "license": "mit", "hash": 9088004090286811000, "line_mean": 27.8493150685, "line_max": 95, "alpha_frac": 0.599002849, "autogenerated": false, "ratio": 3.394037066881547, "config_test": false, ...
# This tic-tac-toe game requires the colorama Python library, which is # available here: http://pypi.python.org/pypi/colorama or can be downloaded # through pip by typing "sudo pip install colorama" into a terminal window from colorama import init, Fore, Back, Style import os init() # Initializes board board1 = [1, ...
{ "repo_name": "jessebikman/Tictactoe-colorama", "path": "ultimate_game.py", "copies": "1", "size": "12724", "license": "mit", "hash": 5305826810082694000, "line_mean": 49.2924901186, "line_max": 103, "alpha_frac": 0.5149324112, "autogenerated": false, "ratio": 3.1148102815177476, "config_test":...