text
stringlengths
0
1.05M
meta
dict
from django.db import models from django.conf import settings import django.utils.timezone as timezone from django.core.exceptions import ValidationError import uuid class Author(models.Model): user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) url...
{ "repo_name": "CMPUT404W17T06/CMPUT404-project", "path": "dash/models.py", "copies": "1", "size": "4865", "license": "apache-2.0", "hash": -7983634182781003000, "line_mean": 35.3059701493, "line_max": 96, "alpha_frac": 0.6495375128, "autogenerated": false, "ratio": 4.077954735959765, "config_te...
from django.http import HttpResponse, JsonResponse, HttpResponseForbidden from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.views.decorators.http import require_POST, require_G...
{ "repo_name": "CMPUT404W17T06/CMPUT404-project", "path": "dash/views.py", "copies": "1", "size": "29985", "license": "apache-2.0", "hash": -414301183872413440, "line_mean": 38.2988204456, "line_max": 131, "alpha_frac": 0.5768217442, "autogenerated": false, "ratio": 4.506989328122652, "config_te...
from rest_framework.views import APIView from dash.models import Post, Author, Category, CanSee from .serializers import PostSerializer from .verifyUtils import postValidators, NotFound, ResourceConflict from .dataUtils import validateData, pidToUrl, getPostData, getPost from .httpUtils import JSONResponse class Pos...
{ "repo_name": "CMPUT404W17T06/CMPUT404-project", "path": "rest/singlePostView.py", "copies": "1", "size": "5349", "license": "apache-2.0", "hash": 2672465103251961000, "line_mean": 29.5657142857, "line_max": 76, "alpha_frac": 0.5593568891, "autogenerated": false, "ratio": 4.560102301790281, "co...
from urllib.parse import urlsplit, urlunsplit from django.core.paginator import Paginator from rest_framework import serializers import requests from dash.models import Post, Author, Comment, Category, CanSee, \ RemoteCommentAuthor from .models import RemoteCredentials from .authUtils import ...
{ "repo_name": "CMPUT404W17T06/CMPUT404-project", "path": "rest/serializers.py", "copies": "1", "size": "6263", "license": "apache-2.0", "hash": 7819549094870637000, "line_mean": 37.6604938272, "line_max": 80, "alpha_frac": 0.5732077279, "autogenerated": false, "ratio": 4.60514705882353, "config...
""" Django settings for stream project. Generated by 'django-admin startproject' using Django 1.10.6. 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://docs.djangoproject.com/en/1.10/ref/settings/ """ import os...
{ "repo_name": "CMPUT404W17T06/CMPUT404-project", "path": "stream/settings.py", "copies": "1", "size": "4316", "license": "apache-2.0", "hash": -6690968736740382000, "line_mean": 25.6419753086, "line_max": 91, "alpha_frac": 0.6953197405, "autogenerated": false, "ratio": 3.4037854889589907, "conf...
"""stream URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
{ "repo_name": "CMPUT404W17T06/CMPUT404-project", "path": "stream/urls.py", "copies": "1", "size": "1283", "license": "apache-2.0", "hash": -9002874958720669000, "line_mean": 41.7666666667, "line_max": 115, "alpha_frac": 0.680436477, "autogenerated": false, "ratio": 3.4864130434782608, "config_t...
#TODO: Add test cases import subprocess, re, datetime from dateutil.parser import * #Warning: If ffprobe's output is ever changed, this part might break. def getLength(filename): result = subprocess.Popen(["ffprobe", filename], stdout = subprocess.PIPE, stderr = subprocess.STDOUT) return [x for x in result.st...
{ "repo_name": "timezombi/lsvd", "path": "video_duration.py", "copies": "1", "size": "1032", "license": "apache-2.0", "hash": 8151305958726048000, "line_mean": 31.25, "line_max": 109, "alpha_frac": 0.7509689922, "autogenerated": false, "ratio": 3.4864864864864864, "config_test": false, "has_no...
__author__ = 'Brandon C. Kelly' import numpy as np import matplotlib.pyplot as plt from scipy.linalg import solve from scipy.optimize import minimize import samplers import multiprocessing import _carmcmc as carmcmcLib class CarmaModel(object): """ Class for performing statistical inference assuming a CARMA(...
{ "repo_name": "farr/carma_pack", "path": "src/carmcmc/carma_pack.py", "copies": "1", "size": "68810", "license": "mit", "hash": -131876566897171710, "line_mean": 43.5949449125, "line_max": 120, "alpha_frac": 0.5952768493, "autogenerated": false, "ratio": 3.6120734908136485, "config_test": false...
# MIT License # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, ...
{ "repo_name": "brandonhamilton/updown-python", "path": "updown/__init__.py", "copies": "1", "size": "3415", "license": "mit", "hash": -4784523748264064000, "line_mean": 33.8469387755, "line_max": 132, "alpha_frac": 0.6442166911, "autogenerated": false, "ratio": 3.675995694294941, "config_test":...
__author__ = 'brandonkelly' from distutils.core import setup, Extension import numpy.distutils.misc_util import os import platform system_name= platform.system() #desc = open("README.rst").read() extension_version = "0.1.0" extension_url = "https://github.com/bckelly80/big_data_combine" BOOST_DIR = os.environ["BOOST_...
{ "repo_name": "brandonckelly/BDC", "path": "HMLinMAE/python/hmlin_mae/setup.py", "copies": "2", "size": "2409", "license": "mit", "hash": -7518694493696822000, "line_mean": 42.0178571429, "line_max": 121, "alpha_frac": 0.6508924865, "autogenerated": false, "ratio": 3.3181818181818183, "config_t...
__author__ = 'brandonkelly' import numpy as np from numba import jit import matplotlib.pyplot as plt from scipy.interpolate import interp1d import time @jit # if you don't have number, then comment out this line but this routine will be slow! def dynamic_time_warping(tseries1, tseries2): """ Compute the dyn...
{ "repo_name": "brandonckelly/bck_stats", "path": "bck_stats/dba.py", "copies": "1", "size": "13381", "license": "mit", "hash": -720592700124811400, "line_mean": 40.0490797546, "line_max": 120, "alpha_frac": 0.5677453105, "autogenerated": false, "ratio": 3.6312075983717773, "config_test": false,...
__author__ = 'brandonkelly' import numpy as np from sklearn.isotonic import IsotonicRegression class REACT(object): def __init__(self, basis='DCT', n_components=None, method='monotone'): try: basis.lower() in ['dct', 'manual'] except ValueError: 'Input basis must be eithe...
{ "repo_name": "brandonckelly/bck_stats", "path": "bck_stats/react.py", "copies": "1", "size": "6675", "license": "mit", "hash": -5587184589497234000, "line_mean": 34.1315789474, "line_max": 109, "alpha_frac": 0.5546067416, "autogenerated": false, "ratio": 3.3814589665653494, "config_test": fals...
__author__ = 'brandonkelly' import numpy as np import abc from sklearn.linear_model import LogisticRegression from sklearn.grid_search import GridSearchCV, ParameterGrid from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifi...
{ "repo_name": "brandonckelly/bck_stats", "path": "build/lib/bck_stats/sklearn_estimator_suite.py", "copies": "2", "size": "26762", "license": "mit", "hash": 735642944689450400, "line_mean": 50.3685220729, "line_max": 120, "alpha_frac": 0.5966295494, "autogenerated": false, "ratio": 4.035283474065...
__author__ = 'brandonkelly' import numpy as np import carmcmc as cm import matplotlib.pyplot as plt from os import environ import cPickle from astropy.io import fits import multiprocessing from matplotlib.mlab import detrend_mean base_dir = environ['HOME'] + '/Projects/carma_pack/src/paper/' data_dir = base_dir + 'd...
{ "repo_name": "brandonckelly/carma_pack", "path": "src/paper/carma_paper.py", "copies": "2", "size": "35307", "license": "mit", "hash": 5748780017111876000, "line_mean": 37.7989010989, "line_max": 123, "alpha_frac": 0.5956892401, "autogenerated": false, "ratio": 2.78490298154283, "config_test":...
__author__ = 'brandonkelly' import numpy as np import matplotlib.pyplot as plt from os import environ from scipy.misc import comb import carmcmc # true values p = 5 # order of AR polynomial sigmay = 2.3 qpo_width = np.array([1.0/100.0, 1.0/100.0, 1.0/500.0]) qpo_cent = np.array([1.0/5.0, 1.0/50.0]) ar_roots = carmcm...
{ "repo_name": "farr/carma_pack", "path": "cpp_tests/analyze_test_data.py", "copies": "2", "size": "2137", "license": "mit", "hash": -1445658283519073300, "line_mean": 32.9365079365, "line_max": 108, "alpha_frac": 0.7061300889, "autogenerated": false, "ratio": 2.4935822637106186, "config_test": ...
__author__ = 'brandonkelly' import numpy as np import matplotlib.pyplot as plt from sklearn.neighbors import NearestNeighbors from scipy.spatial.distance import cdist from scipy import linalg import multiprocessing def distance_matrix(Xvals): covar = np.cov(Xvals, rowvar=0) covar_inv = linalg.inv(covar) ...
{ "repo_name": "brandonckelly/bck_stats", "path": "bck_stats/avg_pred_comp.py", "copies": "1", "size": "5610", "license": "mit", "hash": -6113874521818590000, "line_mean": 34.5126582278, "line_max": 123, "alpha_frac": 0.6178253119, "autogenerated": false, "ratio": 3.090909090909091, "config_test...
__author__ = 'brandonkelly' import numpy as np import matplotlib.pyplot as plt import lib_hmlinmae as maeLib import yamcmcpp class LinMAESample(yamcmcpp.MCMCSample): def __init__(self, y, X): super(LinMAESample, self).__init__() self.y = y self.X = X self.mfeat = X[0].shape[1] ...
{ "repo_name": "brandonckelly/BDC", "path": "HMLinMAE/hmlin_mae.py", "copies": "2", "size": "3300", "license": "mit", "hash": 8837069948865763000, "line_mean": 28.7297297297, "line_max": 81, "alpha_frac": 0.5857575758, "autogenerated": false, "ratio": 3.2384690873405297, "config_test": false, ...
__author__ = 'brandonkelly' import numpy as np import matplotlib.pyplot as plt import os # physical constants, cgs clight = 2.99792458e10 hplanck = 6.6260755e-27 kboltz = 1.380658e-16 wavelength = np.asarray([100.0, 160.0, 250.0, 350.0, 500.0]) # observational wavelengths in microns nu = clight / (wavelength / 1e4)...
{ "repo_name": "brandonckelly/CUDAHM", "path": "dusthm/src/python/make_dusthm_data.py", "copies": "1", "size": "2257", "license": "mit", "hash": 555827005448047700, "line_mean": 27.9487179487, "line_max": 102, "alpha_frac": 0.5923792645, "autogenerated": false, "ratio": 2.286727456940223, "confi...
__author__ = 'brandonkelly' import numpy as np import matplotlib.pyplot as plt import pandas as pd import hmlinmae_gibbs as hmlin import os import multiprocessing as mp from sklearn.ensemble import GradientBoostingRegressor from sklearn import cross_validation from sklearn.metrics import mean_absolute_error import cPi...
{ "repo_name": "brandonckelly/BDC", "path": "boost_hmlin_residuals.py", "copies": "1", "size": "9181", "license": "mit", "hash": -8890185631665146000, "line_mean": 29.7056856187, "line_max": 105, "alpha_frac": 0.5826162727, "autogenerated": false, "ratio": 3.0964586846543, "config_test": false, ...
__author__ = 'brandonkelly' import numpy as np import matplotlib.pyplot as plt class GcvExpSmoother(object): def __init__(self, lookback=30): """ Constructor for class to perform exponentially-weighted average smoothing of a 1-D data set. @param lookback: The maximum look-back length to ...
{ "repo_name": "brandonckelly/bck_stats", "path": "bck_stats/gcv_smoother.py", "copies": "1", "size": "4289", "license": "mit", "hash": -4714377831514575000, "line_mean": 34.4462809917, "line_max": 119, "alpha_frac": 0.6152949405, "autogenerated": false, "ratio": 3.4505229283990344, "config_test...
__author__ = 'brandonkelly' import numpy as np import pandas as pd import os base_dir = os.environ['HOME'] + '/Projects/Kaggle/big_data_combine/' def boxcox(x): if np.any(x < 0): u = x elif np.any(x == 0): lamb = 0.5 u = (x ** lamb - 1.0) / lamb else: u = np.log(x) r...
{ "repo_name": "brandonckelly/BDC", "path": "get_data.py", "copies": "1", "size": "1654", "license": "mit", "hash": 4036594477273187300, "line_mean": 26.5833333333, "line_max": 88, "alpha_frac": 0.5562273277, "autogenerated": false, "ratio": 2.958855098389982, "config_test": false, "has_no_key...
__author__ = 'brandonkelly' import unittest import numpy as np from scipy import stats, integrate from tree import * import matplotlib.pyplot as plt from test_tree_parameters import build_test_data, SimpleBartStep class ProposalTestCase(unittest.TestCase): def setUp(self): nsamples = 500 nfeature...
{ "repo_name": "acbecker/BART", "path": "tests/test_bart_proposal.py", "copies": "1", "size": "7492", "license": "mit", "hash": 9188560527729688000, "line_mean": 40.3922651934, "line_max": 120, "alpha_frac": 0.5858248799, "autogenerated": false, "ratio": 3.8381147540983607, "config_test": true, ...
__author__ = 'brandonkelly' import unittest import numpy as np from scipy import stats, integrate from tree import * import matplotlib.pyplot as plt # generate test data from an ensemble of trees def build_test_data(X, sigsqr, ngrow=5, mtrees=1): if np.isscalar(ngrow): ngrow = [ngrow] * mtrees ytemp...
{ "repo_name": "acbecker/BART", "path": "tests/test_tree_parameters.py", "copies": "1", "size": "11055", "license": "mit", "hash": 386242495227616800, "line_mean": 38.3416370107, "line_max": 120, "alpha_frac": 0.5952057892, "autogenerated": false, "ratio": 3.2774977764601245, "config_test": true...
__author__ = 'brandonkelly' __notes__ = "Adapted from Dan Foreman-Mackey triangle.py module." import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator def multiclass_triangle(xs, classes, labels=None, verbose=True, fig=None, **kwargs): # Deal with 1D sample lists. xs = np....
{ "repo_name": "brandonckelly/bck_stats", "path": "bck_stats/multiclass_triangle_plot.py", "copies": "1", "size": "4254", "license": "mit", "hash": 5972071105419535000, "line_mean": 35.6810344828, "line_max": 120, "alpha_frac": 0.4974141984, "autogenerated": false, "ratio": 3.4726530612244897, "...
__author__ = 'brcinko' from django.conf.urls import patterns, include, url from django.contrib import admin from rest_framework.urlpatterns import format_suffix_patterns import views urlpatterns = patterns('', url(r'^$', views.index, name='index'), url(r'^admin/', includ...
{ "repo_name": "erigones/api_squid", "path": "urls.py", "copies": "1", "size": "1446", "license": "bsd-3-clause", "hash": 6763217094894526000, "line_mean": 56.84, "line_max": 129, "alpha_frac": 0.5456431535, "autogenerated": false, "ratio": 4.3293413173652695, "config_test": false, "has_no_key...
__author__ = 'brcinko' import os import psycopg2 import psycopg2.extras import json import fileinput import string from settings import * """ This file contains method to update a reconfigure squid proxy server """ """ example of JSON in aclrule.values: {"values":[ "192.168.0.0/24", "127.0.0.0/24" ] } EVERY R...
{ "repo_name": "erigones/api_squid", "path": "helpers.py", "copies": "1", "size": "3668", "license": "bsd-3-clause", "hash": 888139865856307300, "line_mean": 28.5887096774, "line_max": 114, "alpha_frac": 0.5932388222, "autogenerated": false, "ratio": 3.3962962962962964, "config_test": false, "...
__author__ = 'breddels' # due to 32 bit limitations in numpy, we cannot use astropy's fits module for writing colfits import sys import math import vaex.dataset import astropy.io.fits import numpy as np import logging logger = logging.getLogger("vaex.file.colfits") def empty(filename, length, column_names, data_type...
{ "repo_name": "maartenbreddels/vaex", "path": "packages/vaex-core/vaex/file/colfits.py", "copies": "1", "size": "6157", "license": "mit", "hash": 6014363751789437000, "line_mean": 37.248447205, "line_max": 142, "alpha_frac": 0.6495046289, "autogenerated": false, "ratio": 2.8757589911256423, "co...
__author__ = 'breddels' from ctypes import * import h5py import sys import numpy as np import mmap import vaex import vaex.vaexfast import timeit import threading filename = sys.argv[1] h5file = h5py.File(filename, "r") column = h5file[sys.argv[2]] length = len(column) assert column.dtype == np.float64 offset = colu...
{ "repo_name": "maartenbreddels/vaex", "path": "bin/vaex_benchmark_mmap.py", "copies": "1", "size": "2992", "license": "mit", "hash": 1518520504967281400, "line_mean": 26.2, "line_max": 109, "alpha_frac": 0.7072192513, "autogenerated": false, "ratio": 2.676207513416816, "config_test": false, "...
__author__ = 'breddels' import javaobj import sys import io if __name__ == "__main__": import logging javaobj._log.setLevel(logging.DEBUG) jobj = file(sys.argv[1]).read()[16 + 5:] print((repr(jobj[:100]))) pobj, index = javaobj.loads(jobj) rest = jobj[index:] import zlib print((repr(re...
{ "repo_name": "maartenbreddels/vaex", "path": "packages/vaex-ui/vaex/ui/gbin.py", "copies": "1", "size": "1100", "license": "mit", "hash": -4504849823928897000, "line_mean": 27.2051282051, "line_max": 58, "alpha_frac": 0.5354545455, "autogenerated": false, "ratio": 3.206997084548105, "config_te...
__author__ = 'breddels' import logging logger = logging.getLogger("vaex.file") opener_classes = [] normal_open = open def register(cls): opener_classes.append(cls) import vaex.file.other try: import vaex.hdf5 as hdf5 except ImportError: hdf5 = None if hdf5: import vaex.hdf5.dataset def can_open(path...
{ "repo_name": "maartenbreddels/vaex", "path": "packages/vaex-core/vaex/file/__init__.py", "copies": "1", "size": "1718", "license": "mit", "hash": 5187195840335908000, "line_mean": 30.2363636364, "line_max": 96, "alpha_frac": 0.6426076834, "autogenerated": false, "ratio": 3.2476370510396975, "c...
__author__ = 'breddels' """ Demonstrates combining Qt and tornado, both which want to have their own event loop. The solution is to run tornado in a thread, the issue is that callbacks will then also be executed in this thread, and Qt doesn't like that. To fix this, I show how to use execute the callback in the main th...
{ "repo_name": "maartenbreddels/vaex", "path": "misc/gist/qt_and_tornado.py", "copies": "1", "size": "3697", "license": "mit", "hash": 8335357420540310000, "line_mean": 37.1134020619, "line_max": 140, "alpha_frac": 0.7541249662, "autogenerated": false, "ratio": 3.333633904418395, "config_test": ...
__author__ = 'breddels' import unittest import vaex as vx import vaex.utils import vaex.image import numpy as np default_size = 2 default_shape = (default_size, default_size) class TestImage(unittest.TestCase): def test_blend(self): black = vaex.image.background(default_shape, "black") white = vae...
{ "repo_name": "maartenbreddels/vaex", "path": "packages/vaex-core/vaex/test/misc.py", "copies": "1", "size": "1519", "license": "mit", "hash": 955847813265572400, "line_mean": 28.7843137255, "line_max": 75, "alpha_frac": 0.5911784068, "autogenerated": false, "ratio": 3.273706896551724, "config_...
__author__ = 'Brenda' from egat.testset import SequentialTestSet from webdriver_resource import WebDriverResource from selenium import webdriver from selenium.webdriver.common.keys import Keys import time from egat.execution_groups import execution_group from selenium.webdriver.common.action_chains import ActionChains...
{ "repo_name": "scotlowery/egat", "path": "examples/example_amazon/trade_in.py", "copies": "2", "size": "5181", "license": "mit", "hash": -2070476349811414500, "line_mean": 39.8031496063, "line_max": 108, "alpha_frac": 0.5651418645, "autogenerated": false, "ratio": 3.8664179104477614, "config_te...
__author__ = 'Brenda' from egat.testset import SequentialTestSet from webdriver_resource import WebDriverResource from selenium import webdriver import time class Test5(SequentialTestSet): def testStep1(self): # We can access the configuration parameters from inside any test function. base_url = s...
{ "repo_name": "scotlowery/egat", "path": "examples/example_jqueryui/toggle_class.py", "copies": "2", "size": "2093", "license": "mit", "hash": -8654669389129581000, "line_mean": 36.3928571429, "line_max": 105, "alpha_frac": 0.65169613, "autogenerated": false, "ratio": 3.883116883116883, "config...
__author__ = 'Brenda' from egat.testset import SequentialTestSet from webdriver_resource import WebDriverResource from selenium import webdriver class Test6(SequentialTestSet): def testStep1(self): # We can access the configuration parameters from inside any test function. base_url = self.configur...
{ "repo_name": "egineering-llc/egat", "path": "examples/example_jqueryui/selectmenu.py", "copies": "2", "size": "3332", "license": "mit", "hash": 8634309000428778000, "line_mean": 41.7307692308, "line_max": 109, "alpha_frac": 0.6278511405, "autogenerated": false, "ratio": 3.677704194260486, "con...
__author__ = 'brendan' import endpoints from protorpc import message_types from protorpc import messages from google.appengine.ext import ndb DEBUG = True USER_AUTH_RC = endpoints.ResourceContainer(message_types.VoidMessage, email=messages.StringField(1, required=True), ...
{ "repo_name": "boneil3/hyperAdmit", "path": "backend/utils.py", "copies": "2", "size": "1692", "license": "mit", "hash": -7233083410390446000, "line_mean": 43.5526315789, "line_max": 93, "alpha_frac": 0.5561465721, "autogenerated": false, "ratio": 4.524064171122995, "config_test": false, "has...
__author__ = 'brendan' import Quandl import pandas as pd #secs = ['EURUSD', 'GBPUSD', 'EURGBP', 'AUDUSD', 'USDMXN', 'USDINR', 'USDBRL', 'USDCAD', 'USDZAR'] #datas = [] #for i, sec in enumerate(secs): # data = pd.DataFrame(Quandl.get('CURRFX/' + sec, authtoken='ZoAeCkDnkL4oFQs1z2_u')['Rate']) # data = data.loc['2...
{ "repo_name": "boneil3/backtest", "path": "data.py", "copies": "1", "size": "6251", "license": "mit", "hash": 8071876989895362000, "line_mean": 56.3486238532, "line_max": 118, "alpha_frac": 0.6938089906, "autogenerated": false, "ratio": 2.1971880492091387, "config_test": false, "has_no_keywor...
__author__ = 'Brendan' import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), "lib")) from endpoints_proto_datastore.ndb.model import EndpointsModel from endpoints_proto_datastore.ndb.properties import EndpointsAliasProperty from endpoints_proto_datastore.ndb import EndpointsDateTimeProperty from ...
{ "repo_name": "Yury191/hyperAdmit", "path": "backend/models.py", "copies": "2", "size": "6715", "license": "mit", "hash": 4853666161414979000, "line_mean": 36.3055555556, "line_max": 117, "alpha_frac": 0.6731198809, "autogenerated": false, "ratio": 3.8837478311162523, "config_test": false, "h...
__author__ = 'Brendan' import sys sys.path.insert(0, 'lib') sys.path.insert(0, 'stripe') from webapp2_extras.auth import InvalidPasswordError, InvalidAuthIdError from protorpc import remote from backend.models import AdmissionsOfficer from backend.models import User from backend.models import FreeUser from backend.util...
{ "repo_name": "Yury191/hyperAdmit", "path": "backend/endpoint_classes.py", "copies": "2", "size": "6823", "license": "mit", "hash": -2486036300456606700, "line_mean": 45.7328767123, "line_max": 132, "alpha_frac": 0.5846401876, "autogenerated": false, "ratio": 3.811731843575419, "config_test": f...
__author__ = 'brendan' import helper_functions import networkx as nx import matplotlib.pyplot as plt import datetime from operator import itemgetter import numpy as np import os proj_cwd = os.path.dirname(os.getcwd()) data_dir = proj_cwd + r'/data' ############### # BUILD A GRAPH ############### # Load data from the...
{ "repo_name": "brschneidE3/LegalNetworks", "path": "python_code/main.py", "copies": "1", "size": "3440", "license": "mit", "hash": -8358682998653153000, "line_mean": 35.5957446809, "line_max": 120, "alpha_frac": 0.6220930233, "autogenerated": false, "ratio": 3.310875842155919, "config_test": fa...
__author__ = 'brendan' import helper_functions import os import csv import datetime import matplotlib.pyplot as plt import networkx as nx proj_cwd = os.path.dirname(os.getcwd()) data_dir = proj_cwd + r'/data' def consolidate(court_name): """ Given court_name, a string representing a CourtListener court, con...
{ "repo_name": "brschneidE3/LegalNetworks", "path": "python_code/consolidate_data.py", "copies": "1", "size": "5733", "license": "mit", "hash": 8513154163254786000, "line_mean": 35.5159235669, "line_max": 119, "alpha_frac": 0.5954997384, "autogenerated": false, "ratio": 3.3983402489626555, "conf...
__author__ = 'brendan' import helper_functions import os import tarfile proj_cwd = os.path.dirname(os.getcwd()) data_dir = proj_cwd + r'/data' def download_url(url, destination_path, curl_path=r'C:/Users/brendan/Downloads/curl-7.38.0-win64/bin/curl'): """ This is a quick and easy function that simulates cli...
{ "repo_name": "brschneidE3/LegalNetworks", "path": "python_code/download_data_batch.py", "copies": "1", "size": "5208", "license": "mit", "hash": -3995542414378783000, "line_mean": 41.6885245902, "line_max": 119, "alpha_frac": 0.6401689708, "autogenerated": false, "ratio": 3.329923273657289, "c...
__author__ = 'brendan' import json from webapp2_extras.appengine.auth.models import UserToken from webapp2_extras.auth import InvalidAuthIdError from webapp2_extras.auth import InvalidPasswordError from backend.models import User from backend.basehandlers import BaseHandler import sys sys.path.insert(0, 'stripe') im...
{ "repo_name": "boneil3/hyperAdmit", "path": "backend/auth.py", "copies": "2", "size": "6302", "license": "mit", "hash": -9197112624926563000, "line_mean": 31.4896907216, "line_max": 96, "alpha_frac": 0.5547445255, "autogenerated": false, "ratio": 4.198534310459694, "config_test": false, "has_...
__author__ = 'brendan' import main import pandas as pd import numpy as np from datetime import datetime as dt from matplotlib import pyplot as plt import random import itertools import time import dateutil from datetime import timedelta cols = ['BoP FA Net', 'BoP FA OI Net', 'BoP FA PI Net', 'CA % GDP'] raw_data = pd...
{ "repo_name": "boneil3/backtest", "path": "BoP.py", "copies": "1", "size": "3114", "license": "mit", "hash": -5144292381117619000, "line_mean": 36.987804878, "line_max": 108, "alpha_frac": 0.6380860629, "autogenerated": false, "ratio": 2.1945031712473573, "config_test": false, "has_no_keyword...
__author__ = 'brendan' import pandas as pd import numpy as np from datetime import datetime as dt from matplotlib import pyplot as plt from main import Backtest import random import itertools import time import dateutil import sys sys.path.append('raw_data') raw_data = pd.read_csv('raw_data/npr_history.csv') data =...
{ "repo_name": "boneil3/backtest", "path": "tic.py", "copies": "1", "size": "2796", "license": "mit", "hash": -4084143796034819000, "line_mean": 41.3787878788, "line_max": 120, "alpha_frac": 0.6552217454, "autogenerated": false, "ratio": 3.022702702702703, "config_test": false, "has_no_keyword...
__author__ = 'brendan' import pandas as pd import numpy as np from datetime import datetime as dt from matplotlib import pyplot as plt import random import itertools import time import dateutil import sys sys.path.append('raw_data') class Backtest(): def __init__(self): self.prices = pd.read_csv('raw_da...
{ "repo_name": "boneil3/backtest", "path": "main.py", "copies": "1", "size": "10391", "license": "mit", "hash": 8060628764924463000, "line_mean": 34.7079037801, "line_max": 117, "alpha_frac": 0.4849388894, "autogenerated": false, "ratio": 3.1893799877225293, "config_test": false, "has_no_keywo...
__author__ = "Brendan O'Connor (anyall.org, brenocon@gmail.com)" #### Modified by Satish Palaniappan ### Insert Current Path import os, sys, inspect cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0])) if cmd_folder not in sys.path: sys.path.insert(0, cmd_folder) ...
{ "repo_name": "tpsatish95/SocialTextFilter", "path": "Twokenize/emoticons.py", "copies": "1", "size": "1928", "license": "apache-2.0", "hash": 489043959897261500, "line_mean": 28.2121212121, "line_max": 105, "alpha_frac": 0.6415975104, "autogenerated": false, "ratio": 2.342648845686513, "config...
__author__ = "Brendan O'Connor (anyall.org, brenocon@gmail.com)" ''' Copyright 2015 Serendio Inc. Modified By - Satish Palaniappan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache....
{ "repo_name": "tpsatish95/Python-Workshop", "path": "Python Scripts/social-text-parser/Twokenize/emoticons.py", "copies": "2", "size": "2484", "license": "apache-2.0", "hash": -4516260468148241000, "line_mean": 30.8461538462, "line_max": 168, "alpha_frac": 0.6751207729, "autogenerated": false, "r...
__author__ = "Brett Bowman" """ import ConsensusCore as cc from BarcodeAnalysis.utils import (arrayFromDataset, asFloatFeature, QUIVER_FEATURES) class ConsensusCoreRead(object): def __init__(self, bax, holeNum, start, end, chemistry): s...
{ "repo_name": "bnbowman/BarcodeAnalysis", "path": "BarcodeAnalysis/ConsensusCoreRead.py", "copies": "1", "size": "3102", "license": "mit", "hash": 6517154028440666000, "line_mean": 32.3548387097, "line_max": 94, "alpha_frac": 0.6009026435, "autogenerated": false, "ratio": 4.018134715025907, "co...
__author__ = 'brett' from monopyly import * from monopyly.utility import Logger from monopyly.game.board import Board from monopyly.squares.property import Property from monopyly.squares.property_set import PropertySet from monopyly.squares.station import Station from monopyly.squares.street import Street from monopyl...
{ "repo_name": "richard-shepherd/monopyly", "path": "AIs/Brett Hutley/buffy.py", "copies": "1", "size": "45035", "license": "mit", "hash": -8352565394576279000, "line_mean": 37.25913339, "line_max": 219, "alpha_frac": 0.5828429304, "autogenerated": false, "ratio": 3.6706064558200198, "config_tes...
__author__ = 'BrianAguirre' from DataStructures.Lists.Itr import Itr from DataStructures.Lists.Itr import Node class List: node_list = [] size = len(node_list) - 2 head = Node() tail = Node() itr = Itr(head) node_list.append(head) node_list.append(tail) def __init__(self): ...
{ "repo_name": "brianaguirre/SampleCodingInterviews", "path": "DataStructures/Lists/List.py", "copies": "1", "size": "1311", "license": "mit", "hash": -2344312290060280300, "line_mean": 17.7285714286, "line_max": 50, "alpha_frac": 0.5675057208, "autogenerated": false, "ratio": 3.1820388349514563, ...
__author__ = 'BrianAguirre' __twitter__ = 'bnap48' ''' REQUIREMENTS: Given three int numbers, calculate which is the most late valid time you can write out of them. EX: (1, 2, 3, 4) -> 23:41 It has to be valid. If no valid time can be made with the four numbers, return 'NO SOLUTION' Print should be in format AB:CD, w...
{ "repo_name": "brianaguirre/SampleCodingInterviews", "path": "ValidLateTimes.py", "copies": "1", "size": "5176", "license": "mit", "hash": 397480870556093630, "line_mean": 22.9675925926, "line_max": 95, "alpha_frac": 0.4333462133, "autogenerated": false, "ratio": 3.3675992192582953, "config_tes...
__author__ = 'briana' import sys import os import math import skimage.io import skimage.exposure import numpy as np SOLAR_IRRADIANCE = { 'LT4': {5: 214.700, 4: 1033.000, 3: 1554.000}, 'LT5': {5: 214.900, 4: 1036.000, 3: 1551.000}, 'LE7': {5: 225.700, 4: 1044.000, 3: 1547.000} } def get_value_from_fil...
{ "repo_name": "zooniverse/kelp", "path": "import-pipeline/color_calibration.py", "copies": "1", "size": "2418", "license": "apache-2.0", "hash": -2871293246245683700, "line_mean": 33.0704225352, "line_max": 121, "alpha_frac": 0.6162117452, "autogenerated": false, "ratio": 2.959608323133415, "co...
from Devices.Input import Input from Devices.Timer import Timer from Devices.AnalogInput import AnalogInput from Devices.Output import Output class DeviceManager: def __init__(self): self.inputs = {} self.outputs = {} def addSimpleInput(self, name, location, invert = False): if name in self.inputs: raise K...
{ "repo_name": "dillmann/rscs", "path": "lib/DeviceManager.py", "copies": "1", "size": "1683", "license": "mit", "hash": -9088539949999225000, "line_mean": 35.5869565217, "line_max": 106, "alpha_frac": 0.7272727273, "autogenerated": false, "ratio": 3.455852156057495, "config_test": false, "has...
import re class Evaluator: # devices should be a DeviceManager Object def __init__(self, devices): self.devices = devices def evaluate(self, condition): try: self.checkLegalExpression(condition) except: raise ValueError(e) # extract device name from quotes in condition deviceNameExtract = re.find...
{ "repo_name": "dillmann/rscs", "path": "lib/Graph/Evaluator.py", "copies": "1", "size": "1059", "license": "mit", "hash": 3869587469151834600, "line_mean": 29.2571428571, "line_max": 92, "alpha_frac": 0.7053824363, "autogenerated": false, "ratio": 3.372611464968153, "config_test": false, "has...
__author__ = 'Brian Farrell' __date_created__ = '1/17/14' import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.audio import MIMEAudio from email.mime.base import MIMEBase from email.mime.image import MIMEImage from email import encoders import mimetypes fr...
{ "repo_name": "vtcgit/ArcPy_Messenger", "path": "ScriptMessaging.py", "copies": "1", "size": "7303", "license": "mit", "hash": -4401430514029833700, "line_mean": 38.2688172043, "line_max": 164, "alpha_frac": 0.6115295084, "autogenerated": false, "ratio": 4.3756740563211505, "config_test": false...
__author__ = 'brianhoffman' import logging class Node(object): def __init__(self, value): self.value = value self._child_node = None # TODO: do note that this is an ordered linked-list. Perhaps this class should # be renamed to better indicate that. # TODO: use a generator/iterator pattern...
{ "repo_name": "freebazaar/FreeBazaar", "path": "rudp/linkedlist.py", "copies": "3", "size": "3140", "license": "mit", "hash": -289130382915534100, "line_mean": 28.9047619048, "line_max": 87, "alpha_frac": 0.5977707006, "autogenerated": false, "ratio": 3.969658659924147, "config_test": false, ...
__author__ = "Brian Lenihan <brian.lenihan@gmail.com" __copyright__ = "Copyright (c) 2012 Python for Android Project" __license__ = "Apache License, Version 2.0" import logging import android from pyxmpp2.jid import JID from pyxmpp2.client import Client from pyxmpp2.settings import XMPPSettings from pyxmpp2.interface...
{ "repo_name": "louietsai/python-for-android", "path": "python3-alpha/python3-src/android-scripts/say_chat.py", "copies": "46", "size": "2159", "license": "apache-2.0", "hash": 5032170297765571000, "line_mean": 28.5753424658, "line_max": 85, "alpha_frac": 0.6956924502, "autogenerated": false, "rat...
__author__ = "Brian Lenihan <brian.lenihan@gmail.com" __copyright__ = "Copyright (c) 2012 Python for Android Project" __license__ = "Apache License, Version 2.0" import logging import sl4a from pyxmpp2.jid import JID from pyxmpp2.client import Client from pyxmpp2.settings import XMPPSettings from pyxmpp2.interfaces i...
{ "repo_name": "tomMoulard/python-projetcs", "path": "scripts3/say_chat.py", "copies": "1", "size": "2153", "license": "apache-2.0", "hash": -4344941393585683500, "line_mean": 28.4931506849, "line_max": 85, "alpha_frac": 0.6948444032, "autogenerated": false, "ratio": 3.570480928689884, "config_t...
__author__ = "Brian Lenihan <brian.lenihan@gmail.com" __copyright__ = "Copyright (c) 2012 Python for Android Project" __license__ = "Apache License, Version 2.0" import os import logging import android """ Create and set a new Tasker variable, display the variable's value in a Tasker popup, and then clear the variabl...
{ "repo_name": "kmonsoor/python-for-android", "path": "python3-alpha/python3-src/android-scripts/tasker_example.py", "copies": "46", "size": "1883", "license": "apache-2.0", "hash": 6468423920425834000, "line_mean": 28.8888888889, "line_max": 81, "alpha_frac": 0.6431226766, "autogenerated": false, ...
__author__ = "Brian Lenihan <brian.lenihan@gmail.com" __copyright__ = "Copyright (c) 2012 Python for Android Project" __license__ = "Apache License, Version 2.0" import os import logging import sl4a """ Create and set a new Tasker variable, display the variable's value in a Tasker popup, and then clear the variable. ...
{ "repo_name": "tomMoulard/python-projetcs", "path": "scripts3/tasker_example.py", "copies": "1", "size": "1874", "license": "apache-2.0", "hash": 3777273291583605000, "line_mean": 28.746031746, "line_max": 78, "alpha_frac": 0.6414087513, "autogenerated": false, "ratio": 3.192504258943782, "conf...
import math import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl ############################################################################## # Physical constants echarge = float("1.6022e-19") # Coloumbs evjoule = float("1.6022e-19") # eV = ev_to_joule Joules...
{ "repo_name": "brianrlynch85/PlasmaScaling", "path": "src/electron_collection_reduction.py", "copies": "1", "size": "2569", "license": "mit", "hash": 6015472095649605000, "line_mean": 32.8026315789, "line_max": 79, "alpha_frac": 0.5165434021, "autogenerated": false, "ratio": 3.1755253399258345, ...
import math import numpy as np import matplotlib.pyplot as plt ############################################################################## # Physical constants echarge = float("1.6022e-19") # Coloumbs evjoule = float("1.6022e-19") # eV = ev_to_joule Joules eperm = float("8.854e-12") # s^4 A^2 m^-3 kg^-1 ###...
{ "repo_name": "brianrlynch85/PlasmaScaling", "path": "src/larmor_dust.py", "copies": "1", "size": "2482", "license": "mit", "hash": -2438656808747705300, "line_mean": 36.0447761194, "line_max": 78, "alpha_frac": 0.4443996777, "autogenerated": false, "ratio": 2.7304730473047303, "config_test": f...
import math import numpy as np import matplotlib.pyplot as plt import plasma_parameters as plasma # Plasma parameters T_Ar = 0.025 * plasma.evjoule # eV v_Ar = math.sqrt(T_Ar / plasma.m_Ar) # m s^-1 vt_Ar = math.sqrt(8.0 / math.pi) * v_Ar # m s^-1 ##############################...
{ "repo_name": "brianrlynch85/PlasmaScaling", "path": "src/larmor_ion.py", "copies": "1", "size": "2474", "license": "mit", "hash": 5927120969690822000, "line_mean": 31.9866666667, "line_max": 82, "alpha_frac": 0.5226354082, "autogenerated": false, "ratio": 2.5505154639175256, "config_test": fal...
import math import numpy as np import matplotlib.pyplot as plt ############################################################################## # Physical constants echarge = float("1.6022e-19") # Coloumbs evjoule = float("1.6022e-19") # eV = ev_to_joule Joules eperm = float("8.854...
{ "repo_name": "brianrlynch85/PlasmaScaling", "path": "src/larmor_elec.py", "copies": "1", "size": "1658", "license": "mit", "hash": 639673620895497900, "line_mean": 29.1454545455, "line_max": 78, "alpha_frac": 0.4794933655, "autogenerated": false, "ratio": 2.726973684210526, "config_test": fals...
from numpy.testing import assert_array_equal, assert_raises import numpy as np from scipy.optimize import linear_sum_assignment def test_linear_sum_assignment(): for cost_matrix, expected_cost in [ # Square ([[400, 150, 400], [400, 450, 600], [300, 225, 300]], [150,...
{ "repo_name": "Shaswat27/scipy", "path": "scipy/optimize/tests/test_hungarian.py", "copies": "48", "size": "1742", "license": "bsd-3-clause", "hash": -1567834453632790000, "line_mean": 27.5573770492, "line_max": 72, "alpha_frac": 0.5212399541, "autogenerated": false, "ratio": 3.262172284644195, ...
from numpy.testing import assert_array_equal from pytest import raises as assert_raises import numpy as np from scipy.optimize import linear_sum_assignment from scipy.sparse.sputils import matrix def test_linear_sum_assignment(): for sign in [-1, 1]: for cost_matrix, expected_cost in [ # Sq...
{ "repo_name": "person142/scipy", "path": "scipy/optimize/tests/test_linear_assignment.py", "copies": "4", "size": "3150", "license": "bsd-3-clause", "hash": -3455006542766542300, "line_mean": 29.8823529412, "line_max": 76, "alpha_frac": 0.5038095238, "autogenerated": false, "ratio": 3.55129650507...
import numpy as np from numpy.testing import assert_array_equal, assert_raises from clustering_metrics.hungarian import linear_sum_assignment from clustering_metrics.entropy import assignment_cost from nose.tools import assert_equal, assert_almost_equal def test_linear_sum_assignment(): for cost_matrix, expected...
{ "repo_name": "escherba/clustering-metrics", "path": "tests/test_hungarian.py", "copies": "1", "size": "3103", "license": "bsd-3-clause", "hash": -8287419173181598000, "line_mean": 27.7314814815, "line_max": 77, "alpha_frac": 0.5188527232, "autogenerated": false, "ratio": 3.3258306538049305, "c...
import numpy as np from numpy.testing import assert_array_equal, assert_raises from lsh_hdc.hungarian import linear_sum_assignment from lsh_hdc.entropy import assignment_cost from nose.tools import assert_equal, assert_almost_equal def test_linear_sum_assignment(): for cost_matrix, expected_cost in [ # S...
{ "repo_name": "escherba/lsh-hdc", "path": "tests/test_hungarian.py", "copies": "2", "size": "3081", "license": "bsd-3-clause", "hash": -1475381451024048400, "line_mean": 27.5277777778, "line_max": 77, "alpha_frac": 0.5154170724, "autogenerated": false, "ratio": 3.288153681963714, "config_test":...
import numpy as np from numpy.testing import assert_array_equal, assert_raises from scipy.optimize import linear_sum_assignment def test_linear_sum_assignment(): for cost_matrix, expected_cost in [ # Square ([[400, 150, 400], [400, 450, 600], [300, 225, 300]], [150, 4...
{ "repo_name": "DailyActie/Surrogate-Model", "path": "01-codes/scipy-master/scipy/optimize/tests/test_hungarian.py", "copies": "1", "size": "1740", "license": "mit", "hash": 576177658038243600, "line_mean": 28.4915254237, "line_max": 72, "alpha_frac": 0.5218390805, "autogenerated": false, "ratio":...
import numpy as np # XXX we should be testing the public API here from sklearn.utils.linear_assignment_ import _hungarian def test_hungarian(): matrices = [ # Square ([[400, 150, 400], [400, 450, 600], [300, 225, 300]], 850 # expected cost ), # Rec...
{ "repo_name": "phdowling/scikit-learn", "path": "sklearn/utils/tests/test_linear_assignment.py", "copies": "421", "size": "1349", "license": "bsd-3-clause", "hash": -2570489902927458000, "line_mean": 21.4833333333, "line_max": 55, "alpha_frac": 0.447739066, "autogenerated": false, "ratio": 3.5406...
# TODO #0.23: Remove this test module as the methods being tested # have been replaced by SciPy methods import numpy as np import pytest @pytest.mark.filterwarnings("ignore::DeprecationWarning") def test_hungarian(): from sklearn.utils.linear_assignment_ import _hungarian matrices = [ # Square ...
{ "repo_name": "chrsrds/scikit-learn", "path": "sklearn/utils/tests/test_linear_assignment.py", "copies": "5", "size": "1482", "license": "bsd-3-clause", "hash": 4975567760992042000, "line_mean": 22.5238095238, "line_max": 65, "alpha_frac": 0.4777327935, "autogenerated": false, "ratio": 3.60583941...
__author__ = 'Brian M Wilcox' __version__ = '0.1.3' """ Copyright 2014 Brian M Wilcox Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2...
{ "repo_name": "briwilcox/Concurrent-Pandas", "path": "concurrentpandas.py", "copies": "1", "size": "10839", "license": "apache-2.0", "hash": -3338542504680345000, "line_mean": 37.1654929577, "line_max": 128, "alpha_frac": 0.5760679029, "autogenerated": false, "ratio": 4.320047827819849, "config...
__author__ = 'briannelson' import numpy as np import pyaudio import datetime import sys class Utilities: def __init__(self): """ Constructor """ @staticmethod def array_from_bytes(data_chunk, sample_width, data_type): data_length = len(data_chunk) remainder = data...
{ "repo_name": "SidWatch/pySIDWatch", "path": "Source/Audio/Utilities.py", "copies": "1", "size": "4631", "license": "mit", "hash": 4397064531992239000, "line_mean": 33.3037037037, "line_max": 120, "alpha_frac": 0.5227812567, "autogenerated": false, "ratio": 4.368867924528302, "config_test": tru...
__author__ = 'briannelson' import numpy as np class Logging: def __init__(self, values_dictionary): """ Constructor """ self.FilenameFormat = values_dictionary["FilenameFormat"] self.Folder = values_dictionary["Folder"] self.TraceLevel = values_dictionary["TraceLeve...
{ "repo_name": "SidWatch/pySIDServerDataProcessor", "path": "source/SIDServer/Objects.py", "copies": "1", "size": "6997", "license": "mit", "hash": -7395448491553022000, "line_mean": 26.4431372549, "line_max": 87, "alpha_frac": 0.5370873231, "autogenerated": false, "ratio": 3.9089385474860334, "...
__author__ = 'briannelson' import pyaudio import numpy as np class Site: def __init__(self, values_dictionary): """ Constructor """ self.MonitorId = values_dictionary["MonitorId"] self.Name = values_dictionary["Name"] self.Latitude = values_dictionary["Latitude"] ...
{ "repo_name": "SidWatch/pySIDWatch", "path": "Source/SID/Objects.py", "copies": "1", "size": "3323", "license": "mit", "hash": -3272782816073355000, "line_mean": 29.495412844, "line_max": 113, "alpha_frac": 0.6136021667, "autogenerated": false, "ratio": 4.2657252888318355, "config_test": false,...
__author__ = 'briannelson' import yaml import io import h5py from SID import Objects import datetime as dt import math import numpy as np from scipy import signal class DateUtility: def __init__(self): """ Constructor """ @staticmethod def get_next_run_time(current_date_time): ...
{ "repo_name": "SidWatch/pySIDWatch", "path": "Source/SID/Utilities.py", "copies": "1", "size": "6245", "license": "mit", "hash": -2843440281644529000, "line_mean": 30.7005076142, "line_max": 100, "alpha_frac": 0.5681345076, "autogenerated": false, "ratio": 4.092398427260813, "config_test": true...
__author__ = 'Brian' # My first neural net!!! import math import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # Consider implementing feature scaling/whitening (scipy.cluster.vq.whiten?) # Consi...
{ "repo_name": "bhwester/neural-network", "path": "neuralnet.py", "copies": "1", "size": "18251", "license": "mit", "hash": 1912024338889718000, "line_mean": 43.4063260341, "line_max": 164, "alpha_frac": 0.6410607638, "autogenerated": false, "ratio": 3.2486650053399786, "config_test": false, "...
__author__ = "Brian O'Neill" # BTO __doc__ = """ Configurable decorator for debugging and profiling that writes caller name(s), args+values, function return values, execution time, number of call, to stdout or to a logger. log_calls can track call history and provide it in CSV format and Pandas DataFrame format. NOTE:...
{ "repo_name": "Twangist/log_calls", "path": "log_calls/log_calls.py", "copies": "1", "size": "124843", "license": "mit", "hash": -3856040721634263000, "line_mean": 44.7635630499, "line_max": 155, "alpha_frac": 0.5155355126, "autogenerated": false, "ratio": 4.200356638180472, "config_test": fals...
__author__ = "Brian O'Neill" # BTO __doc__ = """ Module version = '0.2.4' Slightly ad-hoc decorator used_unused_keywords for `__init__` function of `log_calls`. It's not *totally* ad-hoc: `log_calls.__init__` only uses half the functionality of this decorator ;/ This decorator allows a function to determine whic...
{ "repo_name": "Twangist/log_calls", "path": "log_calls/used_unused_kwds.py", "copies": "1", "size": "6209", "license": "mit", "hash": -6162236203628143000, "line_mean": 36.1796407186, "line_max": 97, "alpha_frac": 0.5872121115, "autogenerated": false, "ratio": 3.637375512595196, "config_test": ...
__author__ = "Brian O'Neill" # BTO __doc__ = """ Module version = '0.3.0' """ from .deco_settings import DecoSetting, DecoSettingsMapping, DecoSetting_bool from .log_calls import _deco_base, DecoSettingHistory from .used_unused_kwds import used_unused_keywords class record_history(_deco_base): """ """ ...
{ "repo_name": "Twangist/log_calls", "path": "log_calls/record_history.py", "copies": "1", "size": "3808", "license": "mit", "hash": -5299845316110112000, "line_mean": 42.2727272727, "line_max": 121, "alpha_frac": 0.5701155462, "autogenerated": false, "ratio": 3.606060606060606, "config_test": f...
__author__ = "Brian O'Neill" # BTO __version__ = '0.1.14' __doc__ = """ 100% coverage of deco_settings.py """ from unittest import TestCase from log_calls import DecoSetting, DecoSettingsMapping from log_calls.log_calls import DecoSettingEnabled, DecoSettingHistory from collections import OrderedDict import insp...
{ "repo_name": "Twangist/log_calls", "path": "tests/test_deco_settings.py", "copies": "1", "size": "24702", "license": "mit", "hash": -952965135023368700, "line_mean": 42.2609457093, "line_max": 126, "alpha_frac": 0.5885758238, "autogenerated": false, "ratio": 3.9764971023824853, "config_test": ...
__author__ = "Brian O'Neill" # BTO # __version__ = '0.3.0' __doc__ = """ DecoSettingsMapping -- class that's usable with any class-based decorator that has several keyword parameters; this class makes it possible for a user to access the collection of settings as an attribute (object of type DecoSettingsMapping) of th...
{ "repo_name": "Twangist/log_calls", "path": "log_calls/deco_settings.py", "copies": "1", "size": "27911", "license": "mit", "hash": 3632666086308834000, "line_mean": 41.8082822086, "line_max": 119, "alpha_frac": 0.5869012217, "autogenerated": false, "ratio": 4.1441722345953975, "config_test": f...
__author__ = 'brianoneill' from log_calls import log_calls ############################################################################## def test_double_func_deco(): """ Double-decorating a function doesn't raise: >>> @log_calls() ... @log_calls() ... def f(): pass >>> f() f <== called by <...
{ "repo_name": "Twangist/log_calls", "path": "tests/test_double_func_deco.py", "copies": "1", "size": "2809", "license": "mit", "hash": 2229902743336150000, "line_mean": 27.6632653061, "line_max": 89, "alpha_frac": 0.5738697045, "autogenerated": false, "ratio": 3.564720812182741, "config_test": ...
__author__ = 'brianoneill' from log_calls import log_calls, record_history import doctest def test_(): """ ``record_history`` is equivalent to ``log_calls`` with the settings: record_history=True log_call_numbers=True mute=log_calls.MUTE.CALLS This example, ``f``, doesn't use ``log_message`` or ``log...
{ "repo_name": "Twangist/log_calls", "path": "tests/test_log_calls_as_record_history.py", "copies": "1", "size": "2287", "license": "mit", "hash": -2907061340422337000, "line_mean": 29.0921052632, "line_max": 86, "alpha_frac": 0.5557498907, "autogenerated": false, "ratio": 3.02113606340819, "con...
__author__ = 'brianoneill' from log_calls import record_history #----------------------------------------------------- # record_history.print, record_history.print_exprs # Test in methods, in functions #----------------------------------------------------- def test_rh_log_message__output_expected(): """ -----...
{ "repo_name": "Twangist/log_calls", "path": "tests/test_record_history_log_methods.py", "copies": "1", "size": "8533", "license": "mit", "hash": -5525261937872755000, "line_mean": 27.5384615385, "line_max": 80, "alpha_frac": 0.4522442283, "autogenerated": false, "ratio": 3.5028735632183907, "co...
__author__ = 'brianoneill' import doctest from log_calls import log_calls # from log_calls.tests.settings_with_NO_DECO import g_DECORATE, g_settings_dict from settings_with_NO_DECO import g_DECORATE, g_settings_dict def test_no_deco__via_dict(): """ >>> @log_calls(settings=g_settings_dict) ... def f(n, m...
{ "repo_name": "Twangist/log_calls", "path": "tests/test_no_deco__via_dict.py", "copies": "1", "size": "1618", "license": "mit", "hash": 4791455272864588000, "line_mean": 26.8965517241, "line_max": 79, "alpha_frac": 0.4703337454, "autogenerated": false, "ratio": 3.611607142857143, "config_test":...
__author__ = 'brianoneill' import doctest from log_calls import log_calls ############################################################################## def test_deco_lambda(): """ >>> f = log_calls()(lambda x: 2 * x) >>> f(3) <lambda> <== called by <module> arguments: x=3 <lambda> ==> re...
{ "repo_name": "Twangist/log_calls", "path": "tests/test_deco_lambda_cant_deco_callables.py", "copies": "1", "size": "3571", "license": "mit", "hash": 3510669529132237000, "line_mean": 27.7983870968, "line_max": 85, "alpha_frac": 0.5642677121, "autogenerated": false, "ratio": 3.5781563126252505, ...
__author__ = 'brianoneill' import doctest from log_calls import log_calls #----------------------------------------------------------------------------- def test_dont_decorate__via_file(): """ >>> @log_calls(settings='settings-with-NO_DECO.txt') ... def f(n, m): ... return 3*n*n*m + 4*n*m*m ...
{ "repo_name": "Twangist/log_calls", "path": "tests/test_no_deco__via_file.py", "copies": "1", "size": "1454", "license": "mit", "hash": -7544700846073288000, "line_mean": 25.9259259259, "line_max": 78, "alpha_frac": 0.4215955983, "autogenerated": false, "ratio": 3.9510869565217392, "config_test...
__author__ = "Brian O'Neill" __version__ = '0.3.0' from log_calls import log_calls import doctest #----------------------------------------------------------------------------- # main__test__get_own_log_calls_wrapper # test methods accessing their OWN wrappers via utility function/classmethod # Aiming for complete c...
{ "repo_name": "Twangist/log_calls", "path": "tests/test_get_own_log_calls_wrapper.py", "copies": "1", "size": "7870", "license": "mit", "hash": -6184044619503666000, "line_mean": 35.1009174312, "line_max": 118, "alpha_frac": 0.493519695, "autogenerated": false, "ratio": 3.5482416591523895, "con...
__author__ = "Brian O'Neill" __version__ = '0.3.0' from log_calls import record_history import doctest #----------------------------------------------------------------------------- # main__record_history_class_deco #----------------------------------------------------------------------------- def main__record_histo...
{ "repo_name": "Twangist/log_calls", "path": "tests/test_record_history__class_deco.py", "copies": "1", "size": "5829", "license": "mit", "hash": 1046654000542091100, "line_mean": 30.5081081081, "line_max": 96, "alpha_frac": 0.4712643678, "autogenerated": false, "ratio": 3.5051112447384245, "con...
""" getters, setters, adders, deleters in both raw and numeric format? update method to equivocate raw data and numeric data? Call in read method? how to deal with NaNs? """ import sys import copy import operator import numpy as np import csv import analysis class Data: # Constructor def __init__(self, file...
{ "repo_name": "bhwester/computer-science-projects", "path": "data_analysis_and_visualization_system/data.py", "copies": "1", "size": "15719", "license": "mit", "hash": 70542518007010830, "line_mean": 35.6433566434, "line_max": 127, "alpha_frac": 0.6071633056, "autogenerated": false, "ratio": 3.78...
import numpy as np class View: # constructor def __init__(self): # automatically resets the view self.reset() def reset(self, vrp=np.matrix([0.5, 0.5, 1]), vpn=np.matrix([0, 0, -1]), vup=np.matrix([0, 1, 0]), u=np.matrix([-1, 0, 0]...
{ "repo_name": "bhwester/computer-science-projects", "path": "data_analysis_and_visualization_system/view.py", "copies": "1", "size": "6811", "license": "mit", "hash": 4936978279960080000, "line_mean": 38.3757225434, "line_max": 124, "alpha_frac": 0.4698282191, "autogenerated": false, "ratio": 3.2...
import numpy as np import pandas as pd import sklearn.linear_model as sklearnLinearModel import sklearn.svm as sklearnSVM import matplotlib.pyplot as plt # Read in data fundedCompanies = pd.read_excel("/Users/Brian/Downloads/cb_data_xlsx_sample.xlsx", \ sheetname="Funded Companies") rounds = pd.read_excel("/U...
{ "repo_name": "bhwester/computer-science-projects", "path": "data_analysis_and_visualization_system/finalproject.py", "copies": "1", "size": "2965", "license": "mit", "hash": 4568199451218487000, "line_mean": 38.5333333333, "line_max": 138, "alpha_frac": 0.7679595278, "autogenerated": false, "rat...
__author__ = 'brock' """ Taken from: https://gist.github.com/1094140 """ from functools import wraps from flask import request, current_app from werkzeug.routing import BaseConverter from werkzeug.exceptions import HTTPException def jsonp(func): """Wraps JSONified output for JSONP requests.""" @wraps(func) ...
{ "repo_name": "Sendhub/flashk_util", "path": "request.py", "copies": "1", "size": "5285", "license": "bsd-3-clause", "hash": -978435764751360800, "line_mean": 29.7325581395, "line_max": 93, "alpha_frac": 0.6344370861, "autogenerated": false, "ratio": 4.184481393507522, "config_test": false, "...
class dstat_plugin(dstat): def __init__(self): self.nick = ('read', 'write') def check(self): if not os.path.exists('/proc/fs/lustre/llite'): raise Exception, 'Lustre filesystem not found' info(1, 'Module %s is still experimental.' % self.filename) def name(self): ...
{ "repo_name": "SpamapS/dstat-plugins", "path": "dstat_plugins/plugins/dstat_lustre.py", "copies": "2", "size": "1158", "license": "apache-2.0", "hash": 877481199610314600, "line_mean": 34.0909090909, "line_max": 104, "alpha_frac": 0.5483592401, "autogenerated": false, "ratio": 3.190082644628099, ...
""" author: Brogan Ross A simple to do list app build using kivy. @todo: 1 - move todo item storage to a better location, ie database, or new internal storage location. 2 - test layouts on mobile devices. 3 - Fix weird layout issues with the PopupDialog's content Edit Icon from ...
{ "repo_name": "broganross/kivy_tests", "path": "todo/main.py", "copies": "1", "size": "10816", "license": "mit", "hash": 2513866079621651000, "line_mean": 31.7757575758, "line_max": 121, "alpha_frac": 0.5953217456, "autogenerated": false, "ratio": 3.9691743119266056, "config_test": false, "ha...
__author__ = 'broglea' import hashlib import string import itertools def hash_value(type=None, value=None): if type is None: return 'You must specify a type' if value is None: return 'You must specify a value' if type == 'MD5': return hashlib.md5(value).hexdigest() if type == ...
{ "repo_name": "HackUCF/collabCTF", "path": "tools/crypto.py", "copies": "1", "size": "2974", "license": "mit", "hash": 5064461042047061000, "line_mean": 27.0566037736, "line_max": 101, "alpha_frac": 0.5625420309, "autogenerated": false, "ratio": 3.986595174262735, "config_test": false, "has_n...
__author__ = 'brooksc' from pprint import pprint import requests import json, time from requests.auth import HTTPBasicAuth # import sys import collections import json import time API_BASE_URL = 'http://www.bugherd.com/api_v2/{api}' class Error(Exception): pass class Response(object): def __init__(self, bo...
{ "repo_name": "brooksc/bugherd", "path": "bugherd/__init__.py", "copies": "1", "size": "15558", "license": "mit", "hash": 8345657850478032000, "line_mean": 29.5058823529, "line_max": 233, "alpha_frac": 0.5903072374, "autogenerated": false, "ratio": 3.5103790613718413, "config_test": false, "h...
""" Check that promotion of read replicas and renaming instances works as expected """ import unittest import time from boto.rds import RDSConnection class PromoteReadReplicaTest(unittest.TestCase): rds = True def setUp(self): self.conn = RDSConnection() self.mainDB_name = "boto-db-%s" % str...
{ "repo_name": "KaranToor/MA450", "path": "google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/rds/test_promote_modify.py", "copies": "2", "size": "5397", "license": "apache-2.0", "hash": -8197522717942799000, "line_mean": 38.1086956522, "line_max": 134, "alpha_frac": 0.6283120252, "...