text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'endrit bajo'
import distances import utils
class Dataset:
data = {}
similar_items = {}
def __init__(self, data):
self.data = data
def get():
return data
def flip():
"""
Transform dataset. Transform the data from:
data = {
item1 :... | {
"repo_name": "endritbajo/movie-recommendations",
"path": "movie_recommendations/recommendations.py",
"copies": "1",
"size": "4669",
"license": "mit",
"hash": 2485905511036983000,
"line_mean": 26.3040935673,
"line_max": 114,
"alpha_frac": 0.4469907903,
"autogenerated": false,
"ratio": 4.678356713... |
__author__ = 'ENG.AHMED HANI'
from ActivationFunctions.MathFunction import *
import random
class Neuron(object):
__weights = []
__bias = 0.0
__input = []
__net = 0.0
__output = 0.0
__activationFunction = MathFunction
__signalError = 0.0
@property
def Input(self):
return se... | {
"repo_name": "AhmedHani/Python-Neural-Networks-API",
"path": "NeuralNetwork/Neuron.py",
"copies": "1",
"size": "3326",
"license": "mit",
"hash": -3616880655723525000,
"line_mean": 23.637037037,
"line_max": 89,
"alpha_frac": 0.5853878533,
"autogenerated": false,
"ratio": 4.519021739130435,
"con... |
"""
LaTeX2e document tree Writer.
"""
__docformat__ = 'reStructuredText'
# code contributions from several people included, thanks to all.
# some named: David Abrahams, Julien Letessier, Lele Gaifax, and others.
#
# convention deactivate code by two # e.g. ##.
import sys
import time
import re
import string
from typ... | {
"repo_name": "pombreda/django-hotclub",
"path": "libs/external_libs/docutils-0.4/docutils/writers/latex2e/__init__.py",
"copies": "6",
"size": "76611",
"license": "mit",
"hash": -6711936597961417000,
"line_mean": 36.4077148438,
"line_max": 91,
"alpha_frac": 0.5521269792,
"autogenerated": false,
... |
"""
LaTeX2e document tree Writer.
"""
__docformat__ = 'reStructuredText'
# code contributions from several people included, thanks to all.
# some named: David Abrahams, Julien Letessier, Lele Gaifax, and others.
#
# convention deactivate code by two # e.g. ##.
import sys
import time
import re
import ... | {
"repo_name": "hugs/selenium",
"path": "selenium/src/py/lib/docutils/writers/latex2e/__init__.py",
"copies": "5",
"size": "79388",
"license": "apache-2.0",
"hash": 5573117510317014000,
"line_mean": 36.5378640777,
"line_max": 91,
"alpha_frac": 0.538431501,
"autogenerated": false,
"ratio": 3.956344... |
__author__ = 'enriqueramirez'
import csv
import sys
import datetime
from models import PreAccountStatement
from StatementProcessor import StatementProcessor
# 1. Open the file and pass the information to a list
with open('test2.csv', 'rU') as csvfile:
reader = csv.reader(csvfile, dialect=csv.excel_tab, delimiter... | {
"repo_name": "EnriqueRE/Estado-de-Cuenta",
"path": "Transaction Uploader/app.py",
"copies": "1",
"size": "1880",
"license": "apache-2.0",
"hash": 8248184795095818000,
"line_mean": 32.5892857143,
"line_max": 79,
"alpha_frac": 0.7430851064,
"autogenerated": false,
"ratio": 3.6862745098039214,
"c... |
__author__ = 'enriqueramirez'
import json
import urllib2, base64
import requests
from collections import OrderedDict
class PreAccountStatement:
def fix_date (self, date):
dates = date.split('.')
dates[0], dates[-1] = dates[-1], dates[0]
return '-'.join(dates)
def fix_id (self, id):
... | {
"repo_name": "EnriqueRE/Estado-de-Cuenta",
"path": "Transaction Uploader/models.py",
"copies": "1",
"size": "2990",
"license": "apache-2.0",
"hash": -2410231471413264400,
"line_mean": 31.5108695652,
"line_max": 77,
"alpha_frac": 0.5705685619,
"autogenerated": false,
"ratio": 3.3259176863181312,
... |
import copy
import numpy
import random
class partitioner_hierfm:
final_partitions = []
study_partitions = []
max_gain = 3
strongly_non_linear = ['abs', 'sqrt']
# Fixed elements through the partitioning.
graph = None
max_size = None
# Elements that will change in each FM run.
nets = {}
... | {
"repo_name": "eSedano/hoplite",
"path": "0.5/partitioners/partitioner_hierfm.py",
"copies": "1",
"size": "7397",
"license": "mit",
"hash": -3297423803537044500,
"line_mean": 34.5673076923,
"line_max": 125,
"alpha_frac": 0.6120048668,
"autogenerated": false,
"ratio": 2.9588,
"config_test": fals... |
import numpy
class search_max_minus_one:
def __init__(self, source_config, model, log=None):
self.limits = source_config['noise_lims']
self.model = model
self.log = log
def run(self):
initial_wlv = self.model.num_noises * [32]
uniform_wlv = self._search_uniform_wlv(initial_wlv)
variab... | {
"repo_name": "eSedano/hoplite",
"path": "0.5/searches/search_max_minus_one.py",
"copies": "1",
"size": "2290",
"license": "mit",
"hash": -181212132976303780,
"line_mean": 34.78125,
"line_max": 146,
"alpha_frac": 0.6462882096,
"autogenerated": false,
"ratio": 3.098782138024357,
"config_test": f... |
import os
import sys
import copy
import time
import random
import scipy
import sympy
import pickle
import threading
from sympy import Symbol
from scipy import linalg
sys.dont_write_bytecode = True
parentdir = os.path.dirname(__file__)
sys.path.insert(0,parentdir)
import hoplite_utils
from lib import c_matrix
from l... | {
"repo_name": "eSedano/hoplite",
"path": "0.5/models/model_megpc_mt.py",
"copies": "1",
"size": "38908",
"license": "mit",
"hash": -4995435381099027000,
"line_mean": 40.7478540773,
"line_max": 205,
"alpha_frac": 0.6159658682,
"autogenerated": false,
"ratio": 3.468045280328015,
"config_test": fa... |
import os
import sys
import shutil
import subprocess
class input_llvm:
def __init__(self, config, source, destination):
self.tool_path = os.path.join(config['llvm_path'], 'Release+Asserts', 'lib', 'hoplite_llvm_graph_extractor.so')
self.source = source
self.destination = destination
try:
... | {
"repo_name": "eSedano/hoplite",
"path": "0.5/input_interfaces/input_llvm.py",
"copies": "1",
"size": "2319",
"license": "mit",
"hash": -761410479309809000,
"line_mean": 34.6923076923,
"line_max": 117,
"alpha_frac": 0.6459680897,
"autogenerated": false,
"ratio": 3.5842349304482224,
"config_test... |
import sys
import copy
import time
import random
import scipy
import sympy
import pickle
from sympy import Symbol
from scipy import linalg
import os,sys
parentdir = os.path.dirname(__file__)
sys.path.insert(0,parentdir)
import hoplite_utils
from lib import c_matrix
from lib import pce_ops
from itertools import prod... | {
"repo_name": "eSedano/hoplite",
"path": "0.5/models/model_megpc.py",
"copies": "1",
"size": "37352",
"license": "mit",
"hash": -4110926642345399000,
"line_mean": 40.9225589226,
"line_max": 205,
"alpha_frac": 0.6153084172,
"autogenerated": false,
"ratio": 3.4736352645773274,
"config_test": true... |
import sys
import copy
import time
import random
import scipy
import sympy
from sympy import Symbol
from scipy import linalg
import os,sys
parentdir = os.path.dirname(__file__)
sys.path.insert(0,parentdir)
import hoplite_utils
from lib import c_matrix
from lib import pce_ops
from itertools import product
class mod... | {
"repo_name": "eSedano/hoplite",
"path": "0.5/models/model_pce_cond.py",
"copies": "1",
"size": "32537",
"license": "mit",
"hash": 9197963081807584000,
"line_mean": 40.6606914213,
"line_max": 163,
"alpha_frac": 0.6268555798,
"autogenerated": false,
"ratio": 3.4828730464568616,
"config_test": fa... |
__author__ = "Eppel, Tamas"
__copyright__ = "Copyright 2012"
__license__ = "BSD"
def _create_pairs(args):
result = []
if args is None or args == []:
return result
if len(args) % 2 != 0:
raise ValueError('args length is not even. args [%s]' % str(args))
i = 0
while i < len(args):
... | {
"repo_name": "peletomi/con",
"path": "src/lib/domain.py",
"copies": "1",
"size": "1873",
"license": "bsd-3-clause",
"hash": -5581689965761668000,
"line_mean": 23.0128205128,
"line_max": 74,
"alpha_frac": 0.4906567005,
"autogenerated": false,
"ratio": 3.7991886409736306,
"config_test": false,
... |
__author__ = "Eppel, Tamas"
__copyright__ = "Copyright 2012"
__license__ = "BSD"
from lib.domain import ValueRepo, Key
import unittest
class ValueRepoTest(unittest.TestCase):
def setUp(self):
self.repo = ValueRepo()
def testAddGetSimple(self):
"""Exact match between repo and retrieval key."... | {
"repo_name": "peletomi/con",
"path": "test/test_valueRepo.py",
"copies": "1",
"size": "2355",
"license": "bsd-3-clause",
"hash": -8849176567482692000,
"line_mean": 28.8227848101,
"line_max": 92,
"alpha_frac": 0.5630573248,
"autogenerated": false,
"ratio": 3.432944606413994,
"config_test": true... |
__author__ = 'eran'
"""
Test for backward & forward algorithm
This test is based on Durbin p. 61
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from hmm.HMMModel import HMMModel
__author__ = 'eran'
n_tiles = 5000
fair = True
dice = []
realDice = []
for i in range(0, n... | {
"repo_name": "eranroz/dnase",
"path": "src/tests/loadedDiceBF.py",
"copies": "1",
"size": "2913",
"license": "mit",
"hash": 4122294719667815000,
"line_mean": 26.7428571429,
"line_max": 101,
"alpha_frac": 0.6560247168,
"autogenerated": false,
"ratio": 2.5396687009590235,
"config_test": false,
... |
__author__ = 'eranroz'
import numpy as np
class MultivariateNormal(object):
"""
Normal distribution for multidimensional data
@param mean: mean array
@param cov: covariance matrix
"""
def __init__(self, mean, cov):
mean = np.array(mean)
if len(mean.shape) == 1:
mea... | {
"repo_name": "eranroz/dnase",
"path": "src/hmm/multivariatenormal.py",
"copies": "1",
"size": "3452",
"license": "mit",
"hash": 8039785828212670000,
"line_mean": 32.1923076923,
"line_max": 93,
"alpha_frac": 0.5454808806,
"autogenerated": false,
"ratio": 3.052166224580018,
"config_test": false,... |
__author__ = 'Eric Ahn'
from twisted.internet.protocol import Factory, Protocol
from twisted.internet import reactor
import subprocess
import requests
import base64
from PIL import Image
api = 'http://159.203.98.104:3000/'
class SocketServer(Protocol):
def __init__(self):
self.buffer = ''
def dataR... | {
"repo_name": "xasos/3DSnap",
"path": "3ds-shim/send.py",
"copies": "1",
"size": "2353",
"license": "mit",
"hash": -8174612266649706000,
"line_mean": 34.1194029851,
"line_max": 142,
"alpha_frac": 0.5159371016,
"autogenerated": false,
"ratio": 3.3807471264367814,
"config_test": false,
"has_no_... |
__author__ = 'erica-li'
__author__ = 'nate'
from igraph import *
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_csv("/home/nate/Desktop/Workbook1.csv")
df.set_index('Name',inplace=True)
cdf = df.T.corr()
print(cdf)
def mat_2_graph(df,threshold=.5):
""... | {
"repo_name": "Li-Erica/Insight-Challenge",
"path": "src/test_graph_plot.py",
"copies": "1",
"size": "1254",
"license": "mit",
"hash": -2644777686911699000,
"line_mean": 18.59375,
"line_max": 62,
"alpha_frac": 0.5669856459,
"autogenerated": false,
"ratio": 2.869565217391304,
"config_test": fals... |
__author__ = 'Erica Li'
import sys
import json
import numpy as np
from time import mktime, strptime
from Hash_Tag_Graph import hash_tag_graph
def main():
"""
Main function for parsing and writing tweets.
This code loops through every new line of the input file, ignoring anything that doesnt
match t... | {
"repo_name": "Li-Erica/Insight-Challenge",
"path": "src/average_degree.py",
"copies": "1",
"size": "2420",
"license": "mit",
"hash": 8840380445693196000,
"line_mean": 29.2625,
"line_max": 105,
"alpha_frac": 0.5962809917,
"autogenerated": false,
"ratio": 4.108658743633277,
"config_test": false,... |
__author__ = 'Erica Li'
import sys
import json
import numpy as np
from time import mktime, strptime
from Hash_Tag_Graph import hash_tag_graph
def main():
"""
same as average degree.py but takes a third value which determines how many tweets
must be added before the drawing function is called again
... | {
"repo_name": "Li-Erica/Insight-Challenge",
"path": "src/average_degree_draw.py",
"copies": "1",
"size": "2689",
"license": "mit",
"hash": 6310067184922501000,
"line_mean": 28.5604395604,
"line_max": 105,
"alpha_frac": 0.5548531052,
"autogenerated": false,
"ratio": 4.105343511450382,
"config_te... |
from __future__ import absolute_import, division, print_function
import math
import sys
import warnings
from abc import ABCMeta, abstractmethod
import numpy as np
from .grid import GridCircle, GridSphere
from .utils import polar_distance
"""Direction of Arrival (DoA) estimation."""
tol = 1e-14
class ModeVector(... | {
"repo_name": "LCAV/pyroomacoustics",
"path": "pyroomacoustics/doa/doa.py",
"copies": "1",
"size": "19537",
"license": "mit",
"hash": -7090736266303609000,
"line_mean": 31.6160267112,
"line_max": 90,
"alpha_frac": 0.5155858115,
"autogenerated": false,
"ratio": 3.8725470763131815,
"config_test":... |
from __future__ import division, print_function
from .doa import *
class SRP(DOA):
"""
Class to apply Steered Response Power (SRP) direction-of-arrival (DoA) for
a particular microphone array.
.. note:: Run locate_source() to apply the SRP-PHAT algorithm.
Parameters
----------
L: numpy... | {
"repo_name": "LCAV/pyroomacoustics",
"path": "pyroomacoustics/doa/srp.py",
"copies": "1",
"size": "4417",
"license": "mit",
"hash": -6075226904644702000,
"line_mean": 31.4779411765,
"line_max": 85,
"alpha_frac": 0.5637310392,
"autogenerated": false,
"ratio": 3.746395250212044,
"config_test": f... |
from __future__ import division, print_function
from .music import *
class CSSM(MUSIC):
"""
Class to apply the Coherent Signal-Subspace method [CSSM]_ for Direction of
Arrival (DoA) estimation.
.. note:: Run locate_sources() to apply the CSSM algorithm.
Parameters
----------
L: numpy arr... | {
"repo_name": "LCAV/pyroomacoustics",
"path": "pyroomacoustics/doa/cssm.py",
"copies": "1",
"size": "4497",
"license": "mit",
"hash": -835113567457925000,
"line_mean": 33.0681818182,
"line_max": 93,
"alpha_frac": 0.577718479,
"autogenerated": false,
"ratio": 3.4779582366589326,
"config_test": f... |
from .music import *
class WAVES(MUSIC):
"""
Class to apply Weighted Average of Signal Subspaces [WAVES]_ for Direction of
Arrival (DoA) estimation.
.. note:: Run locate_sources() to apply the WAVES algorithm.
Parameters
----------
L: numpy array
Microphone array positions. Each ... | {
"repo_name": "LCAV/pyroomacoustics",
"path": "pyroomacoustics/doa/waves.py",
"copies": "1",
"size": "4355",
"license": "mit",
"hash": 7650825012500374000,
"line_mean": 33.5634920635,
"line_max": 93,
"alpha_frac": 0.5630309989,
"autogenerated": false,
"ratio": 3.375968992248062,
"config_test": ... |
import numpy as np
from .music import MUSIC
from scipy.linalg import svdvals
from scipy import linalg
class TOPS(MUSIC):
"""
Class to apply Test of Orthogonality of Projected Subspaces [TOPS]_ for
Direction of Arrival (DoA) estimation.
.. note:: Run locate_source() to apply the TOPS algorithm.
... | {
"repo_name": "LCAV/pyroomacoustics",
"path": "pyroomacoustics/doa/tops.py",
"copies": "1",
"size": "4345",
"license": "mit",
"hash": 7372821016348617000,
"line_mean": 29.1736111111,
"line_max": 95,
"alpha_frac": 0.5139240506,
"autogenerated": false,
"ratio": 3.5527391659852823,
"config_test": ... |
import numpy as np
from .doa import DOA
class MUSIC(DOA):
"""
Class to apply MUltiple SIgnal Classication (MUSIC) direction-of-arrival
(DoA) for a particular microphone array.
.. note:: Run locate_source() to apply the MUSIC algorithm.
Parameters
----------
L: numpy array
Micro... | {
"repo_name": "LCAV/pyroomacoustics",
"path": "pyroomacoustics/doa/music.py",
"copies": "1",
"size": "5854",
"license": "mit",
"hash": -4081299252913215500,
"line_mean": 30.3048128342,
"line_max": 85,
"alpha_frac": 0.5488554834,
"autogenerated": false,
"ratio": 3.6180469715698393,
"config_test"... |
"""
Class for performing the Discrete Fourier Transform (DFT) and inverse DFT for
real signals, including multichannel. It is also possible to specific an
analysis or synthesis window.
When available, it is possible to use the ``pyfftw`` or ``mkl_fft`` packages.
Otherwise the default is to use ``numpy.fft.rfft``/``n... | {
"repo_name": "LCAV/pyroomacoustics",
"path": "pyroomacoustics/transform/dft.py",
"copies": "1",
"size": "8808",
"license": "mit",
"hash": 2281613243406423300,
"line_mean": 33.814229249,
"line_max": 118,
"alpha_frac": 0.5480245232,
"autogenerated": false,
"ratio": 4.020082154267458,
"config_tes... |
title = """
______
// / _/
__ // // / A Java shell and lightweight build tool
// /_/ // / Version 0.0.4
\\\\____/___/
"""
#======================================================================================================================#
# IMPORTS
#=================... | {
"repo_name": "balancededge/JI",
"path": "ji/ji.py",
"copies": "1",
"size": "13340",
"license": "mit",
"hash": 504265423840948300,
"line_mean": 43.7684563758,
"line_max": 136,
"alpha_frac": 0.5166416792,
"autogenerated": false,
"ratio": 4.116013576056773,
"config_test": false,
"has_no_keyword... |
__author__ = 'Eric Fay'
__version__ = "1.0.0"
import requests
import json
import re
baseAPIURL = "https://haveibeenpwned.com/api/v3/"
fourHundredString = "400 - Bad request - the account does not comply with an acceptable format (i.e. it's an empty string)"
fourOThreeString = "403 - Forbidden - no user agent has be... | {
"repo_name": "icanhasfay/PyPwned",
"path": "pypwned/__init__.py",
"copies": "1",
"size": "5163",
"license": "mit",
"hash": 5342387946723879000,
"line_mean": 36.1438848921,
"line_max": 129,
"alpha_frac": 0.5886112725,
"autogenerated": false,
"ratio": 3.9502677888293802,
"config_test": false,
... |
__author__ = 'Eric Gerling'
import imp
import os
from flask import request, url_for
def active_link(link):
"""
Utility for HTML Templates to see if link is the current page being
viewed.
"""
if link == request.url.split('/')[3]:
return True
return False
def get_url(endpoint... | {
"repo_name": "ericgerling/flashpassing.app",
"path": "flashpassing/util/flaskext.py",
"copies": "1",
"size": "1625",
"license": "mit",
"hash": -3161986902320024000,
"line_mean": 31.5,
"line_max": 113,
"alpha_frac": 0.6061538462,
"autogenerated": false,
"ratio": 3.787878787878788,
"config_test"... |
# Imports
print("importing packages")
from keras.models import Sequential
from keras.layers import Dense, Activation
import keras.utils.visualize_util as keras_vis
from mnist import MNIST
import pdb
import numpy as np
from matplotlib import pyplot as plt
# Configure script
print("configuring script")
EXMNISTIMG = './... | {
"repo_name": "ekalosak/neural_net",
"path": "mnist_ae.py",
"copies": "1",
"size": "2311",
"license": "mit",
"hash": -1086229482099006600,
"line_mean": 32.0142857143,
"line_max": 79,
"alpha_frac": 0.7464301168,
"autogenerated": false,
"ratio": 3.4544095665171897,
"config_test": false,
"has_no... |
__author__ = 'Erick'
from Tkinter import *
from tkMessageBox import *
class Application(Frame):
def __init__(self, frame):
Frame.__init__(self, frame)
self.pack()
self.Widgets()
def clicked(self, content):
if content == "":
showinfo("Clicked", "You typed nothing ... | {
"repo_name": "erickmusembi/Robot-Project",
"path": "GUI/Entry GUI.py",
"copies": "1",
"size": "1187",
"license": "mit",
"hash": 8087435319257426000,
"line_mean": 23.2448979592,
"line_max": 86,
"alpha_frac": 0.5871946083,
"autogenerated": false,
"ratio": 3.7802547770700636,
"config_test": false... |
import os
from nose.tools import assert_raises
from nose.plugins.skip import SkipTest
from os import path as op
import sys
from mne.utils import run_tests_if_main, _TempDir, _get_root_dir
skip_files = (
# known crlf
'FreeSurferColorLUT.txt',
'test_edf_stim_channel.txt',
'FieldTrip.py',
'license.... | {
"repo_name": "alexandrebarachant/mne-python",
"path": "mne/tests/test_line_endings.py",
"copies": "2",
"size": "2400",
"license": "bsd-3-clause",
"hash": -854739339582777700,
"line_mean": 34.2941176471,
"line_max": 79,
"alpha_frac": 0.5658333333,
"autogenerated": false,
"ratio": 3.47322720694645... |
from ...externals.six import string_types
import os
from os import path as op
import zipfile
from sys import stdout
from ...utils import _fetch_file, get_config, set_config, _url_to_local_path
from .urls import (url_match, valid_data_types, valid_data_formats,
valid_conditions)
def data_path(url,... | {
"repo_name": "jaeilepp/eggie",
"path": "mne/datasets/megsim/megsim.py",
"copies": "2",
"size": "8086",
"license": "bsd-2-clause",
"hash": 6774150747181433000,
"line_mean": 38.8325123153,
"line_max": 113,
"alpha_frac": 0.6023992085,
"autogenerated": false,
"ratio": 3.885631907736665,
"config_te... |
import numpy as np
url_root = 'http://cobre.mrn.org/megsim'
urls = ['/empdata/neuromag/visual/subject1_day1_vis_raw.fif',
'/empdata/neuromag/visual/subject1_day2_vis_raw.fif',
'/empdata/neuromag/visual/subject3_day1_vis_raw.fif',
'/empdata/neuromag/visual/subject3_day2_vis_raw.fif',
'... | {
"repo_name": "adykstra/mne-python",
"path": "mne/datasets/megsim/urls.py",
"copies": "10",
"size": "5390",
"license": "bsd-3-clause",
"hash": -5032071245956283000,
"line_mean": 29.1117318436,
"line_max": 98,
"alpha_frac": 0.5094619666,
"autogenerated": false,
"ratio": 3.50227420402859,
"config... |
import numpy as np
valid_data_types = ['experimental', 'simulation']
valid_data_formats = ['single-trial', 'evoked', 'raw']
valid_conditions = ['visual', 'auditory', 'somatosensory']
url_root = 'http://cobre.mrn.org/megsim'
urls = ['/empdata/neuromag/visual/subject1_day1_vis_raw.fif',
'/empdata/neuromag/vis... | {
"repo_name": "effigies/mne-python",
"path": "mne/datasets/megsim/urls.py",
"copies": "1",
"size": "5163",
"license": "bsd-3-clause",
"hash": 6249590863442080000,
"line_mean": 31.0683229814,
"line_max": 84,
"alpha_frac": 0.513461166,
"autogenerated": false,
"ratio": 3.4908722109533468,
"config_... |
import os
from os import path as op
import zipfile
from sys import stdout
from ...utils import (_fetch_file, get_config, set_config, _url_to_local_path,
logger)
from .urls import (url_match, valid_data_types, valid_data_formats,
valid_conditions)
from ...externals.six import s... | {
"repo_name": "effigies/mne-python",
"path": "mne/datasets/megsim/megsim.py",
"copies": "1",
"size": "8156",
"license": "bsd-3-clause",
"hash": -3761355166861036500,
"line_mean": 38.7853658537,
"line_max": 113,
"alpha_frac": 0.6015203531,
"autogenerated": false,
"ratio": 3.8967988533205924,
"co... |
import os
from os import path as op
import zipfile
from sys import stdout
from ...utils import _fetch_file, _url_to_local_path, verbose
from ..utils import _get_path, _do_path_update
from .urls import (url_match, valid_data_types, valid_data_formats,
valid_conditions)
@verbose
def data_path(url, ... | {
"repo_name": "wronk/mne-python",
"path": "mne/datasets/megsim/megsim.py",
"copies": "8",
"size": "6567",
"license": "bsd-3-clause",
"hash": 3212081060680342000,
"line_mean": 38.5602409639,
"line_max": 113,
"alpha_frac": 0.6471752703,
"autogenerated": false,
"ratio": 3.7122668174109665,
"config... |
import numpy as np
import pytest
from mne import create_info
from mne.io import RawArray
from mne.preprocessing import mark_flat
@pytest.mark.parametrize('first_samp', (0, 10000))
def test_mark_flat(first_samp):
"""Test marking flat segments."""
# Test if ECG analysis will work on data that is not preloaded... | {
"repo_name": "adykstra/mne-python",
"path": "mne/preprocessing/tests/test_flat.py",
"copies": "1",
"size": "2476",
"license": "bsd-3-clause",
"hash": 4839601108735197,
"line_mean": 37.6875,
"line_max": 78,
"alpha_frac": 0.5961227787,
"autogenerated": false,
"ratio": 3.1105527638190953,
"config... |
import os.path as op
import matplotlib
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_allclose,
assert_equal)
import pytest
from mne import find_events, Epochs, pick_types, channels
from mne.io import read_raw_fif
from mne.io.array import RawArray
from mne.... | {
"repo_name": "teonlamont/mne-python",
"path": "mne/io/array/tests/test_array.py",
"copies": "2",
"size": "4770",
"license": "bsd-3-clause",
"hash": 2581009780915113000,
"line_mean": 33.5652173913,
"line_max": 79,
"alpha_frac": 0.6119496855,
"autogenerated": false,
"ratio": 2.91921664626683,
"c... |
import os.path as op
import numpy as np
import pytest
from mne import create_info
from mne.datasets import testing
from mne.io import RawArray, read_raw_fif
from mne.preprocessing import annotate_flat
data_path = testing.data_path(download=False)
skip_fname = op.join(data_path, 'misc', 'intervalrecording_raw.fif')
... | {
"repo_name": "larsoner/mne-python",
"path": "mne/preprocessing/tests/test_flat.py",
"copies": "12",
"size": "3296",
"license": "bsd-3-clause",
"hash": -7032396035573814000,
"line_mean": 38.2380952381,
"line_max": 78,
"alpha_frac": 0.6168082524,
"autogenerated": false,
"ratio": 3.1480420248328556... |
import os.path as op
import re
import shutil
import zipfile
import numpy as np
from mne.io.constants import FIFF, FWD
from mne.forward._make_forward import _read_coil_defs
from mne.utils import _fetch_file, requires_good_network
commit = 'a3feddb3011335586d50bc40d1c4e36cea20913f' # mne-tools/fiff-constants
# The... | {
"repo_name": "adykstra/mne-python",
"path": "mne/io/tests/test_constants.py",
"copies": "2",
"size": "13137",
"license": "bsd-3-clause",
"hash": 4321613786141043000,
"line_mean": 41.7915309446,
"line_max": 79,
"alpha_frac": 0.5026261704,
"autogenerated": false,
"ratio": 3.50413443584956,
"conf... |
import os.path as op
import warnings
import matplotlib
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_allclose
from nose.tools import assert_equal, assert_raises, assert_true
from mne import find_events, Epochs, pick_types
from mne.io import read_raw_fif
from mne.io.array import RawAr... | {
"repo_name": "jniediek/mne-python",
"path": "mne/io/array/tests/test_array.py",
"copies": "1",
"size": "4065",
"license": "bsd-3-clause",
"hash": 1016606846782308000,
"line_mean": 33.7435897436,
"line_max": 79,
"alpha_frac": 0.6120541205,
"autogenerated": false,
"ratio": 3.0403889304412863,
"c... |
import os.path as op
import numpy as np
from numpy.testing import assert_allclose, assert_array_less
from scipy.interpolate import interp1d
from scipy.spatial.distance import cdist
import pytest
from mne import pick_types, pick_info
from mne.forward._compute_forward import _MAG_FACTOR
from mne.io import (read_raw_fi... | {
"repo_name": "pravsripad/mne-python",
"path": "mne/tests/test_chpi.py",
"copies": "4",
"size": "28395",
"license": "bsd-3-clause",
"hash": -5416878909985447000,
"line_mean": 42.7519260401,
"line_max": 79,
"alpha_frac": 0.6198978693,
"autogenerated": false,
"ratio": 2.924304840370752,
"config_t... |
import os.path as op
import numpy as np
from numpy.testing import assert_allclose
from scipy.interpolate import interp1d
import pytest
from mne import (pick_types, Dipole, make_sphere_model, make_forward_dipole,
pick_info)
from mne.io import (read_raw_fif, read_raw_artemis123, read_raw_ctf, read_inf... | {
"repo_name": "teonlamont/mne-python",
"path": "mne/tests/test_chpi.py",
"copies": "2",
"size": "18941",
"license": "bsd-3-clause",
"hash": 7601177813769426000,
"line_mean": 43.5670588235,
"line_max": 79,
"alpha_frac": 0.6074124914,
"autogenerated": false,
"ratio": 2.942519807363679,
"config_te... |
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_allclose,
assert_equal)
import pytest
import matplotlib.pyplot as plt
from mne import find_events, Epochs, pick_types, channels
from mne.io import read_raw_fif
from mne.io.array import RawA... | {
"repo_name": "adykstra/mne-python",
"path": "mne/io/array/tests/test_array.py",
"copies": "2",
"size": "6154",
"license": "bsd-3-clause",
"hash": 7865773011049158000,
"line_mean": 34.367816092,
"line_max": 79,
"alpha_frac": 0.6134221644,
"autogenerated": false,
"ratio": 3.0480435859336303,
"co... |
import sys
from mne.utils import run_subprocess
run_script = """
import sys
import mne
out = set()
# check scipy
ok_scipy_submodules = set(['scipy', 'numpy', # these appear in old scipy
'fftpack', 'lib', 'linalg', 'fft',
'misc', 'sparse', 'version'])
scipy_sub... | {
"repo_name": "larsoner/mne-python",
"path": "mne/tests/test_import_nesting.py",
"copies": "6",
"size": "1371",
"license": "bsd-3-clause",
"hash": 1795615700970348500,
"line_mean": 30.8837209302,
"line_max": 77,
"alpha_frac": 0.5506929249,
"autogenerated": false,
"ratio": 3.497448979591837,
"co... |
import sys
from mne.utils import run_subprocess
run_script = """
import sys
import mne
out = set()
# check scipy (Numba imports it to check the version)
ok_scipy_submodules = set(['scipy', 'numpy', # these appear in old scipy
'version'])
scipy_submodules = set(x.split('.')[1] for x in s... | {
"repo_name": "drammock/mne-python",
"path": "mne/tests/test_import_nesting.py",
"copies": "8",
"size": "1372",
"license": "bsd-3-clause",
"hash": -4920968886954788000,
"line_mean": 30.9069767442,
"line_max": 77,
"alpha_frac": 0.5590379009,
"autogenerated": false,
"ratio": 3.473417721518987,
"c... |
import os.path as op
import numpy as np
import pytest
from numpy.testing import assert_allclose
from mne.datasets import testing
from mne.io import read_raw_fif
from mne.preprocessing import regress_artifact, create_eog_epochs
data_path = testing.data_path(download=False)
raw_fname = op.join(data_path, 'MEG', 'sam... | {
"repo_name": "larsoner/mne-python",
"path": "mne/preprocessing/tests/test_regress.py",
"copies": "13",
"size": "1381",
"license": "bsd-3-clause",
"hash": -7093458886014635000,
"line_mean": 35.3421052632,
"line_max": 78,
"alpha_frac": 0.7060101376,
"autogenerated": false,
"ratio": 3.1315192743764... |
"""Tools for MLS generation"""
import numpy as np
from ._max_len_seq_inner import _max_len_seq_inner
__all__ = ['max_len_seq']
# These are definitions of linear shift register taps for use in max_len_seq()
_mls_taps = {2: [1], 3: [2], 4: [3], 5: [3], 6: [5], 7: [6], 8: [7, 6, 1],
9: [5], 10: [7], 11:... | {
"repo_name": "andim/scipy",
"path": "scipy/signal/_max_len_seq.py",
"copies": "47",
"size": "3843",
"license": "bsd-3-clause",
"hash": 3777098554060353500,
"line_mean": 37.8181818182,
"line_max": 78,
"alpha_frac": 0.5755919854,
"autogenerated": false,
"ratio": 3.409937888198758,
"config_test":... |
"""Tools for MLS generation"""
import numpy as np
from ._max_len_seq_inner import _max_len_seq_inner
__all__ = ['max_len_seq']
# These are definitions of linear shift register taps for use in max_len_seq()
_mls_taps = {2: [1], 3: [2], 4: [3], 5: [3], 6: [5], 7: [6], 8: [7, 6, 1],
9: [5], 10: [7], 11: ... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scipy-master/scipy/signal/_max_len_seq.py",
"copies": "1",
"size": "4944",
"license": "mit",
"hash": -6741672673647160000,
"line_mean": 34.8260869565,
"line_max": 78,
"alpha_frac": 0.5675566343,
"autogenerated": false,
"ratio": 3.26121... |
import commands
from flask import jsonify
from flask import Flask, Response, request, redirect,session, url_for
from flask.ext.login import LoginManager, UserMixin,login_required, login_user, logout_user
#@app.after_request
#def treat_as_plain_text(response):
# response.headers["content-type"] = "text/plain; charse... | {
"repo_name": "mourgaya/iscsi_ihm",
"path": "app/run.py",
"copies": "1",
"size": "7064",
"license": "apache-2.0",
"hash": 3826089300339881000,
"line_mean": 27.0317460317,
"line_max": 98,
"alpha_frac": 0.6054643262,
"autogenerated": false,
"ratio": 3.5912557193695984,
"config_test": false,
"ha... |
__author__ = 'ericmuxagata'
# example:
# $ PYTHONPATH=`pwd` python baphomet/image2term_cli.py http://fc00.deviantart.net/fs71/f/2011/310/5/a/giant_nyan_cat_by_daieny-d4fc8u1.png -t 100 -r 0.01
try:
from PIL import Image
except:
from sys import stderr
stderr.write('[E] PIL not installed\n')
exit(1)
fr... | {
"repo_name": "marcioapaiva/baphomet",
"path": "image2term.py",
"copies": "1",
"size": "3712",
"license": "mit",
"hash": -3390092724179870700,
"line_mean": 29.4262295082,
"line_max": 154,
"alpha_frac": 0.4657866379,
"autogenerated": false,
"ratio": 3.9073684210526314,
"config_test": false,
"h... |
__author__ = 'ericmuxagata'
# example:
# $ PYTHONPATH=`pwd` python examples/image2term_cli.py http://fc00.deviantart.net/fs71/f/2011/310/5/a/giant_nyan_cat_by_daieny-d4fc8u1.png -t 100 -r 0.01
try:
from PIL import Image
except:
from sys import stderr
stderr.write('[E] PIL not installed\n')
exit(1)
fr... | {
"repo_name": "ericmux/termux2d",
"path": "image2term.py",
"copies": "1",
"size": "3623",
"license": "mit",
"hash": 251509847672430900,
"line_mean": 29.4453781513,
"line_max": 154,
"alpha_frac": 0.4606679547,
"autogenerated": false,
"ratio": 3.925243770314193,
"config_test": false,
"has_no_ke... |
__author__ = 'Eric'
import pygame
import random
pygame.init()
white = (255, 255, 255)
black = (0, 0, 0)
display_width = 800
display_height = 600
gameDisplay = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Basic Snake")
block_size = 10
FPS = 15
font = pygame.font.SysFont(None, 25)
def snake(block... | {
"repo_name": "EricGrahamMacEachern/Basic-Snake",
"path": "mainBasicSnake.py",
"copies": "1",
"size": "3429",
"license": "bsd-2-clause",
"hash": -6527649465186065000,
"line_mean": 28.3162393162,
"line_max": 94,
"alpha_frac": 0.5491396909,
"autogenerated": false,
"ratio": 3.617088607594937,
"con... |
__author__ = 'eric'
from port_input import PortfolioInput
import numpy as np
import matplotlib.pyplot as plt
def look_at(portfolio_input, s_study_pdf):
i_trading_days = 252
dt_start, dt_end = portfolio_input.get_start_end_dates()
s_date_format = "%Y-%m-%d %H:%M:%S"
na_benchmark_returns = portfolio_... | {
"repo_name": "ericsomdahl/compfiOne",
"path": "HW3/analyze/analyze.py",
"copies": "1",
"size": "3441",
"license": "unlicense",
"hash": -8457472291068676000,
"line_mean": 46.1506849315,
"line_max": 122,
"alpha_frac": 0.7003777972,
"autogenerated": false,
"ratio": 3.1310282074613283,
"config_tes... |
__author__ = 'eric'
from simulate.order_input import OrdersInput
from simulate.market_struct import MarketStructure
def simulate(df_market_struct, ls_symbols):
num_trading_days = len(df_market_struct)
#iterate over each trading day
for day in xrange(num_trading_days):
na_orders = df_market_struct... | {
"repo_name": "ericsomdahl/compfiOne",
"path": "HW3/simulate/marketsim.py",
"copies": "1",
"size": "3362",
"license": "unlicense",
"hash": -3150925675781880300,
"line_mean": 41.0375,
"line_max": 107,
"alpha_frac": 0.6353361095,
"autogenerated": false,
"ratio": 3.4803312629399588,
"config_test":... |
__author__ = 'eric'
from utils import pretty_json, validate_yaml
import sys
import pymongo
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
################################################################################
# Constants
# query operator groupings... | {
"repo_name": "mongolab/dex",
"path": "dex/analyzer.py",
"copies": "1",
"size": "16302",
"license": "mit",
"hash": 7380995713152502000,
"line_mean": 41.5639686684,
"line_max": 128,
"alpha_frac": 0.4623359097,
"autogenerated": false,
"ratio": 5.136105860113422,
"config_test": false,
"has_no_ke... |
__author__ = 'eric'
import json
from bson import json_util
import yaml
import yaml.constructor
from datetime import datetime, date
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
################################################################################... | {
"repo_name": "mongolab/dex",
"path": "dex/utils.py",
"copies": "1",
"size": "2455",
"license": "mit",
"hash": 8168343160425927000,
"line_mean": 29.3086419753,
"line_max": 130,
"alpha_frac": 0.5702647658,
"autogenerated": false,
"ratio": 4.139966273187184,
"config_test": false,
"has_no_keywor... |
__author__ = 'eric'
import nibabel as nb
import sys
import csv
import numpy as np
import scipy.optimize as op
import scipy.stats as st
import getopt as go
import fitting_diffusion as ic
# import matplotlib.pylab as pl
import matplotlib as ml
import os.path as os
def print_help():
print('This program processes a... | {
"repo_name": "sahmed95/IVIM_fitting",
"path": "IVIM_fit.py",
"copies": "1",
"size": "14788",
"license": "bsd-3-clause",
"hash": 8430172086519470000,
"line_mean": 40.5393258427,
"line_max": 185,
"alpha_frac": 0.6309169597,
"autogenerated": false,
"ratio": 2.760500280007467,
"config_test": false... |
__author__ = 'eric'
import numpy as np
import datetime as dt
def convert_to_datetime_ordinal(na_in):
dt_in = dt.datetime(na_in['year'], na_in['month'], na_in['day'])
return dt_in.toordinal()
def markup_with_datetime_ordinal(na_in):
dt_in = dt.datetime(na_in['year'], na_in['month'], na_in['day'])
re... | {
"repo_name": "ericsomdahl/compfiOne",
"path": "HW3/simulate/order_input.py",
"copies": "1",
"size": "3127",
"license": "unlicense",
"hash": -6735373187922466000,
"line_mean": 39.6233766234,
"line_max": 101,
"alpha_frac": 0.6197633515,
"autogenerated": false,
"ratio": 3.3696120689655173,
"confi... |
__author__ = 'eric'
import pandas as pd
import numpy as np
import math
import copy
import QSTK.qstkutil.qsdateutil as du
import datetime as dt
import QSTK.qstkutil.DataAccess as da
import QSTK.qstkutil.tsutil as tsu
import QSTK.qstkstudy.EventProfiler as ep
import os
f = None
dataObj = da.DataAccess('Yahoo')
print "S... | {
"repo_name": "ericsomdahl/compfiOne",
"path": "HW6/hw6.py",
"copies": "1",
"size": "5876",
"license": "unlicense",
"hash": 6646552084529334000,
"line_mean": 33.1686046512,
"line_max": 102,
"alpha_frac": 0.6267869299,
"autogenerated": false,
"ratio": 2.9248382279741163,
"config_test": false,
... |
__author__ = 'eric'
import pandas as pd
import numpy as np
import QSTK.qstkutil.DataAccess as da
import QSTK.qstkutil.qsdateutil as du
import datetime as dt
import copy
data_obj = None
ldt_timestamps = None
ldf_data = None
d_data = None
def main(in_args):
load_data(in_args.ls_symbols)
if in_args.indicator =... | {
"repo_name": "ericsomdahl/compfiOne",
"path": "HW5/hw5.py",
"copies": "1",
"size": "4321",
"license": "unlicense",
"hash": 2579533752904787500,
"line_mean": 29.2237762238,
"line_max": 113,
"alpha_frac": 0.6253182134,
"autogenerated": false,
"ratio": 2.9555403556771545,
"config_test": false,
... |
__author__ = 'eric'
import QSTK.qstkutil.qsdateutil as du
import QSTK.qstkutil.DataAccess as da
import QSTK.qstkutil.tsutil as tsu
import numpy as np
import datetime as dt
class PortfolioInput(object):
def __init__(self, csv_file, symbol):
self.csv_file = csv_file
self.symbol = symbol
se... | {
"repo_name": "ericsomdahl/compfiOne",
"path": "HW3/analyze/port_input.py",
"copies": "1",
"size": "3814",
"license": "unlicense",
"hash": -4797612756950912000,
"line_mean": 40.9230769231,
"line_max": 103,
"alpha_frac": 0.659674882,
"autogenerated": false,
"ratio": 3.405357142857143,
"config_te... |
__author__ = 'eric'
import re
from utils import pretty_json, small_json, yamlfy
from time import strptime, mktime
from datetime import datetime
import traceback
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
##################################################... | {
"repo_name": "mongolab/dex",
"path": "dex/parsers.py",
"copies": "1",
"size": "14565",
"license": "mit",
"hash": -2876845587151557600,
"line_mean": 37.6339522546,
"line_max": 98,
"alpha_frac": 0.4184002746,
"autogenerated": false,
"ratio": 4.856618872957653,
"config_test": false,
"has_no_key... |
__author__ = 'eric'
import unittest
import json
from bittrex.bittrex import Bittrex
def test_basic_response(unit_test, result, method_name):
unit_test.assertTrue(result['success'], "{0:s} failed".format(method_name))
unit_test.assertTrue(result['message'] is not None, "message not present in response")
u... | {
"repo_name": "avbanks/Bittrex-CommandLine-Trader",
"path": "bin/cli_trade/bittrex/test/bittrex_tests.py",
"copies": "2",
"size": "4246",
"license": "mit",
"hash": -1895424769002311200,
"line_mean": 39.8269230769,
"line_max": 120,
"alpha_frac": 0.6481394253,
"autogenerated": false,
"ratio": 3.641... |
__author__ = 'Eric'
from flask import Flask, session, request
from flask_redisSession import RedisSession
from datetime import timedelta
import unittest
'''
app = Flask(__name__)
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(seconds=40)
RedisSession(app)
print('++++++++++++++++++++++++++++')
print(app.config... | {
"repo_name": "EricQAQ/Flask-RedisSession",
"path": "test.py",
"copies": "1",
"size": "2080",
"license": "mit",
"hash": 9163798697524794000,
"line_mean": 29.6029411765,
"line_max": 90,
"alpha_frac": 0.5504807692,
"autogenerated": false,
"ratio": 3.7545126353790614,
"config_test": true,
"has_n... |
__author__ = 'eric'
# QSTK Imports
import QSTK.qstkutil.qsdateutil as du
import QSTK.qstkutil.DataAccess as da
import numpy as np
# Third Party Imports
import datetime as dt
class MarketStructure(object):
def __init__(self, order_input, starting_cash):
self.order_input = order_input
self.df_ma... | {
"repo_name": "ericsomdahl/compfiOne",
"path": "HW3/simulate/market_struct.py",
"copies": "1",
"size": "2809",
"license": "unlicense",
"hash": -2783810318062192000,
"line_mean": 42.2153846154,
"line_max": 114,
"alpha_frac": 0.6614453542,
"autogenerated": false,
"ratio": 3.5467171717171717,
"con... |
__author__ = 'Eric'
#SEE LICENSE.txt for this program's licensing
import get_text_file
import nav_bar
#main method that iterates through the list of unformatted .html files and formats them
#PARAM -- path of the folder to look for unformatted .html files
#RETURN -- 0 if operates correctly, something else if not
def... | {
"repo_name": "albmin/html_injector",
"path": "main_html.py",
"copies": "1",
"size": "3437",
"license": "mit",
"hash": 6043337130868557000,
"line_mean": 40.4096385542,
"line_max": 106,
"alpha_frac": 0.6578411405,
"autogenerated": false,
"ratio": 3.4097222222222223,
"config_test": false,
"has_... |
__author__ = 'Eric'
#SEE LICENSE.txt for this program's licensing
import subprocess
import os
import main_html
#main method of class
#PARAM -- path, which is the current path that will be passed into the html injector,
# --- along with the path/directory to look for additional subdirectories to inject into
#RE... | {
"repo_name": "albmin/html_injector",
"path": "folder_hunter.py",
"copies": "1",
"size": "1303",
"license": "mit",
"hash": -6604826200554651000,
"line_mean": 27.9555555556,
"line_max": 99,
"alpha_frac": 0.6884113584,
"autogenerated": false,
"ratio": 3.7988338192419824,
"config_test": false,
"... |
__author__ = 'Eric'
#SEE LICENSE.txt for this program's licensing
#This class hunts through the folder whos path is passed in, looking for
# .html files that don't contain opening html tags, indicating that
# it is an html file, but is not formatted properly
import subprocess
#main method that gets the list of fil... | {
"repo_name": "albmin/html_injector",
"path": "get_text_file.py",
"copies": "1",
"size": "2521",
"license": "mit",
"hash": -119629287700497680,
"line_mean": 35.0142857143,
"line_max": 108,
"alpha_frac": 0.6402221341,
"autogenerated": false,
"ratio": 3.802413273001508,
"config_test": false,
"h... |
__author__ = 'Eric'
#SEE LICENSE.txt for this program's licensing
#This is a class containg methods to implement a navigation bar, which is required on every visible
#page. To be implemented in the html_injector directory and called upon from the
# main_html file
#method to add the nav_bar formatting to the html
#PA... | {
"repo_name": "albmin/html_injector",
"path": "nav_bar.py",
"copies": "1",
"size": "1686",
"license": "mit",
"hash": -5954221984964107000,
"line_mean": 39.1666666667,
"line_max": 99,
"alpha_frac": 0.6465005931,
"autogenerated": false,
"ratio": 3.2423076923076923,
"config_test": false,
"has_no... |
__author__ = 'Eric Price'
from datetime import date
import boto3
import json
import re, sys
VOL_TYPE_MAG = 'standard'
VOL_TYPE_SSD = 'gp2'
VIRT_TYPE_PV = 'paravirtual'
VIRT_TYPE_HVM = 'hvm'
ROOT_DEV_EBS = 'ebs'
ROOT_DEV_INS = 'instance-store'
YEAR = date.today().year
# amzn-ami-hvm-2015.03.rc-0.x86_64-gp2
RC_REG... | {
"repo_name": "23andMe/cloudformation-environmentbase",
"path": "src/environmentbase/scripts/region_arch_2_ami.py",
"copies": "3",
"size": "4185",
"license": "bsd-2-clause",
"hash": -7979856977783489000,
"line_mean": 31.4418604651,
"line_max": 109,
"alpha_frac": 0.6150537634,
"autogenerated": false... |
__author__ = 'Eric Price'
from urllib2 import urlopen
from lxml.html import fromstring
import json
"""
Yes, it's a screen scraper script for assembling the instance type to arch map.
The thought is that updates to the web page will be minor ... maybe
"""
SELECT_TABLES = "div.informaltable"
SELECT_TABLE_DISCRIMINATOR... | {
"repo_name": "23andMe/cloudformation-environmentbase",
"path": "src/environmentbase/scripts/instance_type_scraper.py",
"copies": "1",
"size": "2167",
"license": "bsd-2-clause",
"hash": 6161517264086451000,
"line_mean": 29.9571428571,
"line_max": 106,
"alpha_frac": 0.6677434241,
"autogenerated": fa... |
__author__ = 'Eric'
import os
from Ity.Tokenizers import Tokenizer
from Ity.Formatters import Formatter
from jinja2 import Environment, FileSystemLoader
class SaliencyFormatter(Formatter):
def __init__(self, debug=None, template='standalone.html', template_root=None):
super(SaliencyFormatter,... | {
"repo_name": "uwgraphics/Ubiqu-Ity",
"path": "Ity/Formatters/SaliencyFormatter/__init__.py",
"copies": "2",
"size": "1661",
"license": "bsd-2-clause",
"hash": -8377695601072015000,
"line_mean": 33.3829787234,
"line_max": 95,
"alpha_frac": 0.5803732691,
"autogenerated": false,
"ratio": 3.98321342... |
__author__ = 'eric'
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.mail import Mail
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from config import config
login_manager = LoginManager()
login_manager.session_protection = 'strong... | {
"repo_name": "kefatong/ops",
"path": "app/__init__.py",
"copies": "1",
"size": "1044",
"license": "apache-2.0",
"hash": 5525480014659761000,
"line_mean": 20.2127659574,
"line_max": 70,
"alpha_frac": 0.6829501916,
"autogenerated": false,
"ratio": 3.4455445544554455,
"config_test": true,
"has_... |
__author__ = 'eric'
from .import api
from flask import jsonify, g
from .errors import forbidden, unauthorized
from ..models import User
from flask.ext.httpauth import HTTPBasicAuth
auth = HTTPBasicAuth()
@api.route('/token')
def get_token():
return jsonify({'token': g.current_user.generate_auth_token... | {
"repo_name": "kefatong/cmdb",
"path": "app/api_1_0/authentication.py",
"copies": "1",
"size": "1631",
"license": "apache-2.0",
"hash": 2385538997583158000,
"line_mean": 25.1833333333,
"line_max": 102,
"alpha_frac": 0.6394849785,
"autogenerated": false,
"ratio": 3.405010438413361,
"config_test"... |
__author__ = 'eric'
from app import create_app,db
#from app.models import User, Role,Idc, Rack, Asset, Device, DeviceType, DeviceDisks, Logger, DevicePorts, DeviceMemorys, VirtMachine, DevicePowerManage, DevicePools
from app.models import *
from flask.ext.script import Manager, Shell
from flask.ext.migrate i... | {
"repo_name": "kefatong/cmdb",
"path": "manage.py",
"copies": "1",
"size": "1258",
"license": "apache-2.0",
"hash": 4282962829477167600,
"line_mean": 38.5806451613,
"line_max": 165,
"alpha_frac": 0.7146263911,
"autogenerated": false,
"ratio": 3.7,
"config_test": false,
"has_no_keywords": fals... |
import os
import json
import numpy as np
from numpy.random import randint
import logging
from itertools import combinations
try:
from tqdm import tqdm
except ImportError:
def tqdm(x, **kwargs):
return x
logging.basicConfig(format='%(asctime)s : %(levelname)s :%(message)s')
class Fixed:
def __... | {
"repo_name": "INGEOTEC/GOIC",
"path": "goic/params.py",
"copies": "1",
"size": "7703",
"license": "apache-2.0",
"hash": 771467894878136400,
"line_mean": 27.8501872659,
"line_max": 102,
"alpha_frac": 0.5249902635,
"autogenerated": false,
"ratio": 3.6079625292740047,
"config_test": false,
"has... |
import os
import sys
import json
import numpy as np
from itertools import combinations
try:
from tqdm import tqdm
except ImportError:
def tqdm(x, **kwargs):
return x
class Fixed:
def __init__(self, value):
self.value = value
self.valid_values = [value]
def neighborhood(self... | {
"repo_name": "INGEOTEC/microTC",
"path": "microtc/params.py",
"copies": "1",
"size": "9306",
"license": "apache-2.0",
"hash": 2751356135969891300,
"line_mean": 29.8145695364,
"line_max": 155,
"alpha_frac": 0.5520094563,
"autogenerated": false,
"ratio": 3.56551724137931,
"config_test": false,
... |
import numpy as np
from time import time
from sklearn.metrics import f1_score, accuracy_score, recall_score, precision_score
from sklearn import preprocessing
from sklearn.model_selection import StratifiedKFold
try:
from tqdm import tqdm
except ImportError:
def tqdm(x, **kwargs):
return x
OPTION_NON... | {
"repo_name": "INGEOTEC/b4msa",
"path": "b4msa/params.py",
"copies": "1",
"size": "7840",
"license": "apache-2.0",
"hash": 2289547434226211800,
"line_mean": 33.5374449339,
"line_max": 155,
"alpha_frac": 0.4906887755,
"autogenerated": false,
"ratio": 3.581544084056647,
"config_test": false,
"h... |
__author__ = 'erik + jc + anna'
# TODO: Merge Quad and Shape
import numpy as np
class Shape(object):
def __init__(self, id, vertices):
self._id = id
self._vertices = vertices
def get_vertices(self):
return self._vertices
class Quad(Shape):
# _quadlist and _vertexlist have to be of... | {
"repo_name": "BGCECSE2015/CADO",
"path": "PYTHON/NURBSReconstruction/PetersScheme/Shape.py",
"copies": "1",
"size": "3146",
"license": "bsd-3-clause",
"hash": 6409158823223022000,
"line_mean": 29.2596153846,
"line_max": 99,
"alpha_frac": 0.5708836618,
"autogenerated": false,
"ratio": 3.754176610... |
__author__ = 'erik + jc + benni'
import numpy as np
class Coordinate(object):
"""
Coordinate is a base class for everything which has a position.
"""
def __init__(self, id, x, y, z):
"""
:param id: id of this object
:param x: x coordinate
:param y: y coordinate
... | {
"repo_name": "BGCECSE2015/CADO",
"path": "PYTHON/NURBSReconstruction/PetersScheme/Vertex.py",
"copies": "1",
"size": "4554",
"license": "bsd-3-clause",
"hash": 8989967175698558000,
"line_mean": 26.4337349398,
"line_max": 119,
"alpha_frac": 0.5546772069,
"autogenerated": false,
"ratio": 3.9462738... |
__author__ = 'erik + jc'
class Quad:
# _quadlist and _vertexlist have to be of type np.array!
def __init__(self, id, vertex1, vertex2, vertex3, vertex4, edge1, edge2, edge3, edge4):
self._id = id
self._vertices = [vertex1, vertex2, vertex3, vertex4]
for vertex in self._vertices:
... | {
"repo_name": "BGCECSE2015/CADO",
"path": "PYTHON/NURBSReconstruction/PetersScheme/Quad.py",
"copies": "1",
"size": "1884",
"license": "bsd-3-clause",
"hash": -571426997592136700,
"line_mean": 28,
"line_max": 91,
"alpha_frac": 0.5562632696,
"autogenerated": false,
"ratio": 3.768,
"config_test":... |
__author__ = 'Erik'
import Highscore
import pygame
import os
from Highscore import *
from pygame import *
class HighscoreView:
"""
View for displaying players highscore in a simple list.
"""
def __init__(self, screen):
self.screen = screen
self.screenWidth = screen.get_width()
... | {
"repo_name": "Ramqvist/SpaceMania",
"path": "view/HighscoreView.py",
"copies": "1",
"size": "1717",
"license": "apache-2.0",
"hash": 113748022175996180,
"line_mean": 34.7708333333,
"line_max": 111,
"alpha_frac": 0.6109493302,
"autogenerated": false,
"ratio": 3.6223628691983123,
"config_test": ... |
__author__ = 'erik'
import model_util as mu
import abc
class OutputInterface:
def __init__(self, model_utils):
assert isinstance(model_utils, mu.BaseModel)
self._model_obj = model_utils
@abc.abstractmethod
def print_output(self):
pass
@abc.abstractmethod
def upd... | {
"repo_name": "EWannerberg/AutomaticHeuristicGeneration",
"path": "ModelPredictiveControl/output.py",
"copies": "1",
"size": "10184",
"license": "mit",
"hash": -9107748213511873000,
"line_mean": 36.0327272727,
"line_max": 124,
"alpha_frac": 0.5173802042,
"autogenerated": false,
"ratio": 3.9079048... |
__author__ = 'erik'
import numpy as np
from PetersScheme.Edge import Edge
from PetersScheme.Quad import Quad
from PetersScheme.Vertex import Vertex
def getABsC_ind(quadIndex, indVertex, indOtherVertex, regularPoints):
'''
:param _quad:
:param indVertex:
:param indOtherVertex:
:param regularPoints... | {
"repo_name": "BGCECSE2015/CADO",
"path": "PYTHON/NURBSReconstruction/DooSabin/DualCont_toABC_simple.py",
"copies": "1",
"size": "4309",
"license": "bsd-3-clause",
"hash": -1752698289055357400,
"line_mean": 30.2246376812,
"line_max": 115,
"alpha_frac": 0.5739150615,
"autogenerated": false,
"ratio... |
__author__ = 'Erik'
import pygame, sys, Buttons, os
import GameView
from Enemies import *
import FlashText
import random
import HighscoreView
from pygame import *
from FlashText import *
#Main class for the Game
class Initializer:
fpsClock = pygame.time.Clock()
# Center window on screen #
os.environ['SDL_... | {
"repo_name": "Ramqvist/SpaceMania",
"path": "view/MainMenu.py",
"copies": "1",
"size": "15009",
"license": "apache-2.0",
"hash": -7399010129126027000,
"line_mean": 41.6420454545,
"line_max": 165,
"alpha_frac": 0.5540009328,
"autogenerated": false,
"ratio": 3.9570261007118375,
"config_test": fa... |
__author__ = 'erik'
from getExtraOrdCornerIndexMask import getExtraOrdCornerIndexMask
from createBicubicCoefMatrices import createBicubicCoefMatrices
from getBezierPointCoefs import getBiquadraticPatchCoefs
from get3x3ControlPointIndexMask import get3x3ControlPointIndexMask
from raiseBezDegree import raiseDeg2D_from3x... | {
"repo_name": "BGCECSE2015/CADO",
"path": "PYTHON/NURBSReconstruction/PetersScheme/createNURBSMatrices.py",
"copies": "1",
"size": "4924",
"license": "bsd-3-clause",
"hash": -8000285041693150000,
"line_mean": 43.7636363636,
"line_max": 167,
"alpha_frac": 0.6066206336,
"autogenerated": false,
"rat... |
__author__ = 'erik'
from tournament import *
import math
import random
import decimal
db = connect()
deletePlayers()
deleteMatches()
registerPlayer("Ace")
registerPlayer("Jimmy")
registerPlayer("Phil")
registerPlayer("Sport")
registerPlayer("Ed")
registerPlayer("Lucy")
registerPlayer("Jake")
registerPlayer("Adam")
... | {
"repo_name": "erikarthur/P2_Tournament",
"path": "vagrant/myTourney.py",
"copies": "1",
"size": "2194",
"license": "apache-2.0",
"hash": 4743555129167201000,
"line_mean": 24.8117647059,
"line_max": 84,
"alpha_frac": 0.6185050137,
"autogenerated": false,
"ratio": 3.4551181102362203,
"config_tes... |
__author__ = 'erik'
import os
import subprocess
import re
import requests
from PIL import Image
def add_zeros(number, digits):
number_str = str(number)
if number < 10:
for members in range(digits-1):
number_str = "0" + number_str
elif number < 100:
for members in range(digits-2... | {
"repo_name": "the-it/WS_THEbotIT",
"path": "archive/offline/download_RE_pics_OCR/160118_download_RE_OCR.py",
"copies": "1",
"size": "3255",
"license": "mit",
"hash": 8632934923467947000,
"line_mean": 39.6875,
"line_max": 131,
"alpha_frac": 0.557296467,
"autogenerated": false,
"ratio": 3.32482124... |
__author__ = 'Erik'
import pygame
import os
from pygame import *
from PlayerWeapons import *
class Drawable:
def draw(self):
pass
class PlayerSpaceShip(Drawable, pygame.sprite.Sprite):
max_left_acceleration = -20
max_right_acceleration = 20
max_up_acceleration = -20
max_down_accelerat... | {
"repo_name": "Ramqvist/SpaceMania",
"path": "view/Player.py",
"copies": "1",
"size": "8210",
"license": "apache-2.0",
"hash": 8005982374041001000,
"line_mean": 34.8558951965,
"line_max": 162,
"alpha_frac": 0.6045066991,
"autogenerated": false,
"ratio": 3.5992985532661113,
"config_test": false,... |
__author__ = 'Erik'
import pygame, os
class FlashText:
def __init__(self, screen, text, duration, color):
self.screen = screen
self.text = text
self.duration = duration
self.fontSize = 20
self.sizeScale = 0.47
self.color = color
self.width = screen.get_wid... | {
"repo_name": "Ramqvist/SpaceMania",
"path": "view/FlashText.py",
"copies": "1",
"size": "1789",
"license": "apache-2.0",
"hash": 2558493665530641400,
"line_mean": 29.8620689655,
"line_max": 101,
"alpha_frac": 0.5813303522,
"autogenerated": false,
"ratio": 3.711618257261411,
"config_test": fals... |
__author__ = 'Erik'
import pygame, sys, glob, os
from pygame import *
import FlashText
from FlashText import *
import random
import EnemyWeapons
class Drawable:
def draw(self):
pass
class AbstractEnemy(Drawable):
max_acceleration = 10
min_acceleration = 5
width = 0
height = 0
screenWi... | {
"repo_name": "Ramqvist/SpaceMania",
"path": "view/Enemies.py",
"copies": "1",
"size": "11788",
"license": "apache-2.0",
"hash": -2465083336883257300,
"line_mean": 31.7444444444,
"line_max": 140,
"alpha_frac": 0.5779606379,
"autogenerated": false,
"ratio": 3.4937759336099585,
"config_test": fal... |
__author__ = 'Erik'
import pygame, sys, glob, os
from pygame import *
import FlashText
from FlashText import *
import random
class Drawable:
def draw(self):
pass
#Abstract weapons class for different player weapons to extends.
class AbstractEnemyWeapon(Drawable):
width = 0
height = 0
x = 0
... | {
"repo_name": "Ramqvist/SpaceMania",
"path": "view/EnemyWeapons.py",
"copies": "1",
"size": "2636",
"license": "apache-2.0",
"hash": 8177864607121364000,
"line_mean": 27.0425531915,
"line_max": 77,
"alpha_frac": 0.6202579666,
"autogenerated": false,
"ratio": 3.6509695290858724,
"config_test": f... |
__author__ = 'Erik'
import pygame, sys, glob, os
from pygame import *
import math
import FlashText
from FlashText import *
import random
class Drawable:
def draw(self):
pass
#Abstract weapons class for different player weapons to extends.
class AbstractWeapon(Drawable):
width = 0
height = 0
x... | {
"repo_name": "Ramqvist/SpaceMania",
"path": "view/PlayerWeapons.py",
"copies": "1",
"size": "4952",
"license": "apache-2.0",
"hash": -8041321902579973000,
"line_mean": 31.7947019868,
"line_max": 84,
"alpha_frac": 0.6092487884,
"autogenerated": false,
"ratio": 3.6067006554989076,
"config_test":... |
__author__ = 'erik'
import requests
import re
def add_zeros(number, digits):
number_str = str(number)
if number < 10:
for members in range(digits-1):
number_str = "0" + number_str
elif number < 100:
for members in range(digits-2):
number_str = "0" + number_str
... | {
"repo_name": "the-it/WS_THEbotIT",
"path": "archive/offline/themenseite_auto/themenseite_GDZ.py",
"copies": "1",
"size": "1140",
"license": "mit",
"hash": -3088725817713229300,
"line_mean": 33.5151515152,
"line_max": 120,
"alpha_frac": 0.5654082529,
"autogenerated": false,
"ratio": 3.03733333333... |
__author__ = 'erik'
"""
Convert a Bam to Fastq
"""
from cosmos.lib.ezflow.dag import DAG, add_,map_,reduce_,split_,reduce_split_,sequence_,branch_,configure,add_run
from cosmos.lib.ezflow.tool import INPUT,Tool
from cosmos.Workflow.models import TaskFile
from genomekey.tools import picard,samtools,genomekey_scripts,b... | {
"repo_name": "LPM-HMS/GenomeKey",
"path": "obsolete/genomekey/workflows/bam2fastq.py",
"copies": "1",
"size": "3227",
"license": "mit",
"hash": 5907139257650347000,
"line_mean": 35.2696629213,
"line_max": 119,
"alpha_frac": 0.6101642392,
"autogenerated": false,
"ratio": 3.396842105263158,
"con... |
__author__ = 'erik'
def raiseDeg1D(old_bezier_points):
# raiseDeg1D Raise the order of the bezier curve by 1.
# Provided a dxN - matrix of d-dimensional bezier points, the algorithm outputs a
# dx(N+1) matrix of bezier points drawing te exact same curve but with a
# degree 1 higher. Tested and w... | {
"repo_name": "BGCECSE2015/CADO",
"path": "PYTHON/NURBSReconstruction/PetersScheme/raiseBezDegree.py",
"copies": "1",
"size": "2500",
"license": "bsd-3-clause",
"hash": -1539514910545539300,
"line_mean": 34.7285714286,
"line_max": 102,
"alpha_frac": 0.6592,
"autogenerated": false,
"ratio": 2.8669... |
__author__ = 'erik'
from get_key import get_elevation_key
import googlemaps
import googlemaps.convert as con
# inspired by https://developers.google.com/maps/documentation/elevation/intro
# http://maps.googleapis.com/maps/api/elevation/outputFormat?parameters
request_client = googlemaps.Client(key=get_elevation_... | {
"repo_name": "EWannerberg/AutomaticHeuristicGeneration",
"path": "ModelPredictiveControl/HeightDataRetrieval/google_elevation.py",
"copies": "2",
"size": "10566",
"license": "mit",
"hash": 7562447372204073000,
"line_mean": 39.6384615385,
"line_max": 129,
"alpha_frac": 0.6180200644,
"autogenerated"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.