text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'myang'
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.common.keys import Keys
from time import sleep
from selenium.webdriver.support.wait import WebDriverWait
from selenium.w... | {
"repo_name": "PyLearner/myworks",
"path": "selenium/network/a10api/login.py",
"copies": "1",
"size": "3361",
"license": "apache-2.0",
"hash": 7807525731134823000,
"line_mean": 44.6901408451,
"line_max": 125,
"alpha_frac": 0.6503770739,
"autogenerated": false,
"ratio": 3.2278481012658227,
"conf... |
import pycosat
import sys
def solve(n):
y =[]
#rows
for i in range (1,(n*n)+1,n):
y += vertical(range(i,i+n,1),True)
#columns
for i in range (1,n+1):
y+= vertical(range(i,(n*n)-n+1+i,n),True)
#diagonals
y+=diagonal(1,n)
#results
result = []
for sol in pycosat.itersolve(y):
result.append(sol)
... | {
"repo_name": "nellsel/NQueens",
"path": "Assignment/n_queens2.py",
"copies": "1",
"size": "4625",
"license": "mit",
"hash": -7005842417912921000,
"line_mean": 23.4708994709,
"line_max": 86,
"alpha_frac": 0.5593513514,
"autogenerated": false,
"ratio": 3.048780487804878,
"config_test": false,
... |
__author__ = 'N00D13'
#importing Libs
import config
import os.path
import os
import re
import tornado.ioloop
import tornado.web
#Write Hello World
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.render("www/index.html")
class PostHandler(tornado.web.RequestHandler):
def get(self)... | {
"repo_name": "N00D13/RockCoreCMS",
"path": "server.py",
"copies": "1",
"size": "1081",
"license": "mit",
"hash": -8443284942323604000,
"line_mean": 20.1960784314,
"line_max": 68,
"alpha_frac": 0.6040703053,
"autogenerated": false,
"ratio": 3.806338028169014,
"config_test": false,
"has_no_key... |
__author__ = "n01z3"
import matplotlib.pyplot as plt
import numpy as np
import cv2
import pandas as pd
from shapely.wkt import loads as wkt_loads
import tifffile as tiff
import os
import random
from keras.models import Model
from keras.layers import Input, merge, Convolution2D, MaxPooling2D, UpSampling2D, Reshape, cor... | {
"repo_name": "escientists/dstl",
"path": "unet.py",
"copies": "1",
"size": "17529",
"license": "apache-2.0",
"hash": -6621167937599015000,
"line_mean": 35.8256302521,
"line_max": 121,
"alpha_frac": 0.5995207941,
"autogenerated": false,
"ratio": 2.804191329387298,
"config_test": false,
"has_n... |
__author__ = 'n3k'
class Tower(object):
def __init__(self, rings=[], max_rings=0):
if len(rings) > 0:
self.rings = rings
else:
self.rings = [i for i in xrange(max_rings, 0, -1)]
def __iter__(self):
return iter(self.rings)
def is_empty(self):
return... | {
"repo_name": "n3k/HanoiTowers",
"path": "src/HanoiTowers.py",
"copies": "1",
"size": "8330",
"license": "mit",
"hash": 7027686660931584000,
"line_mean": 31.4124513619,
"line_max": 89,
"alpha_frac": 0.4840336134,
"autogenerated": false,
"ratio": 3.4265734265734267,
"config_test": false,
"has_... |
__author__ = 'n3k'
from IODevice import IODevice
from Clock import Clock
from Logger import Logger
from Scheduler import *
from datetime import datetime
import Queue
class SystemManager(object):
def __init__(self):
self.timer = 10
self.init_time = datetime.now()
self.system_clock = Clo... | {
"repo_name": "n3k/SchedulerSimulator",
"path": "Scheduler/SystemManager.py",
"copies": "1",
"size": "2874",
"license": "mit",
"hash": -5848134587190474000,
"line_mean": 28.6288659794,
"line_max": 104,
"alpha_frac": 0.6252609603,
"autogenerated": false,
"ratio": 3.975103734439834,
"config_test"... |
__author__ = 'n3k'
from Logger import Logger
from abc import ABCMeta, abstractmethod
class Subject(object):
__metaclass__ = ABCMeta
def __init__(self):
self._observers = []
def attach(self, observer):
if not observer in self._observers:
self._observers.append(observer)
... | {
"repo_name": "n3k/SchedulerSimulator",
"path": "Scheduler/Clock.py",
"copies": "1",
"size": "1336",
"license": "mit",
"hash": -4615862439618835000,
"line_mean": 21.2833333333,
"line_max": 65,
"alpha_frac": 0.5628742515,
"autogenerated": false,
"ratio": 4.214511041009464,
"config_test": false,
... |
__author__ = 'n3k'
from Logger import Logger
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import ssl
import threading
from StringIO import StringIO
from ssl import SSLError
class FakeHTTPServer(HTTPServer):
def __init__(self, server_address, RequestHandlerClass, bin... | {
"repo_name": "n3k/CertSlayer",
"path": "CertSlayer/FakeTLSServer.py",
"copies": "1",
"size": "3758",
"license": "mit",
"hash": 7135073560414607000,
"line_mean": 28.1317829457,
"line_max": 126,
"alpha_frac": 0.6381053752,
"autogenerated": false,
"ratio": 4.080347448425624,
"config_test": false,... |
__author__ = 'n3k'
from Logger import Logger
import sys
class ProcessState(object):
def __init__(self):
pass
def change_state(self, process, clock_value=0):
pass
def update(self, process, clock_value=0):
pass
def __str__(self):
pass
class StateNewProcess(ProcessSt... | {
"repo_name": "n3k/SchedulerSimulator",
"path": "Scheduler/Process.py",
"copies": "1",
"size": "7700",
"license": "mit",
"hash": 6616869505746979000,
"line_mean": 35.4976303318,
"line_max": 121,
"alpha_frac": 0.6448051948,
"autogenerated": false,
"ratio": 3.9165818921668363,
"config_test": fals... |
__author__ = 'n3k'
from Logger import Logger
import threading
from time import sleep
class Processor(threading.Thread):
def __init__(self, systemManager, queue):
threading.Thread.__init__(self)
self.stop_request = threading.Event()
self.system_manager = systemManager
self.queue =... | {
"repo_name": "n3k/SchedulerSimulator",
"path": "Scheduler/Processor.py",
"copies": "1",
"size": "3051",
"license": "mit",
"hash": 694879047390365600,
"line_mean": 39.68,
"line_max": 110,
"alpha_frac": 0.6273352999,
"autogenerated": false,
"ratio": 4.003937007874016,
"config_test": false,
"ha... |
__author__ = 'n3k'
from Logger import Logger
import threading
#FCFS behaviour
class IODevice(threading.Thread):
def __init__(self,device, systemManager, processList):
threading.Thread.__init__(self)
self.stop_request = threading.Event()
self.device = device
self.system_manager = s... | {
"repo_name": "n3k/SchedulerSimulator",
"path": "Scheduler/IODevice.py",
"copies": "1",
"size": "1819",
"license": "mit",
"hash": 3303076411597650000,
"line_mean": 33.3396226415,
"line_max": 82,
"alpha_frac": 0.5750412314,
"autogenerated": false,
"ratio": 4.124716553287982,
"config_test": false... |
__author__ = 'n3k'
from ProcessFactory import ProcessFactory
from abc import ABCMeta, abstractmethod
from Processor import *
from time import sleep
from random import randrange
class Scheduler(threading.Thread):
__metaclass__ = ABCMeta
def __init__(self, systemManager, processList):
threading.Thread... | {
"repo_name": "n3k/SchedulerSimulator",
"path": "Scheduler/Scheduler.py",
"copies": "1",
"size": "5065",
"license": "mit",
"hash": 592068813608378600,
"line_mean": 32.3223684211,
"line_max": 101,
"alpha_frac": 0.6153998026,
"autogenerated": false,
"ratio": 4.281487743026204,
"config_test": fals... |
__author__ = 'n3k'
from Process import Process
from Operation import *
from random import randrange
class ProcessFactory(object):
def __init__(self, systemManager):
self.system_manager = systemManager
self._generate_pid = self._get_next_pid()
self._devices_list = self.system_manager.io_de... | {
"repo_name": "n3k/SchedulerSimulator",
"path": "Scheduler/ProcessFactory.py",
"copies": "1",
"size": "2205",
"license": "mit",
"hash": 5151283913442425000,
"line_mean": 28.0263157895,
"line_max": 96,
"alpha_frac": 0.6149659864,
"autogenerated": false,
"ratio": 4.0310786106032905,
"config_test"... |
__author__ = 'n3k'
import random
import string
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
def get_random_name(size):
r... | {
"repo_name": "n3k/CertSlayer",
"path": "CertSlayer/Utils.py",
"copies": "1",
"size": "1495",
"license": "mit",
"hash": -5219820367548592000,
"line_mean": 32.2444444444,
"line_max": 94,
"alpha_frac": 0.6140468227,
"autogenerated": false,
"ratio": 3.29295154185022,
"config_test": false,
"has_n... |
__author__ = 'n3k'
import struct
from pycab.CabStructs import CABFileFormat, CFHEADER, CFFOLDER, CFFILE, CFDATA
class CabReader(CABFileFormat):
"""
This class is able to read VALID .cab files
"""
def __init__(self, filename):
self.filename = filename
self.cfheader = ... | {
"repo_name": "n3k/PyCAB",
"path": "pycab/CabReader.py",
"copies": "1",
"size": "7367",
"license": "mit",
"hash": -1170258227165787100,
"line_mean": 35.0201005025,
"line_max": 81,
"alpha_frac": 0.5521922085,
"autogenerated": false,
"ratio": 3.924880127863612,
"config_test": false,
"has_no_key... |
__author__ = 'n3k'
import unittest
import random
import datetime
from pycab.CabStructs import CFHEADER, CFFOLDER, CFFILE, CFDATA
class StructsTestCase(unittest.TestCase):
def setUp(self):
pass
def test_cfheader_signature(self):
"""
This method checks a cfheader comp... | {
"repo_name": "n3k/PyCAB",
"path": "tests/CabUnitTests.py",
"copies": "1",
"size": "6756",
"license": "mit",
"hash": -5873538695768174000,
"line_mean": 39.1951219512,
"line_max": 104,
"alpha_frac": 0.6190053286,
"autogenerated": false,
"ratio": 3.4539877300613497,
"config_test": true,
"has_no... |
__author__ = 'n3k'
"""
This code attemps to create valid .CAB SET files.
"""
import os
from itertools import groupby
from Utils import Utils
from pycab.CabStructs import CABFileFormat, CFHEADER, CFFOLDER, CFFILE, CFDATA
class CABException(Exception):
pass
class CABFolderUnit(object):
de... | {
"repo_name": "n3k/PyCAB",
"path": "pycab/CabWriter.py",
"copies": "1",
"size": "17394",
"license": "mit",
"hash": 5435089691588014000,
"line_mean": 38.2685185185,
"line_max": 183,
"alpha_frac": 0.5693342532,
"autogenerated": false,
"ratio": 3.9008746355685133,
"config_test": false,
"has_no_k... |
__author__ = 'nacim'
from zope.component import getGlobalSiteManager
from utils import urlparsing
from os import path
current_dir = path.dirname(path.realpath(__file__))
image_path = path.join(current_dir, "images")
gsm = getGlobalSiteManager()
class ServiceCheck(object):
name = None
image = ""
def __i... | {
"repo_name": "Grindizer/mist",
"path": "mist/checks.py",
"copies": "1",
"size": "3836",
"license": "mit",
"hash": 421414722091882400,
"line_mean": 27.8421052632,
"line_max": 71,
"alpha_frac": 0.4775808133,
"autogenerated": false,
"ratio": 4.349206349206349,
"config_test": false,
"has_no_keyw... |
__author__ = "Nadimozzaman Pappo"
__github__ = "http://github.com/mnpappo"
"""
Gradient Descent used in ANN.
"""
import theano
from theano import tensor as T
import numpy as np
import matplotlib.pyplot as plt
# some input sample
xi = np.arange(-100, 400, 0.1)
# given expression
x = T.dscalar('x')
exp1 = 5*x+2
fnexp... | {
"repo_name": "mnpappo/neural_network",
"path": "gradient_descent.py",
"copies": "1",
"size": "1779",
"license": "mit",
"hash": 3299848339565875700,
"line_mean": 19.2159090909,
"line_max": 55,
"alpha_frac": 0.635188308,
"autogenerated": false,
"ratio": 2.552367288378766,
"config_test": false,
... |
__author__ = "Nadimozzaman Pappo"
__github__ = "http://github.com/mnpappo"
"""
Just Testing using saved model.
"""
import numpy as np
import scipy.misc
from keras.models import model_from_json
# load some image to test
def load_and_scale_imgs():
img_names = ['data/cat.jpg', 'data/dog.jpg']
# resize img to 32x3... | {
"repo_name": "mnpappo/neural_network",
"path": "cifar10_test.py",
"copies": "1",
"size": "1141",
"license": "mit",
"hash": 1524095064079399200,
"line_mean": 33.5757575758,
"line_max": 139,
"alpha_frac": 0.6748466258,
"autogenerated": false,
"ratio": 2.97911227154047,
"config_test": false,
"h... |
__author__ = "Nadimozzaman Pappo"
__github__ = "http://github.com/mnpappo"
"""
This scripts simulates(by 2d ploting) various activation functions used in ANN.
"""
import theano
import theano.tensor as T
import matplotlib.pyplot as plt
import numpy as np
# sigmoid/logistic function
def sigmoid(a):
x = T.dmatrix(... | {
"repo_name": "mnpappo/neural_network",
"path": "activation_functions_theano.py",
"copies": "1",
"size": "1372",
"license": "mit",
"hash": -3665331553820503600,
"line_mean": 23.9454545455,
"line_max": 79,
"alpha_frac": 0.6720116618,
"autogenerated": false,
"ratio": 2.925373134328358,
"config_te... |
__author__ = "Nadimozzaman Pappo"
__github__ = "http://github.com/mnpappo"
"""
This script use keras & minist dataset to test random Dropout effects on result.
"""
import numpy as np
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from ... | {
"repo_name": "mnpappo/neural_network",
"path": "mnist_cnn_dropout_test.py",
"copies": "1",
"size": "4523",
"license": "mit",
"hash": 4294539007884585000,
"line_mean": 32.5037037037,
"line_max": 80,
"alpha_frac": 0.6539907141,
"autogenerated": false,
"ratio": 3.2100780695528743,
"config_test": ... |
__author__ = 'naetech'
import os
import module_locator
program_path = module_locator.module_path()
print "Program path is: %s" % program_path
from Classes.Settings import Settings
from Classes.PHP import PHP
from Classes.GUI import GUI
program_settings = Settings()
settings_file_path = "%s/%s" % (program_path, "s... | {
"repo_name": "btrdeveloper/btr",
"path": "Application.py",
"copies": "5",
"size": "2114",
"license": "mit",
"hash": -1764019150853207600,
"line_mean": 32.5714285714,
"line_max": 104,
"alpha_frac": 0.6556291391,
"autogenerated": false,
"ratio": 3.44299674267101,
"config_test": false,
"has_no_... |
__author__ = 'naetech'
import os
import subprocess
import re
import threading
import signal
from Compiler import Compiler
from threading import Thread
class PHP:
program_php_server_thread = None
def found(self, php_path):
if not os.path.exists(php_path):
return False
# attemp... | {
"repo_name": "btrdeveloper/btr",
"path": "Classes/PHP.py",
"copies": "5",
"size": "2205",
"license": "mit",
"hash": 381052451236340000,
"line_mean": 29.6388888889,
"line_max": 121,
"alpha_frac": 0.6285714286,
"autogenerated": false,
"ratio": 3.597063621533442,
"config_test": false,
"has_no_k... |
__author__ = 'naetech'
import sys
import os
import shutil
import urllib
import zipfile
import Settings
from subprocess import call
class Compiler:
build_dir = "./build"
output_dir = "./dist"
tmp_dir = "./nrtmp"
resources_dir = "./resources"
php_linux_binary_dir = "/home/naetech/php"
php_mac_... | {
"repo_name": "jwrb/nightrain",
"path": "Classes/Compiler.py",
"copies": "1",
"size": "13431",
"license": "mit",
"hash": 4419083437892633000,
"line_mean": 35.3027027027,
"line_max": 127,
"alpha_frac": 0.5264686174,
"autogenerated": false,
"ratio": 3.8264957264957267,
"config_test": true,
"has... |
__author__ = 'naetech'
import sys
import wx
import wx.html
import wx.html2
import wx.lib.wxpTag
from Compiler import Compiler
class GUI:
def show_error(self, title, message):
app = wx.PySimpleApp()
dlg = ErrorDialog(None, title, message)
dlg.ShowModal()
dlg.Destroy()
app... | {
"repo_name": "btrdeveloper/btr",
"path": "Classes/GUI.py",
"copies": "5",
"size": "3240",
"license": "mit",
"hash": 3783807405464830000,
"line_mean": 26.9396551724,
"line_max": 87,
"alpha_frac": 0.5938271605,
"autogenerated": false,
"ratio": 3.3575129533678756,
"config_test": false,
"has_no_... |
__author__ = 'Nafnlaus'
CACHE_DIR = "/tmp/imgen"
word_list = "creature|battlefield|artifact|library|magic|trample|flying|sacrifice|life|damage|vigilance|protection|spirit|arcane"
import re
import sys
import json
import os
import time
import random
import math
import requests
from flask import request
from . import... | {
"repo_name": "croxis/mtgai",
"path": "app/magic_image.py",
"copies": "1",
"size": "7163",
"license": "mit",
"hash": 6584242693834891000,
"line_mean": 32.6291079812,
"line_max": 155,
"alpha_frac": 0.5226860254,
"autogenerated": false,
"ratio": 3.6508664627930685,
"config_test": false,
"has_no... |
import pandas
import numpy as np
import csv
def open_file():
# To read 25th and 26th columns
io = pandas.read_csv('od2016.csv',sep=",",usecols=(3,4))
print(io)
x=np.array(io)
print("Using Numpy to save the data in an array")
print(x)
#if you want to skew the values
#print("weighted s... | {
"repo_name": "hhabib/anonymization-tool",
"path": "app/code/supression.py",
"copies": "1",
"size": "1521",
"license": "mit",
"hash": 6625030361695484000,
"line_mean": 30.0408163265,
"line_max": 82,
"alpha_frac": 0.5259697567,
"autogenerated": false,
"ratio": 3.5454545454545454,
"config_test": ... |
from jor import utils
import yaml
def load_yaml(name_file):
with open(name_file, 'r') as f:
content_dict = yaml.safe_load(f)
return content_dict
def get_template(namespace, release):
"""
:param namespace: the namespace of a project like nova, keystone,
oslo_messaging.
:param release... | {
"repo_name": "NguyenHoaiNam/Jump-Over-Release",
"path": "jor/mapconf/load_yaml.py",
"copies": "1",
"size": "2033",
"license": "apache-2.0",
"hash": -9099070783725264000,
"line_mean": 25.4025974026,
"line_max": 77,
"alpha_frac": 0.5818986719,
"autogenerated": false,
"ratio": 3.656474820143885,
... |
from oslo_config import cfg
from jor.getconf import oldconf
from jor.mapconf import load_yaml as load, write_conf as cru
from jor import utils
LOG = utils.get_log(__name__)
OPTION_IN_FILE = None
def mapping_config(path_new_file, CONF, namespaces, release):
global OPTION_IN_FILE
OPTION_IN_FILE = oldconf.get... | {
"repo_name": "NguyenHoaiNam/Jump-Over-Release",
"path": "jor/mapconf/gen_conf.py",
"copies": "1",
"size": "7742",
"license": "apache-2.0",
"hash": 545408394409015550,
"line_mean": 48.3121019108,
"line_max": 79,
"alpha_frac": 0.4705502454,
"autogenerated": false,
"ratio": 4.881462799495586,
"co... |
import os
import importlib
import sys
from oslo_config import cfg
__all__ = ['make_enviroment']
def import_opts(project_name):
# Make setup.cfg url
dir_path = os.getcwd()
sys.path.insert(0, dir_path)
setup_cfg = "{}/setup.cfg".format(dir_path)
# Get list module should be called with
setup_c... | {
"repo_name": "daikk115/compare_openstack_versions",
"path": "run.py",
"copies": "1",
"size": "7311",
"license": "mit",
"hash": -463775864902391600,
"line_mean": 33.980861244,
"line_max": 86,
"alpha_frac": 0.5651757625,
"autogenerated": false,
"ratio": 3.8478947368421053,
"config_test": false,
... |
__author__ = 'nampnq'
import os
import urllib
import posixpath
import sys
import importlib
import mimetypes
from flask import Flask
from flask import render_template_string, abort, escape, render_template, redirect, make_response, send_file
app = Flask(__name__, template_folder=os.getcwd(), static_folder=None)
de... | {
"repo_name": "NamPNQ/SimpleJinjaServer",
"path": "SimpleJinjaServer.py",
"copies": "1",
"size": "4588",
"license": "mit",
"hash": 4187414378494351000,
"line_mean": 30.6413793103,
"line_max": 108,
"alpha_frac": 0.577157803,
"autogenerated": false,
"ratio": 3.848993288590604,
"config_test": fals... |
__author__ = 'namukhtar'
import IPython
import nltk
from nltk.book import *
# text1
# text2
# text1.concordance("monstrous")
# text1.similar("monstrous")
# text2.similar("monstrous")
# text2.common_contexts(["monstrous", "very"])
# text4.dispersion_plot(["citizens", "democracy", "freedom", "duties", "America"])
#... | {
"repo_name": "Chaparqanatoos/kaggle-knowledge",
"path": "src/main/python/nltk_test.py",
"copies": "1",
"size": "1909",
"license": "apache-2.0",
"hash": -1450937451897012700,
"line_mean": 25.5138888889,
"line_max": 82,
"alpha_frac": 0.6951283394,
"autogenerated": false,
"ratio": 3.176372712146422... |
__author__ = 'namukhtar'
import IPython
import sklearn as sk
import numpy as np
import matplotlib
import nltk
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_olivetti_faces
faces = fetch_olivetti_faces()
print faces.DESCR
print faces.keys()
print faces.images.shape
print faces.data.shape
print ... | {
"repo_name": "Chaparqanatoos/kaggle-knowledge",
"path": "src/main/python/sentimentanalysis.py",
"copies": "4",
"size": "1778",
"license": "apache-2.0",
"hash": 672493034680417800,
"line_mean": 27.2380952381,
"line_max": 95,
"alpha_frac": 0.6799775028,
"autogenerated": false,
"ratio": 3.065517241... |
__author__ = 'namukhtar'
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
s = pd.Series([1,3,5,np.nan,6,8])
s
dates = pd.date_range('20130101',periods=6)
dates
df = pd.DataFrame(np.random.randn(6,4),index=dates,columns=list('ABCD'))
print df
df2 = pd.DataFrame({ 'A' : 1.,
... | {
"repo_name": "Chaparqanatoos/kaggle-knowledge",
"path": "src/main/python/pandas_test.py",
"copies": "1",
"size": "4853",
"license": "apache-2.0",
"hash": -1337836829844916200,
"line_mean": 23.6345177665,
"line_max": 121,
"alpha_frac": 0.5742839481,
"autogenerated": false,
"ratio": 2.624661979448... |
__author__ = 'namukhtar'
"""
import IPython
import sklearn as sk
import numpy as np
import matplotlib
import nltk
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_olivetti_faces
faces = fetch_olivetti_faces()
print faces.DESCR
print faces.keys()
print faces.images.shape
print faces.data.shape
pr... | {
"repo_name": "Chaparqanatoos/kaggle-knowledge",
"path": "src/main/python/scikitlearn_test.py",
"copies": "1",
"size": "3446",
"license": "apache-2.0",
"hash": 1837422149135831800,
"line_mean": 24.6940298507,
"line_max": 95,
"alpha_frac": 0.6542707728,
"autogenerated": false,
"ratio": 3.238005644... |
__author__ = 'Narongdej'
from operator import itemgetter
import os, sys, hashlib, time, urllib, cStringIO
from PIL import Image
import vectorspace
class CaptchaDecoder:
def __init__(self):
self.v = vectorspace.VectorSpace()
iconset = [x[1] for x in os.walk("iconset")][0]
self.imageset =... | {
"repo_name": "Zenyai/Simple-Captcha-Decoder",
"path": "captchadecoder/captchadecoder.py",
"copies": "1",
"size": "5071",
"license": "mit",
"hash": 5762604977760699000,
"line_mean": 27.8181818182,
"line_max": 96,
"alpha_frac": 0.4843226188,
"autogenerated": false,
"ratio": 4.112733171127331,
"c... |
__author__ = 'nash.xiejun'
import json
import os
import sys
import traceback
from keystoneclient.v2_0.endpoints import Endpoint
from nova.proxy import clients
from nova.proxy import compute_context
# from install_tool import cps_server, fsutils, fs_system_util
# TODO:
sys.path.append('/usr/bin/install_tool')
import c... | {
"repo_name": "hgqislub/hybird-orchard",
"path": "etc/hybrid_cloud/scripts/patches/patches_tool/services.py",
"copies": "3",
"size": "24656",
"license": "apache-2.0",
"hash": -4497770530237651000,
"line_mean": 36.5281582953,
"line_max": 192,
"alpha_frac": 0.6009490591,
"autogenerated": false,
"ra... |
__author__ = 'nash.xiejun'
import log
import os
import stat
import time
import config
import utils
from constants import PatchFilePath
from dispatch import DispatchPatchTool
from services import RefCPSService, CPSServiceBusiness
from utils import SSHConnection
logger = log
print_logger = log
class InstallerBase(obj... | {
"repo_name": "Hybrid-Cloud/cloud_manager",
"path": "etc/hybrid_cloud/scripts/patches/patches_tool/patches_tool.py",
"copies": "3",
"size": "7801",
"license": "apache-2.0",
"hash": -1125716808130521500,
"line_mean": 39.2113402062,
"line_max": 133,
"alpha_frac": 0.5983848225,
"autogenerated": false,... |
__author__ = 'nash.xiejun'
import sys
import os
import traceback
import json
from keystoneclient.v2_0.endpoints import Endpoint
from novaclient import client as nova_client
from nova.proxy import clients
from nova.proxy import compute_context
from constants import SysUserInfo
# from install_tool import cps_server, fs... | {
"repo_name": "Hybrid-Cloud/badam",
"path": "patches_tool/services.py",
"copies": "1",
"size": "23721",
"license": "apache-2.0",
"hash": -5409323300647180000,
"line_mean": 35.8911353033,
"line_max": 192,
"alpha_frac": 0.6042746933,
"autogenerated": false,
"ratio": 3.661778326644026,
"config_tes... |
__author__ = 'nash.xiejun'
import logging
import traceback
import os
from oslo.config import cfg
from common import config
from common.engineering_logging import log_for_func_of_class
import utils
from utils import AllInOneUsedCMD, print_log, ELog
from common.config import ConfigCommon
from services import RefServi... | {
"repo_name": "Hybrid-Cloud/badam",
"path": "engineering/engineering_factory.py",
"copies": "1",
"size": "22280",
"license": "apache-2.0",
"hash": -2142681837687326200,
"line_mean": 39.0017953321,
"line_max": 144,
"alpha_frac": 0.5929084381,
"autogenerated": false,
"ratio": 3.850674040788109,
"... |
__author__ = 'nash.xiejun'
import os
import logging
import traceback
import sys
from utils import get_hybrid_cloud_badam_path
sys.path.append(get_hybrid_cloud_badam_path())
from keystoneclient.v2_0 import client as keystone_client
from keystoneclient.v2_0.endpoints import Endpoint
from utils import print_log, ELog
f... | {
"repo_name": "Hybrid-Cloud/badam",
"path": "engineering/services.py",
"copies": "1",
"size": "9029",
"license": "apache-2.0",
"hash": -4657884070131149000,
"line_mean": 36.7782426778,
"line_max": 192,
"alpha_frac": 0.6081515118,
"autogenerated": false,
"ratio": 3.8437633035334184,
"config_test... |
__author__ = 'nash.xiejun'
import subprocess
import logging
import sys
import traceback
import os
class ELog(object):
def __init__(self, module_logger):
self.module_logger = module_logger
def info(self, log_contents, *args):
self.module_logger.info(log_contents, *args)
print(log_cont... | {
"repo_name": "Hybrid-Cloud/badam",
"path": "engineering/utils.py",
"copies": "1",
"size": "5310",
"license": "apache-2.0",
"hash": -8422928259200586000,
"line_mean": 32.19375,
"line_max": 124,
"alpha_frac": 0.5903954802,
"autogenerated": false,
"ratio": 3.73943661971831,
"config_test": false,
... |
__author__ = 'nash.xiejun'
import os
class FileName(object):
PATCHES_TOOL_CONFIG_FILE = 'patches_tool_config.ini'
class CfgFilePath(object):
HYBRID_CLOUD_CONFIG_FILES = 'hybrid_cloud_config_files'
# 'neutron-l2-proxy.json'
NEUTRON_L2_PROXY_JSON_FILE = 'neutron-l2-proxy.json'
# '/etc/neut... | {
"repo_name": "Hybrid-Cloud/badam",
"path": "patches_tool/constants.py",
"copies": "1",
"size": "3583",
"license": "apache-2.0",
"hash": 4726314822743530000,
"line_mean": 42.2592592593,
"line_max": 116,
"alpha_frac": 0.6603404968,
"autogenerated": false,
"ratio": 2.654074074074074,
"config_test... |
__author__ = 'Natalia.Nikonova'
# -*- coding: utf-8 -*-
class GroupHelper:
def __init__(self, app):
self.app = app
def return_to_groups_page(self):
# return to groups page
wd = self.app.wd
wd.find_element_by_link_text("group page").click()
def create(self, grou... | {
"repo_name": "natalianik/python_training",
"path": "fixture/group.py",
"copies": "1",
"size": "3177",
"license": "apache-2.0",
"hash": -8504739690452480000,
"line_mean": 34.5402298851,
"line_max": 100,
"alpha_frac": 0.5807365439,
"autogenerated": false,
"ratio": 3.5143805309734515,
"config_tes... |
__author__ = 'Natalia.Nikonova'
# -*- coding: utf-8 -*-
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_nam... | {
"repo_name": "natalianik/python_training",
"path": "fixture/session.py",
"copies": "1",
"size": "1412",
"license": "apache-2.0",
"hash": -4313760377464531000,
"line_mean": 30.8372093023,
"line_max": 87,
"alpha_frac": 0.5446175637,
"autogenerated": false,
"ratio": 3.4271844660194173,
"config_te... |
__author__ = 'Natalia.Nikonova'
# -*- coding: utf-8 -*-
class ContactHelper:
def __init__(self, app):
self.app = app
def fill_contact_form(self, contact):
wd = self.app.wd
self.change_field_value("firstname", contact.firstname)
self.change_field_value("middlename", ... | {
"repo_name": "natalianik/python_training",
"path": "fixture/contact.py",
"copies": "1",
"size": "5038",
"license": "apache-2.0",
"hash": -5621851835878770000,
"line_mean": 45.5471698113,
"line_max": 105,
"alpha_frac": 0.6151250496,
"autogenerated": false,
"ratio": 3.5083565459610027,
"config_t... |
__author__ = 'Natalia.Nikonova'
from model.contact import contact
def test_edit_first_contact(app):
if app.contact.count() == 0:
app.contact.create_new(contact(firstname="Natalia", middlename="V.", lastname="Nikonova",
nickname="natalian", title="engineer", company="PS", address... | {
"repo_name": "natalianik/python_training",
"path": "test/test_edit_contact.py",
"copies": "1",
"size": "1117",
"license": "apache-2.0",
"hash": -7483954662735863000,
"line_mean": 67.9375,
"line_max": 119,
"alpha_frac": 0.6078782453,
"autogenerated": false,
"ratio": 3.501567398119122,
"config_t... |
__author__ = 'Natalie'
import os
from re import search
from time import sleep
from sys import stderr
from copy import copy
import AzureTools
import AzureSimulation
from AzureTools import comp_user
from AzureSimulation import sms, blob_service
class AzureUser:
def _... | {
"repo_name": "vecnet/vecnet.azure",
"path": "AzureUser.py",
"copies": "1",
"size": "16648",
"license": "mpl-2.0",
"hash": 6876250211109919000,
"line_mean": 38.0798122066,
"line_max": 124,
"alpha_frac": 0.4983781836,
"autogenerated": false,
"ratio": 4.663305322128852,
"config_test": false,
"h... |
__author__ = 'Natalie'
import os
from time import sleep
from sys import stderr
from copy import copy
from azure import *
from validate_email import validate_email
import AzureUser
from AzureSimulation import sms, blob_service
from AzureTools import comp_user
class Azure... | {
"repo_name": "vecnet/vecnet.azure",
"path": "AzureUserPool.py",
"copies": "1",
"size": "11855",
"license": "mpl-2.0",
"hash": -8136160250721418000,
"line_mean": 34.3880597015,
"line_max": 127,
"alpha_frac": 0.4976803037,
"autogenerated": false,
"ratio": 4.761044176706827,
"config_test": false,... |
__author__ = 'Natalie'
import os
import contextlib
import shutil
from subprocess import Popen
from getpass import getuser
import Tkinter as tk
import sys
from threading import Lock
class subscriptionDialog:
def __init__(self):
# Acquire Lock
mutex.acquire();
self.root = tk.Tk()
... | {
"repo_name": "vecnet/vecnet.azure",
"path": "setup.py",
"copies": "1",
"size": "5697",
"license": "mpl-2.0",
"hash": -9142893144362000000,
"line_mean": 32.5117647059,
"line_max": 122,
"alpha_frac": 0.5439705108,
"autogenerated": false,
"ratio": 4.0461647727272725,
"config_test": false,
"has_... |
__author__ = 'Natalie'
import os
import zipfile
from getpass import getuser
from time import localtime
import shutil
# The current user on the computer; used to access the right folder under C:/Users
comp_user = getuser()
def timestamp():
"""
Creates a timestamp
:return: stamp
"""
# Simulatio... | {
"repo_name": "vecnet/vecnet.azure",
"path": "AzureTools.py",
"copies": "1",
"size": "2889",
"license": "mpl-2.0",
"hash": -7581838213973466000,
"line_mean": 25.2636363636,
"line_max": 88,
"alpha_frac": 0.5721703011,
"autogenerated": false,
"ratio": 3.689655172413793,
"config_test": false,
"h... |
__author__ = 'Natalie'
import Tkinter as tk
class MyDialog:
def __init__(self):
#top = self.top = tk.Toplevel(parent)
self.root = tk.Tk()
self.myLabel1 = tk.Label(self.root, text='Enter Azure Subscription Name:')
self.myLabel1.pack()
self.myEntryBox1 = tk.Entry(self.root)... | {
"repo_name": "vecnet/vecnet.azure",
"path": "tkinter_test.py",
"copies": "1",
"size": "1532",
"license": "mpl-2.0",
"hash": -1116986929307640700,
"line_mean": 25.4137931034,
"line_max": 84,
"alpha_frac": 0.6501305483,
"autogenerated": false,
"ratio": 3.481818181818182,
"config_test": false,
... |
__author__ = 'nata'
from model.contact import Contact
testdata = [
Contact(first_name="First Name 1", middle_name="Middle Name 1", last_name="Last Name 1", nickname="Nickname 1",
title="Title 1", company="Company 1", address="Address 1 1", home_phone="+9999999991",
mobile_phone="+999999999... | {
"repo_name": "ilnatvl/python_training",
"path": "data/contacts.py",
"copies": "1",
"size": "1100",
"license": "apache-2.0",
"hash": -4069315348435213300,
"line_mean": 67.75,
"line_max": 115,
"alpha_frac": 0.6481818182,
"autogenerated": false,
"ratio": 3.559870550161812,
"config_test": false,
... |
__author__ = 'nata'
from pony.orm import *
from datetime import datetime
from model.group import Group
from model.contact import Contact
from pymysql.converters import decoders
class ORMFixture:
db = Database()
class ORMGroup(db.Entity):
_table_ = 'group_list'
id = PrimaryKey(int, column='gr... | {
"repo_name": "ilnatvl/python_training",
"path": "fixture/orm.py",
"copies": "1",
"size": "4022",
"license": "apache-2.0",
"hash": 3459175125130923500,
"line_mean": 44.191011236,
"line_max": 115,
"alpha_frac": 0.6364992541,
"autogenerated": false,
"ratio": 3.859884836852207,
"config_test": fals... |
__author__ = 'nata'
import mysql.connector
from model.group import Group
from model.contact import Contact
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection = mysql.c... | {
"repo_name": "ilnatvl/python_training",
"path": "fixture/db.py",
"copies": "1",
"size": "2126",
"license": "apache-2.0",
"hash": -960200638322607700,
"line_mean": 42.4081632653,
"line_max": 117,
"alpha_frac": 0.5790216369,
"autogenerated": false,
"ratio": 4.201581027667984,
"config_test": fals... |
__author__ = 'nata'
import jsonpickle
import os.path
import getopt
import sys
from model.group import Group
from generator import random_string
n = 3
f = "data/groups.json"
testdata = [Group(name="", header="", footer="")] + [
Group(name=random_string("name", 10), header=random_string("header"), footer=random_st... | {
"repo_name": "ilnatvl/python_training",
"path": "generator/groups.py",
"copies": "1",
"size": "1121",
"license": "apache-2.0",
"hash": 4483978016625033700,
"line_mean": 23.9111111111,
"line_max": 105,
"alpha_frac": 0.5762711864,
"autogenerated": false,
"ratio": 3.407294832826748,
"config_test"... |
__author__ = 'nata'
import jsonpickle
import random
import string
import os.path
import getopt
import sys
from model.contact import Contact
from generator import random_string
n = 3
f = "data/contacts.json"
def random_multiline_text(prefix, maxrows=5):
return prefix + random_string("") + "\n".join([random_strin... | {
"repo_name": "ilnatvl/python_training",
"path": "generator/contacts.py",
"copies": "1",
"size": "3106",
"license": "apache-2.0",
"hash": -2154378857479110100,
"line_mean": 35.1162790698,
"line_max": 122,
"alpha_frac": 0.5859626529,
"autogenerated": false,
"ratio": 3.7466827503015683,
"config_t... |
__author__ = 'nate'
import re
import json
import time
import smtplib
import email.MIMEMultipart
import email.MIMEText
from random import choice
import subprocess
class Email(object):
@staticmethod
def prettifyit(input_json):
json_dict = json.loads(input_json)
out = "%20s\t%s\r\n%20s\t%20... | {
"repo_name": "nseifert/octowolf_queue",
"path": "octoqueue/Email.py",
"copies": "1",
"size": "3986",
"license": "mit",
"hash": 1247401991334866000,
"line_mean": 32.7796610169,
"line_max": 114,
"alpha_frac": 0.5597089814,
"autogenerated": false,
"ratio": 3.5088028169014085,
"config_test": false... |
__author__ = 'nate'
import time
from random import choice
import json
class Job(object):
# Potential variables needed for Job:
# 1) Username
# 2) Gaussian input file name / path
# 3) Gaussian output file name / path
# 4) Time & Date for input file submission
# 5) E-mail address
DEFAULT_IN... | {
"repo_name": "nseifert/octowolf_queue",
"path": "octoqueue/Job.py",
"copies": "1",
"size": "2613",
"license": "mit",
"hash": -4062229832402438700,
"line_mean": 40.4761904762,
"line_max": 120,
"alpha_frac": 0.6023727516,
"autogenerated": false,
"ratio": 3.225925925925926,
"config_test": false,
... |
__author__ = "Nathan I. Budd"
__email__ = "nibudd@gmail.com"
__copyright__ = "Copyright 2017, LASR Lab"
__license__ = "MIT"
__version__ = "0.1"
__status__ = "Production"
__date__ = "14 Apr 2017"
class SplineOrd3():
"""3rd order spline that matches initial and final position and velocity.
Given an initial and... | {
"repo_name": "lasr/orbital_elements",
"path": "utilities/spline_ord3.py",
"copies": "1",
"size": "1656",
"license": "mit",
"hash": -6264998910226849000,
"line_mean": 24.875,
"line_max": 79,
"alpha_frac": 0.51147343,
"autogenerated": false,
"ratio": 3.4074074074074074,
"config_test": false,
"... |
__author__ = "Nathan I. Budd"
__email__ = "nibudd@gmail.com"
__copyright__ = "Copyright 2017, LASR Lab"
__license__ = "MIT"
__version__ = "0.1"
__status__ = "Production"
__date__ = "16 Mar 2017"
class SystemDynamics():
"""Combines plant dynamics and multiple perturbations into a single system.
A callable obj... | {
"repo_name": "lasr/orbital_elements",
"path": "utilities/system_dynamics.py",
"copies": "1",
"size": "1747",
"license": "mit",
"hash": 439336302189990800,
"line_mean": 31.3518518519,
"line_max": 79,
"alpha_frac": 0.6021751574,
"autogenerated": false,
"ratio": 3.9704545454545452,
"config_test":... |
import argparse
import sys
import time
def accuracy(tp, fp, tn, fn):
if tp == 0 and fp == 0 and tn == 0 and fn == 0:
return 0.0
else:
return float(tp + tn) / float(tp + fp + tn + fn)
def f1score(precis, recall):
if precis == 0.0 and recall == 0.0:
return 0.0
else:
r... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "utility/aucroc.py",
"copies": "1",
"size": "3824",
"license": "mit",
"hash": -2614922559638865400,
"line_mean": 34.4166666667,
"line_max": 120,
"alpha_frac": 0.5951882845,
"autogenerated": false,
"ratio": 3.6911196911196913,
"config_test"... |
import argparse
import sys
import time
def parseargs(): # handle user arguments
parser = argparse.ArgumentParser(description='Generates area under curve based on predicted vs actual labels')
parser.add_argument('--fasta', default='NONE', help='Location of fasta file.')
parser.add_argument('--output', ... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "utility/seedPrinter.py",
"copies": "1",
"size": "1459",
"license": "mit",
"hash": -3008521709751667700,
"line_mean": 30.0638297872,
"line_max": 114,
"alpha_frac": 0.593557231,
"autogenerated": false,
"ratio": 3.7797927461139897,
"config_t... |
import argparse
import os
import sys
import time
def parseargs(): # handle user arguments
parser = argparse.ArgumentParser(description='Limit the number of reads per cluster in patient files.')
parser.add_argument('--fasta', default='NONE', help='Location of input FASTA file. Required.')
parser.add_ar... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "utility/clusterLimiter.py",
"copies": "1",
"size": "3036",
"license": "mit",
"hash": -3253711776068881000,
"line_mean": 37.9358974359,
"line_max": 116,
"alpha_frac": 0.5777338603,
"autogenerated": false,
"ratio": 3.9326424870466323,
"conf... |
import argparse
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import shlex
import subprocess
import sys
import time
def graph(title, xaxis, yaxis, names, values, results, outdir, verbose): # graph the plots
if verbose:
print "Plotting graph: " + title
plt.figure... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "utility/plotter.py",
"copies": "1",
"size": "7227",
"license": "mit",
"hash": -695734984041151400,
"line_mean": 42.5421686747,
"line_max": 120,
"alpha_frac": 0.5508509755,
"autogenerated": false,
"ratio": 3.9578313253012047,
"config_test"... |
import argparse
import math
import numpy as np
import random
import sys
import time
def similarity(i, j): # similarity measure (0 to 1) between instances i and j
norm = 0.0 # the squared 2-norm of the difference between the two instance vectors, computed in for loop below
for k in range(len(i)):
... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "cirrhosisTests/gicf.py",
"copies": "1",
"size": "16753",
"license": "mit",
"hash": -4555596369079321000,
"line_mean": 42.9737532808,
"line_max": 119,
"alpha_frac": 0.5862830538,
"autogenerated": false,
"ratio": 3.7630278526504943,
"config... |
import argparse
import math
import random
import sys
import time
def similarity(i, j): # similarity measure (0 to 1) between instances i and j
norm = 0.0 # the squared 2-norm of the difference between the two instance vectors, computed in for loop below
for k in range(len(i)):
norm += (i[k] - j... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "cirrhosisTests/bak/gicf.py",
"copies": "1",
"size": "17810",
"license": "mit",
"hash": -1948056197575027700,
"line_mean": 44.9046391753,
"line_max": 118,
"alpha_frac": 0.601459854,
"autogenerated": false,
"ratio": 3.7901681208767823,
"con... |
import argparse
import shlex
import subprocess
import sys
def parseargs(): # handle user arguments
parser = argparse.ArgumentParser(description='Bulk NCBI download script')
parser.add_argument('--start', default='NONE', help='NCBI SRA run number to start on. Required.')
parser.add_argument('--end', de... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "bak/bulkNCBIDownload.py",
"copies": "1",
"size": "3075",
"license": "mit",
"hash": 302719290448743800,
"line_mean": 47.8095238095,
"line_max": 120,
"alpha_frac": 0.5749593496,
"autogenerated": false,
"ratio": 3.4628378378378377,
"config_t... |
import argparse
import os
import shlex
import subprocess
import sys
import time
def option1(indir, output, alpha, alphaopt, uclustid, uclustpath, verbose):
print indir + output + alpha + alphaopt + uclustid + uclustpath + verbose
print "Option not yet implemented."
def option2(indir, output, alpha, alphaop... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "bak/clusterRepT2D.py",
"copies": "2",
"size": "12039",
"license": "mit",
"hash": 746260901972609200,
"line_mean": 50.0127118644,
"line_max": 120,
"alpha_frac": 0.5326023756,
"autogenerated": false,
"ratio": 4.097685500340368,
"config_test... |
import argparse
import os
import shlex
import subprocess
import sys
import time
def option1(indir, output, alpha, alphaopt, verbose):
# this option simply combines 1/alpha reads from each fasta file without clustering
# output is thus in fasta format, not uclust or other clustering format
if alphaopt == ... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "cirrhosisTests/clusterRepT2D.py",
"copies": "2",
"size": "13035",
"license": "mit",
"hash": 2463463351006754300,
"line_mean": 49.1346153846,
"line_max": 120,
"alpha_frac": 0.5304181051,
"autogenerated": false,
"ratio": 4.145992366412214,
... |
import argparse
import os
import shlex
import subprocess
import sys
import time
def option1(indir, output, alpha, uclustid, uclustpath, verbose):
print indir + output + alpha + uclustid + uclustpath + verbose
print "Option not yet implemented."
def option2(indir, output, alpha, uclustid, uclustpath, verbos... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "cirrhosisTests/bak/clusterRep.py",
"copies": "1",
"size": "9754",
"license": "mit",
"hash": 7541108139969778000,
"line_mean": 47.775,
"line_max": 120,
"alpha_frac": 0.555874513,
"autogenerated": false,
"ratio": 4.005749486652977,
"config_... |
import argparse
import os
import shlex
import subprocess
import sys
import time
import numpy
import misvm
def parseargs(): # handle user arguments
parser = argparse.ArgumentParser(description='Classify fasta-format sequence reads')
parser.add_argument('--bow', default='d', choices=['d', 'h'], help='Dista... | {
"repo_name": "nlapier2/multiInstanceLearning",
"path": "pipelineT2D.py",
"copies": "2",
"size": "20639",
"license": "mit",
"hash": 7363852166255508000,
"line_mean": 46.6651270208,
"line_max": 120,
"alpha_frac": 0.5675662581,
"autogenerated": false,
"ratio": 3.879511278195489,
"config_test": tr... |
__author__ = 'nathan.muir'
from celery import Celery
from state import State
from camera import CameraFactory
from pprint import PrettyPrinter
pp = PrettyPrinter()
def noop(x):
pass
class TaskMonitor(object):
def __init__(self, broker=None, camera='celery_cloudwatch.PrintCamera',
verbose=Fals... | {
"repo_name": "mwaaas/celery-cloudwatch",
"path": "celery_cloudwatch/task_monitor.py",
"copies": "1",
"size": "1623",
"license": "mit",
"hash": -5302762122468696000,
"line_mean": 32.1224489796,
"line_max": 91,
"alpha_frac": 0.5804066543,
"autogenerated": false,
"ratio": 4.25984251968504,
"confi... |
__author__ = 'nathan.muir'
class Stats(object):
def __init__(self, samplecount=0, total=0.0, minimum=None, maximum=None):
self.samplecount = samplecount
self.sum = total
self.minimum = minimum
self.maximum = maximum
def __iadd__(self, value):
if isinstance(value, Stats)... | {
"repo_name": "mwaaas/celery-cloudwatch",
"path": "celery_cloudwatch/stats.py",
"copies": "2",
"size": "1361",
"license": "mit",
"hash": 6463153742670448000,
"line_mean": 31.4047619048,
"line_max": 113,
"alpha_frac": 0.5709037472,
"autogenerated": false,
"ratio": 4.099397590361446,
"config_test... |
__author__ = 'nathan.muir'
from collections import defaultdict
import threading
from stats import Stats
import sys, traceback
class State(object):
def __init__(self):
self._mutex = threading.Lock()
# track the number of events in the current window
self.totals = defaultdict(lambda: defa... | {
"repo_name": "fergalwalsh/celery-cloudwatch",
"path": "celery_cloudwatch/state.py",
"copies": "1",
"size": "4792",
"license": "mit",
"hash": 8894340113270789000,
"line_mean": 35.030075188,
"line_max": 115,
"alpha_frac": 0.5181552588,
"autogenerated": false,
"ratio": 4.3603275705186535,
"config... |
__author__ = 'nathan.muir'
from celery.utils.timer2 import Timer
from celery.utils.dispatch import Signal
from import_class import import_class
class CameraFactory(object):
def __init__(self, class_name):
self.c = import_class(class_name)
def camera(self, state, config):
return self.c(stat... | {
"repo_name": "mwaaas/celery-cloudwatch",
"path": "celery_cloudwatch/camera.py",
"copies": "2",
"size": "1310",
"license": "mit",
"hash": -7356256474193920000,
"line_mean": 22.3928571429,
"line_max": 75,
"alpha_frac": 0.6083969466,
"autogenerated": false,
"ratio": 3.598901098901099,
"config_tes... |
__author__ = 'Nathan Seifert'
import numpy as np
import os
import subprocess
import datetime
class Calpgm:
# Common parameters for CALPGM.
PARAMS_RIGID = {'A': 10000, 'B': 20000, 'C': 30000}
PARAMS_QUART_A = {'-DelJ': 200, '-DelJK': 1100, '-DelK': 2000,
'-delJ': 40100, '-delK': 4100... | {
"repo_name": "nseifert/autofit2",
"path": "calpgm/calpgm.py",
"copies": "1",
"size": "3629",
"license": "mit",
"hash": -6834902339334926000,
"line_mean": 32.9158878505,
"line_max": 84,
"alpha_frac": 0.5489115459,
"autogenerated": false,
"ratio": 3.6992864424057084,
"config_test": false,
"has... |
__author__ = 'nati'
import logging
import boto.ec2
from garbo import config
_resource_collectors = set()
def aws_collector(conn_obj=None):
"""
Collect AWS collectors to a global module set
:param conn_obj: AWS connection function (default: EC2 connection)
"""
def wrap(f):
def wrapped... | {
"repo_name": "natict/garbo",
"path": "garbo/discovery/aws/utils.py",
"copies": "1",
"size": "1891",
"license": "mit",
"hash": 4439626988821021000,
"line_mean": 30.5166666667,
"line_max": 79,
"alpha_frac": 0.5668958223,
"autogenerated": false,
"ratio": 4.066666666666666,
"config_test": false,
... |
import pickle
from pprint import pprint
from time import time
import sys
from collections import defaultdict
class Business:
def __init__(self, business_id, stars, name, categories):
self.id = business_id
self.stars = stars
self.name = name
self.categories = categories
self.cleanReviews = [] #List of list o... | {
"repo_name": "njetty/Yelp-Review-Analysis",
"path": "Task1/CategoryCount.py",
"copies": "1",
"size": "1085",
"license": "mit",
"hash": -2072043753688365800,
"line_mean": 26.125,
"line_max": 62,
"alpha_frac": 0.7437788018,
"autogenerated": false,
"ratio": 3.511326860841424,
"config_test": false... |
from org.gluu.service.cdi.util import CdiUtil
from org.gluu.oxauth.security import Identity
from org.gluu.model.custom.script.type.auth import PersonAuthenticationType
from org.gluu.oxauth.service import AuthenticationService, UserService
from org.gluu.oxauth.model.common import User
from org.gluu.util import StringHe... | {
"repo_name": "GluuFederation/oxAuth",
"path": "Server/integrations/azuread/AzureADAuthenticationForGluu.py",
"copies": "1",
"size": "12502",
"license": "mit",
"hash": -4804012208977860000,
"line_mean": 45.1365313653,
"line_max": 146,
"alpha_frac": 0.650055991,
"autogenerated": false,
"ratio": 4.... |
__author__ = 'naveen'
#!/usr/bin/env python
import logging
import httplib2
import time
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run
from goto.instance import Instance
from goto.image import Image
from goto.ramdisk import Ramdisk
from... | {
"repo_name": "naviens/goto",
"path": "goto/connection.py",
"copies": "1",
"size": "19075",
"license": "apache-2.0",
"hash": -251372008162898800,
"line_mean": 29.9659090909,
"line_max": 137,
"alpha_frac": 0.5789252949,
"autogenerated": false,
"ratio": 4.224806201550388,
"config_test": false,
... |
__author__ = 'naveen'
#!/usr/bin/env python
import logging
import sys
import argparse
import httplib2
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client import tools
from oauth2client.tools import run_flow
from apiclient.discovery import build
CLIENT_SECRET... | {
"repo_name": "naviens/oneclick",
"path": "gce/hello.py",
"copies": "1",
"size": "1094",
"license": "apache-2.0",
"hash": 480938963627856600,
"line_mean": 26.35,
"line_max": 65,
"alpha_frac": 0.7486288848,
"autogenerated": false,
"ratio": 3.586885245901639,
"config_test": false,
"has_no_keywo... |
__author__ = 'nb254'
from collections import Counter
import csv, time
import pandas as pd
POSTID_INDEX = 0
USERID_INDEX = 1
TIME_POSTED_INDEX = 2
POST_TYPE_INDEX = 3
def SaveStatToCSV(file_name, data, header):
with open(file_name, 'wb') as myfile:
wr = csv.writer(myfile)
wr.writerow(h... | {
"repo_name": "Nik0l/UTemPro",
"path": "UsersActivity.py",
"copies": "1",
"size": "9237",
"license": "mit",
"hash": 7843826355453718000,
"line_mean": 36.856557377,
"line_max": 132,
"alpha_frac": 0.5793006387,
"autogenerated": false,
"ratio": 3.1439754935330155,
"config_test": false,
"has_no_k... |
__author__ = 'nb254'
import sqlite3
import numpy
import csv
import sys
sys.path.append("/mnt/nb254_data/src/utils/")
#import pandas as pd
from once import once, oncecleardb, onceprintdb, onceinit
DIR = '/mnt/nb254_data/db/'
def runquery(c,query,parameters=()):
c.execute(query,parameters)
return c.fetchall()
... | {
"repo_name": "Nik0l/UTemPro",
"path": "QueryDB.py",
"copies": "1",
"size": "11963",
"license": "mit",
"hash": -4113688841726604000,
"line_mean": 64.0163043478,
"line_max": 458,
"alpha_frac": 0.7135333946,
"autogenerated": false,
"ratio": 3.2928709055876686,
"config_test": false,
"has_no_keyw... |
__author__ = 'nb254'
import time
import csv
from datetime import date
import Features as feature
from time import mktime
from datetime import datetime
import pandas as pd
def dateWeekend(data):
data_w = []
for index in xrange(0, len(data)):
#print data['TimeAsked'][index]
sq = str(data['TimeA... | {
"repo_name": "Nik0l/UTemPro",
"path": "TimeFeatures.py",
"copies": "1",
"size": "2181",
"license": "mit",
"hash": -2935217683392182300,
"line_mean": 34.1774193548,
"line_max": 104,
"alpha_frac": 0.5575424117,
"autogenerated": false,
"ratio": 3.183941605839416,
"config_test": false,
"has_no_k... |
__author__ = 'nb254'
import numpy as np
import pandas as pd
from sklearn import cluster
from sklearn.cluster import KMeans
from sklearn.neighbors import NearestNeighbors
from sklearn.neighbors import kneighbors_graph
import ClusteringPrediction as cp
import ClusteringSaveResults as csr
import DataPreprocessing as dp
... | {
"repo_name": "Nik0l/UTemPro",
"path": "ML/Clustering.py",
"copies": "1",
"size": "10761",
"license": "mit",
"hash": 2777898354476456000,
"line_mean": 38.2737226277,
"line_max": 111,
"alpha_frac": 0.6375801505,
"autogenerated": false,
"ratio": 3.4791464597478177,
"config_test": true,
"has_no_... |
__author__ = 'nb254'
import os
import QueryDB as query
import DecisionTree as tree
import util as util
import numpy as np
from Variables import header as header
from Variables import fn as fname
import pandas as pd
import UsersActivity as useractivity
import NLPFeatures as nlp
import TimeFeatures as timefeatures
impor... | {
"repo_name": "Nik0l/UTemPro",
"path": "FeatureExtractor.py",
"copies": "1",
"size": "13076",
"license": "mit",
"hash": -2829563894184424000,
"line_mean": 39.6086956522,
"line_max": 135,
"alpha_frac": 0.6714591618,
"autogenerated": false,
"ratio": 3.0781544256120528,
"config_test": false,
"ha... |
__author__ = 'nb254'
import pandas as pd
import FeatureSelector as fs
def mergePostFeatures(DIR):
df = pd.read_csv(DIR + 'posts/quest_stats.csv')
#print 'samples in posts before merging', len(df)
df1 = pd.read_csv(DIR + 'posts/nlp_features.csv')
df2 = pd.read_csv(DIR + 'posts/users_activity.csv')
... | {
"repo_name": "Nik0l/UTemPro",
"path": "MergeFeatures.py",
"copies": "1",
"size": "2611",
"license": "mit",
"hash": 2611455852841906000,
"line_mean": 34.7671232877,
"line_max": 84,
"alpha_frac": 0.6200689391,
"autogenerated": false,
"ratio": 2.7368972746331237,
"config_test": false,
"has_no_k... |
import argparse
import h5py
import numpy as np
import os
import sys
#from sklearn import cross_validation as skcv
DATA_DIR = "/share/data40T/chloe/SamSpecCoEN"
import CoExpressionNetwork
numFolds = 10
def main():
""" Create sample-specific co-expression networks for one fold and one repeat
of a subtype-... | {
"repo_name": "chagaz/SamSpecCoEN",
"path": "code/setupSubtypeStratifiedCV_computeNetworks.py",
"copies": "1",
"size": "4164",
"license": "mit",
"hash": -6990907777209772000,
"line_mean": 39.8235294118,
"line_max": 99,
"alpha_frac": 0.63376561,
"autogenerated": false,
"ratio": 3.7581227436823106,... |
import argparse
import h5py
import numpy as np
import os
import sys
from sklearn import cross_validation as skcv
DATA_DIR = "/share/data40T/chloe/SamSpecCoEN"
#import CoExpressionNetwork
numFolds = 10
def main():
""" Create train/test indices for one repeat of a subtype-stratified CV
on the RFS data.
... | {
"repo_name": "chagaz/SamSpecCoEN",
"path": "code/setupSubtypeStratifiedCV_writeIndices.py",
"copies": "1",
"size": "4115",
"license": "mit",
"hash": 4328898671165141500,
"line_mean": 34.7826086957,
"line_max": 99,
"alpha_frac": 0.6051032807,
"autogenerated": false,
"ratio": 3.565857885615251,
... |
import argparse
import h5py
import matplotlib # in a non-interactive environment
matplotlib.use('Agg') # in a non-interactive environment
import matplotlib.pyplot as plt
import numpy as np
import os
import scipy.stats as st
import sys
from sklearn import metrics as skm
orange_color = '#d66000'
blue_color = '#005599... | {
"repo_name": "chagaz/SamSpecCoEN",
"path": "code/OuterCrossVal.py",
"copies": "1",
"size": "27055",
"license": "mit",
"hash": 4389766378042555400,
"line_mean": 40.3053435115,
"line_max": 125,
"alpha_frac": 0.5652929218,
"autogenerated": false,
"ratio": 3.9629412626336604,
"config_test": true,
... |
import argparse
import string
import sys
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 16})
orange_color = '#d66000'
blue_color = '#005599'
def plot_numf(results_dir, figure_path, num_repeats=10):
""" Plot cross-validated number of selected features,
averaged over mul... | {
"repo_name": "chagaz/SamSpecCoEN",
"path": "code/create_plots.py",
"copies": "1",
"size": "16621",
"license": "mit",
"hash": 5635413850993457000,
"line_mean": 36.0178173719,
"line_max": 93,
"alpha_frac": 0.5117020637,
"autogenerated": false,
"ratio": 3.436220798015299,
"config_test": false,
... |
from picas.clients import CouchClient
from couchdb import Server
from picas.modifiers import BasicTokenModifier
from picas.actors import RunActor
from picas.iterators import BasicViewIterator
from SetUpGrid import SetUpRun, RunInstance, splitData
class ExampleActor(RunActor):
def __init__(self, iterator, modifier,... | {
"repo_name": "chStaiger/ACES-Training",
"path": "code/pipeline.py",
"copies": "1",
"size": "4213",
"license": "mit",
"hash": -6100351505545888000,
"line_mean": 40.7128712871,
"line_max": 111,
"alpha_frac": 0.6285307382,
"autogenerated": false,
"ratio": 4.200398803589232,
"config_test": false,
... |
#python imports
import pprint
# PiCaS imports
from picas.generators import TokenGenerator
from picas.clients import CouchClient
def generate_tokens(DataAndFeatureExtractors, nrRepeats, nrFolds, experiment):
"""
Generate all the tokens.
DataAndFeatureExtractors: list of tuples, (dataset, ((method, speci... | {
"repo_name": "chStaiger/ACES-Training",
"path": "code/CreateTokens.py",
"copies": "1",
"size": "4215",
"license": "mit",
"hash": -5937995739772421000,
"line_mean": 43.8404255319,
"line_max": 132,
"alpha_frac": 0.462633452,
"autogenerated": false,
"ratio": 5.017857142857143,
"config_test": fals... |
import numpy, json
import random
# Difference between the two classes:
#
# SingleGeneFeatureExtractorFactory: receives a training dataset and determines the possible features and their ranking
# SingleGeneFeatureExtractor: receives an order of features and determines their feature values given a dataset
clas... | {
"repo_name": "chStaiger/ACES-Training",
"path": "code/featureExtractors/SingleGenes/RandomGeneFeatureExtractor.py",
"copies": "1",
"size": "2219",
"license": "mit",
"hash": 2481020369488353300,
"line_mean": 40.0925925926,
"line_max": 171,
"alpha_frac": 0.7147363677,
"autogenerated": false,
"rati... |
__author__ = """N. Cullen <ncullen.th@dartmouth.edu>"""
from pyBN.classes.bayesnet import BayesNet
from pyBN.classes.factor import Factor
from pyBN.utils.graph import topsort
import numpy as np
def lw_sample(bn, evidence={}, target=None, n=1000):
"""
Approximate Marginal probabilities from
likelihood weighted s... | {
"repo_name": "ncullen93/pyBN",
"path": "pyBN/inference/marginal_approx/lw_sample.py",
"copies": "1",
"size": "2200",
"license": "mit",
"hash": -6112046025616795000,
"line_mean": 24.5930232558,
"line_max": 71,
"alpha_frac": 0.6054545455,
"autogenerated": false,
"ratio": 3.1073446327683616,
"con... |
__author__ = 'ndenev@gmail.com'
import json
import requests
import cerberus
from abc import ABCMeta, abstractmethod
from urllib import urlencode
from functools import partial
VERSION = '0.0.1'
class SeyrenException(Exception):
pass
class SeyrenAlertException(SeyrenException):
pass
class SeyrenCheckExcep... | {
"repo_name": "ndenev/PySeyrenApi",
"path": "seyren/seyren.py",
"copies": "1",
"size": "10469",
"license": "bsd-3-clause",
"hash": 5304692378986844000,
"line_mean": 36.6582733813,
"line_max": 135,
"alpha_frac": 0.4907823097,
"autogenerated": false,
"ratio": 4.274806043282973,
"config_test": fal... |
__author__ = 'Neil Butcher'
from PyQt4 import QtCore, QtGui
from datetime import datetime
class ComboDelegate(QtGui.QStyledItemDelegate):
def __init__(self, parent, itemslist):
QtGui.QItemDelegate.__init__(self, parent)
self.itemslist = itemslist
self.parent = parent
def createEditor(... | {
"repo_name": "ergoregion/Rota-Program",
"path": "Rota_System/UI/delegates.py",
"copies": "1",
"size": "3317",
"license": "mit",
"hash": -4705939428984452000,
"line_mean": 31.2038834951,
"line_max": 66,
"alpha_frac": 0.6638528791,
"autogenerated": false,
"ratio": 3.875,
"config_test": false,
... |
__author__ = 'Neil Butcher'
from collections import Counter
from Rota_System.StandardTimes import time_string, date_string
from datetime import timedelta
def person(a):
return a.person
def role(a):
return a.role
class CheckInformation(object):
def __init__(self, text):
self.text = text
... | {
"repo_name": "ergoregion/Rota-Program",
"path": "Rota_System/Evaluation/CheckingAlgorithms.py",
"copies": "1",
"size": "7809",
"license": "mit",
"hash": 2886429015649450000,
"line_mean": 36.1857142857,
"line_max": 159,
"alpha_frac": 0.5794595979,
"autogenerated": false,
"ratio": 3.76337349397590... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.