text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'casey'
"""
@package coverage_model.util.numpy_utils
@file coverage_model/util/numpy_utils.py
@author Casey Bryant
@brief Common numpy array manipulation routines.
"""
import numpy as np
import random
import string
class NumpyUtils(object):
@classmethod
def sort_flat_arrays(cls, np_dict, sort_... | {
"repo_name": "ooici/coverage-model",
"path": "coverage_model/util/numpy_utils.py",
"copies": "1",
"size": "9439",
"license": "bsd-2-clause",
"hash": -6871114243662425000,
"line_mean": 44.1626794258,
"line_max": 143,
"alpha_frac": 0.6339654624,
"autogenerated": false,
"ratio": 3.7205360662199447,... |
__author__ = 'castilla'
import numpy as np
import operator
import csv
if __name__ == "__main__":
palavras=[]
ocorrencias=[]
vocab = open('../vocab.txt', 'r')
lista = vocab.readlines()
for item in lista:
partes = item.split(" ")
palavras.append(partes[0])
ocorrencias.append(... | {
"repo_name": "castilla/pyGlove",
"path": "read_evaluate.py",
"copies": "1",
"size": "3015",
"license": "mit",
"hash": 8006662475827723000,
"line_mean": 28.2718446602,
"line_max": 92,
"alpha_frac": 0.5157545605,
"autogenerated": false,
"ratio": 3.140625,
"config_test": false,
"has_no_keywords... |
__author__ = 'catatonic'
"""
harvest.py:
Identifies potential candidate packets for TospoVirus disclosed passwords.
"""
from scapy.all import *
import urllib
from subprocess import Popen
import difflib
ap_list = {}
def monitor(pkt):
if pkt.haslayer(Dot11) and pkt.type == 0 and pkt.subtype == 8:
if pkt... | {
"repo_name": "catatonicprime/TospoVirus",
"path": "harvest.py",
"copies": "1",
"size": "1187",
"license": "mit",
"hash": -2219019290169201400,
"line_mean": 34.9696969697,
"line_max": 139,
"alpha_frac": 0.6427969671,
"autogenerated": false,
"ratio": 2.9164619164619165,
"config_test": false,
"... |
__author__ = 'catears'
# Henrik 'catears' Adolfsson
# henad221@student.liu.se
# 2015 - 01 - 15
from collections import defaultdict
from pygame.locals import *
# Mapping of pygame keys to application keynames
# Changing this will result in a different keypress
# for the user but not for the internal application
# (as... | {
"repo_name": "CatEars/PygameContext",
"path": "keyhandle.py",
"copies": "1",
"size": "1494",
"license": "mit",
"hash": 6631663074209222000,
"line_mean": 24.3220338983,
"line_max": 78,
"alpha_frac": 0.6338688086,
"autogenerated": false,
"ratio": 3.6174334140435835,
"config_test": false,
"has_... |
__author__ = 'catears'
# Henrik 'catears' Adolfsson
# henad221@student.liu.se
"""
Example context with a random_polygon
"""
import random
import functools
def make_random_polygon():
rand = lambda: (random.randint(0, g.width), random.randint(0, g.height))
return [rand() for _ in range(0, random.randint(3, 9))... | {
"repo_name": "CatEars/PygameContext",
"path": "example_contexts/polygon.py",
"copies": "1",
"size": "1312",
"license": "mit",
"hash": -2786070712827979000,
"line_mean": 25.24,
"line_max": 76,
"alpha_frac": 0.5670731707,
"autogenerated": false,
"ratio": 3.8475073313782993,
"config_test": false,... |
__author__ = 'catears'
# Henrik 'catears' Adolfsson
# henad221@student.liu.se
"""
Example context with balls that move randomly
"""
import random
from context import EmptyContext
def outside_l(circle):
return circle['pos'][0] - circle['r'] <= 0
def outside_r(circle):
return circle['pos'][0] + circle['r']... | {
"repo_name": "CatEars/PygameContext",
"path": "example_contexts/circle.py",
"copies": "1",
"size": "2860",
"license": "mit",
"hash": 729906810790811800,
"line_mean": 26.5096153846,
"line_max": 93,
"alpha_frac": 0.5486013986,
"autogenerated": false,
"ratio": 3.4499396863691194,
"config_test": f... |
__author__ = 'catherine'
if __name__ == "__main__":
try:
from docutils.core import publish_cmdline
from docutils.utils import Reporter
except:
raise NameError("Cannot find `docutils` for the selected interpreter.")
import sys
command = sys.argv[1]
args = sys.argv[2:]
... | {
"repo_name": "jwren/intellij-community",
"path": "python/helpers/rest_runners/rst2smth.py",
"copies": "8",
"size": "1126",
"license": "apache-2.0",
"hash": -7414342318307841000,
"line_mean": 34.1875,
"line_max": 83,
"alpha_frac": 0.5905861456,
"autogenerated": false,
"ratio": 3.923344947735192,
... |
__author__ = 'cauanicastro'
__copyright__ = "Copyright 2015, Cauani Castro"
__credits__ = ["Cauani Castro"]
__license__ = "Apache License 2.0"
__version__ = "1.0"
__maintainer__ = "Cauani Castro"
__email__ = "cauani.castro@hotmail.com"
__status__ = "Examination program"
def calculaRaiz(numero, aproximacoes):
raiz ... | {
"repo_name": "cauanicastro/Prog1Ifes",
"path": "atividade4.py",
"copies": "1",
"size": "1285",
"license": "apache-2.0",
"hash": 788944542810382800,
"line_mean": 37.9696969697,
"line_max": 150,
"alpha_frac": 0.5789883268,
"autogenerated": false,
"ratio": 2.9337899543378994,
"config_test": false... |
__author__ = "Cauani Castro"
__copyright__ = "Copyright 2015, Cauani Castro"
__credits__ = ["Cauani Castro"]
__license__ = "Apache License 2.0"
__version__ = "1.0"
__maintainer__ = "Cauani Castro"
__email__ = "cauani.castro@hotmail.com"
__status__ = "Examination program"
def ExibeEstatisticas():
print("###########... | {
"repo_name": "cauanicastro/Prog1Ifes",
"path": "atividade3.py",
"copies": "1",
"size": "5150",
"license": "apache-2.0",
"hash": 9191986900468464000,
"line_mean": 34.7638888889,
"line_max": 167,
"alpha_frac": 0.6576699029,
"autogenerated": false,
"ratio": 2.9211571185479297,
"config_test": fals... |
__author__ = "cauanicastro"
__copyright__ = "Copyright 2016, cauanicastro"
__credits__ = ["Cauani Castro"]
__license__ = "Apache License 2.0"
__version__ = "1.0"
__created_on__ = "16-04-13"
__maintainer__ = "cauanicastro"
__email__ = "cauani.castro@hotmail.com"
def contaPalavras(linha):
aux = ""
separadores =... | {
"repo_name": "cauanicastro/Prog1Ifes",
"path": "biblioteca.py",
"copies": "1",
"size": "6091",
"license": "apache-2.0",
"hash": 5601128984822846000,
"line_mean": 24.2738589212,
"line_max": 96,
"alpha_frac": 0.5319323592,
"autogenerated": false,
"ratio": 3.226165254237288,
"config_test": false,... |
__author__ = 'cbdasg'
import requests
from requests_oauthlib import OAuth1
import hmac
from hashlib import sha1
def fix_signature_url_chars(str):
str = str.replace(":", "%3A")
str = str.replace("/", "%2F")
str = str.replace("=", "%3D")
str = str.replace("&", "%26")
return str
def fix_request_url_c... | {
"repo_name": "unchaoss/unchaoss",
"path": "engine/py/wordpressops/wordpressops.py",
"copies": "2",
"size": "1920",
"license": "apache-2.0",
"hash": 9090684381935403000,
"line_mean": 34.5555555556,
"line_max": 108,
"alpha_frac": 0.6427083333,
"autogenerated": false,
"ratio": 3.1423895253682486,
... |
__author__ = 'cbdasg'
import json
#=============================== SINLGE KEY ENCRYPT/DECRYPT ====================================
from Crypto.Cipher import AES
import base64, os
#======= SINGLE KEY ENCRYPT/DECRYPT (https://gist.github.com/syedrakib/d71c463fc61852b8d366) ==========
class singleKeCryptDecrypt:
... | {
"repo_name": "unchaoss/unchaoss",
"path": "engine/py/core/util.py",
"copies": "1",
"size": "8185",
"license": "apache-2.0",
"hash": 813533174354395500,
"line_mean": 43.0053763441,
"line_max": 215,
"alpha_frac": 0.6536346976,
"autogenerated": false,
"ratio": 3.5143838557320737,
"config_test": f... |
__author__ = 'cbdasg'
import os
import util
def get_credentials_base():
home_dir = os.path.expanduser('~')
credentials_base = os.path.join(home_dir, '.credentials')
if not os.path.exists(credentials_base):
os.makedirs(credentials_base)
return credentials_base
# UNCHAOSS expects the same maste... | {
"repo_name": "unchaoss/unchaoss",
"path": "engine/py/core/core.py",
"copies": "1",
"size": "1402",
"license": "apache-2.0",
"hash": 634879932728616400,
"line_mean": 40.2352941176,
"line_max": 106,
"alpha_frac": 0.7368045649,
"autogenerated": false,
"ratio": 3.728723404255319,
"config_test": fa... |
__author__ = 'cb'
import threading
import socket
import re
import traceback
import logging
logger = logging.getLogger(__name__)
class SyslogServer(threading.Thread):
def __init__(self, syslog_port, worker_queue):
self.syslog_port = syslog_port
self.worker_queue = worker_queue
self.format_... | {
"repo_name": "carbonblack/cb-infoblox-connector",
"path": "cbinfoblox/syslog_server.py",
"copies": "1",
"size": "1895",
"license": "mit",
"hash": -7851317657341869000,
"line_mean": 31.6724137931,
"line_max": 133,
"alpha_frac": 0.5192612137,
"autogenerated": false,
"ratio": 3.515769944341373,
"... |
__author__ = 'cbn'
import json
from re import match
from flask import Flask, render_template, redirect, request, url_for
from redis import StrictRedis
import colorsys
import cooperhewitt.swatchbook as sb
from flask_paginate import Pagination
from random import choice
app = Flask(__name__)
app.redis = StrictRedis()
ap... | {
"repo_name": "bibliotechy/identify-by-color",
"path": "server.py",
"copies": "1",
"size": "3211",
"license": "mit",
"hash": 5352088659130418000,
"line_mean": 27.9279279279,
"line_max": 124,
"alpha_frac": 0.6194331984,
"autogenerated": false,
"ratio": 3.1823587710604557,
"config_test": false,
... |
__author__ = 'cbryce'
__license__ = 'Apache2'
__date__ = '20150409'
__version__ = '0.00'
"""
Fuzzy-sansa - an Open Source Facial Recognition Tool Maybe
Copyright 2015 Chapin Bryce
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
... | {
"repo_name": "chapinb/fuzzy-sansa",
"path": "fuzzy-sansa.py",
"copies": "1",
"size": "4373",
"license": "apache-2.0",
"hash": -2060431087658788000,
"line_mean": 28.355704698,
"line_max": 114,
"alpha_frac": 0.6178824606,
"autogenerated": false,
"ratio": 3.382057231245166,
"config_test": false,
... |
__author__ = 'cbryce'
import os
import logging
class CollectorBase(object):
"""
Base Class for all collectors, allowing them to share the collection methods
"""
def __init__(self):
self.targ = ''
self.dest = ''
self.case = ''
self.eid = ''
self.target_user = '... | {
"repo_name": "lcdi/LCDIC",
"path": "collectors/base.py",
"copies": "1",
"size": "3466",
"license": "mit",
"hash": 8031039916063307000,
"line_mean": 34.3673469388,
"line_max": 117,
"alpha_frac": 0.436237738,
"autogenerated": false,
"ratio": 4.572559366754618,
"config_test": false,
"has_no_key... |
__author__ = 'cbryce'
import os
from .base import CollectorBase
class Ubuntu13(CollectorBase):
"""
Collect data from Ubuntu 13
"""
def __init__(self):
super(Ubuntu13, self).__init__()
self.name = 'Ubuntu 13 Collector'
self.description = 'Collection of artifacts found in Ubu... | {
"repo_name": "lcdi/LCDIC",
"path": "collectors/debian.py",
"copies": "1",
"size": "1626",
"license": "mit",
"hash": -2425606261789310000,
"line_mean": 23.6515151515,
"line_max": 80,
"alpha_frac": 0.5590405904,
"autogenerated": false,
"ratio": 3.8349056603773586,
"config_test": false,
"has_no... |
__author__ = 'cbryce'
import re
def cc():
if not easygui.ccbox('Would you like to continue?'):
quit()
if __name__ == '__main__':
import easygui
import lcdic
# Get case information
msg = 'Enter Case Information'
title = 'Case Data'
fieldnames = ['Case Number', 'Evidence ID', 'Ex... | {
"repo_name": "lcdi/LCDIC",
"path": "lcdic_gui.py",
"copies": "1",
"size": "2510",
"license": "mit",
"hash": -7217122511152022000,
"line_mean": 28.1860465116,
"line_max": 117,
"alpha_frac": 0.5426294821,
"autogenerated": false,
"ratio": 3.7406855439642324,
"config_test": false,
"has_no_keywor... |
__author__ = 'cbryce'
__version__ = 0.00
import os
import logging
from .base import CollectorBase
class WinXP(CollectorBase):
"""
Collector Class for the
"""
def __init__(self):
super(WinXP, self).__init__()
self.name = 'Windows XP Collector'
self.description = 'Collection ... | {
"repo_name": "lcdi/LCDIC",
"path": "collectors/windows.py",
"copies": "1",
"size": "13077",
"license": "mit",
"hash": -8714543090313027000,
"line_mean": 34.8273972603,
"line_max": 163,
"alpha_frac": 0.565726084,
"autogenerated": false,
"ratio": 4.171291866028708,
"config_test": true,
"has_no... |
__author__ = 'cbryce'
__version__ = 0.00
import progressbar
import os
import yara
class YaraSearch():
def __init__(self, custom_rule, target):
self.custom_rule = custom_rule
self.target = target
def run(self):
if os.path.isfile(self.custom_rule):
rules = yara.compile(sel... | {
"repo_name": "lcdi/LCDIC",
"path": "collectors/search.py",
"copies": "1",
"size": "1493",
"license": "mit",
"hash": 2361917249014117400,
"line_mean": 27.7307692308,
"line_max": 107,
"alpha_frac": 0.4641661085,
"autogenerated": false,
"ratio": 4.229461756373937,
"config_test": false,
"has_no_... |
__author__ = 'cccaballero'
from gluon import current
import os
def upload():
path = os.path.join(request.folder, 'uploads')
form = SQLFORM.factory(
Field('upload', 'upload', requires=IS_NOT_EMPTY(), uploadfolder=path),
table_name=current.plugin_daxs_media_galley.settings.table_upload_name
... | {
"repo_name": "daxslab/web2py-media-galley",
"path": "controllers/plugin_daxs_media_galley.py",
"copies": "1",
"size": "2791",
"license": "mit",
"hash": -4375473434925932500,
"line_mean": 31.4651162791,
"line_max": 92,
"alpha_frac": 0.6180580437,
"autogenerated": false,
"ratio": 3.445679012345679... |
__author__ = 'cccaballero'
from gluon import *
from gluon.contrib.ordereddict import OrderedDict
def set_seo_meta(type="website", card="summary", title=None,
author=None, keywords=None, generator="Web2py Web Framework",
url=None, image=None, description=None, site_name=None,
... | {
"repo_name": "daxslab/web2py-simple-seo",
"path": "modules/plugin_simple_seo/seo.py",
"copies": "1",
"size": "3340",
"license": "mit",
"hash": 2734145262129312000,
"line_mean": 34.5319148936,
"line_max": 106,
"alpha_frac": 0.5892215569,
"autogenerated": false,
"ratio": 3.7954545454545454,
"con... |
class Solution:
# @param {string[]} tokens
# @return {integer}
def evalRPN(self, tokens):
i = 0
while len(tokens) != 1:
if not tokens[i].strip('-').isdigit(): # 1st prob in py, integer checker including negative ones
if tokens[i] == '*':
tokens... | {
"repo_name": "cc13ny/algo",
"path": "leetcode/150-Evaluate-Reverse-Polish-Notation/ERPN_001.py",
"copies": "5",
"size": "1163",
"license": "mit",
"hash": 9167256931667561000,
"line_mean": 40.5357142857,
"line_max": 108,
"alpha_frac": 0.3955288048,
"autogenerated": false,
"ratio": 3.7395498392282... |
class Solution:
# @return a list of lists of length 3, [[val1,val2,val3]]
def threeSum(self, num):
num.sort()
res = []
for i in range(len(num)-2):
if i == 0 or num[i] > num[i-1]:
left = i + 1; right = len(num) - 1
while left < right:
... | {
"repo_name": "cc13ny/Allin",
"path": "leetcode/015-3Sum/ThreeSum_001.py",
"copies": "5",
"size": "1091",
"license": "mit",
"hash": -3733121122761905000,
"line_mean": 40.9615384615,
"line_max": 85,
"alpha_frac": 0.4005499542,
"autogenerated": false,
"ratio": 4.180076628352491,
"config_test": fa... |
class Solution:
# @param {string} s
# @return {string}
def longestPalindrome(self, s):
size = len(s)
ls = []
ll = 0
rr = 0
l = 0
r = 0
maxlen = r - l + 1
for i in range(1, size):
if s[i-1] == s[i]:
r = i
... | {
"repo_name": "Chasego/codi",
"path": "leetcode/005-Longest-Palindromic-Substring/LongPalSubstr_001.py",
"copies": "5",
"size": "1984",
"license": "mit",
"hash": 2374014732128316400,
"line_mean": 28.6119402985,
"line_max": 66,
"alpha_frac": 0.2691532258,
"autogenerated": false,
"ratio": 3.968,
... |
class Solution:
# @param {string} str
# @return {integer}
def extractnum(self, ss):
num = 0
for i in range(len(ss)):
if ss[i].isdigit() == False:
break
else:
num = num + 1
return ss[:num]
def isoverflow(self, sss, ... | {
"repo_name": "Chasego/codirit",
"path": "leetcode/008-String-to-Integer/Str2Int_001.py",
"copies": "5",
"size": "1880",
"license": "mit",
"hash": 5478983514924081000,
"line_mean": 27.4848484848,
"line_max": 60,
"alpha_frac": 0.4079787234,
"autogenerated": false,
"ratio": 4.196428571428571,
"co... |
__author__ = 'CClive'
import theano
import numpy
import neural_layer
import theano.tensor as T
class NeuralNet(object):
"""
Generic neural network class
Acts as a container that manages a list of neural layers.
Also adds cost, error, and prediction functions to the network.
"""
def __init__(s... | {
"repo_name": "cliffclive/neuromancy",
"path": "neuromancy/neural_net.py",
"copies": "2",
"size": "8122",
"license": "mit",
"hash": 2363939053491485000,
"line_mean": 41.3020833333,
"line_max": 102,
"alpha_frac": 0.5818763851,
"autogenerated": false,
"ratio": 3.7019143117593436,
"config_test": f... |
__author__ = 'CClive'
import theano
import numpy
import theano.tensor as T
from theano.tensor.signal import downsample
from theano.tensor.nnet import conv
class NeuralLayer(object):
def __init__(self, input, W=None, b=None, activation=None):
"""
Basic layer of a neural net: weights W and bias b... | {
"repo_name": "dksahuji/neuromancy",
"path": "neuromancy/neural_layer.py",
"copies": "2",
"size": "7761",
"license": "mit",
"hash": 6594224671872244000,
"line_mean": 38.5969387755,
"line_max": 92,
"alpha_frac": 0.5954129622,
"autogenerated": false,
"ratio": 4.04008328995315,
"config_test": true... |
__author__ = 'cdan'
import httplib
def get_status_code(host, path):
""" This function retreives the status code of a website by requesting
HEAD data from the host. This means that it only requests the headers.
If the host cannot be reached or something else goes wrong, it returns
None inst... | {
"repo_name": "SANDAG/DataSurfer",
"path": "api/utilities/export_test.py",
"copies": "1",
"size": "1287",
"license": "mit",
"hash": -8478004757306640000,
"line_mean": 36.8823529412,
"line_max": 161,
"alpha_frac": 0.6923076923,
"autogenerated": false,
"ratio": 3.1012048192771084,
"config_test": ... |
# ADDED: velocidad LOS
# ADDED: signo a eta_blue y eta_red
# ADDED: normalization factor in p,b,r eta + rho profiles
from math import pi, sin, cos
from numpy import sqrt, arange
# from zeeman import *
# from fvoigt import fvoigt
from copy import deepcopy
from mutils2 import *
# ======================================... | {
"repo_name": "cdiazbas/LMpyMilne",
"path": "milne.py",
"copies": "1",
"size": "6532",
"license": "mit",
"hash": 7936703507437912000,
"line_mean": 33.3789473684,
"line_max": 141,
"alpha_frac": 0.4820881813,
"autogenerated": false,
"ratio": 2.4779969650986344,
"config_test": false,
"has_no_key... |
def fvoigt(damp,vv):
"""
Extract spectral data from the Kitt Peak FTS-Spectral-Atlas
as provided by H. Neckel, Hamburg.
INPUTS:
DAMP: A scalar with the damping parameter
VV: Wavelength axis usually in Doppler units.
OUTPUTS:
H: Voigt function
F: Faraday-Voigt function
NOTES:
... | {
"repo_name": "aasensio/pyiacsun",
"path": "pyiacsun/util/fvoigt.py",
"copies": "1",
"size": "1842",
"license": "mit",
"hash": -820709520044281900,
"line_mean": 24.6956521739,
"line_max": 71,
"alpha_frac": 0.6433224756,
"autogenerated": false,
"ratio": 2.37984496124031,
"config_test": false,
... |
import matplotlib.pyplot as plt
import pyLib.imtools as imtools
import numpy as np
# # ========================= CREANDO DICCIONARIO
# cdict1={'red': ((0.0, 0.0, 0.0),
# (0.5, 0.0, 0.1),
# (1.0, 1.0, 1.0)),
# 'green':((0.0, 0.0, 0.0),
# (1.0, 0.0, 0.0)),
# 'blue': ((0.0, 0.0, 0.0),
# ... | {
"repo_name": "cdiazbas/MPySIR",
"path": "1map_OLD.py",
"copies": "1",
"size": "8343",
"license": "mit",
"hash": -844891488818037200,
"line_mean": 36.9859813084,
"line_max": 154,
"alpha_frac": 0.5863598226,
"autogenerated": false,
"ratio": 2.680051397365885,
"config_test": false,
"has_no_keyw... |
import matplotlib.pyplot as plt
import pyLib.imtools as imtools
import numpy as np
# ========================= CREANDO PHIMAP
import matplotlib.colors as mcolors
def make_colormap(seq):
seq = [(None,) * 3, 0.0] + list(seq) + [1.0, (None,) * 3]
cdict = {'red': [], 'green': [], 'blue': []}
for i, item ... | {
"repo_name": "cdiazbas/MPySIR",
"path": "allmaps.py",
"copies": "1",
"size": "4633",
"license": "mit",
"hash": 5517724357132258000,
"line_mean": 39.3660714286,
"line_max": 213,
"alpha_frac": 0.5598963954,
"autogenerated": false,
"ratio": 2.6474285714285712,
"config_test": false,
"has_no_keyw... |
__author__ = 'Cecilia'
import gensim
import numpy as np
import scipy.io as spio
from sklearn.cluster import MiniBatchKMeans as kmeans
import os
def get_word_2_vec(model_file, save_file, concept_file):
model = gensim.models.Word2Vec.load_word2vec_format(model_file, binary=True)
with open(concept_file, 'r') as... | {
"repo_name": "crmauceri/VisualCommonSense",
"path": "code/database_builder/get_vocab_features.py",
"copies": "1",
"size": "5336",
"license": "mit",
"hash": -953453465884107000,
"line_mean": 42.3902439024,
"line_max": 151,
"alpha_frac": 0.5982008996,
"autogenerated": false,
"ratio": 3.21445783132... |
__author__ = 'Cedric Da Costa Faro'
from datetime import datetime, date
import hashlib
from werkzeug.security import generate_password_hash, check_password_hash
from flask import request
from flask.ext.login import UserMixin
from . import db, login_manager
# We define here user table with all required fields,
# we a... | {
"repo_name": "cdcf/time_tracker",
"path": "app/models.py",
"copies": "1",
"size": "3650",
"license": "bsd-3-clause",
"hash": -5091426325701063000,
"line_mean": 40.4772727273,
"line_max": 96,
"alpha_frac": 0.6821917808,
"autogenerated": false,
"ratio": 3.5129932627526466,
"config_test": false,
... |
__author__ = 'Cedric Da Costa Faro'
from flask.ext.wtf import Form
from wtforms import StringField, PasswordField, BooleanField, SubmitField, validators
from wtforms.validators import Required, Length, Email, Regexp, EqualTo
from wtforms import ValidationError
from ..models import User
# We allow here a user to be c... | {
"repo_name": "cdcf/time_tracker",
"path": "app/auth/forms.py",
"copies": "1",
"size": "1942",
"license": "bsd-3-clause",
"hash": 8440094075152128000,
"line_mean": 51.4864864865,
"line_max": 120,
"alpha_frac": 0.6565396498,
"autogenerated": false,
"ratio": 4.526806526806527,
"config_test": fals... |
__author__ = 'Cedric Da Costa Faro'
from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms.validators import Length, Required
from wtforms.fields.html5 import DateField
from ..models import Client
import datetim... | {
"repo_name": "cdcf/time_tracker",
"path": "app/projects/forms.py",
"copies": "1",
"size": "1544",
"license": "bsd-3-clause",
"hash": -8379751659161218000,
"line_mean": 36.6585365854,
"line_max": 119,
"alpha_frac": 0.7046632124,
"autogenerated": false,
"ratio": 4.01038961038961,
"config_test": ... |
__author__ = 'Cedric Da Costa Faro'
from flask.ext.wtf import Form
from wtforms import SubmitField
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms.validators import Required
from ..models import Client, Project
from wtforms.fields.html5 import DateField
import datetime
# We define here the st... | {
"repo_name": "cdcf/time_tracker",
"path": "app/agendas/forms.py",
"copies": "1",
"size": "1135",
"license": "bsd-3-clause",
"hash": -4382612146455704600,
"line_mean": 29.6756756757,
"line_max": 85,
"alpha_frac": 0.6995594714,
"autogenerated": false,
"ratio": 3.626198083067093,
"config_test": f... |
__author__ = 'Cedric Da Costa Faro'
from flask import render_template, current_app, request, redirect, url_for, flash
from flask.ext.login import login_user, logout_user, login_required
from ..models import User
from . import auth
from app import db
from .forms import LoginForm, RegistrationForm
# We enable here new... | {
"repo_name": "cdcf/time_tracker",
"path": "app/auth/routes.py",
"copies": "1",
"size": "2071",
"license": "bsd-3-clause",
"hash": 1725368505882962400,
"line_mean": 40.44,
"line_max": 112,
"alpha_frac": 0.6779333655,
"autogenerated": false,
"ratio": 3.806985294117647,
"config_test": false,
"h... |
__author__ = 'Cedric Da Costa Faro'
from flask import render_template, flash, redirect, url_for, abort, request, current_app
from flask.ext.login import login_required, current_user
from .. import db
from ..models import Agenda
from . import agendas
from .forms import AgendaForm
# We allow here a user to create a ne... | {
"repo_name": "cdcf/time_tracker",
"path": "app/agendas/routes.py",
"copies": "1",
"size": "2726",
"license": "bsd-3-clause",
"hash": 2749393665992331300,
"line_mean": 36.3424657534,
"line_max": 117,
"alpha_frac": 0.6515040352,
"autogenerated": false,
"ratio": 3.365432098765432,
"config_test": ... |
__author__ = 'Cedric Da Costa Faro'
from flask import render_template, flash, redirect, url_for
from flask.ext.login import login_required, current_user
from .. import db
from ..models import User
from . import users
from .forms import ProfileForm, ChangePasswordForm
# last part first_or_404 will return a 404 status... | {
"repo_name": "cdcf/time_tracker",
"path": "app/users/routes.py",
"copies": "1",
"size": "2073",
"license": "bsd-3-clause",
"hash": -6436530425740043000,
"line_mean": 38.1132075472,
"line_max": 99,
"alpha_frac": 0.687891944,
"autogenerated": false,
"ratio": 3.831792975970425,
"config_test": fal... |
__author__ = 'Cedric Da Costa Faro'
import os
from app import create_app
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
from app import db
from app.models import User
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
migrate = Migrate(ap... | {
"repo_name": "cdcf/time_tracker",
"path": "manage.py",
"copies": "1",
"size": "1243",
"license": "bsd-3-clause",
"hash": 2040202919969653500,
"line_mean": 30.8717948718,
"line_max": 114,
"alpha_frac": 0.7127916331,
"autogenerated": false,
"ratio": 3.5514285714285716,
"config_test": false,
"h... |
__author__ = 'Cedric'
# each information will be used to sort the properties for the given policy
import random
from monopyly import *
from .Memory import *
from .Policy import *
class VSSchizoAI(PlayerAIBase):
'''
'''
def __init__(self):
'''
ctor
'''
# memory information
... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/Cedric Daligny/VSSchizoAI.py",
"copies": "1",
"size": "29822",
"license": "mit",
"hash": 6162684342410625000,
"line_mean": 52.6258992806,
"line_max": 214,
"alpha_frac": 0.5989401664,
"autogenerated": false,
"ratio": 3.5310279488394127,
"co... |
__author__ = 'Cedric'
# each information will be used to sort the properties for the given policy
import random
from monopyly import *
from .Memory import *
from .Policy import *
class VSSmartBuyerBlueFocusAI(PlayerAIBase):
'''
'''
def __init__(self):
'''
ctor
'''
# memory... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/Cedric Daligny/VSSmartBuyerBlueFocusAI.py",
"copies": "1",
"size": "19739",
"license": "mit",
"hash": -3457856910518529500,
"line_mean": 37.3910505837,
"line_max": 197,
"alpha_frac": 0.6022399027,
"autogenerated": false,
"ratio": 3.826449486... |
__author__ = 'Cedric'
# each information will be used to sort the properties for the given policy
#import random
from monopyly import *
from .Memory import *
from .Policy import *
class VSSmartBuyerNeutral(PlayerAIBase):
'''
'''
def __init__(self):
'''
ctor
'''
# memory i... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/Cedric Daligny/VSSmartBuyerNeutral.py",
"copies": "1",
"size": "22886",
"license": "mit",
"hash": -1725063134238901000,
"line_mean": 40.6757741348,
"line_max": 228,
"alpha_frac": 0.6216783217,
"autogenerated": false,
"ratio": 3.7495902982628... |
__author__ = 'Cedric'
from ..Memory import *
from monopyly import *
class AuctionPolicy(object):
def __init__(self,memory,threshold_buy_at_any_cost,keep_cash):
'''
ctor
'''
self.memory = memory
self.threshold = threshold_buy_at_any_cost
self.keep_cash = keep_cash
... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/Cedric Daligny/Policy/AuctionPolicy.py",
"copies": "1",
"size": "1347",
"license": "mit",
"hash": -1182312042872396500,
"line_mean": 34.4210526316,
"line_max": 83,
"alpha_frac": 0.6114413076,
"autogenerated": false,
"ratio": 4.07878787878787... |
__author__ = 'Cedric'
from ..Memory import *
from monopyly import *
class DealPolicy(object):
def __init__(self,memory):
'''
ctor
'''
self.memory = memory
self.properties_we_like = [
[Square.Name.OLD_KENT_ROAD, 80],
[Square.Name.WHITECHAP... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/Cedric Daligny/Policy/DealPolicy.py",
"copies": "1",
"size": "5448",
"license": "mit",
"hash": -8399262462012154000,
"line_mean": 40.2651515152,
"line_max": 85,
"alpha_frac": 0.560492014,
"autogenerated": false,
"ratio": 4.071001494768311,
... |
__author__ = 'Cedric'
from ..Memory import *
from monopyly import *
class SellingPolicy(object):
def __init__(self, ai, memory):
'''
ctor
'''
self.ai = ai
self.memory = memory
def computeMortgage(self, game_state, player):
'''
Gives the player an option... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/Cedric Daligny/Policy/SellingPolicy.py",
"copies": "1",
"size": "9934",
"license": "mit",
"hash": 754281529506986800,
"line_mean": 46.3,
"line_max": 185,
"alpha_frac": 0.5707238498,
"autogenerated": false,
"ratio": 4.125,
"config_test": fa... |
__author__ = 'Cedric'
from monopyly import *
class AcquiringPolicy(object):
def __init__(self,ai):
self.ai = ai
self.last_offers = []
def acquire_through_landing(self,game_state,player,property):
'''
Called when the AI lands on an unowned property. Only the active
play... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/Cedric Daligny/Policy/AcquiringPolicy.py",
"copies": "1",
"size": "9220",
"license": "mit",
"hash": 8580615338033832000,
"line_mean": 45.095,
"line_max": 197,
"alpha_frac": 0.6404860056,
"autogenerated": false,
"ratio": 4.084182543198937,
... |
__author__ = 'Cedric'
from monopyly import *
class UnmortgagePolicy(object):
def __init__(self):
'''
ctor
'''
def compute(self, game_state, player):
'''
Called near the start of the player's turn to give them the
opportunity to unmortgage properties.
U... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/Cedric Daligny/Policy/UnmortgagePolicy.py",
"copies": "1",
"size": "1259",
"license": "mit",
"hash": 6533988398404749000,
"line_mean": 33.9722222222,
"line_max": 77,
"alpha_frac": 0.6115965052,
"autogenerated": false,
"ratio": 4.100977198697... |
__author__ = 'Cedric'
from monopyly import *
'''
buying_house_policy # ONE_COMPLETE_SET, ONE_AVAILABLE_PROPERTY, ALL_AVAILABLE_PROPERTY, ALL_COMPLETE_SET
buying_house_repartition_policy # MAXIMIZE_HOTEL, SAME_SIZE
# information used to know if house will be build
buying_hou... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/Cedric Daligny/Policy/HousePolicy_v2.py",
"copies": "1",
"size": "7612",
"license": "mit",
"hash": -6089262619517751000,
"line_mean": 50.7823129252,
"line_max": 175,
"alpha_frac": 0.5779033106,
"autogenerated": false,
"ratio": 4.233592880978... |
__author__ = 'Cedric'
import random
from monopyly import *
class JailPolicy(object):
'''
OutOfJailInformation
threshold_random_exit
max_round_in_jail # no limit is 500
threshold_free_square
'''
def __init__(self,threshold,max_round,free_square):
'''
... | {
"repo_name": "richard-shepherd/monopyly",
"path": "AIs/Cedric Daligny/Policy/JailPolicy.py",
"copies": "1",
"size": "1606",
"license": "mit",
"hash": 9173316395307077000,
"line_mean": 33.170212766,
"line_max": 78,
"alpha_frac": 0.614953271,
"autogenerated": false,
"ratio": 3.512035010940919,
"... |
__author__ = 'Celery'
import os
import cPickle as pickle
import rtmidi
from rtmidi import midiconstants as rt_const
from midi.objects.pot import Pot
from midi.objects.key import Key
import midi.defaults.defaults as d
class Engine():
def __init__(self):
self.dir = None
self.file = ''
self.... | {
"repo_name": "S1M1S/TopHat-MIDI",
"path": "midi/main.py",
"copies": "1",
"size": "2447",
"license": "mit",
"hash": 3018517683264948000,
"line_mean": 31.2105263158,
"line_max": 84,
"alpha_frac": 0.5508786269,
"autogenerated": false,
"ratio": 3.0209876543209875,
"config_test": false,
"has_no_k... |
__author__ = 'Celery'
import os
DIRECTORY = os.sep.join(os.path.dirname(os.path.realpath(__file__)).split('\\')[:-2])
NUM_OF_POTS_H = 4
NUM_OF_POTS_V = 2
NUM_OF_KEYS_H = 4
NUM_OF_KEYS_V = 4
DRAWING_AREA_WIDTH = DRAWING_AREA_HEIGHT = 100
DRAWING_AREA_OUTLINE_THICKNESS = 6
DRAWING_AREA_INDENT = 10
DRAWING_AREA_CENTRE... | {
"repo_name": "S1M1S/TopHat-MIDI",
"path": "midi/defaults/defaults.py",
"copies": "1",
"size": "1171",
"license": "mit",
"hash": 6358410344773691000,
"line_mean": 25.0444444444,
"line_max": 105,
"alpha_frac": 0.6413321947,
"autogenerated": false,
"ratio": 2.3051181102362204,
"config_test": fals... |
__author__ = 'Celery'
from base import Base
import rtmidi.midiconstants as m
def clamp(n, min_n, max_n): # clamp input between min and max
return max(min(max_n, n), min_n)
class Pot(Base):
def __init__(self, name, midi_loc, func, colour=None, state=False):
Base.__init__(self, name, midi_loc, func,... | {
"repo_name": "S1M1S/TopHat-MIDI",
"path": "midi/objects/pot.py",
"copies": "1",
"size": "1518",
"license": "mit",
"hash": 5712815940102341000,
"line_mean": 27.1296296296,
"line_max": 75,
"alpha_frac": 0.5559947299,
"autogenerated": false,
"ratio": 3.3289473684210527,
"config_test": false,
"h... |
__author__ = 'Celery'
import gtk
from base_widg import BaseWidg
from option_widg import OptionWidg
import midi.defaults.defaults as d
class KeyWidg(BaseWidg):
def __init__(self, parent, engine):
BaseWidg.__init__(self, parent, engine)
self.option_widg = OptionWidg(self)
self.set_label_te... | {
"repo_name": "S1M1S/TopHat-MIDI",
"path": "gui/widgets/key_widg.py",
"copies": "1",
"size": "4494",
"license": "mit",
"hash": -9115532625421537000,
"line_mean": 51.8823529412,
"line_max": 101,
"alpha_frac": 0.505117935,
"autogenerated": false,
"ratio": 4.100364963503649,
"config_test": false,
... |
__author__ = 'Celery'
import gtk
from base_widg import BaseWidg
import midi.defaults.defaults as d
class OptionWidg(BaseWidg):
def __init__(self, linked_widg):
self.lnkd_widg = linked_widg
lwp = self.lnkd_widg.get_parent()
self.alignment = gtk.Alignment()
self.frame = gtk.Frame()
... | {
"repo_name": "S1M1S/TopHat-MIDI",
"path": "gui/widgets/option_widg.py",
"copies": "1",
"size": "3427",
"license": "mit",
"hash": -5711975441967206000,
"line_mean": 43.5194805195,
"line_max": 132,
"alpha_frac": 0.5789320105,
"autogenerated": false,
"ratio": 3.211808809746954,
"config_test": fal... |
__author__ = 'Celery'
import midi.defaults.defaults as d
class Base:
def __init__(self, name, midi_loc, func, colour=None, state=False):
self.name = name
self.midi_loc = midi_loc
self.func = func
self.state = state
self.linked_mod = None
self.available_funcs = None... | {
"repo_name": "S1M1S/TopHat-MIDI",
"path": "midi/objects/base.py",
"copies": "1",
"size": "2606",
"license": "mit",
"hash": 2674738319640532500,
"line_mean": 27.9666666667,
"line_max": 106,
"alpha_frac": 0.5402916347,
"autogenerated": false,
"ratio": 3.9070464767616193,
"config_test": false,
... |
__author__ = 'Celery'
import pygtk
pygtk.require('2.0')
import gtk
from widgets.key_widg import KeyWidg
from widgets.pot_widg import PotWidg
from midi.main import Engine
import midi.defaults.defaults as d
class Gui:
def new_menu_item(self, name, img=None, accel=None, func=None, *args):
if img is not None... | {
"repo_name": "S1M1S/TopHat-MIDI",
"path": "gui/gui.py",
"copies": "1",
"size": "9591",
"license": "mit",
"hash": 1165059341581017300,
"line_mean": 40.5238095238,
"line_max": 129,
"alpha_frac": 0.5435303931,
"autogenerated": false,
"ratio": 3.67612111920276,
"config_test": false,
"has_no_keyw... |
# Example of using matplotlib to create boxplot:
# http://matplotlib.org/examples/pylab_examples/boxplot_demo2.html
import argparse
import sys
import os
import re
import pylab
import numpy
usage = """ %s [options] -i INFILE
Use matplotlib to create boxplot
""" % (__file__)
def append_element_to_list(element, lis... | {
"repo_name": "csiu/tokens",
"path": "python/relic/matplotlib_boxplot.py",
"copies": "1",
"size": "5492",
"license": "mit",
"hash": -690917945004816100,
"line_mean": 31.4970414201,
"line_max": 169,
"alpha_frac": 0.4794246176,
"autogenerated": false,
"ratio": 2.5820404325340856,
"config_test": f... |
__author__ = 'cenk'
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import Permission
class BottomUpRoleAuthenticateBackend(ModelBackend):
"""
Authenticates against settings.AUTH_USER_MODEL.
"""
def get_role_permissions(self, user_obj, obj=None):
"""
... | {
"repo_name": "cenkbircanoglu/django-roles",
"path": "django_roles/backends/bottomup_role_authenticate_backend.py",
"copies": "1",
"size": "1941",
"license": "mit",
"hash": -6810606050448815000,
"line_mean": 39.4375,
"line_max": 117,
"alpha_frac": 0.6130860381,
"autogenerated": false,
"ratio": 3.... |
__author__ = 'cenk'
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import Permission
class RoleAuthenticateBackend(ModelBackend):
"""
Authenticates against settings.AUTH_USER_MODEL.
"""
def get_role_permissions(self, user_obj, obj=None):
"""
Ret... | {
"repo_name": "cenkbircanoglu/django-roles",
"path": "django_roles/backends/role_authenticate_backend.py",
"copies": "1",
"size": "1956",
"license": "mit",
"hash": -3153177723753045000,
"line_mean": 38.9183673469,
"line_max": 117,
"alpha_frac": 0.6119631902,
"autogenerated": false,
"ratio": 3.904... |
__author__ = 'cenk'
import json
class Config():
def __init__(self, path=None):
self.path = path
self.data = {}
self.cassandra_conf = None
self.elastic_conf = None
self.spark_conf = None
self.rollups = None
self.load_config_from_json()
self.parse()... | {
"repo_name": "egemsoft/cassandra-spark-rollup",
"path": "cronjob/app/config.py",
"copies": "2",
"size": "1333",
"license": "mit",
"hash": 7490275946030369000,
"line_mean": 24.1509433962,
"line_max": 56,
"alpha_frac": 0.5881470368,
"autogenerated": false,
"ratio": 3.6222826086956523,
"config_te... |
__author__ = 'cenk'
import numpy as np
import scipy.optimize as sop
class SparseAutoencoder(object):
def process(self, epsilon=0.1):
""" Load the dataset and preprocess using ZCA Whitening """
from reader.stl import STL
import scipy
image_channels = 3 # number of channels in the... | {
"repo_name": "cenkbircanoglu/cnn-example",
"path": "sparsity/base.py",
"copies": "1",
"size": "1992",
"license": "mit",
"hash": 4377410912981769000,
"line_mean": 38.0588235294,
"line_max": 98,
"alpha_frac": 0.6114457831,
"autogenerated": false,
"ratio": 3.852998065764023,
"config_test": false,... |
__author__ = 'cenk'
def check_vertical(cells, free_cells):
for (i, j) in cells:
if (i, j + 1) in cells and (i, j + 2) in free_cells:
return (i, j + 2)
if (i, j + 1) in free_cells and (i, j + 2) in cells:
return (i, j + 1)
if (i, j - 1) in cells and (i, j - 2) in fre... | {
"repo_name": "cenkbircanoglu/tic-tac-toe",
"path": "game/algorithm/finisher.py",
"copies": "1",
"size": "3530",
"license": "mit",
"hash": 3342080256166419500,
"line_mean": 35.78125,
"line_max": 69,
"alpha_frac": 0.4801699717,
"autogenerated": false,
"ratio": 3.374760994263862,
"config_test": f... |
__author__ = 'cephalopodblue'
import json
import os
class JsonSerializer:
@staticmethod
def release_json(release):
"""
Get a dictionary that we like & json also likes
"""
release_data = {"glossary_title": release.glossary_title, "item_code": release.item_code, \
... | {
"repo_name": "hidat/audio_pipeline",
"path": "audio_pipeline/serializers/JsonSerializer.py",
"copies": "1",
"size": "1525",
"license": "mit",
"hash": -7916651079056881000,
"line_mean": 31.4680851064,
"line_max": 99,
"alpha_frac": 0.5704918033,
"autogenerated": false,
"ratio": 3.7195121951219514,... |
__author__ = 'cephalopodblue'
import musicbrainzngs as ngs
from . import Util
import time
RETRY = 5
class MBInfo:
default_server = ngs.hostname
def __init__(self, server=None, backup_server=None, useragent=("hidat_audio_pipeline", "0.1")):
if server is not None and server != self.default_server:
... | {
"repo_name": "hidat/audio_pipeline",
"path": "audio_pipeline/util/MBInfo.py",
"copies": "1",
"size": "3437",
"license": "mit",
"hash": 6161031231740158000,
"line_mean": 34.0816326531,
"line_max": 113,
"alpha_frac": 0.5341867908,
"autogenerated": false,
"ratio": 4.043529411764706,
"config_test"... |
__author__ = 'cephalopodblue'
import os
import argparse
import mutagen
import shutil
import csv
import hashlib
import uuid as UUID
import sys
import xml.etree.ElementTree as ET
import datetime
import MBInfo
import MetaProcessor
import DaletSerializer
import musicbrainzngs.musicbrainz as musicbrainz
import unicodedata
... | {
"repo_name": "hidat/audio_pipeline",
"path": "audio_pipeline/file_walker/TrackXMLWalker.py",
"copies": "1",
"size": "14631",
"license": "mit",
"hash": -8080738823980865000,
"line_mean": 48.4290540541,
"line_max": 417,
"alpha_frac": 0.580001367,
"autogenerated": false,
"ratio": 3.8472258743097556... |
__author__ = 'ceposta'
'''
BIG NOTE: We dont use this script yet...
it's experimental..
woudd like to get to use it soon...
'''
import sys, urllib, urllib2, json, re;
if len(sys.argv) < 4:
print "invalid parameters"
print "args: AppName VersionNumber OSEBrokerUrl OSEDomain"
SOURCE_APP_NAME = sys.argv... | {
"repo_name": "finiteloopme/cd-jboss-fuse",
"path": "ose-scripts/create_ose.py",
"copies": "1",
"size": "3264",
"license": "apache-2.0",
"hash": -2048429047051906800,
"line_mean": 29.8018867925,
"line_max": 139,
"alpha_frac": 0.5968137255,
"autogenerated": false,
"ratio": 3.392931392931393,
"co... |
__author__ = 'ceposta'
#
#
# Example how to call this:
# $ python check_app_exists.py https://broker.hosts.pocteam.com /broker/rest/ dev christian christian fuse10 fusesource-fuse-1.0.0
# expects these params:
# 1 -- OSE broker
# 2 -- path to rest API, eg, /broker/rest/ <-- note the trailing slash
# 3 -- domain
# 4 -... | {
"repo_name": "finiteloopme/cd-jboss-fuse",
"path": "ose-scripts/check_app_exists.py",
"copies": "1",
"size": "1499",
"license": "apache-2.0",
"hash": -9130067839594099000,
"line_mean": 28.98,
"line_max": 130,
"alpha_frac": 0.6190793863,
"autogenerated": false,
"ratio": 2.9624505928853755,
"con... |
__author__ = 'ceposta'
#
# python create_new_app.py https://broker.hosts.pocteam.com /broker/rest/ dev christian christian fuse10 fuse-1.0.0
# expects these params:
# 1 -- OSE broker
# 2 -- path to rest API, eg, /broker/rest/ <-- note the trailing slash
# 3 -- domain
# 4 -- user
# 5 -- password
# 6 -- app name
# 7 -- ... | {
"repo_name": "finiteloopme/cd-jboss-fuse",
"path": "ose-scripts/create_new_app.py",
"copies": "1",
"size": "1966",
"license": "apache-2.0",
"hash": -8547086767828930000,
"line_mean": 32.9137931034,
"line_max": 121,
"alpha_frac": 0.5981688708,
"autogenerated": false,
"ratio": 3.076682316118936,
... |
__author__ = 'cerias'
from bottle import Bottle, ServerAdapter
# copied from bottle. Only changes are to import ssl and wrap the socket
class SSLWSGIRefServer(ServerAdapter):
def run(self, handler):
from wsgiref.simple_server import make_server, WSGIRequestHandler
import ssl
if self.quiet:... | {
"repo_name": "cerias/ptMonitor",
"path": "webserver.py",
"copies": "1",
"size": "1144",
"license": "apache-2.0",
"hash": 4460558262590159000,
"line_mean": 29.1052631579,
"line_max": 73,
"alpha_frac": 0.6092657343,
"autogenerated": false,
"ratio": 3.8133333333333335,
"config_test": false,
"ha... |
__author__ = 'cerias'
from logger import log
from subprocess import call
from ConfigManagement import ConfigPlugin
class manager:
def __init__(self):
self._c = ConfigPlugin("tomcat")
self._url = "http://{}:{}@127.0.0.1/manager/text/".format(self._c.getVar("auth","username"),self._c.getVar("auth"... | {
"repo_name": "cerias/ptMonitor",
"path": "plugins/tomcat.py",
"copies": "1",
"size": "1220",
"license": "apache-2.0",
"hash": -3694108177011415000,
"line_mean": 22.4615384615,
"line_max": 154,
"alpha_frac": 0.6196721311,
"autogenerated": false,
"ratio": 3.2620320855614975,
"config_test": false... |
__author__ = 'cfiloteo'
from django.dispatch import receiver
from django_cas_ng.signals import cas_user_authenticated
from home import models as hmod
###########################################################
### Signal handler for when users authenticate via CAS
@receiver(cas_user_authenticated)
def cas_authentic... | {
"repo_name": "AIS-BYU/ais-site",
"path": "website/home/__init__.py",
"copies": "1",
"size": "1594",
"license": "mit",
"hash": -8193064842254987000,
"line_mean": 31.5306122449,
"line_max": 62,
"alpha_frac": 0.6141781681,
"autogenerated": false,
"ratio": 4.1947368421052635,
"config_test": false,... |
__author__ = 'CFPB Labs'
import time
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
from selenium.webd... | {
"repo_name": "mjjavaid/cfpb-transit_subsidy",
"path": "tests/selenium/TransitSubsidyApp.py",
"copies": "2",
"size": "6299",
"license": "cc0-1.0",
"hash": 5579742521086228000,
"line_mean": 43.048951049,
"line_max": 195,
"alpha_frac": 0.6543895856,
"autogenerated": false,
"ratio": 3.32225738396624... |
__author__ = "CFPBLabs"
"""
Tests the TransitSubsidyApp which abstract the functionality of the actual application.
"""
from base_test import *
#---------------------- Fixture ----------------------#
# Assumes tests will be run on the same server the app is running on.
# Obviously, this will have to be changed ... | {
"repo_name": "mjjavaid/cfpb-transit_subsidy",
"path": "tests/selenium/transit_subsidy_ui_tests.py",
"copies": "2",
"size": "5777",
"license": "cc0-1.0",
"hash": 7163625790720117000,
"line_mean": 28.7783505155,
"line_max": 99,
"alpha_frac": 0.6364895274,
"autogenerated": false,
"ratio": 3.1210156... |
__author__ = 'CFPB Labs'
__version__ = '0.9.1'
#-------------------------------------------------------------------------------
from django.db import models
from django.forms.widgets import Select,HiddenInput,Textarea
from django.forms import ModelForm
from django import forms
from django.contrib.auth.models imp... | {
"repo_name": "cfpb/transit_subsidy",
"path": "transit_subsidy/models.py",
"copies": "2",
"size": "6006",
"license": "cc0-1.0",
"hash": 537117629374898200,
"line_mean": 32.125,
"line_max": 114,
"alpha_frac": 0.6192141192,
"autogenerated": false,
"ratio": 3.6801470588235294,
"config_test": false... |
__author__ = 'cgomezfandino@gmail.com'
import datetime as dt
import v20
from configparser import ConfigParser
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Create an object config
config = ConfigParser()
# Read the config
config.read("../API_Connection_Oanda/pyalgo.cfg... | {
"repo_name": "cgomezfandino/Project_PTX",
"path": "Models_TFM/mrbt_KCL.py",
"copies": "1",
"size": "13314",
"license": "mit",
"hash": -4155866523309742000,
"line_mean": 35.3770491803,
"line_max": 145,
"alpha_frac": 0.5512242752,
"autogenerated": false,
"ratio": 3.317717418390232,
"config_test"... |
__author__ = 'cgomezfandino@gmail.com'
import pandas as pd
import configparser
import v20
import json
config = configparser.ConfigParser()
### Connection to know the account number
config.read('../API_Connection_Oanda/pyalgo.cfg')
ctx = v20.Context(
'api-fxpractice.oanda.com',
443,
True,
applicatio... | {
"repo_name": "cgomezfandino/Project_PTX",
"path": "API_Connection_Oanda/Oanda_Instruments.py",
"copies": "1",
"size": "1185",
"license": "mit",
"hash": -5912929131225544000,
"line_mean": 20.9444444444,
"line_max": 69,
"alpha_frac": 0.641350211,
"autogenerated": false,
"ratio": 3.4248554913294798... |
__author__ = 'cgonzalez'
import os
import numpy as np
import pygal
from pygal.style import RedBlueStyle as PlotStyle
from PyQt4 import QtGui
from PyQt4 import QtCore
from .modules import regression
from .forms.MainWindow_UI import *
from .forms.AboutAlges_UI import *
from .forms.About_UI import *
class Main(QtGui.... | {
"repo_name": "carlgonz/u-fit",
"path": "src/python/u_fit/main.py",
"copies": "1",
"size": "5989",
"license": "mit",
"hash": 3031755201750351000,
"line_mean": 30.6931216931,
"line_max": 106,
"alpha_frac": 0.552012022,
"autogenerated": false,
"ratio": 3.5691299165673422,
"config_test": false,
... |
__author__ = 'chachalaca'
from Roulette import Roulette
from Strategy import Strategy
class AntiMartingale(Strategy):
def __init__(self, bet: float, cash: float, roulette: Roulette):
self.init_bet = bet
self.cash = cash
self.roulette = roulette
def play(self):
history = []
... | {
"repo_name": "chachalaca/MonteCarloRoulette",
"path": "AntiMartingale.py",
"copies": "1",
"size": "1349",
"license": "mit",
"hash": -262107926134238600,
"line_mean": 21.8644067797,
"line_max": 79,
"alpha_frac": 0.4788732394,
"autogenerated": false,
"ratio": 3.685792349726776,
"config_test": fa... |
__author__ = 'chachalaca'
from Roulette import Roulette
from Strategy import Strategy
class DAlembert(Strategy):
def __init__(self, init_bet: float, cash: float, roulette: Roulette):
self.init_bet = init_bet
self.cash = cash
self.roulette = roulette
def play(self):
history = ... | {
"repo_name": "chachalaca/MonteCarloRoulette",
"path": "DAlembert.py",
"copies": "1",
"size": "1377",
"license": "mit",
"hash": 8482275323314439000,
"line_mean": 22.7413793103,
"line_max": 79,
"alpha_frac": 0.4814814815,
"autogenerated": false,
"ratio": 3.5953002610966056,
"config_test": false,... |
__author__ = 'chachalaca'
from Roulette import Roulette
from Strategy import Strategy
class Fibonacci(Strategy):
def __init__(self, init_bet: float, cash: float, roulette: Roulette):
self.init_bet = init_bet
self.cash = cash
self.roulette = roulette
def fib(self, n):
if n < 2... | {
"repo_name": "chachalaca/MonteCarloRoulette",
"path": "Fibonacci.py",
"copies": "1",
"size": "1599",
"license": "mit",
"hash": 45379741469466550,
"line_mean": 21.5211267606,
"line_max": 79,
"alpha_frac": 0.4602876798,
"autogenerated": false,
"ratio": 3.4535637149028076,
"config_test": false,
... |
__author__ = 'chachalaca'
from Roulette import Roulette
from Strategy import Strategy
class Labouchere(Strategy):
init_series = None
def __init__(self, init_bet: float, cash: float, roulette: Roulette):
self.init_bet = init_bet
self.cash = cash
self.roulette = roulette
self.i... | {
"repo_name": "chachalaca/MonteCarloRoulette",
"path": "Labouchere.py",
"copies": "1",
"size": "2083",
"license": "mit",
"hash": 6592158193160886000,
"line_mean": 25.0375,
"line_max": 79,
"alpha_frac": 0.4728756601,
"autogenerated": false,
"ratio": 3.766726943942134,
"config_test": false,
"ha... |
__author__ = 'chachalaca'
from Roulette import Roulette
from Strategy import Strategy
class Martingale(Strategy):
def __init__(self, bet: float, cash: float, roulette: Roulette):
self.init_bet = bet
self.cash = cash
self.roulette = roulette
def play(self):
history = []
... | {
"repo_name": "chachalaca/MonteCarloRoulette",
"path": "Martingale.py",
"copies": "1",
"size": "1344",
"license": "mit",
"hash": 5559362592309068000,
"line_mean": 22.1724137931,
"line_max": 79,
"alpha_frac": 0.4776785714,
"autogenerated": false,
"ratio": 3.6923076923076925,
"config_test": false... |
__author__ = 'chachalaca'
import numpy as np
from functools import reduce
class KMeans:
clusters_count = None
cluster_centers = None
def __init__(self, clusters_count):
self.clusters_count = clusters_count
def fit(self, data):
self.cluster_centers = self._lloyd_k_means(data)
... | {
"repo_name": "chachalaca/K-means",
"path": "KMeans.py",
"copies": "1",
"size": "4374",
"license": "mit",
"hash": -5831556167015193000,
"line_mean": 32.3893129771,
"line_max": 117,
"alpha_frac": 0.4821673525,
"autogenerated": false,
"ratio": 4.347912524850894,
"config_test": false,
"has_no_ke... |
__author__ = 'chachalaca'
import numpy as np
from FrenchRoulette import FrenchRoulette
from AmericanRoulette import AmericanRoulette
from Martingale import Martingale
from Fibonacci import Fibonacci
from DAlembert import DAlembert
from Labouchere import Labouchere
from AntiMartingale import AntiMartingale
import pan... | {
"repo_name": "chachalaca/MonteCarloRoulette",
"path": "main.py",
"copies": "1",
"size": "6344",
"license": "mit",
"hash": -4909996861291498000,
"line_mean": 31.5333333333,
"line_max": 131,
"alpha_frac": 0.5559583859,
"autogenerated": false,
"ratio": 3.351294241944004,
"config_test": false,
"... |
__author__ = 'Chad Dotson'
def valid_position(n_queen_positions, new_position):
for existing_position in n_queen_positions:
if existing_position[1] == new_position[1] or existing_position[0] == new_position[0]:
return False
row_difference = abs(new_position[1] - existing_position[1])
... | {
"repo_name": "axiros/transcrypt",
"path": "src/demo_1_queens/solver.py",
"copies": "1",
"size": "1358",
"license": "apache-2.0",
"hash": 7145266736148330000,
"line_mean": 26.7142857143,
"line_max": 94,
"alpha_frac": 0.6340206186,
"autogenerated": false,
"ratio": 3.4035087719298245,
"config_tes... |
__author__ = 'Chad'
import pandas as pd
import numpy as np
# Pandas makes data exploration and manipulation easier and more readable
# Pandas has its own read_csv method; it's smart enough to infer data types
train_df = pd.read_csv('.\\data\\train.csv', header=0)
# To prepare our data we must first convert text value... | {
"repo_name": "SgfPythonDevs/cboschert-intro2ml",
"path": "scripts/PandasML.py",
"copies": "1",
"size": "4904",
"license": "mit",
"hash": -7154288555571643000,
"line_mean": 50.0833333333,
"line_max": 150,
"alpha_frac": 0.7020799347,
"autogenerated": false,
"ratio": 3.090107120352867,
"config_te... |
__author__ = 'Chao'
import numpy as np
from sklearn import svm, cross_validation
from sklearn.ensemble import RandomForestClassifier
from sklearn.neighbors import KNeighborsClassifier
activity_label = {'1': 'WALKING',
'2': 'WALKING_UPSTAIRS',
'3': 'WALKING_DOWNSTAIRS',
... | {
"repo_name": "Sapphirine/Human-Activity-Monitoring-and-Prediction",
"path": "analysis.py",
"copies": "1",
"size": "6718",
"license": "apache-2.0",
"hash": -3678663670991686700,
"line_mean": 33.8082901554,
"line_max": 149,
"alpha_frac": 0.575915451,
"autogenerated": false,
"ratio": 3.246979217013... |
__author__ = 'Chapin Bryce'
__version__ = 0.00
import os
import datetime
import logging
#
# Main function. Callable by other scripts
#
base = os.path.dirname(os.path.realpath(__file__))
def main(outpath, targ, rule, os_type, config):
start = datetime.datetime.now()
if not os.path.exists(outpath):
... | {
"repo_name": "lcdi/LCDIC",
"path": "lcdic.py",
"copies": "1",
"size": "6283",
"license": "mit",
"hash": -7154462556837671000,
"line_mean": 31.056122449,
"line_max": 117,
"alpha_frac": 0.61403788,
"autogenerated": false,
"ratio": 3.8688423645320196,
"config_test": true,
"has_no_keywords": fal... |
__author__ = 'chapter09'
"""
a fat tree implementation within the mininet envrionment
"""
from mininet.topo import Topo
class FatTree(Topo):
"Create a fat-tree topology."
def __init__(self, k=4):
'''Init.
@param k number of ports
'''
if (k % 2) != 0 or k <= 0:
... | {
"repo_name": "chapter09/mininet_misc",
"path": "fattree.py",
"copies": "1",
"size": "2014",
"license": "apache-2.0",
"hash": 6680155477093971000,
"line_mean": 26.9722222222,
"line_max": 69,
"alpha_frac": 0.4920556107,
"autogenerated": false,
"ratio": 3.4545454545454546,
"config_test": false,
... |
__author__ = 'chapter'
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def weight_varible(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)
def bias_variable(shape):
initial = tf.constant(0.1, shape=shape)
return tf.Variable(initia... | {
"repo_name": "samleoqh/machine-ln",
"path": "src/tflow/tf_cnn_example.py",
"copies": "1",
"size": "2351",
"license": "mit",
"hash": -5436775930724392000,
"line_mean": 28.4,
"line_max": 114,
"alpha_frac": 0.6626967248,
"autogenerated": false,
"ratio": 2.459205020920502,
"config_test": false,
... |
__author__ = 'Charles Leifer'
__license__ = 'MIT'
__version__ = '0.4.8'
from huey.api import Huey, crontab
try:
import redis
from huey.backends.redis_backend import RedisBlockingQueue
from huey.backends.redis_backend import RedisDataStore
from huey.backends.redis_backend import RedisEventEmitter
f... | {
"repo_name": "angvp/huey",
"path": "huey/__init__.py",
"copies": "4",
"size": "2434",
"license": "mit",
"hash": 8191345308639195000,
"line_mean": 38.2580645161,
"line_max": 77,
"alpha_frac": 0.5846343468,
"autogenerated": false,
"ratio": 4.2404181184668985,
"config_test": false,
"has_no_keyw... |
__author__ = 'Charles Leifer'
__license__ = 'MIT'
__version__ = '0.4.9'
from huey.api import Huey, crontab
try:
import redis
from huey.backends.redis_backend import RedisBlockingQueue
from huey.backends.redis_backend import RedisDataStore
from huey.backends.redis_backend import RedisEventEmitter
f... | {
"repo_name": "antoviaque/huey",
"path": "huey/__init__.py",
"copies": "1",
"size": "2434",
"license": "mit",
"hash": -1805909005860005600,
"line_mean": 38.2580645161,
"line_max": 77,
"alpha_frac": 0.5846343468,
"autogenerated": false,
"ratio": 4.2404181184668985,
"config_test": false,
"has_n... |
__author__ = 'Charles'
from StringIO import StringIO
from imghdr import what
from hashlib import md5
import os
from subprocess import *
import logging
import sys
import subprocess
from PIL import Image
# from ssim import compute_ssim
from webm import handlers
from webm import decode
import time
import shutil
from colle... | {
"repo_name": "CharlesZhong/Mobile-Celluar-Measure",
"path": "http_parser/image.py",
"copies": "1",
"size": "12607",
"license": "mit",
"hash": 5067858890870215000,
"line_mean": 32.8924731183,
"line_max": 127,
"alpha_frac": 0.5587372095,
"autogenerated": false,
"ratio": 3.3466949827448897,
"conf... |
__author__ = 'charles'
from twitter_connection import TwitterAgent
from IRToolKit import TF_IDF
import multiprocessing
seed_list = [
"nytimes",
"BBC",
"TheEconomist",
"CBCNews",
"Forbes",
"CNN",
"washingtonpost",
"Reuters",
"globeandmail",
]
replace_dict = {
"http": ("http", "u... | {
"repo_name": "TextMiningToolKitTeam/TwitterMining",
"path": "subjective_objective_miner.py",
"copies": "1",
"size": "3335",
"license": "isc",
"hash": 914793429683365400,
"line_mean": 31.3883495146,
"line_max": 80,
"alpha_frac": 0.5166416792,
"autogenerated": false,
"ratio": 3.57449088960343,
"... |
__author__ = 'charles'
import os
def CreateTwitterSet(seed_id):
id_set = set()
twitter_id = "washingtonpost"
with open("data_pool/"+twitter_id+".retweets") as f:
for line in f:
words = line.split(": ")
if len(words[0].split()) == 1:
id_set.add(words[0])
w... | {
"repo_name": "TextMiningToolKitTeam/TwitterMining",
"path": "processing_unit.py",
"copies": "1",
"size": "1048",
"license": "isc",
"hash": -197861354564620320,
"line_mean": 31.75,
"line_max": 68,
"alpha_frac": 0.5209923664,
"autogenerated": false,
"ratio": 3.7971014492753623,
"config_test": fa... |
__author__ = 'Charles'
import sys
import logging
from BaseHTTPServer import BaseHTTPRequestHandler
from StringIO import StringIO
from pprint import pprint
from http_parser.http import HttpStream
from http_parser.reader import SocketReader
from model import HTTP_Requset, HTTP_Response
try:
from http_parser.parser i... | {
"repo_name": "CharlesZhong/Mobile-Celluar-Measure",
"path": "http_parser/parser.py",
"copies": "1",
"size": "2393",
"license": "mit",
"hash": -5795212457326023000,
"line_mean": 28.1829268293,
"line_max": 82,
"alpha_frac": 0.6372753865,
"autogenerated": false,
"ratio": 3.670245398773006,
"confi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.