text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'jab08'
class InstanceBackedModel(object):
r"""
Mixin for models constructed from a set of Vectorizable objects.
Allows for models where visualizing the meaning of a set of components
is trivial. Requires that the following attributes to be present:
n_components
components
a... | {
"repo_name": "karla3jo/menpo-old",
"path": "menpo/model/instancebacked.py",
"copies": "3",
"size": "4172",
"license": "bsd-3-clause",
"hash": 2362725492209181700,
"line_mean": 28.8,
"line_max": 79,
"alpha_frac": 0.5898849473,
"autogenerated": false,
"ratio": 4.768,
"config_test": false,
"has... |
__author__ = 'jacekf'
try:
import txZMQ
except ImportError as ex:
print "You must have ZeroMQ and txZMQ installed"
raise ex
from corepost import Response, IRESTResource
from corepost.enums import Http
from corepost.routing import UrlRouter, RequestRouter
from enums import MediaType
from formencode import ... | {
"repo_name": "jacek99/corepost",
"path": "corepost/ext/multicore/zmq.py",
"copies": "1",
"size": "1330",
"license": "bsd-3-clause",
"hash": -6347628663831138000,
"line_mean": 27.2978723404,
"line_max": 127,
"alpha_frac": 0.6969924812,
"autogenerated": false,
"ratio": 4.276527331189711,
"config... |
__author__ = 'Jacklam'
import sys
import time
from email.mime.text import MIMEText
from smtpFactory import SmtpServerFactory
class EmailSender:
def __init__(self, serverFactory=SmtpServerFactory):
# initialize a server factory
self.serverFactory = serverFactory
def set_smtp_server(self, host... | {
"repo_name": "fmdallas/myTornadoWebApp",
"path": "EmailSender.py",
"copies": "1",
"size": "3611",
"license": "mit",
"hash": -9108919381781131000,
"line_mean": 35.4747474747,
"line_max": 95,
"alpha_frac": 0.628080864,
"autogenerated": false,
"ratio": 3.8911637931034484,
"config_test": false,
... |
__author__ = 'jack'
# -*- coding:utf-8 -*-
import requests
import re
import bs4
import getpass
import string
import sys
default_encoding = 'utf-8'
if sys.getdefaultencoding() != default_encoding:
reload(sys)
sys.setdefaultencoding(default_encoding)
class Stu:
def __init__(self):
self.User_agent =... | {
"repo_name": "chen86860/WYUGPA",
"path": "wyuStudentCa.py",
"copies": "1",
"size": "4708",
"license": "mit",
"hash": 6659322181710775000,
"line_mean": 32.7795275591,
"line_max": 163,
"alpha_frac": 0.4876456876,
"autogenerated": false,
"ratio": 2.9323308270676693,
"config_test": false,
"has_n... |
__author__ = 'jackyun'
from flask import Blueprint, render_template, request
from flask_login import login_required, current_user
from smartmemorizer.extensions import login_manager, db
from smartmemorizer.user.models import User
from smartmemorizer.word.models import Word
from sqlalchemy import func
from random import... | {
"repo_name": "younseunghyun/smart-memorizer",
"path": "smartmemorizer/memorizer/views.py",
"copies": "1",
"size": "2411",
"license": "bsd-3-clause",
"hash": 4526071480875436500,
"line_mean": 34.4558823529,
"line_max": 187,
"alpha_frac": 0.670676068,
"autogenerated": false,
"ratio": 3.53519061583... |
__author__ = "Jack Zhu"
__email__ = "yuelin@gmail.com"
__license__ = "MIT"
from snakemake.shell import shell
shell("""
module load samtools/1.3 picard/1.139
## Generate intervals for hsmetrics
cat <(samtools view -H {snakemake.input} ) <(gawk '{{print $1 "\t" $2+1 "\t" $3 "\t+\tinterval_" NR}}' {snakem... | {
"repo_name": "seandavi/snakewrappers",
"path": "bio/bw_hsmetrics/wrapper.py",
"copies": "1",
"size": "1055",
"license": "mit",
"hash": -2477498680742444500,
"line_mean": 33.0322580645,
"line_max": 180,
"alpha_frac": 0.6454976303,
"autogenerated": false,
"ratio": 2.836021505376344,
"config_test... |
__author__ = 'Jacob Bieker'
import os, sys, random
import numpy
import pandas
from astropy.table import Table, vstack
import copy
import scipy.odr as odr
from scipy.stats import linregress
from statsmodels.formula.api import ols
import statsmodels.api as sm
# Fit plane or line iteratively
# if more than one cluster,... | {
"repo_name": "jacobbieker/GCP-perpendicular-least-squares",
"path": "pls.py",
"copies": "1",
"size": "35002",
"license": "mit",
"hash": 4180551246443016700,
"line_mean": 36.5155412647,
"line_max": 154,
"alpha_frac": 0.5579395463,
"autogenerated": false,
"ratio": 3.224207811348563,
"config_test... |
__author__ = 'Jacob Bieker'
import ROOT
import numpy as np
from rootpy.plotting import Canvas, Graph
from rootpy.plotting.style import get_style, set_style
from rootpy.interactive import wait
import rootpy.plotting.root2matplotlib as rplt
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator, M... | {
"repo_name": "jacobbieker/ATLAS-Luminosity",
"path": "luminosity-time.py",
"copies": "1",
"size": "1362",
"license": "mit",
"hash": -4727846486891590000,
"line_mean": 35.8378378378,
"line_max": 101,
"alpha_frac": 0.6828193833,
"autogenerated": false,
"ratio": 3.1454965357967666,
"config_test":... |
import sys, glob, argparse
import numpy as np
import math, cv2
from scipy.stats import multivariate_normal
import time
from sklearn import svm
def dictionary(descriptors, N):
em = cv2.EM(N)
em.train(descriptors)
return np.float32(em.getMat("means")), \
np.float32(em.getMatVector("covs")), np.float32(em.getMat("w... | {
"repo_name": "drewlinsley/draw_classify",
"path": "fisher.py",
"copies": "1",
"size": "5285",
"license": "mit",
"hash": 4761926872360962000,
"line_mean": 38.447761194,
"line_max": 148,
"alpha_frac": 0.6739829707,
"autogenerated": false,
"ratio": 2.661127895266868,
"config_test": false,
"has_... |
import functools
import hashlib
import logging
import re
import struct
import time
import tornado.escape
import tornado.web
class WebSocketHandler(tornado.web.RequestHandler):
"""Subclass this class to create a basic WebSocket handler.
Override on_message to handle incoming messages. You can also override
... | {
"repo_name": "cloudkick/cast-site",
"path": "hyde/lib/tornado/tornado/websocket.py",
"copies": "1",
"size": "10027",
"license": "apache-2.0",
"hash": 595149224800774900,
"line_mean": 35.8639705882,
"line_max": 83,
"alpha_frac": 0.6213224294,
"autogenerated": false,
"ratio": 4.213025210084034,
... |
__author__ = 'Jacob'
import os
import time
import wx
from images import icons
ID_BUTTON = 100
ID_EXIT = 200
ID_SPLITTER = 300
class DirectoryListCtrl(wx.ListCtrl):
def __init__(self, parent, id, pos, size, style):
wx.ListCtrl.__init__(self, parent=parent, id=id, size=size, pos=pos, style=style)
... | {
"repo_name": "marioharper182/cloaked-octo-spice",
"path": "Src/gui/DirectoryLstCtrl.py",
"copies": "1",
"size": "2254",
"license": "apache-2.0",
"hash": 3789095872683662300,
"line_mean": 28.6710526316,
"line_max": 93,
"alpha_frac": 0.533717835,
"autogenerated": false,
"ratio": 3.344213649851632,... |
__author__ = 'Jacob'
import wx
from odmtools.controller.olvSeriesSelector import EVT_OVL_CHECK_EVENT
from odmtools.controller import olvSeriesSelector
from odmtools.odmservices import ServiceManager
[wxID_PNLSERIESSELECTOR, wxID_PNLSERIESSELECTORCBSITES, wxID_PNLSERIESSELECTORCBVARIABLES,
wxID_PNLSERIESSELEC... | {
"repo_name": "ODM2/ODMToolsPython",
"path": "odmtools/view/clsSeriesSelector.py",
"copies": "1",
"size": "12336",
"license": "bsd-3-clause",
"hash": -6531221713455870000,
"line_mean": 39.5420875421,
"line_max": 125,
"alpha_frac": 0.6194876783,
"autogenerated": false,
"ratio": 3.3179128563743947,... |
from requests.auth import AuthBase
class TokenAuth(AuthBase):
"""Base HelpSocial implementation for :class:`requests.auth.AuthBase <AuthBase>`
which provides token based authentication for api requests from which all
authentication methods should derive.
This class should not be created directly.
... | {
"repo_name": "helpsocial/py-client",
"path": "helpsocial/auth.py",
"copies": "1",
"size": "3212",
"license": "mit",
"hash": -1278977490414165000,
"line_mean": 28.7407407407,
"line_max": 112,
"alpha_frac": 0.6407222914,
"autogenerated": false,
"ratio": 4.43646408839779,
"config_test": false,
... |
from .utils import data_get
class ApiException(Exception):
"""Base class for all HelpSocial Connect Api exceptions."""
def __init__(self, message, code=None, details=None):
"""
:type message: string
:param message: the response message
:type code: int
:param code: the... | {
"repo_name": "helpsocial/py-client",
"path": "helpsocial/exceptions.py",
"copies": "1",
"size": "3454",
"license": "mit",
"hash": -1556943852709143300,
"line_mean": 32.5339805825,
"line_max": 89,
"alpha_frac": 0.5819339896,
"autogenerated": false,
"ratio": 5.071953010279001,
"config_test": fal... |
try:
import ujson as json
except ImportError:
import json
from functools import reduce
from requests import Timeout
from ssl import SSLError
def _pop_key_token(key_path):
if key_path is None or '.' not in key_path:
return key_path, None
parts = key_path.split('.')
return parts[0], '.'.jo... | {
"repo_name": "helpsocial/py-client",
"path": "helpsocial/utils.py",
"copies": "1",
"size": "4909",
"license": "mit",
"hash": 1493707716794035700,
"line_mean": 25.6793478261,
"line_max": 90,
"alpha_frac": 0.6115298431,
"autogenerated": false,
"ratio": 4.132154882154882,
"config_test": false,
... |
try:
import ujson as json
except ImportError:
import json
from requests import Request, Session
from sseclient import SSEClient
from threading import Thread
from time import sleep, time
from .auth import ApplicationAuth, UserAuth, SSEAuth
from .decorators import Authenticate
from .exceptions import ApiExcept... | {
"repo_name": "helpsocial/py-client",
"path": "helpsocial/client.py",
"copies": "1",
"size": "25555",
"license": "mit",
"hash": 4270592437739250700,
"line_mean": 30.3943488943,
"line_max": 111,
"alpha_frac": 0.5749951086,
"autogenerated": false,
"ratio": 4.7158147259642,
"config_test": false,
... |
__author__ = 'Jacques Supcik'
# Caveats: This is a just a quick and dirty way to generate the list of
# all keywords for the ARM Assembler
import yaml
import re
from jinja2 import Environment, FileSystemLoader
class KeywordList:
result = set()
def __init__(self, data):
self.result = set()
s... | {
"repo_name": "frosc/arm-assembler-latex-listings",
"path": "src/generate.py",
"copies": "1",
"size": "2034",
"license": "apache-2.0",
"hash": 8706470975975629000,
"line_mean": 26.5,
"line_max": 75,
"alpha_frac": 0.5073746313,
"autogenerated": false,
"ratio": 3.4416243654822334,
"config_test": ... |
__author__ = 'jadams'
import numpy as np
import nltk
import os
import re
import unicodedata
import codecs
import collections
import csv
import simplejson as json
import paramiko
class auto(object):
def __init__(self):
self.tylersList = []
print('Welcome. Lets Automate! \nWe will now start tasks..... | {
"repo_name": "Johnisgeek/KnowledgeBasic",
"path": "tyler.py",
"copies": "1",
"size": "2319",
"license": "apache-2.0",
"hash": 354214885866579100,
"line_mean": 21.0857142857,
"line_max": 77,
"alpha_frac": 0.6601983614,
"autogenerated": false,
"ratio": 3.138024357239513,
"config_test": false,
... |
__author__ = 'jaddison'
"""
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
from django.conf import settings
from django.http import Http404
from django.views.static import serve as django_serve
try:
# only in django 1.... | {
"repo_name": "jaddison/django-cachebuster",
"path": "cachebuster/views.py",
"copies": "2",
"size": "1522",
"license": "bsd-3-clause",
"hash": 6946093974564215000,
"line_mean": 37.05,
"line_max": 83,
"alpha_frac": 0.6767411301,
"autogenerated": false,
"ratio": 3.994750656167979,
"config_test": ... |
__author__ = 'jae'
import argparse
import multiprocessing
import cv2
import numpy as np
import ps_drone
import time
import os
def draw_detections(img, rects):
for x, y, w, h in rects:
cv2.rectangle(img, (x,y), (x+w, y+h), (0, 255, 0), 3)
if __name__ == "__main__":
parser = argparse.ArgumentParser(des... | {
"repo_name": "agiantwhale/pigeon",
"path": "pablo.py",
"copies": "1",
"size": "4303",
"license": "mit",
"hash": 4968772971206577000,
"line_mean": 31.8473282443,
"line_max": 117,
"alpha_frac": 0.5287009063,
"autogenerated": false,
"ratio": 3.3908589440504335,
"config_test": false,
"has_no_key... |
__author__ = 'jaguasch'
from dateutil import parser
import json
import hashlib
from dojo.models import Finding
import re
class DawnScannerParser(object):
def __init__(self, filename, test):
tree = filename.read()
try:
data = json.loads(str(tree, 'utf-8'))
except:
d... | {
"repo_name": "OWASP/django-DefectDojo",
"path": "dojo/tools/dawnscanner/parser.py",
"copies": "2",
"size": "2094",
"license": "bsd-3-clause",
"hash": -5166046136882542000,
"line_mean": 29.7941176471,
"line_max": 102,
"alpha_frac": 0.4641833811,
"autogenerated": false,
"ratio": 4.3264462809917354... |
__author__ = 'jaguasch'
import hashlib
from datetime import datetime
from dojo.models import Finding
class BundlerAuditParser(object):
def __init__(self, filename, test):
lines = filename.read()
dupes = dict()
find_date = datetime.now()
warnings = lines.split('\n\n')
for ... | {
"repo_name": "OWASP/django-DefectDojo",
"path": "dojo/tools/bundler_audit/parser.py",
"copies": "2",
"size": "2808",
"license": "bsd-3-clause",
"hash": -2586051702701937700,
"line_mean": 39.1142857143,
"line_max": 89,
"alpha_frac": 0.4825498575,
"autogenerated": false,
"ratio": 4.380655226209049... |
__author__ = 'jaguasch'
import json
from dojo.models import Finding
from datetime import datetime
class AnchoreEngineScanParser(object):
def __init__(self, filename, test):
tree = filename.read()
try:
data = json.loads(str(tree, 'utf-8'))
except:
data = json.loads(... | {
"repo_name": "OWASP/django-DefectDojo",
"path": "dojo/tools/anchore_engine/parser.py",
"copies": "2",
"size": "2675",
"license": "bsd-3-clause",
"hash": 486736657775778100,
"line_mean": 33.2948717949,
"line_max": 135,
"alpha_frac": 0.4493457944,
"autogenerated": false,
"ratio": 3.992537313432835... |
__author__ = 'Jaimiey Sears and Alex Schendel'
####### GENERAL PURPOSE CONSTANTS #######
OPERATION_SUCCESS = 0
OPERATION_FAILURE = -1
# indexes of lidar data in processedDataArrays
X_IDX = 0
Y_IDX = 1
Z_IDX = 2
D_IDX = 3
PHI_IDX = 4
TH_IDX = 5
# Starting theta angle of our scans
START_ANGLE = 0
# Resolution of LID... | {
"repo_name": "MarsRobotics/Experiments",
"path": "LIDAR Data Extraction/LidarCommands/Currently Used/rpi/constants.py",
"copies": "1",
"size": "1406",
"license": "bsd-3-clause",
"hash": 5662102615932246000,
"line_mean": 23.2586206897,
"line_max": 109,
"alpha_frac": 0.6834992888,
"autogenerated": f... |
__author__ = 'Jaka & Jani'
#coding: UTF-8
from operands import *
from simplify import simplify, simplify_not
def only_literals(p):
"""
Vrne True, ce so v formuli p samo literali (in ne dodatni operatorji). Sicer False.
"""
# Loceno preverimo Not
if isinstance(p, Not):
return isinstance(p.... | {
"repo_name": "rusepatacis/LVR_team5",
"path": "team5_sat_solver/cnf.py",
"copies": "1",
"size": "6788",
"license": "mit",
"hash": -6150497256815274000,
"line_mean": 29.5765765766,
"line_max": 113,
"alpha_frac": 0.5139952858,
"autogenerated": false,
"ratio": 3.419647355163728,
"config_test": fa... |
__author__ = 'Jaka & Jani'
#coding: UTF-8
from operands import *
def simplify(formula, verbose=False):
""""
Metoda namenjena poenostavljanju logicnih izrazov.
Kot parameter sprejme logicno formulo (izraz) ter ga poskusa poenostaviti. Deluje na rekurziven nacin.
Zastavica verbose doloca izpis sledi fu... | {
"repo_name": "rusepatacis/LVR_team5",
"path": "team5_sat_solver/simplify.py",
"copies": "1",
"size": "8429",
"license": "mit",
"hash": -4309798314626502700,
"line_mean": 31.7976653696,
"line_max": 106,
"alpha_frac": 0.5222446316,
"autogenerated": false,
"ratio": 3.7934293429342936,
"config_tes... |
__author__ = 'Jaka & Jani'
#coding: UTF-8
from operands import *
def X2SATsudoku(vhod):
""""
vhod - slovar z vnosi ((i,j) -> stevilka), kjer je
i indeks [1-9] vrstice v sudoku tabeli
j indeks [1-9] stolpca v sudoku tabeli
stevilka - znana vrednost na danem mestu
... | {
"repo_name": "rusepatacis/LVR_team5",
"path": "team5_sat_solver/prevedba_sudoku.py",
"copies": "1",
"size": "3196",
"license": "mit",
"hash": -4049065467589802500,
"line_mean": 38.4567901235,
"line_max": 102,
"alpha_frac": 0.4026908636,
"autogenerated": false,
"ratio": 3.205616850551655,
"conf... |
__author__ = 'Jaka & Jani'
#coding: UTF-8
from operands import *
""" Prevedba problema barvanja grafa na problem SAT """
def barvanje(G, b):
"""
Funkcija, ki vhodni graf G prevede na problem SAT (v obliki logicne formule).
G - neusmerjen graf, podan s seznamom povezav (dvojk, vozlišča so nizi),... | {
"repo_name": "rusepatacis/LVR_team5",
"path": "team5_sat_solver/prevedba_coloring.py",
"copies": "1",
"size": "1797",
"license": "mit",
"hash": -5102097474813878000,
"line_mean": 41.5238095238,
"line_max": 115,
"alpha_frac": 0.6240896359,
"autogenerated": false,
"ratio": 2.3517786561264824,
"c... |
__author__ = 'Jaka & Jani'
#coding: UTF-8
from time import time
class Stopwatch():
"""
Razred stoparica, namenjen merjenju cas izvajanja razlicnih delov programa.
Ukazi: intermediate(tag), start(tag),restart(tag),stop(tag).
Stoparica se avtomatsko aktivira, ko kreiramo objekt. Z uporabo "intermediat... | {
"repo_name": "rusepatacis/LVR_team5",
"path": "team5_sat_solver/utils.py",
"copies": "1",
"size": "2801",
"license": "mit",
"hash": -4759296753865961000,
"line_mean": 30.8409090909,
"line_max": 110,
"alpha_frac": 0.4991074616,
"autogenerated": false,
"ratio": 3.4158536585365855,
"config_test":... |
__author__ = 'Jaka & Jani'
#coding: UTF-8
import itertools
from operands import *
from simplify import simplify_not
def hadamardova_matrika(n):
""""
Iskanje hadamardove matrike stopnje n.
Vrne logicno funkcijo, katere resitev (ce obstaja) je hadamardova matrika.
"""""
if n % 2 == 1:
retur... | {
"repo_name": "rusepatacis/LVR_team5",
"path": "team5_sat_solver/prevedba_hadamard.py",
"copies": "1",
"size": "3306",
"license": "mit",
"hash": 4269729669665569000,
"line_mean": 32.3838383838,
"line_max": 97,
"alpha_frac": 0.5832324455,
"autogenerated": false,
"ratio": 2.8143100511073254,
"con... |
__author__ = 'Jaka & Jani'
#coding: UTF-8
""" Modul, ki vsebuje algoritem DPLL. """
from cnf import convert_to_CNF
from simplify import *
from operands import *
def dpll(f, verbose=False):
"""
Algoritem DPLL za resevanje SAT.
f - formula (objekt operandov)
verbose - zastavica za izpis poteka funkcij... | {
"repo_name": "rusepatacis/LVR_team5",
"path": "team5_sat_solver/dpll.py",
"copies": "1",
"size": "5571",
"license": "mit",
"hash": -2902678371679741000,
"line_mean": 30.4689265537,
"line_max": 101,
"alpha_frac": 0.5263913824,
"autogenerated": false,
"ratio": 3.099610461880913,
"config_test": f... |
__author__ = 'Jaka & Jani'
#coding: UTF-8
""" Osnovni logicni operandi, ki jih uporabljamo za konstrukcijo formul. """
"""
Razred, ki predstavlja logicni FALSE (0).
Uporaba: Fls()
"""
class Fls:
def __init__(self):
pass
def __repr__(self):
return 'Fls'
def vrednost(self, v):
re... | {
"repo_name": "rusepatacis/LVR_team5",
"path": "team5_sat_solver/operands.py",
"copies": "1",
"size": "3982",
"license": "mit",
"hash": -22115584353960684,
"line_mean": 18.8059701493,
"line_max": 106,
"alpha_frac": 0.5484924623,
"autogenerated": false,
"ratio": 2.7448275862068967,
"config_test"... |
__author__ = 'jake'
from sklearn.base import BaseEstimator
import numpy as np
class Averager(BaseEstimator):
"""
Simple meta-estimator which averages predictions
May use any of the pythagorean means
"""
class StepwiseRegressor(Averager):
"""
An averager which iteratively adds predictions whi... | {
"repo_name": "jpopham91/berserker",
"path": "berserker/estimators/meta.py",
"copies": "1",
"size": "1349",
"license": "mit",
"hash": 8232686877373087000,
"line_mean": 29.6818181818,
"line_max": 104,
"alpha_frac": 0.6300963677,
"autogenerated": false,
"ratio": 3.5130208333333335,
"config_test":... |
__author__ = 'jake'
from PIL import Image
from PIL import ImageEnhance
from PIL import ImageOps
from string import maketrans
import pytesseract
import os
import re
import csv
# directory with all of your post-game screencaps
file_dir = '/home/jake/mega/data/postgame_screens/'
# location of csv file containing game st... | {
"repo_name": "jpopham91/nhl15-analytics",
"path": "parse_postgame.py",
"copies": "1",
"size": "3880",
"license": "mit",
"hash": -8236164665610825000,
"line_mean": 32.1623931624,
"line_max": 115,
"alpha_frac": 0.5698453608,
"autogenerated": false,
"ratio": 3.436669619131975,
"config_test": fals... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
from sklearn.neighbors import KernelDensity
#----------------------------------------------------------------------
# Plot a 1D density example
N = 100
np.random.seed(1)
X = np.concatenate((np.random.normal(0, 1, 0.3 * N),
... | {
"repo_name": "hkucukdereli/MousyBox",
"path": "scikit_kde.py",
"copies": "1",
"size": "1152",
"license": "mit",
"hash": 5223284170198828000,
"line_mean": 30.1351351351,
"line_max": 71,
"alpha_frac": 0.5729166667,
"autogenerated": false,
"ratio": 2.769230769230769,
"config_test": false,
"has_... |
from matplotlib import pyplot as plt
import numpy as np
from sklearn.mixture import GMM
#----------------------------------------------------------------------
# This function adjusts matplotlib settings for a uniform feel in the textbook.
# Note that with usetex=True, fonts are rendered with LaTeX. This may
# result... | {
"repo_name": "sniemi/EuclidVisibleInstrument",
"path": "sandbox/GaussianMixtureModel.py",
"copies": "1",
"size": "3599",
"license": "bsd-2-clause",
"hash": 5546457602066713000,
"line_mean": 31.4234234234,
"line_max": 79,
"alpha_frac": 0.6287857738,
"autogenerated": false,
"ratio": 2.881505204163... |
import numpy as np
from matplotlib import pyplot as plt
from scipy.special import gamma
from scipy.stats import norm
from sklearn.neighbors import BallTree
from astroML.density_estimation import GaussianMixture1D
from astroML.plotting import plot_mcmc,hist
# hack to fix an import issue in older versions of pymc
import... | {
"repo_name": "AndrewRook/machine_learning",
"path": "figure_5-24.py",
"copies": "1",
"size": "6544",
"license": "mit",
"hash": 5328921494397641000,
"line_mean": 31.396039604,
"line_max": 92,
"alpha_frac": 0.5907701711,
"autogenerated": false,
"ratio": 2.7097308488612835,
"config_test": false,
... |
import numpy as np
from scipy.stats import binom
from matplotlib import pyplot as plt
# ----------------------------------------------------------------------
# This function adjusts matplotlib settings for a uniform feel in the textbook.
# Note that with usetex=True, fonts are rendered with LaTeX. This may
# result... | {
"repo_name": "YcheLanguageStudio/PythonStudy",
"path": "bioinformatics/hypothesis_test/binomial_distribution.py",
"copies": "1",
"size": "1571",
"license": "mit",
"hash": 4382857858640838700,
"line_mean": 31.7291666667,
"line_max": 79,
"alpha_frac": 0.6078930617,
"autogenerated": false,
"ratio":... |
""" Module to give helpful messages to the user that did not
compile megaman properly (adapted from scikit-learn's check_build utility)
"""
import os
INPLACE_MSG = """
It appears that you are importing a local megaman source tree.
Please either use an inplace install or try from another location."""
STANDARD_MSG = "... | {
"repo_name": "jmcq89/megaman",
"path": "megaman/__check_build/__init__.py",
"copies": "4",
"size": "2031",
"license": "bsd-2-clause",
"hash": -2158083548643401500,
"line_mean": 35.2678571429,
"line_max": 77,
"alpha_frac": 0.6036435254,
"autogenerated": false,
"ratio": 4.153374233128834,
"confi... |
print(__doc__)
from time import time
import pylab as pl
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.ticker import NullFormatter
import numpy as np
from sklearn import manifold, datasets
# Next line to silence pyflakes. This import is needed.
Axes3D
n_points = 1000
X, color = datasets.samples_generator... | {
"repo_name": "aufziehvogel/kaggle",
"path": "titanic/plot_compare_methods.py",
"copies": "1",
"size": "2899",
"license": "mit",
"hash": 2372914509564965400,
"line_mean": 29.8404255319,
"line_max": 76,
"alpha_frac": 0.6353915143,
"autogenerated": false,
"ratio": 2.747867298578199,
"config_test"... |
__author__ = 'Jake Wharton'
__author_email__ = 'JakeWharton@GMail.com'
__url__ = 'http://mine.jakewharton.com/projects/show/pycache'
__revision__ = "$Rev$"[6:-2]
__license__ = '''
Copyright 2009 Jake Wharton
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance ... | {
"repo_name": "dibaunaumh/pycache",
"path": "storage/sqlite.py",
"copies": "1",
"size": "2363",
"license": "apache-2.0",
"hash": -1961284187903795500,
"line_mean": 40.4736842105,
"line_max": 157,
"alpha_frac": 0.6390181972,
"autogenerated": false,
"ratio": 3.464809384164223,
"config_test": fals... |
__author__ = 'Jakob Abesser'
import unittest
import numpy as np
import os
from ..transform.transformer import Transformer
from ..tools import Tools
class TestTransform(unittest.TestCase):
""" Unit tests for Transformer class
"""
def setUp(self):
""" Load reference data exported from Matlab """
... | {
"repo_name": "jakobabesser/pymus",
"path": "pymus/test/test_transformer.py",
"copies": "1",
"size": "3040",
"license": "mit",
"hash": -2617068949921793500,
"line_mean": 47.253968254,
"line_max": 127,
"alpha_frac": 0.4904605263,
"autogenerated": false,
"ratio": 4.239888423988843,
"config_test":... |
import gzip
import autograd.numpy as np
import matplotlib.pyplot as plt
from skimage import transform
from autograd.scipy.misc import logsumexp
import cPickle
def read_int32(f):
return np.fromstring(f.read(4), dtype=np.dtype('>i4'))[0]
def read_images(path):
with gzip.open(path) as f:
magic = read_... | {
"repo_name": "Cubix651/neuralnetwork",
"path": "utils.py",
"copies": "1",
"size": "2921",
"license": "mit",
"hash": 5597694771946606000,
"line_mean": 28.21,
"line_max": 88,
"alpha_frac": 0.619308456,
"autogenerated": false,
"ratio": 3.1923497267759564,
"config_test": false,
"has_no_keywords"... |
__author__ = 'Jakub Danek'
import ConfigParser as cp
DATA_PATH='./data/'
"""
Reads functionality provider (library) information from data file
based on the provider name (expects to find provider_name.properties file in
the ./data folder.
Reads list of different versions and their sizes in kB.
Each item from the f... | {
"repo_name": "danekja/entropy",
"path": "2015-07-ilpsearch-init/code/data.py",
"copies": "1",
"size": "1638",
"license": "apache-2.0",
"hash": 6528112305266844000,
"line_mean": 29.3518518519,
"line_max": 95,
"alpha_frac": 0.6935286935,
"autogenerated": false,
"ratio": 4.2,
"config_test": false... |
__author__ = 'Jakub Dutkiewicz'
import numpy as np
from scipy.stats import spearmanr
class QuestionBase:
def __init__(self, filename):
self.word1 = []
self.word2 = []
self.sims = []
iFile = open(filename)
for line in iFile:
self.word1.append(line.split(',')[0])
... | {
"repo_name": "dudenzz/word_embedding",
"path": "SimilarityRegression/QuestionHandling/QuestionBase.py",
"copies": "1",
"size": "2233",
"license": "mit",
"hash": 6686042811728665000,
"line_mean": 30.0138888889,
"line_max": 123,
"alpha_frac": 0.5020152262,
"autogenerated": false,
"ratio": 3.050546... |
__author__ = 'Jakub Dutkiewicz'
class QuestionBase:
#possible question types:
#Turney : "question [word].|ans1|ans2":cAns
#TOEFL
def __init__(self, filename, questionType):
self.answers = []
self.questionWords= []
self.questions= []
self.possibilities = []
... | {
"repo_name": "dudenzz/word_embedding",
"path": "SimilarityClassification/QuestionsHandling/QuestionBase.py",
"copies": "1",
"size": "4258",
"license": "mit",
"hash": -7840623912772350000,
"line_mean": 39.7450980392,
"line_max": 110,
"alpha_frac": 0.4502113668,
"autogenerated": false,
"ratio": 4.... |
import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'resources', 'lib'))
from urlparse import parse_qsl
from tvseriesonlinepl import list
from threading import Thread
import urllib
import xbmcgui
import xbmcplugin
import urlresolver
_url = sys.argv[0]
_handle = int(sys.argv[1])
def build_url(qu... | {
"repo_name": "jakzal/plugin.video.tvseriesonlinepl",
"path": "addon.py",
"copies": "1",
"size": "2718",
"license": "mit",
"hash": -6183694252312800000,
"line_mean": 31.7469879518,
"line_max": 109,
"alpha_frac": 0.6629874908,
"autogenerated": false,
"ratio": 3.440506329113924,
"config_test": fa... |
__author__ = 'James Addison'
import os
import sys
if sys.version < '3':
import codecs
def u(x):
""" Make string a unicode """
return codecs.unicode_escape_decode(x)[0]
else:
def u(x):
""" Make string a unicode """
return x
def unique_string(file):
# TODO: consider u... | {
"repo_name": "defcube/django-cachebuster",
"path": "cachebuster/detectors/git.py",
"copies": "1",
"size": "1968",
"license": "bsd-3-clause",
"hash": -8607064012461154000,
"line_mean": 30.7419354839,
"line_max": 147,
"alpha_frac": 0.5807926829,
"autogenerated": false,
"ratio": 3.7557251908396947,... |
__author__ = 'James Addison'
import os
def unique_string(file):
# TODO: consider using 'inspect' to get the calling module rather than
# forcing the user to pass it in. It's passed in because we need to find the .git dir
# for the calling module, not that of django-cachebuster!
base_dir = original_di... | {
"repo_name": "jaddison/django-cachebuster",
"path": "cachebuster/detectors/git.py",
"copies": "1",
"size": "1742",
"license": "bsd-3-clause",
"hash": -5250611202190133000,
"line_mean": 35.2916666667,
"line_max": 147,
"alpha_frac": 0.5884041332,
"autogenerated": false,
"ratio": 3.7705627705627704... |
__author__ = 'James Addison'
import posixpath
import datetime
import urllib
import os
from django import template
from django.conf import settings
try:
# finders won't exist if we're not using Django 1.3+
from django.contrib.staticfiles import finders
except ImportError:
finders = None
register = templ... | {
"repo_name": "defcube/django-cachebuster",
"path": "cachebuster/templatetags/cachebuster.py",
"copies": "1",
"size": "3102",
"license": "bsd-3-clause",
"hash": 232631485086131260,
"line_mean": 34.6551724138,
"line_max": 117,
"alpha_frac": 0.6308833011,
"autogenerated": false,
"ratio": 4.06020942... |
__author__ = 'James Boggs'
__version__ = 'alpha 0.03'
# Just reads Myo input and writes it to a serial port for an Arduino
# to read. A stand-in for reading a Myo directly from the Arduino,
# which will come later.
import serial
import myo as libmyo
libmyo.init('C:\\Users\\James\\Documents\\Coding\\MyoArm\\myo-sdk-wi... | {
"repo_name": "JBoggsy/MyoArm",
"path": "MyoReader.py",
"copies": "1",
"size": "1715",
"license": "mit",
"hash": -601469084967686100,
"line_mean": 30.2,
"line_max": 82,
"alpha_frac": 0.5772594752,
"autogenerated": false,
"ratio": 3.2729007633587788,
"config_test": false,
"has_no_keywords": fa... |
import nltk
import sys
from sys import exit
pos_tweets = [('I love this car', 'positive'),
('This view is amazing', 'positive'),
('I feel great this morning', 'positive'),
('I am so excited about the concert', 'positive'),
('He is my best friend', 'positive'),
... | {
"repo_name": "jamesacampbell/python-examples",
"path": "multi-categorization-tweets-example.py",
"copies": "1",
"size": "6583",
"license": "mit",
"hash": -4959251909662075000,
"line_mean": 48.8636363636,
"line_max": 168,
"alpha_frac": 0.5907019143,
"autogenerated": false,
"ratio": 3.666852367688... |
__author__ = 'jamescarthew'
##################################################
# MAJOR SCALE
##################################################
# T T S T T T S
# 0 2 4 5 7 9 11 12
##################################################
##################################################
# MINOR SCALE
########... | {
"repo_name": "jamesrobertcarthew/notes",
"path": "scales.py",
"copies": "1",
"size": "1948",
"license": "mit",
"hash": -7172778476641129000,
"line_mean": 32.5862068966,
"line_max": 78,
"alpha_frac": 0.4132443532,
"autogenerated": false,
"ratio": 3.896,
"config_test": false,
"has_no_keywords"... |
# Purpose: To allocate shares of cost amongst
# a group of friends who benifit by mutual cooperation.
from __future__ import division
from random import randint
from math import factorial
from copy import copy
# Travelling salesman solver
# global variables for tsp
qstart = 0
qend = 0
queue = []
bestCo... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578115_Taxi_Fare_Splitter/recipe-578115.py",
"copies": "1",
"size": "7615",
"license": "mit",
"hash": 84090490956766640,
"line_mean": 17.0023640662,
"line_max": 121,
"alpha_frac": 0.5634931057,
"autogenerated": false,
"ratio": 3.4193982936... |
repeatTimes = 4 # NUMBER OF CYCLES
from Tkinter import *
from winsound import Beep
from math import *
from random import*
from time import *
W = 800 # canvas dimensions
H = 600 # adjust to suit
scale = 200
def FindRef( crossRef, p, q):
a = min( p, q)
b = max( p, q)
faceKey = str( a) + ':' + str( b)
... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/576521_Blobby_Planet/recipe-576521.py",
"copies": "1",
"size": "11140",
"license": "mit",
"hash": 2490051996442967600,
"line_mean": 29.6043956044,
"line_max": 130,
"alpha_frac": 0.4476660682,
"autogenerated": false,
"ratio": 2.751296616448... |
from html.entities import html5
from twilio.rest import TwilioRestClient
import random
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "AC00fed5146483f1a0bbfef3032c5e2227"
auth_token = "e6ee9ed82a6c8e3c0ff6002a3590cc8b"
client = TwilioRestClient(account_sid, auth_token)
quotes = [ "Just... | {
"repo_name": "JamesEarle/PythonProjects",
"path": "GPP Scripts/text.py",
"copies": "1",
"size": "4057",
"license": "mit",
"hash": 3058154035957268500,
"line_mean": 73.2037037037,
"line_max": 143,
"alpha_frac": 0.7541801847,
"autogenerated": false,
"ratio": 3.392887383573243,
"config_test": fal... |
import plotly.plotly as py
import plotly.graph_objs as go
import bs4 as bs
from urllib import parse
import urllib.request
import os
from os import listdir
import sys
py.sign_in('roland23', 'plxezgfw1z')
x_arr = []
hit_arr = []
std_arr = []
adj_arr = []
i = 0
outPath = 'docs-img'
outFolders = listdir(outPath)
outDa... | {
"repo_name": "JamesEarle/PythonProjects",
"path": "GPP Scripts/graphs.py",
"copies": "1",
"size": "2551",
"license": "mit",
"hash": 6797104458170756000,
"line_mean": 19.5806451613,
"line_max": 119,
"alpha_frac": 0.6413171305,
"autogenerated": false,
"ratio": 2.592479674796748,
"config_test": f... |
__author__ = 'James & Guorong'
import logging
import itertools
import math
from fdr import fdr
from GO import GOLocusParser
from scipy.stats import hypergeom
def calc_pvalue(gene_list, gene_set, M):
gene_list = set(gene_list)
gene_set = set(gene_set)
N = len(gene_list)
n = len(gene_set)
overlap =... | {
"repo_name": "ucsd-ccbb/Oncolist",
"path": "src/server/Utils/HypergeomCalculator.py",
"copies": "1",
"size": "2426",
"license": "mit",
"hash": -6143351347678005000,
"line_mean": 38.7868852459,
"line_max": 149,
"alpha_frac": 0.6236603462,
"autogenerated": false,
"ratio": 2.7015590200445434,
"co... |
__author__ = 'James & Guorong'
import logging
import itertools
import math
from fdr import fdr
import GOLocusParser
#import GOParser
from scipy.stats import hypergeom
from datetime import datetime
def calc_pvalue(gene_list, gene_set, M):
gene_list = set(gene_list)
gene_set = set(gene_set)
N = len(gene_li... | {
"repo_name": "ucsd-ccbb/jupyter-genomics",
"path": "src/networkAnalysis/go_annotation/HypergeomCalculator.py",
"copies": "1",
"size": "3019",
"license": "mit",
"hash": 8663384521477577000,
"line_mean": 42.1428571429,
"line_max": 149,
"alpha_frac": 0.5948989732,
"autogenerated": false,
"ratio": 2... |
__author__ = 'James Gurtowski <gurtowsk@cshl.edu> / Sri Ramakrishnan <sramakri@cshl.edu>'
__date__ = '1/23/13'
from collections import namedtuple
import time
import json
import os
import re
import sys
import base64
import logging
import ast
import StringIO
import uuid
import math
from collections import Counter
from ... | {
"repo_name": "mlhenderson/narrative",
"path": "src/biokbase/narrative/services/jnomics_service.py",
"copies": "5",
"size": "49827",
"license": "mit",
"hash": -3391200196916543000,
"line_mean": 36.2956586826,
"line_max": 208,
"alpha_frac": 0.6135629277,
"autogenerated": false,
"ratio": 3.54337932... |
"""This is a class that implements an interface to mySQL databases, conforming
to the API published by the Python db-sig at
http://www.python.org/sigs/db-sig/DatabaseAPI.html
It is really just a wrapper for an older python interface to mySQL databases
called mySQL, which I modified to facilitate use of a cursor. Tha... | {
"repo_name": "mattduan/proof",
"path": "driver/mysql-0.3.5/CompatMysqldb.py",
"copies": "1",
"size": "9171",
"license": "bsd-3-clause",
"hash": 2505174400447214600,
"line_mean": 28.9705882353,
"line_max": 86,
"alpha_frac": 0.640061062,
"autogenerated": false,
"ratio": 3.14290610006854,
"config... |
import sys
class Number:
def __init__(self, value):
self.value = int(value)
print "Converting "+str(self.value)+" to binary formats.\n"
self.mag = getMagnitude(abs(self.value))
self.sign = getSign(self.value)
self.onesComp = get1sComplement(self.mag,self.sign)
self.... | {
"repo_name": "jamesfholland/10to2converter",
"path": "genBin.py",
"copies": "1",
"size": "2849",
"license": "mit",
"hash": -7479998837584260000,
"line_mean": 27.7777777778,
"line_max": 129,
"alpha_frac": 0.575991576,
"autogenerated": false,
"ratio": 3.470158343483557,
"config_test": false,
"... |
try:
import pickle
import random
import re
import string
import time
import copy
import traceback
from string import Template
from cgi import escape
from burp import IBurpExtender, IScannerInsertionPointProvider, IScannerInsertionPoint, IParameter, IScannerCheck, \
IScan... | {
"repo_name": "albinowax/ActiveScanPlusPlus",
"path": "activeScan++.py",
"copies": "1",
"size": "47173",
"license": "apache-2.0",
"hash": 1429675717380699000,
"line_mean": 44.9328140214,
"line_max": 982,
"alpha_frac": 0.6126173871,
"autogenerated": false,
"ratio": 3.9564706869076574,
"config_te... |
__author__ = 'James Klingler - Institute for Software Integrated Systems, Vanderbilt University'
import json
import random
import uuid
import datetime
class TopLevelRequirementsGroup(object):
def __init__(self, name):
self.category = True
self.weight_neg = 1.0 # Real [0,1]
self.descript... | {
"repo_name": "dynamics-team/requirements-editor",
"path": "sandbox/jklingler/scripts/requirements_creation.py",
"copies": "1",
"size": "4997",
"license": "mit",
"hash": -6427267811341233000,
"line_mean": 28.9281437126,
"line_max": 130,
"alpha_frac": 0.5401240744,
"autogenerated": false,
"ratio":... |
__author__ = 'James Klingler - Institute for Software Integrated Systems, Vanderbilt University'
# NOTE: This will generate a requirements.json file based on a csv description of requirements:
# (name, unit, description, threshold, objective, test_bench, metric_name, group_name)
# Requirements will be "Grouped" accor... | {
"repo_name": "dynamics-team/requirements-editor",
"path": "sandbox/jklingler/scripts/create_requirements.py",
"copies": "1",
"size": "3029",
"license": "mit",
"hash": 3487536430840325000,
"line_mean": 36.875,
"line_max": 114,
"alpha_frac": 0.5873225487,
"autogenerated": false,
"ratio": 4.0279255... |
__author__ = 'James Kokou GAGLO'
__copyright__ = "Copyright {YEAR}, Dovealabs"
__credits__ = ["James Kokou GAGLO"]
__license__ = "GPL"
__version__ = "1.0.1"
__maintainer__ = "James Kokou GAGLO"
__email__ = "freemanpolys@gmail.com"
__status__ = "Production"
from fabric.api import hosts, run,runs_once,cd
ims_core = ('v... | {
"repo_name": "freemanpolys/ltelabs",
"path": "imscore/fabopenimscore.py",
"copies": "1",
"size": "2247",
"license": "apache-2.0",
"hash": 2759488867267325400,
"line_mean": 37.7586206897,
"line_max": 186,
"alpha_frac": 0.6858032933,
"autogenerated": false,
"ratio": 2.980106100795756,
"config_te... |
__author__ = 'jamesma'
class PositionData:
def __init__(self, data):
self.working_sells = 0
self.timestamp = 0
self.tradable_id = None
self.working_buys = 0
self.realized_pnl = 0
self.unrealized_pnl = 0
self.market_id = None
self.avg_buy_price = 0
... | {
"repo_name": "hftstrat/The-Gateway-code-samples",
"path": "classes/position_data.py",
"copies": "1",
"size": "1170",
"license": "mit",
"hash": -283997192919268540,
"line_mean": 32.4571428571,
"line_max": 58,
"alpha_frac": 0.5777777778,
"autogenerated": false,
"ratio": 3.2681564245810057,
"conf... |
__author__ = 'jamesma'
import asyncore
import socket
from cStringIO import StringIO
import logging
class SocketClient(asyncore.dispatcher):
def __init__(self, host, port):
asyncore.dispatcher.__init__(self)
self.read_buffer = StringIO()
self.logger = logging.getLogger()
self.write... | {
"repo_name": "hftstrat/The-Gateway-code-samples",
"path": "classes/socket_client.py",
"copies": "1",
"size": "1905",
"license": "mit",
"hash": 1313753725884328700,
"line_mean": 25.8450704225,
"line_max": 63,
"alpha_frac": 0.5884514436,
"autogenerated": false,
"ratio": 3.78727634194831,
"config... |
__author__ = 'jamesma'
import datetime as dt
class MarketData:
def __init__(self, data):
self.timestamp = 0
self.datetime = dt.datetime.now()
self.market_id = None
self.last_price = 0
self.total_volume = 0
self.tick_value = 0
self.numerator = 1
self... | {
"repo_name": "hftstrat/The-Gateway-code-samples",
"path": "classes/market_data.py",
"copies": "1",
"size": "1428",
"license": "mit",
"hash": -6965840914743914000,
"line_mean": 29.4042553191,
"line_max": 82,
"alpha_frac": 0.5588235294,
"autogenerated": false,
"ratio": 3.019027484143763,
"config... |
class dstat_plugin(dstat):
"""
Riak Stats counter
Displays Riak Stats
"""
def __init__(self):
self.name = 'riak'
self.nick = ('gets', 'glat', 'puts', 'plat')
self.vars = ('node_gets_total', 'node_get_fsm_time_mean',
'node_puts_total', 'node_put_fsm_tim... | {
"repo_name": "basho/dstat-riak",
"path": "dstat_riak.py",
"copies": "2",
"size": "1315",
"license": "apache-2.0",
"hash": 496275127791012740,
"line_mean": 27.5869565217,
"line_max": 70,
"alpha_frac": 0.4988593156,
"autogenerated": false,
"ratio": 3.683473389355742,
"config_test": false,
"has... |
import warnings
from functools import wraps
import sys
import numpy as np
def clean_warning_registry():
"""Safe way to reset warnings """
warnings.resetwarnings()
reg = "__warningregistry__"
for mod_name, mod in list(sys.modules.items()):
if 'six.moves' in mod_name:
continue
... | {
"repo_name": "Jerryzcn/Mmani",
"path": "Mmani/utils/testing.py",
"copies": "1",
"size": "6795",
"license": "bsd-2-clause",
"hash": 8912967131421997000,
"line_mean": 32.8109452736,
"line_max": 78,
"alpha_frac": 0.5818984547,
"autogenerated": false,
"ratio": 4.3810444874274665,
"config_test": fa... |
__author__ = 'James'
from monopyly import *
from .property_probs_calcs import PropertyProbCalcs
from .property_sim import *
from .board_utils import *
class DecisionUtils():
def __init__(self, property_probs):
self.property_probs = property_probs
self.board_utils = BoardUtils(self.property_probs)
... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/James Tyas/decision_utils.py",
"copies": "1",
"size": "15632",
"license": "mit",
"hash": 676823921847819800,
"line_mean": 56.0510948905,
"line_max": 163,
"alpha_frac": 0.599283521,
"autogenerated": false,
"ratio": 4.009233136701718,
"confi... |
__author__ = 'James'
from monopyly import *
from .property_probs_calcs import PropertyProbCalcs
class BoardUtils():
def __init__(self, property_probs):
self.property_probs = property_probs
pass
def get_list_of_complete_sets_i_own(self, board, my_own_player):
property_sets_i_own = None... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/James Tyas/board_utils.py",
"copies": "1",
"size": "9288",
"license": "mit",
"hash": 5878183672267673000,
"line_mean": 47.1243523316,
"line_max": 133,
"alpha_frac": 0.6413652024,
"autogenerated": false,
"ratio": 3.7694805194805197,
"config... |
__author__ = 'James'
from monopyly import *
from .property_with_probs import *
class PropertyProbCalcs():
def __init__(self):
self.properties_with_probs={}
self._add_all_properties()
def rolls_to_recoup(self, property_name, num_houses=None, set_owned=None,number_of_stations_owned=Non... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/James Tyas/property_probs_calcs.py",
"copies": "1",
"size": "8319",
"license": "mit",
"hash": -600180580253909500,
"line_mean": 93.5340909091,
"line_max": 229,
"alpha_frac": 0.695997115,
"autogenerated": false,
"ratio": 2.418313953488372,
... |
__author__ = 'James'
from monopyly import *
class PropertyProb():
def __init__(self, property_name, rolls_recoup_single_prop
, rolls_recoup_all_sets, rolls_recoup_houses,
income_single_prop, income_all_sets, income_houses):
# Structure to store various probabilities
... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/James Tyas/property_with_probs.py",
"copies": "1",
"size": "1921",
"license": "mit",
"hash": -9018315121175707000,
"line_mean": 39.8723404255,
"line_max": 86,
"alpha_frac": 0.6543466944,
"autogenerated": false,
"ratio": 3.217755443886097,
... |
__author__ = 'James'
from stack import Stack
import operator
class RPN:
"""
Instances of the RPN class maintain a stack and
expose methods for the evaluation of strings
in postfix (reverse Polish notation).
"""
def __init__(self):
self.stack = Stack()
# Data in format op: (fn, ... | {
"repo_name": "james-dietz/rpn",
"path": "rpn.py",
"copies": "1",
"size": "2771",
"license": "mit",
"hash": 9148811589500388000,
"line_mean": 32.7926829268,
"line_max": 69,
"alpha_frac": 0.48682786,
"autogenerated": false,
"ratio": 4.810763888888889,
"config_test": false,
"has_no_keywords": f... |
__author__ = 'James'
import json
import urllib2
import csv
import base64
import time
import StringIO
from urllib2 import urlopen, Request, HTTPError
from urllib import quote
#https://github.com/settings/tokens
TOKEN = ""
def write_github_csv(cities_csv, output_csv):
with open(cities_csv + '.csv', 'rb') as cities... | {
"repo_name": "JamesMilnerUK/github-map",
"path": "scraping/github_api.py",
"copies": "1",
"size": "2743",
"license": "mit",
"hash": 961871555114985600,
"line_mean": 28.8152173913,
"line_max": 96,
"alpha_frac": 0.5468465184,
"autogenerated": false,
"ratio": 4.0576923076923075,
"config_test": fa... |
import os
import sys
import struct
def sizeof_fmt(num, suffix='B'):
for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']:
if abs(num) < 1024.0:
return "%3.1f%s%s" % (num, unit, suffix)
num /= 1024.0
return "%.1f%s%s" % (num, 'Yi', suffix)
drive_list = ['/mnt/slcdrive','/mnt/mlcdriv... | {
"repo_name": "JamesPavek/RADIANCE-main",
"path": "util/flatsat_check.py",
"copies": "1",
"size": "2535",
"license": "mit",
"hash": -1927453103873630000,
"line_mean": 31.5,
"line_max": 93,
"alpha_frac": 0.500591716,
"autogenerated": false,
"ratio": 3.1451612903225805,
"config_test": false,
"h... |
__author__ = 'James Polera'
__since__ = '2011.10.17'
__email__ = 'james@uncryptic.com'
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
settings = dict()
if sys.arg... | {
"repo_name": "polera/srambler",
"path": "setup.py",
"copies": "1",
"size": "1286",
"license": "mit",
"hash": -3793212304436897000,
"line_mean": 25.8125,
"line_max": 68,
"alpha_frac": 0.6516329705,
"autogenerated": false,
"ratio": 3.289002557544757,
"config_test": false,
"has_no_keywords": fa... |
__author__ = 'James Polera'
__since__ = '2012.05.29'
__email__ = 'james@uncryptic.com'
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
settings = dict()
if sys.arg... | {
"repo_name": "polera/nameparts",
"path": "setup.py",
"copies": "1",
"size": "1339",
"license": "bsd-2-clause",
"hash": 4543664755448505000,
"line_mean": 26.3265306122,
"line_max": 76,
"alpha_frac": 0.6527259149,
"autogenerated": false,
"ratio": 3.433333333333333,
"config_test": false,
"has_n... |
__author__ = 'James Robert Lloyd'
__description__ = 'Postprocessing of results of experiments'
import os
import sys
root_dir = os.path.dirname(__file__)
sys.path.append(root_dir)
import shutil
import numpy as np
import matplotlib.pyplot as plt
import util
def display_learning_curves(score_folders, picture_folder)... | {
"repo_name": "jamesrobertlloyd/automl-phase-2",
"path": "postprocessing.py",
"copies": "1",
"size": "3454",
"license": "mit",
"hash": -7124250673658912000,
"line_mean": 40.130952381,
"line_max": 118,
"alpha_frac": 0.5909090909,
"autogenerated": false,
"ratio": 3.6666666666666665,
"config_test"... |
__author__ = 'James Robert Lloyd'
__description__ = 'Scraps of code before module structure becomes apparent'
from util import callback_1d
import pybo
from pybo.functions.functions import _cleanup, GOModel
import numpy as np
from sklearn.datasets import load_iris
from sklearn.datasets import make_hastie_10_2
from s... | {
"repo_name": "jamesrobertlloyd/automl-phase-1",
"path": "sandpit.py",
"copies": "1",
"size": "1709",
"license": "mit",
"hash": 7117135420330095000,
"line_mean": 24.5074626866,
"line_max": 110,
"alpha_frac": 0.6155646577,
"autogenerated": false,
"ratio": 3.2614503816793894,
"config_test": false... |
from __future__ import print_function
import pandas as pd
from pytagcloud import create_tag_image, make_tags
from pytagcloud.lang.counter import get_tag_counts
from merge_cluster import merge_tweets
def visualize_clusters(file_path, output_dir="."):
"""
Visualize clusters using tag cloud.
file_path: in... | {
"repo_name": "Shitaibin/tweets-spam-clustering",
"path": "experiment/tools/visualize.py",
"copies": "1",
"size": "1846",
"license": "mit",
"hash": -7437316083732646000,
"line_mean": 26.9696969697,
"line_max": 61,
"alpha_frac": 0.6180931744,
"autogenerated": false,
"ratio": 3.5229007633587788,
... |
# handle data
# including load data...
from __future__ import print_function
import logging
import numpy as np
# Display progress logs on stdout
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(levelname)s %(message)s')
logger = logging.getLogger('tweetspamtools')
###############... | {
"repo_name": "Shitaibin/tweets-spam-clustering",
"path": "experiment/tools/handledata.py",
"copies": "1",
"size": "2592",
"license": "mit",
"hash": -7046403419652353000,
"line_mean": 22.5636363636,
"line_max": 69,
"alpha_frac": 0.5574845679,
"autogenerated": false,
"ratio": 3.4979757085020244,
... |
# TODO: copy nltk_data from ubuntu and put into Anaconda\lib
from __future__ import print_function
import logging
import string
from nltk import word_tokenize
from nltk.stem.porter import PorterStemmer
from sklearn.feature_extraction.text import TfidfVectorizer
# Display progress logs on stdout
logging.basicConfig... | {
"repo_name": "Shitaibin/tweets-spam-clustering",
"path": "experiment/tools/feature_extraction.py",
"copies": "1",
"size": "1180",
"license": "mit",
"hash": 8575510433245498000,
"line_mean": 25.8181818182,
"line_max": 78,
"alpha_frac": 0.6940677966,
"autogenerated": false,
"ratio": 3.881578947368... |
__author__ = 'James Stidard'
import hashlib
import os
import base64
from typing import Callable
from collections import namedtuple
class PasswordHelper:
Result = namedtuple('Result', ['success', 'new_password'])
_Parts = namedtuple('Parts', ['algorithm', 'iterations', 'salt', 'hash'])
algorithm = 'sha... | {
"repo_name": "OliverDashiell/utilise-py",
"path": "src/utilise/password_helper.py",
"copies": "1",
"size": "5156",
"license": "mit",
"hash": -8926084772106026000,
"line_mean": 41.9666666667,
"line_max": 114,
"alpha_frac": 0.6181148177,
"autogenerated": false,
"ratio": 4.164781906300485,
"confi... |
__author__ = "James Turk (dev@jamesturk.net)"
__version__ = "2.0.0-dev1"
__license__ = "BSD"
import django
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Manager
def limit_total_votes(num):
from secretballot.models import Vote
def total_vote_limiter(request, content_typ... | {
"repo_name": "jamesturk/django-secretballot",
"path": "secretballot/__init__.py",
"copies": "1",
"size": "4207",
"license": "bsd-2-clause",
"hash": 6551150873045572000,
"line_mean": 45.7444444444,
"line_max": 161,
"alpha_frac": 0.5923460899,
"autogenerated": false,
"ratio": 3.9207828518173344,
... |
__author__ = "James Turk (james.p.turk@gmail.com)"
__version__ = "0.4.0"
__license__ = "BSD"
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Manager
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
def limit_total_votes(nu... | {
"repo_name": "eugena/django-secretballot",
"path": "secretballot/__init__.py",
"copies": "1",
"size": "3963",
"license": "bsd-2-clause",
"hash": 4475721428872759000,
"line_mean": 46.1785714286,
"line_max": 161,
"alpha_frac": 0.5884430987,
"autogenerated": false,
"ratio": 3.908284023668639,
"co... |
__author__ = "James Turk (jturk@sunlightfoundation.com)"
__version__ = "0.2.2"
__copyright__ = "Copyright (c) 2009 Sunlight Labs"
__license__ = "BSD"
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Manager
from django.contrib.contenttypes.models import ContentType
from django.contr... | {
"repo_name": "TermiT/django-secretballot",
"path": "secretballot/__init__.py",
"copies": "1",
"size": "3566",
"license": "bsd-3-clause",
"hash": 8345208649992942000,
"line_mean": 44.1392405063,
"line_max": 161,
"alpha_frac": 0.6197420079,
"autogenerated": false,
"ratio": 3.699170124481328,
"co... |
__author__ = "James Turk (jturk@sunlightfoundation.com)"
__version__ = "0.2.3"
__copyright__ = "Copyright (c) 2009 Sunlight Labs"
__license__ = "BSD"
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Manager
from django.contrib.contenttypes.models import ContentType
from django.contr... | {
"repo_name": "Afnarel/django-secretballot",
"path": "secretballot/__init__.py",
"copies": "3",
"size": "3673",
"license": "bsd-3-clause",
"hash": 9049452835482941000,
"line_mean": 45.4936708861,
"line_max": 161,
"alpha_frac": 0.6106724748,
"autogenerated": false,
"ratio": 3.7556237218813906,
"... |
__author__ = 'jamh'
from collections import OrderedDict
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting
from pyspark import SparkConf, SparkContext
from pyspark.sql import HiveContext
from orangecontrib.spark.base.shared_spark_context import SharedSparkContext
from orangecontrib.spa... | {
"repo_name": "jamartinh/Orange3-Spark",
"path": "orangecontrib/spark/widgets/data/spark_context.py",
"copies": "1",
"size": "2697",
"license": "bsd-2-clause",
"hash": 4108519726366826500,
"line_mean": 33.5769230769,
"line_max": 107,
"alpha_frac": 0.632183908,
"autogenerated": false,
"ratio": 3.7... |
__author__ = 'jamh'
from collections import OrderedDict
import pyspark
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting
from pyspark.sql import HiveContext
from orangecontrib.spark.base.shared_spark_context import SharedSparkContext
from orangecontrib.spark.utils.gui_utils import Gui... | {
"repo_name": "jamartinh/Orange3-Spark",
"path": "orangecontrib/spark/widgets/data/spark_table.py",
"copies": "1",
"size": "3354",
"license": "bsd-2-clause",
"hash": -147192284736437950,
"line_mean": 37.5517241379,
"line_max": 152,
"alpha_frac": 0.637149672,
"autogenerated": false,
"ratio": 3.941... |
__author__ = 'jamh'
from collections import OrderedDict
import pyspark
from Orange.widgets import widget, gui, settings
from Orange.widgets.settings import Setting
from PyQt4 import QtGui
from orangecontrib.spark.utils.gui_utils import GuiParam
from orangecontrib.spark.utils.spark_api_utils import get_dataframe_funct... | {
"repo_name": "jamartinh/Orange3-Spark",
"path": "orangecontrib/spark/widgets/data/spark_sample.py",
"copies": "1",
"size": "3136",
"license": "bsd-2-clause",
"hash": -1065598965787811600,
"line_mean": 42.5555555556,
"line_max": 135,
"alpha_frac": 0.6651785714,
"autogenerated": false,
"ratio": 3.... |
__author__ = 'jamh'
from collections import OrderedDict
import pyspark
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting
from PyQt4 import QtGui
from pyspark.sql import HiveContext
from ..base.shared_spark_context import SharedSparkContext
from ..utils.gui_utils import GuiParam
from ... | {
"repo_name": "jamartinh/Orange3-Spark",
"path": "orangecontrib/spark/base/spark_ml_transformer.py",
"copies": "1",
"size": "5447",
"license": "bsd-2-clause",
"hash": 8020279056237690000,
"line_mean": 38.1870503597,
"line_max": 175,
"alpha_frac": 0.6394345511,
"autogenerated": false,
"ratio": 3.7... |
__author__ = 'jamh'
import pyspark
from Orange.widgets import widget
from pyspark.ml import Model
from pyspark.sql import HiveContext
from orangecontrib.spark.base.shared_spark_context import SharedSparkContext
class OWSparkMLMOdel(SharedSparkContext, widget.OWWidget):
priority = 7
name = "Model Transformer... | {
"repo_name": "jamartinh/Orange3-Spark",
"path": "orangecontrib/spark/widgets/ml/spark_ml_model.py",
"copies": "1",
"size": "1761",
"license": "bsd-2-clause",
"hash": -9201982287466795000,
"line_mean": 31.6111111111,
"line_max": 109,
"alpha_frac": 0.6433844407,
"autogenerated": false,
"ratio": 3.... |
__author__ = 'jamh'
import pyspark
from Orange.widgets import widget
from pyspark.sql import HiveContext
from orangecontrib.spark.base.shared_spark_context import SharedSparkContext
class OWSparkMLMOdel(SharedSparkContext, widget.OWWidget):
priority = 6
name = "Cache DataFrame"
description = "Call DataF... | {
"repo_name": "jamartinh/Orange3-Spark",
"path": "orangecontrib/spark/widgets/data/spark_df_cache.py",
"copies": "1",
"size": "1280",
"license": "bsd-2-clause",
"hash": -8632701340828269000,
"line_mean": 31,
"line_max": 109,
"alpha_frac": 0.653125,
"autogenerated": false,
"ratio": 3.7209302325581... |
__author__ = 'jamh'
import random
from Orange.widgets import widget, gui
from PyQt4 import QtGui, QtCore
from pyspark.ml import evaluation
from orangecontrib.spark.base.spark_ml_transformer import OWSparkTransformer
from orangecontrib.spark.utils.ml_api_utils import get_evaluators
class OWSparkMLEvaluator(OWSparkT... | {
"repo_name": "jamartinh/Orange3-Spark",
"path": "orangecontrib/spark/widgets/ml/spark_ml_evaluation.py",
"copies": "1",
"size": "2532",
"license": "bsd-2-clause",
"hash": -3892792446643535400,
"line_mean": 31.4615384615,
"line_max": 108,
"alpha_frac": 0.6153238547,
"autogenerated": false,
"ratio... |
__author__ = 'jamiebrew'
from ngram import Ngram
import string
import math
import operator
import re
"""
a corpus represents information about a text as a tree indexed by string
* each entry in the tree is an ngram object
* the key for a multi-word ngram is the space-separated words in the ngram
"""
class Corpus(ob... | {
"repo_name": "jbrew/stereotype",
"path": "old/corpus.py",
"copies": "1",
"size": "8829",
"license": "apache-2.0",
"hash": 6832613833141801000,
"line_mean": 38.0663716814,
"line_max": 143,
"alpha_frac": 0.5682410239,
"autogenerated": false,
"ratio": 3.891141472014103,
"config_test": false,
"h... |
__author__ = 'jamiebrew'
import os
import string
import operator
"""
Takes a transcript formatted as follows, with newlines separating lines, and without paragraph breaks in the middle of
lines. (this is how transcripts are formatted on genius.com)
Pulls the transcript from 'raw_transcripts/name]' and saves them to ... | {
"repo_name": "jbrew/stereotype",
"path": "transcript_parser.py",
"copies": "1",
"size": "3293",
"license": "apache-2.0",
"hash": 404118587698303400,
"line_mean": 33.3020833333,
"line_max": 129,
"alpha_frac": 0.6295171576,
"autogenerated": false,
"ratio": 3.767734553775744,
"config_test": false... |
__author__ = 'jamiebrew'
# information about a unique string within a corpus
class Ngram(object):
def __init__(self, string, count=1, after_distance=0, before_distance=0):
self.string = string
self.count = count
self.after = [{} for _ in range(after_distance)]
self.before = [{} for... | {
"repo_name": "jbrew/stereotype",
"path": "old/ngram.py",
"copies": "1",
"size": "1853",
"license": "apache-2.0",
"hash": 1764413476852713500,
"line_mean": 34.6346153846,
"line_max": 120,
"alpha_frac": 0.5418240691,
"autogenerated": false,
"ratio": 4.211363636363636,
"config_test": false,
"ha... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.