text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'ASUS'
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
wd.find_element_by_link_text("groups").click()
def create(self, group):
self.open_groups_page()
self.init_group_creation()
self.fil... | {
"repo_name": "alen4ik/python_training",
"path": "fixture/group.py",
"copies": "1",
"size": "2048",
"license": "apache-2.0",
"hash": 8689464730519984000,
"line_mean": 29.5820895522,
"line_max": 63,
"alpha_frac": 0.59375,
"autogenerated": false,
"ratio": 3.4478114478114477,
"config_test": false,... |
__author__ = 'Asus'
__author__ = 'Asus'
from IClassifier import IClassifier
from utilities import load_stf
from glove import Glove
from scipy.spatial.distance import cosine
from scipy.spatial.distance import euclidean
from nltk.corpus import wordnet as wn
class GloveWordnetRetrofitClassifier(IClassifier):
... | {
"repo_name": "dudenzz/word_embedding",
"path": "SimilarityClassification/Classifiers/GloveWordnetRetrofitClassifier.py",
"copies": "1",
"size": "2075",
"license": "mit",
"hash": 7949070969346828000,
"line_mean": 32.0163934426,
"line_max": 100,
"alpha_frac": 0.4968674699,
"autogenerated": false,
... |
__author__ = 'Asus'
from IClassifier import IClassifier
from utilities import load_stf
from glove import Glove
from scipy.spatial.distance import cosine
from scipy.spatial.distance import euclidean
import numpy as np
class GloveClassifier(IClassifier):
def __init__(self,k):
self.GloveInstance = N... | {
"repo_name": "dudenzz/word_embedding",
"path": "SimilarityClassification/Classifiers/HubnessNormalizedGloveClassifier.py",
"copies": "1",
"size": "1448",
"license": "mit",
"hash": -2464367086936393000,
"line_mean": 34.2,
"line_max": 107,
"alpha_frac": 0.6139502762,
"autogenerated": false,
"ratio... |
__author__ = 'Asus'
import time
from glove import Glove
import numpy as np
import io
def calculate_size(filename):
start = time.clock()
max = 0
with io.open(filename, 'r', encoding='utf-8') as savefile:
for i, line in enumerate(savefile):
if line.strip()... | {
"repo_name": "dudenzz/word_embedding",
"path": "SimilarityClassification/Utils/utilities.py",
"copies": "2",
"size": "1890",
"license": "mit",
"hash": -2085848145017212000,
"line_mean": 28.9836065574,
"line_max": 67,
"alpha_frac": 0.5142857143,
"autogenerated": false,
"ratio": 3.825910931174089,... |
__author__ = 'Atash'
from selenium.webdriver.support.ui import Select
import os
from model.contact import Contact
from selenium.webdriver.common.by import By
import re
class ContatHelper:
def __init__(self, app):
self.app = app
def add_new_contact_page(self):
wd = self.app.wd
wd.find... | {
"repo_name": "aalekperov/Task1",
"path": "fixture/contact.py",
"copies": "1",
"size": "9059",
"license": "apache-2.0",
"hash": 4447524462610200000,
"line_mean": 40.7511520737,
"line_max": 103,
"alpha_frac": 0.5984104206,
"autogenerated": false,
"ratio": 3.5567334118570866,
"config_test": false... |
__author__ = 'atash'
from sys import maxsize
class Contact:
def __init__(self, firstname=None, middlename=None, lastname=None, nickname=None,
photo_path=None, title=None,
company=None, company_address=None, home=None,
all_phones_from_home_page=None,
... | {
"repo_name": "aalekperov/Task1",
"path": "model/contact.py",
"copies": "1",
"size": "3213",
"license": "apache-2.0",
"hash": 2958461026120925000,
"line_mean": 49.21875,
"line_max": 166,
"alpha_frac": 0.5004668534,
"autogenerated": false,
"ratio": 3.9764851485148514,
"config_test": false,
"ha... |
__author__ = 'Atash'
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_name("user").clear()
wd.find_element_by_... | {
"repo_name": "aalekperov/Task1",
"path": "fixture/session.py",
"copies": "1",
"size": "1425",
"license": "apache-2.0",
"hash": -1768377598208185000,
"line_mean": 29.3191489362,
"line_max": 73,
"alpha_frac": 0.5649122807,
"autogenerated": false,
"ratio": 3.3608490566037736,
"config_test": false... |
__author__ = 'Atash'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_... | {
"repo_name": "aalekperov/Task1",
"path": "fixture/group.py",
"copies": "1",
"size": "3094",
"license": "apache-2.0",
"hash": 7817131440786895000,
"line_mean": 31.9255319149,
"line_max": 100,
"alpha_frac": 0.5875888817,
"autogenerated": false,
"ratio": 3.5039637599093996,
"config_test": false,
... |
__author__ = 'ataylor'
from pandas import DataFrame
import numpy as np
import warnings
def create_sounding_df(data=None, index=None, columns=None, dtype=None, copy=False):
df = DataFrame(data, index, columns, dtype, copy)
if 'pressure' not in df.columns:
df['pressure'] = np.nan
warnings.warn(... | {
"repo_name": "aktaylor08/skewtpy",
"path": "skewtpy/profile.py",
"copies": "1",
"size": "1706",
"license": "apache-2.0",
"hash": 964827880890642000,
"line_mean": 27.9152542373,
"line_max": 93,
"alpha_frac": 0.5603751465,
"autogenerated": false,
"ratio": 3.8080357142857144,
"config_test": false... |
__author__ = 'Atef Bellaaj'
__author__ = 'Bellaaj'
import collections
import nltk.metrics
import nltk.classify.util
from nltk.classify import NaiveBayesClassifier
from nltk.corpus import movie_reviews
neg_ids = movie_reviews.fileids('neg')
pos_ids = movie_reviews.fileids('pos')
from nltk.corpus import stopwords
stop... | {
"repo_name": "HaythemSahbani/Web-mining-university-project",
"path": "src/3-trained-classifier/Polarity_stop_words.py",
"copies": "1",
"size": "1937",
"license": "mit",
"hash": -5206195233096113000,
"line_mean": 34.2181818182,
"line_max": 102,
"alpha_frac": 0.7320598864,
"autogenerated": false,
... |
__author__ = 'athira'
import cv2
# Load an image and read it
img1 = cv2.imread('cat.jpg') #load the image
img2 = cv2.imread('cat.jpg', 0) #load the image in gray scale
cv2.imshow('image1', img1)
cv2.waitKey(0)
cv2.namedWindow('image2', cv2.WINDOW_NORMAL) # There is a special case where you can already create a wi... | {
"repo_name": "Farious/PersonTracker",
"path": "Source/readImage.py",
"copies": "1",
"size": "1053",
"license": "apache-2.0",
"hash": -7623888780767886000,
"line_mean": 30.9090909091,
"line_max": 113,
"alpha_frac": 0.7113010446,
"autogenerated": false,
"ratio": 2.908839779005525,
"config_test":... |
import os
import json
def make_standalone(fig):
'''This is used to wrap a fig with tex headers
'''
header = '\\documentclass[border=3mm]{standalone}\n'
header += '\\usepackage{pgfplots}\n'
header += '\\pgfplotsset{compat=newest}\n'
header += '\\pagestyle{empty}\n'
header += '\\begin{docume... | {
"repo_name": "AthrunArthur/pypgf",
"path": "pgf.py",
"copies": "1",
"size": "5399",
"license": "mit",
"hash": -1757050749636263700,
"line_mean": 23.5409090909,
"line_max": 88,
"alpha_frac": 0.4517503241,
"autogenerated": false,
"ratio": 3.399874055415617,
"config_test": false,
"has_no_keywor... |
__author__ = 'at'
from app import AfricasTalkingGateway, AfricasTalkingGatewayException
from app import settings
from app import logging
from urllib import urlencode
import requests
# redis queue
from rq.decorators import job
from redis import Redis
redis_conn = Redis()
from app.lib.witty import ask_wit
class Fetc... | {
"repo_name": "ianjuma/octopus",
"path": "app/api/_utils.py",
"copies": "2",
"size": "2423",
"license": "apache-2.0",
"hash": -7775597148978341000,
"line_mean": 24.5157894737,
"line_max": 97,
"alpha_frac": 0.5984316962,
"autogenerated": false,
"ratio": 3.8278041074249605,
"config_test": false,
... |
__author__ = 'AT'
from GPy.util.linalg import mdot
from mog_diag import MoG_Diag
from scipy.misc import logsumexp
from util import log_diag_gaussian
import numpy as np
from savigp import SAVIGP
class SAVIGP_Diag(SAVIGP):
"""
Implementation of the SAVIGP model in the case that posterior is the mixture of dia... | {
"repo_name": "adezfouli/savigp",
"path": "GP/savigp_diag.py",
"copies": "1",
"size": "3962",
"license": "apache-2.0",
"hash": -8126128708674861000,
"line_mean": 39.8453608247,
"line_max": 118,
"alpha_frac": 0.5254921757,
"autogenerated": false,
"ratio": 2.954511558538404,
"config_test": false,... |
__author__ = 'AT'
from GPy.util.linalg import mdot
import numpy as np
class MoG:
"""
A generic class for representing posterior distribution. MoG stands for mixture of Gaussians, and this class is
suitable when posterior is a mixture of Gaussians. The posterior distribution is as follows:
q(u) = \su... | {
"repo_name": "adezfouli/savigp",
"path": "GP/mog.py",
"copies": "1",
"size": "7239",
"license": "apache-2.0",
"hash": 6457086204631298000,
"line_mean": 30.6113537118,
"line_max": 128,
"alpha_frac": 0.577980384,
"autogenerated": false,
"ratio": 3.8,
"config_test": false,
"has_no_keywords": fa... |
__author__ = 'AT'
from savigp import SAVIGP
from GPy.util.linalg import mdot
from mog_single_comp import MoG_SingleComponent
import numpy as np
class SAVIGP_SingleComponent(SAVIGP):
"""
Implementation of SAVIGP in the case that the posterior covariance is full, and the mixture has only one component.
"""... | {
"repo_name": "adezfouli/savigp",
"path": "GP/savigp_single_comp.py",
"copies": "1",
"size": "2840",
"license": "apache-2.0",
"hash": 5281746222936914000,
"line_mean": 39.5714285714,
"line_max": 125,
"alpha_frac": 0.5654929577,
"autogenerated": false,
"ratio": 3.1243124312431245,
"config_test":... |
__author__ = 'AT'
from scipy.linalg import cho_solve, solve_triangular
from mog import MoG
from GPy.util.linalg import mdot
import math
import numpy as np
from util import chol_grad, pddet, jitchol, tr_AB
class MoG_SingleComponent(MoG):
"""
Implementation of posterior distribution when it is a single compone... | {
"repo_name": "adezfouli/savigp",
"path": "GP/mog_single_comp.py",
"copies": "1",
"size": "6040",
"license": "apache-2.0",
"hash": 1154992935167493600,
"line_mean": 37.2278481013,
"line_max": 118,
"alpha_frac": 0.5700331126,
"autogenerated": false,
"ratio": 2.965144820814924,
"config_test": fal... |
__author__ = 'AT'
from util import inv_chol
from GPy.util.linalg import mdot
from mog import MoG
import numpy as np
class MoG_Diag(MoG):
"""
Implementation of a posterior distribution where the covariance matrix is a mixture of diagonal Gaussians.
The class has to important internal field as follows:
... | {
"repo_name": "adezfouli/savigp",
"path": "GP/mog_diag.py",
"copies": "1",
"size": "4598",
"license": "apache-2.0",
"hash": 2010812814273499600,
"line_mean": 31.8428571429,
"line_max": 126,
"alpha_frac": 0.5428447151,
"autogenerated": false,
"ratio": 2.769879518072289,
"config_test": false,
"... |
__author__ = 'AT'
import math
from GPy.util.linalg import mdot
from numpy.ma import argsort, sort
from scipy.linalg import inv, det
from scipy.misc import logsumexp
from scipy.special import erfinv
from scipy.special._ufuncs import gammaln
import numpy as np
from util import cross_ent_normal
class Likelihood:
... | {
"repo_name": "adezfouli/savigp",
"path": "GP/likelihood.py",
"copies": "1",
"size": "16432",
"license": "apache-2.0",
"hash": 3025340559836770000,
"line_mean": 29.2058823529,
"line_max": 141,
"alpha_frac": 0.5311587147,
"autogenerated": false,
"ratio": 3.089302500470013,
"config_test": false,
... |
__author__ = 'AT'
from GPy.util.linalg import mdot
import math
from numpy.linalg import inv
from savigp_single_comp import SAVIGP_SingleComponent
from savigp import SAVIGP, Configuration
import numpy as np
class SAVIGP_Reparam(SAVIGP_SingleComponent):
def init_mog(self, init_m):
super(SAVIGP_SingleCompo... | {
"repo_name": "adezfouli/savigp",
"path": "GP/savigp_reparam.py",
"copies": "1",
"size": "4389",
"license": "apache-2.0",
"hash": 2554066154695920600,
"line_mean": 34.3951612903,
"line_max": 122,
"alpha_frac": 0.5165185692,
"autogenerated": false,
"ratio": 2.758642363293526,
"config_test": fals... |
__author__ = 'aus'
import facebook
import re
#mesaave
mesa_ave_id = "621422037868632"
#tarifamesaalicantemadridalicante
tarifa_mesa_alc_mad_alc_id = "256075921093789"
#https://www.facebook.com/groups/512002085573921/
ave_alc_mad_alc_id = "512002085573921"
access_token = "CAACEdEose0cBAFI6ll267OFJhCyc2kjbZCtBzoL681... | {
"repo_name": "albertoaus/facebook-utils",
"path": "version1.py",
"copies": "1",
"size": "2878",
"license": "apache-2.0",
"hash": -3419460071526091300,
"line_mean": 28.3673469388,
"line_max": 224,
"alpha_frac": 0.6296038916,
"autogenerated": false,
"ratio": 2.6847014925373136,
"config_test": fa... |
import numpy as np
from tensorflow.contrib.learn import TensorFlowDNNRegressor
import evolutionLearning as e
from trainingFunctions import addThem
# Initializes the Neural Network to evolve.
NN = TensorFlowDNNRegressor(hidden_units=[2], steps=5000)
# Evolves the neural network to learn the function.
# Params:
# NN:... | {
"repo_name": "derrowap/MA490-MachineLearning-FinalProject",
"path": "evolveAddThem.py",
"copies": "1",
"size": "1499",
"license": "mit",
"hash": 5071125132117359000,
"line_mean": 30.914893617,
"line_max": 78,
"alpha_frac": 0.6797865243,
"autogenerated": false,
"ratio": 3.3237250554323725,
"con... |
import numpy as np
import pandas as pd
from tensorflow.contrib import skflow
from sklearn.metrics import accuracy_score
from sklearn.cross_validation import train_test_split
# import threading
from trainingFunctions import addThem
# class myThread(threading.Thread):
# def __init__(self, size):
# threading.Thread._... | {
"repo_name": "derrowap/MA490-MachineLearning-FinalProject",
"path": "nnAddThem2.py",
"copies": "1",
"size": "3048",
"license": "mit",
"hash": 5727477442769801000,
"line_mean": 25.0598290598,
"line_max": 82,
"alpha_frac": 0.6617454068,
"autogenerated": false,
"ratio": 2.83271375464684,
"config_... |
import numpy as np
from tensorflow.contrib.learn import TensorFlowDNNRegressor
from trainingFunctions import fib
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import normalize
x = np.zeros(70)
y = np.zeros(70, dtype='int64')
for i in range(70):
x[i] = i + 1
y[i] = fib(i + 1)
x = normalize(x... | {
"repo_name": "derrowap/MA490-MachineLearning-FinalProject",
"path": "skFib.py",
"copies": "1",
"size": "1045",
"license": "mit",
"hash": 8778740807808165000,
"line_mean": 25.15,
"line_max": 78,
"alpha_frac": 0.6449760766,
"autogenerated": false,
"ratio": 3.011527377521614,
"config_test": false... |
import numpy as np
from tensorflow.contrib.learn import TensorFlowDNNRegressor
from trainingFunctions import multiply
from sklearn.metrics import accuracy_score
top = 20
x = np.zeros((top ** 2, 2))
y = np.zeros(top ** 2)
count = 0
for i in range(1, top+1):
for j in range(1, top+1):
x[count] = [i, j]
y[count] = m... | {
"repo_name": "derrowap/MA490-MachineLearning-FinalProject",
"path": "skMultiply.py",
"copies": "1",
"size": "1141",
"license": "mit",
"hash": 1625173426123785000,
"line_mean": 23.8260869565,
"line_max": 78,
"alpha_frac": 0.6275197195,
"autogenerated": false,
"ratio": 2.9407216494845363,
"confi... |
import tensorflow as tf
import numpy as np
from trainingFunctions import addThem
# ============================================================================
# START TENSORFLOW INTERACTIVE SESSION
# ============================================================================
"""TensorFlow uses a highly efficient C... | {
"repo_name": "derrowap/MA490-MachineLearning-FinalProject",
"path": "nnAddThem.py",
"copies": "1",
"size": "3710",
"license": "mit",
"hash": 8153697782086737000,
"line_mean": 35.0291262136,
"line_max": 78,
"alpha_frac": 0.6514824798,
"autogenerated": false,
"ratio": 3.438368860055607,
"config_... |
import tensorflow as tf
import numpy as np
from trainingFunctions import multiply
# ============================================================================
# START TENSORFLOW INTERACTIVE SESSION
# ============================================================================
"""TensorFlow uses a highly efficient ... | {
"repo_name": "derrowap/MA490-MachineLearning-FinalProject",
"path": "nnMultiply2.py",
"copies": "1",
"size": "3572",
"license": "mit",
"hash": 8430598625097149000,
"line_mean": 35.8350515464,
"line_max": 78,
"alpha_frac": 0.6522956327,
"autogenerated": false,
"ratio": 3.5366336633663367,
"conf... |
import tensorflow as tf
import numpy as np
from trainingFunctions import multiply
def one_hot(index):
"""Defines a one-hot encoding array for specified index.
Args:
index: The index in the array to assign as a 1.
Returns:
An array filled with zeros, except a 1 at the specified index.
"""
output = np.zeros(... | {
"repo_name": "derrowap/MA490-MachineLearning-FinalProject",
"path": "nnMultiply.py",
"copies": "1",
"size": "5066",
"license": "mit",
"hash": -8538565542291408000,
"line_mean": 37.0977443609,
"line_max": 78,
"alpha_frac": 0.645282274,
"autogenerated": false,
"ratio": 3.951638065522621,
"config... |
import tensorflow as tf
import numpy as np
from trainingFunctions import adder
# ============================================================================
# START TENSORFLOW INTERACTIVE SESSION
# ============================================================================
"""TensorFlow uses a highly efficient C++... | {
"repo_name": "derrowap/MA490-MachineLearning-FinalProject",
"path": "adderNN_v3.py",
"copies": "1",
"size": "4879",
"license": "mit",
"hash": -2907102527761652000,
"line_mean": 31.7516778523,
"line_max": 78,
"alpha_frac": 0.6495183439,
"autogenerated": false,
"ratio": 3.6302083333333335,
"conf... |
import numpy as np
from tensorflow.contrib.learn import TensorFlowDNNClassifier
from trainingFunctions import evenParity
from sklearn.metrics import accuracy_score
x = np.zeros((65536, 16), dtype='int32')
y = np.zeros(65536, dtype='int32')
for i in range(65536):
temp = bin(i)[2:].zfill(16)
x[i] = [int(j) for j in t... | {
"repo_name": "derrowap/MA490-MachineLearning-FinalProject",
"path": "skParity.py",
"copies": "1",
"size": "1154",
"license": "mit",
"hash": 7088790843754486000,
"line_mean": 27.875,
"line_max": 78,
"alpha_frac": 0.6447140381,
"autogenerated": false,
"ratio": 2.906801007556675,
"config_test": f... |
import os
import sys
import tensorflow as tf
# We have five actions
n_classes = 5
# Grab height and width arguments
height = int(sys.argv[1])
width = int(sys.argv[2])
# Total image matrix size
input_size = height * width
# Reshaping convolutions
reshape_param = (int(height/4))*(int(width/4))*64
# Define the image ... | {
"repo_name": "austinpgraham/SmartKart",
"path": "src/cnn_python/construct.py",
"copies": "1",
"size": "2722",
"license": "apache-2.0",
"hash": -6953789711111321000,
"line_mean": 31.7951807229,
"line_max": 82,
"alpha_frac": 0.690668626,
"autogenerated": false,
"ratio": 2.8926673751328376,
"conf... |
__author__ = 'austin'
def module_check_r(module):
"""
Just for debian-based systems like Kali and Ubuntu
"""
ri = tk.messagebox.askyesno("error",
"""%s was not found on your system if your an admin and would like to install it
press yes"""... | {
"repo_name": "austin395/NetworkTools",
"path": "scanners.py",
"copies": "1",
"size": "2881",
"license": "mit",
"hash": 4801153201996782000,
"line_mean": 32.1149425287,
"line_max": 112,
"alpha_frac": 0.589378688,
"autogenerated": false,
"ratio": 3.8516042780748663,
"config_test": false,
"has_... |
__author__ = 'austin'
import dataset
import os
import time
import sys
def make_new_database(new_database_name, media_folder):
file_ext = (".mp4", ".avi", ".flv", ".wmv", ".mpg", ".mov", ".mkv", ".mpeg")
start_time = time.time() # FOR TESTING ... start time
db = dataset.connect('sqlite:///{}.vdb'.forma... | {
"repo_name": "redeuxx/vidDB",
"path": "make_new_database.py",
"copies": "1",
"size": "1373",
"license": "mit",
"hash": -8589384122682406000,
"line_mean": 31.7142857143,
"line_max": 107,
"alpha_frac": 0.506190823,
"autogenerated": false,
"ratio": 3.922857142857143,
"config_test": false,
"has_... |
__author__ = 'austin'
import subprocess
import time
import os
if os.getuid() != 0:
print("""not root: iptables functions require root privledge those functions will not be executed.
this mode is for testing only""")
class LiKnockServer:
"""
LiKnock-Server is designed to establish a listening connec... | {
"repo_name": "severedsec/LiKnox-OS",
"path": "LiKnock/LiKnock-server.py",
"copies": "1",
"size": "5036",
"license": "mit",
"hash": -5749194262497820000,
"line_mean": 46.0654205607,
"line_max": 130,
"alpha_frac": 0.525019857,
"autogenerated": false,
"ratio": 4.077732793522268,
"config_test": fa... |
__author__ = 'Austin'
import os,os.path
import xml.etree.ElementTree as ET
#get the path to the pmd commits
#gwtcwd = get current working directory
#print os.getcwd()
def parse(logpath):
rootdir = os.path.abspath(os.path.dirname(os.getcwd()))
#print rootdir
LoR= []
pmd_folder = logpath
print p... | {
"repo_name": "UBC-Victorious-410/project",
"path": "tools/pmd_parser.py",
"copies": "1",
"size": "1800",
"license": "mit",
"hash": -5457313715963984000,
"line_mean": 29,
"line_max": 77,
"alpha_frac": 0.4372222222,
"autogenerated": false,
"ratio": 4.137931034482759,
"config_test": false,
"has... |
__author__ = 'austin'
# will be capable of exporting scans to different file types
import tkinter as tk
import tkinter.filedialog
import pickle
import socket
# need to add support for clean csv xml txt
# the dictionary nesting could be cleaned up a little bit when exporting as human readable data
class Export:
@s... | {
"repo_name": "austin395/NetworkTools",
"path": "export.py",
"copies": "1",
"size": "1384",
"license": "mit",
"hash": -8240794785297480000,
"line_mean": 26.1568627451,
"line_max": 95,
"alpha_frac": 0.5628612717,
"autogenerated": false,
"ratio": 3.8232044198895028,
"config_test": false,
"has_n... |
__author__ = 'Autio'
################################################
# Shit Crimson - 7DRL 2014 - By ArchBang #
# 9/3/2014 - 16/3/2014 #
################################################
# Based on Roguebasin.com's roguelike tutorial #
# #
#
#
#... | {
"repo_name": "ArchBang85/S_Crimson",
"path": "ShitCrimson.py",
"copies": "1",
"size": "58307",
"license": "apache-2.0",
"hash": -5653800929157368000,
"line_mean": 32.9388824214,
"line_max": 252,
"alpha_frac": 0.5464695491,
"autogenerated": false,
"ratio": 3.4552296296296294,
"config_test": fal... |
import adsk.core, adsk.fusion, traceback
import os
import tempfile
import subprocess
# global set of event handlers to keep them referenced for the duration of the command
handlers = []
app = adsk.core.Application.get()
if app:
ui = app.userInterface
RADIOBUTTONGROUP = adsk.core.RadioButtonGroupComma... | {
"repo_name": "marcomanno/polygon_triangulation",
"path": "fusion_script/mesh_bool/mesh_boolean.py",
"copies": "1",
"size": "7321",
"license": "apache-2.0",
"hash": 3894091341129252000,
"line_mean": 39.8342857143,
"line_max": 139,
"alpha_frac": 0.5760142057,
"autogenerated": false,
"ratio": 4.173... |
__author__ = "auxiliary-character"
from wpilib.command import Command
from wpilib.timer import Timer
import wpilib
import csv
class RecordMacro(Command):
"""This records robot movements and writes them to a .csv file."""
def __init__(self, robot, name):
super().__init__()
self.robot = robot
... | {
"repo_name": "DenfeldRobotics4009/python-framework",
"path": "commands/record_macro.py",
"copies": "1",
"size": "1169",
"license": "bsd-3-clause",
"hash": -9065455216644522000,
"line_mean": 28.225,
"line_max": 105,
"alpha_frac": 0.619332763,
"autogenerated": false,
"ratio": 3.770967741935484,
... |
__author__ = 'auxiliary-character'
from wpilib.command import Command
import wpilib
import math
class DriveStraight(Command):
"""Drives the robot straight using the navX, PIDs, and a bit of math."""
def __init__(self, robot, x, y, timeout=None):
super().__init__()
self.robot = robot
sel... | {
"repo_name": "DenfeldRobotics4009/2015_Lopez_Jr",
"path": "commands/semiauto_commands/drive_straight.py",
"copies": "1",
"size": "1643",
"license": "bsd-3-clause",
"hash": 8517265513883887000,
"line_mean": 30.5961538462,
"line_max": 98,
"alpha_frac": 0.6256847231,
"autogenerated": false,
"ratio"... |
__author__ = 'auxiliary-character'
from wpilib.command import Command
import wpilib
import math
class Turn(Command):
"""Does some turning based on math, the navX, and a PID controller."""
def __init__(self, robot, angle):
super().__init__()
self.robot = robot
self.angle = angle
... | {
"repo_name": "DenfeldRobotics4009/2015_Lopez_Jr",
"path": "commands/semiauto_commands/turn.py",
"copies": "1",
"size": "1683",
"license": "bsd-3-clause",
"hash": 9186172982501165000,
"line_mean": 31.3653846154,
"line_max": 98,
"alpha_frac": 0.6339869281,
"autogenerated": false,
"ratio": 3.550632... |
__author__ = 'auxiliary-character'
import threading
import wpilib
import serial
import re
class IMUSimple(threading.Thread):
float_regex = """([\+\-\ ]\d{3}\.\d{2})"""
int8_regex = """([0-9A-Fa-f]{2})"""
int16_regex = """([0-9A-Fa-f]{4})"""
termination_regex = int8_regex
yprc_packet_regex = re.com... | {
"repo_name": "DenfeldRobotics4009/2015_Lopez_Jr",
"path": "imu_simple.py",
"copies": "1",
"size": "1922",
"license": "bsd-3-clause",
"hash": 7964717382175934000,
"line_mean": 26.8550724638,
"line_max": 60,
"alpha_frac": 0.5015608741,
"autogenerated": false,
"ratio": 3.8286852589641436,
"config... |
__author__ = "auxiliary-character"
import wpilib
from wpilib.command import Command
class SuperStrafe64(Command):
"""Only for Nintendo 64."""
kBack = 0
kForward = 1
kRight = 2
kLeft = 3
def __init__(self, robot, direction):
super().__init__()
self.robot = robot
self.requ... | {
"repo_name": "DenfeldRobotics4009/2015_Lopez_Jr",
"path": "commands/semiauto_commands/super_strafe_64.py",
"copies": "1",
"size": "1249",
"license": "bsd-3-clause",
"hash": -5528069923901526000,
"line_mean": 26.152173913,
"line_max": 67,
"alpha_frac": 0.5868694956,
"autogenerated": false,
"ratio... |
__author__ = "auxiliary-character"
import wpilib
from wpilib.command import Command
class SuperStrafeEntertainmentSystem(Command):
"""Cartridge-based entertainment system."""
kBack = 0
kForward = 1
kRight = 2
kLeft = 3
def __init__(self, robot, direction):
super().__init__()
sel... | {
"repo_name": "DenfeldRobotics4009/2016_Dos_Point_Oh",
"path": "commands/semiauto/super_strafe_entertainment_system.py",
"copies": "1",
"size": "1257",
"license": "bsd-3-clause",
"hash": -5816460163849677000,
"line_mean": 26.9333333333,
"line_max": 67,
"alpha_frac": 0.600636436,
"autogenerated": fa... |
__author__ = "auxiliary-character"
import wpilib
from wpilib.timer import Timer
from wpilib.command import Command
import csv
class PlayMacro(Command):
"""This plays macro movements from the .csv file."""
def __init__(self, robot, name):
"""Initialize the command and get all the requirements."""
... | {
"repo_name": "DenfeldRobotics4009/python-framework",
"path": "commands/play_macro.py",
"copies": "1",
"size": "1611",
"license": "bsd-3-clause",
"hash": -134495411226501060,
"line_mean": 28.8333333333,
"line_max": 81,
"alpha_frac": 0.5667287399,
"autogenerated": false,
"ratio": 3.987623762376238... |
__author__ = "auxiliary-character"
import csv
import wpilib
from wpilib.command import Command
from wpilib.timer import Timer
from utilities.settings import Settings
class PlayMacro(Command):
"""This plays macro movements from the .csv file."""
def __init__(self, robot, name):
"""Initialize the comm... | {
"repo_name": "DenfeldRobotics4009/2016_Dos_Point_Oh",
"path": "macros/play_macro.py",
"copies": "1",
"size": "2399",
"license": "bsd-3-clause",
"hash": -5957401128605432000,
"line_mean": 28.9875,
"line_max": 83,
"alpha_frac": 0.5681533972,
"autogenerated": false,
"ratio": 4.201401050788091,
"c... |
__author__ = "auxiliary-character"
import csv
import wpilib
from wpilib.command import Command
from wpilib.timer import Timer
from utilities.settings import Settings
class RecordMacro(Command):
"""This records robot movements and writes them to a .csv file."""
def __init__(self, robot, name):
super... | {
"repo_name": "DenfeldRobotics4009/2016_Dos_Point_Oh",
"path": "macros/record_macro.py",
"copies": "1",
"size": "1876",
"license": "bsd-3-clause",
"hash": 1054404207226903700,
"line_mean": 28.7777777778,
"line_max": 105,
"alpha_frac": 0.6044776119,
"autogenerated": false,
"ratio": 3.9411764705882... |
__author__ = 'avale'
import time, random
def solve(grid): return search(parse_grid(grid))
def search(values):
"Using depth-first search and propagation, try all possible values."
if values is False:
return False ## Failed earlier
if all(len(values[s]) == 1 for s in squares):
return values... | {
"repo_name": "andredalton/bcc",
"path": "2015/MAC0327/Desafios 2/p3.py",
"copies": "1",
"size": "3352",
"license": "apache-2.0",
"hash": 6222991863946814000,
"line_mean": 39.8780487805,
"line_max": 92,
"alpha_frac": 0.611575179,
"autogenerated": false,
"ratio": 3.295968534906588,
"config_test"... |
__author__ = 'avathar'
from selectors import RankSelector
from crossover import OnePointCrossover
from chromosome import Chromosome
from mutation import Mutation
from fitness import FitnessFunction
import random
class GeneticAlgorithm(object):
def __init__(self, population_size, sample_genotype, crossover_rate=... | {
"repo_name": "avathardev/ppolom",
"path": "darwin/ga.py",
"copies": "2",
"size": "3126",
"license": "mit",
"hash": -1481341017634758100,
"line_mean": 35.7764705882,
"line_max": 77,
"alpha_frac": 0.5886116443,
"autogenerated": false,
"ratio": 4.517341040462428,
"config_test": false,
"has_no_k... |
__author__ = 'avathar'
import json
import numpy as np
from darwin.ga import GeneticAlgorithm
from darwin.genotype import Genotype
from darwin.fitness import FitnessFunction
item = '1005.90.03'
def read_distance():
with open('distances.json', 'r') as input_file:
distances = json.load(input_file)
... | {
"repo_name": "avatharBot/ppolom",
"path": "ppolom.py",
"copies": "2",
"size": "3259",
"license": "mit",
"hash": -2511581590090491400,
"line_mean": 30.3365384615,
"line_max": 76,
"alpha_frac": 0.5694998466,
"autogenerated": false,
"ratio": 3.7373853211009176,
"config_test": false,
"has_no_key... |
__author__ = 'avathar'
import random
from chromosome import Chromosome
class Genotype(object):
"""
Genotype defines the structure of a chromosome
"""
def __init__(self, labels, values):
self.labels = labels
self.values = values
def describe(self):
"""
describe: tu... | {
"repo_name": "avatharBot/ppolom",
"path": "darwin/genotype.py",
"copies": "2",
"size": "1128",
"license": "mit",
"hash": -8110609767163993000,
"line_mean": 23.5217391304,
"line_max": 78,
"alpha_frac": 0.5647163121,
"autogenerated": false,
"ratio": 4.256603773584906,
"config_test": false,
"ha... |
__author__ = 'avinashj'
"""
The accounts module contains the definitions for basic CRUD operations on Accounts
"""
from qds_sdk.qubole import Qubole
from qds_sdk.resource import Resource
from argparse import ArgumentParser
import logging
import json
log = logging.getLogger("qds_account")
class AccountCmdLine:
... | {
"repo_name": "jainavi/qds-sdk-py",
"path": "qds_sdk/accounts.py",
"copies": "1",
"size": "1946",
"license": "apache-2.0",
"hash": 6795997318420048000,
"line_mean": 26.4084507042,
"line_max": 90,
"alpha_frac": 0.6223021583,
"autogenerated": false,
"ratio": 4.422727272727273,
"config_test": fals... |
__author__ = 'avinashj'
"""
The cloud creds module contains the definitions for basic CRUD operations on CloudCred
"""
from qds_sdk.qubole import Qubole
from qds_sdk.resource import Resource
from argparse import ArgumentParser
import logging
import json
log = logging.getLogger("qds_cloud_cred")
class CloudCredCmd... | {
"repo_name": "jainavi/qds-sdk-py",
"path": "qds_sdk/cloud_creds.py",
"copies": "1",
"size": "2169",
"license": "apache-2.0",
"hash": -7789673559407318000,
"line_mean": 29.1388888889,
"line_max": 91,
"alpha_frac": 0.5961272476,
"autogenerated": false,
"ratio": 4.338,
"config_test": false,
"ha... |
__author__ = 'avinashj'
"""
The published hivetables module contains the definitions for basic CRUD operations on PublishedHivetable
"""
from qds_sdk.qubole import Qubole
from qds_sdk.resource import Resource
from argparse import ArgumentParser
import logging
import json
log = logging.getLogger("qds_published_hivet... | {
"repo_name": "jainavi/qds-sdk-py",
"path": "qds_sdk/published_hivetables.py",
"copies": "1",
"size": "5285",
"license": "apache-2.0",
"hash": 7284062271244049000,
"line_mean": 35.4551724138,
"line_max": 104,
"alpha_frac": 0.606244087,
"autogenerated": false,
"ratio": 4.034351145038168,
"config... |
__author__ = 'avinashj'
"""
The space subscribers module contains the definitions for basic CRUD operations on SpaceSubscriber
"""
from qds_sdk.qubole import Qubole
from qds_sdk.resource import Resource
from argparse import ArgumentParser
import logging
import json
log = logging.getLogger("qds_space_subscriber")
... | {
"repo_name": "jainavi/qds-sdk-py",
"path": "qds_sdk/space_subscribers.py",
"copies": "1",
"size": "5571",
"license": "apache-2.0",
"hash": 4546381834662094300,
"line_mean": 35.4183006536,
"line_max": 105,
"alpha_frac": 0.6020463113,
"autogenerated": false,
"ratio": 4.345553822152886,
"config_t... |
__author__ = 'avinashj'
"""
The subscribed hivetables module contains the definitions for basic CRUD operations on SubscribedHivetable
"""
from qds_sdk.qubole import Qubole
from qds_sdk.resource import Resource
from argparse import ArgumentParser
import logging
import json
log = logging.getLogger("qds_subscribed_hi... | {
"repo_name": "jainavi/qds-sdk-py",
"path": "qds_sdk/subscribed_hivetables.py",
"copies": "1",
"size": "4758",
"license": "apache-2.0",
"hash": -555314366587825660,
"line_mean": 35.053030303,
"line_max": 109,
"alpha_frac": 0.6258932325,
"autogenerated": false,
"ratio": 4.056265984654732,
"confi... |
__author__ = 'Avinesh_Kumar'
'''
MIT License
Copyright (c) 2017 Avinesh Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... | {
"repo_name": "avinesh09/SimplePyHttpServer",
"path": "SimplePyHttpServer.py",
"copies": "1",
"size": "2659",
"license": "mit",
"hash": 6651258470527368000,
"line_mean": 33.5324675325,
"line_max": 78,
"alpha_frac": 0.6991350132,
"autogenerated": false,
"ratio": 3.980538922155689,
"config_test":... |
__author__ = 'AVIRAM'
import sys
import json
import logging
from pprint import pprint
#sys.path.insert(0, 'lib') #we need this line in order to make libraries imported from lib folder work properly
import requests #Used for http requests
def getCurrencyResults(FROM,TO):
URL="https://query.yahooa... | {
"repo_name": "yaakov300/ForexApp",
"path": "models/priceInterface.py",
"copies": "1",
"size": "2988",
"license": "mit",
"hash": 7711611803835160000,
"line_mean": 34.8888888889,
"line_max": 233,
"alpha_frac": 0.6429049531,
"autogenerated": false,
"ratio": 3.106029106029106,
"config_test": false... |
__author__ = 'avraham'
import time
class MyType(type):
def __new__(cls, name, bases, attrs):
bases = (object,)
return super(MyType, cls).__new__(cls, name, bases, attrs)
class TFExample(object):
"""Version 123
This is the docstring for the class, any relevant info should go here
This is th... | {
"repo_name": "davidvoler/ate_meteor",
"path": "xmlrpc/tf_example.py",
"copies": "1",
"size": "3130",
"license": "mit",
"hash": -3732162088206004700,
"line_mean": 25.9827586207,
"line_max": 114,
"alpha_frac": 0.538658147,
"autogenerated": false,
"ratio": 3.7893462469733654,
"config_test": false... |
import os
import sys
import re
import sublime
import subprocess
import cssbeautifier
class CssFormatter:
def __init__(self, formatter):
self.formatter = formatter
def format(self, text):
text = text.decode("utf-8")
opts = self.formatter.settings.get('codeformatter_css_options')
... | {
"repo_name": "jay3126/sublimetext-codeformatter",
"path": "codeformatter/cssformatter.py",
"copies": "3",
"size": "1900",
"license": "mit",
"hash": -9084731452926822000,
"line_mean": 25.7605633803,
"line_max": 99,
"alpha_frac": 0.5731578947,
"autogenerated": false,
"ratio": 4.033970276008493,
... |
import os
import sys
import re
import sublime
import subprocess
import jsbeautifier
class JsFormatter:
def __init__(self, formatter):
self.formatter = formatter
def format(self, text):
text = text.decode("utf-8")
opts = self.formatter.settings.get('codeformatter_js_options')
... | {
"repo_name": "dgmdan/sublimetext-codeformatter",
"path": "codeformatter/jsformatter.py",
"copies": "3",
"size": "4186",
"license": "mit",
"hash": 6170834737703727000,
"line_mean": 27.6712328767,
"line_max": 99,
"alpha_frac": 0.5661729575,
"autogenerated": false,
"ratio": 4.08390243902439,
"con... |
import os, sys, re, sublime
directory = os.path.dirname(os.path.realpath(__file__))
libs_path = os.path.join(directory, "lib")
if libs_path not in sys.path:
sys.path.append(libs_path)
try:
# Python 3
from .phpformatter import PhpFormatter
from .jsformatter import JsFormatter
from .htmlformatter ... | {
"repo_name": "TadeuRodrigues/sublimetext-codeformatter",
"path": "codeformatter/formatter.py",
"copies": "3",
"size": "3896",
"license": "mit",
"hash": 5236552615257220000,
"line_mean": 31.1983471074,
"line_max": 99,
"alpha_frac": 0.589835729,
"autogenerated": false,
"ratio": 3.963377416073245,
... |
import os
import re
import sublime
import subprocess
import os.path
from os.path import dirname, realpath
class PhpFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.opts = formatter.settings.get('codeformatter_php_options')
def format(self, text):
php_path =... | {
"repo_name": "crlang/sublime-text---front-end-config",
"path": "Data/Packages/CodeFormatter/codeformatter/phpformatter.py",
"copies": "2",
"size": "5222",
"license": "mit",
"hash": 8373095596663269000,
"line_mean": 30.6484848485,
"line_max": 101,
"alpha_frac": 0.5394484872,
"autogenerated": false,... |
import os
import sys
import re
import htmlbeautifier
import sublime
directory = os.path.dirname(os.path.realpath(__file__))
libs_path = os.path.join(directory, 'lib')
libs_path = os.path.join(libs_path, 'htmlbeautifier')
if libs_path not in sys.path:
sys.path.append(libs_path)
use_bs4 = True
try:
from bs4 i... | {
"repo_name": "crlang/sublime-text---front-end-config",
"path": "Data/Packages/CodeFormatter/codeformatter/htmlformatter.py",
"copies": "1",
"size": "3926",
"license": "mit",
"hash": -5530302567888876000,
"line_mean": 32.5555555556,
"line_max": 97,
"alpha_frac": 0.5534895568,
"autogenerated": false... |
import os
import sys
import re
import sublime
import subprocess
import os.path
from os.path import dirname, realpath
class PhpFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.opts = formatter.settings.get('codeformatter_php_options')
def format(self, text):
... | {
"repo_name": "RevanProdigalKnight/sublimetext-codeformatter",
"path": "codeformatter/phpformatter.py",
"copies": "1",
"size": "4835",
"license": "mit",
"hash": -6730934610643223000,
"line_mean": 32.8111888112,
"line_max": 184,
"alpha_frac": 0.5904860393,
"autogenerated": false,
"ratio": 3.671222... |
import os
import sys
import re
import sublime
import subprocess
directory = os.path.dirname(os.path.realpath(__file__))
libs_path = os.path.join(directory, "lib")
libs_path = os.path.join(libs_path, "htmlbeautifier")
if libs_path not in sys.path:
sys.path.append(libs_path)
import htmlbeautifier
use_bs4 = Tr... | {
"repo_name": "RevanProdigalKnight/sublimetext-codeformatter",
"path": "codeformatter/htmlformatter.py",
"copies": "1",
"size": "3401",
"license": "mit",
"hash": 1277315414199450000,
"line_mean": 33.3535353535,
"line_max": 174,
"alpha_frac": 0.5930608645,
"autogenerated": false,
"ratio": 3.829954... |
import os
import sys
import re
import sublime
import subprocess
import coldfusionbeautifier
class ColdfusionFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.opts = formatter.settings.get('codeformatter_coldfusion_options')
def format(self, text):
text = text.... | {
"repo_name": "RevanProdigalKnight/sublimetext-codeformatter",
"path": "codeformatter/coldfusionformatter.py",
"copies": "1",
"size": "2326",
"license": "mit",
"hash": 1151307143303282300,
"line_mean": 32.2285714286,
"line_max": 99,
"alpha_frac": 0.6229578676,
"autogenerated": false,
"ratio": 3.7... |
import os
import sys
import re
import sublime
import subprocess
import cssbeautifier
class CssFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.opts = formatter.settings.get('codeformatter_css_options')
def format(self, text):
text = text.decode("utf-8")
... | {
"repo_name": "RevanProdigalKnight/sublimetext-codeformatter",
"path": "codeformatter/cssformatter.py",
"copies": "1",
"size": "2206",
"license": "mit",
"hash": 5929386929632855000,
"line_mean": 28.4133333333,
"line_max": 99,
"alpha_frac": 0.5856754306,
"autogenerated": false,
"ratio": 3.89065255... |
import os
import sys
import re
import sublime
import subprocess
import jsbeautifier
class JsFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.opts = formatter.settings.get('codeformatter_js_options')
def format(self, text):
text = text.decode("utf-8")
... | {
"repo_name": "RevanProdigalKnight/sublimetext-codeformatter",
"path": "codeformatter/jsformatter.py",
"copies": "1",
"size": "4934",
"license": "mit",
"hash": 3030268438215400000,
"line_mean": 29.4567901235,
"line_max": 99,
"alpha_frac": 0.5830968788,
"autogenerated": false,
"ratio": 3.928343949... |
import os
import sys
import re
import sublime
import subprocess
import vbscriptbeautifier
class VbscriptFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.opts = formatter.settings.get('codeformatter_vbscript_options')
def format(self, text):
text = text.decod... | {
"repo_name": "RevanProdigalKnight/sublimetext-codeformatter",
"path": "codeformatter/vbscriptformatter.py",
"copies": "1",
"size": "2517",
"license": "mit",
"hash": -8625865103353759000,
"line_mean": 30.8607594937,
"line_max": 99,
"alpha_frac": 0.6015097338,
"autogenerated": false,
"ratio": 3.86... |
import os
import sys
import re
import sublime
directory = os.path.dirname(os.path.realpath(__file__))
libs_path = os.path.join(directory, 'lib')
if libs_path not in sys.path:
sys.path.append(libs_path)
try:
# Python 3
from .phpformatter import PhpFormatter
from .jsformatter import JsFormatter
fr... | {
"repo_name": "crlang/sublime-text---front-end-config",
"path": "Data/Packages/CodeFormatter/codeformatter/formatter.py",
"copies": "1",
"size": "3680",
"license": "mit",
"hash": -429174601770344960,
"line_mean": 33.0740740741,
"line_max": 99,
"alpha_frac": 0.6366847826,
"autogenerated": false,
"... |
import os
import sys
import re
import sublime
st_version = 2
if sublime.version() == '' or int(sublime.version()) > 3000:
st_version = 3
if (st_version == 2):
from pybeautifier import Beautifier
else:
#from .pybeautifier import Beautifier
print('CodeFormatter: formatting python files on ST3 not supp... | {
"repo_name": "RevanProdigalKnight/sublimetext-codeformatter",
"path": "codeformatter/pyformatter.py",
"copies": "1",
"size": "9914",
"license": "mit",
"hash": 7338739944273438000,
"line_mean": 32.0466666667,
"line_max": 99,
"alpha_frac": 0.5676820658,
"autogenerated": false,
"ratio": 3.816012317... |
import os
import sys
import sublime
import sublime_plugin
st_version = 2
if sublime.version() == '' or int(sublime.version()) > 3000:
st_version = 3
reloader_name = 'codeformatter.reloader'
# ST3 loads each package as a module, so it needs an extra prefix
if st_version == 3:
reloader_name = 'CodeFormatter.' ... | {
"repo_name": "crlang/sublime-text---front-end-config",
"path": "Data/Packages/CodeFormatter/CodeFormatter.py",
"copies": "2",
"size": "6068",
"license": "mit",
"hash": -5956755684221830000,
"line_mean": 28.7450980392,
"line_max": 99,
"alpha_frac": 0.6031641397,
"autogenerated": false,
"ratio": 3... |
import os, sys, re, sublime
directory = os.path.dirname(os.path.realpath(__file__))
libs_path = os.path.join(directory, "lib")
if libs_path not in sys.path:
sys.path.append(libs_path)
try:
# Python 3
from .phpformatter import PhpFormatter
from .jsformatter import JsFormatter
from .htmlformatter ... | {
"repo_name": "RevanProdigalKnight/sublimetext-codeformatter",
"path": "codeformatter/formatter.py",
"copies": "1",
"size": "5046",
"license": "mit",
"hash": 2588512869972717600,
"line_mean": 32.417218543,
"line_max": 99,
"alpha_frac": 0.608600872,
"autogenerated": false,
"ratio": 3.9889328063241... |
import os, sys, sublime, sublime_plugin
st_version = 2
if sublime.version() == '' or int(sublime.version()) > 3000:
st_version = 3
reloader_name = 'codeformatter.reloader'
# ST3 loads each package as a module, so it needs an extra prefix
if st_version == 3:
reloader_name = 'CodeFormatter.' + reloader_name
... | {
"repo_name": "RevanProdigalKnight/sublimetext-codeformatter",
"path": "CodeFormatter.py",
"copies": "1",
"size": "5396",
"license": "mit",
"hash": 8678561073666991000,
"line_mean": 31.119047619,
"line_max": 184,
"alpha_frac": 0.6241660489,
"autogenerated": false,
"ratio": 3.7085910652920964,
"... |
import re
import coldfusionbeautifier
class ColdfusionFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.options = coldfusionbeautifier.default_options()
# parse custom options from settings file
self.fill_custom_options(formatter.settings.get('codeformat... | {
"repo_name": "crlang/sublime-text---front-end-config",
"path": "Data/Packages/CodeFormatter/codeformatter/coldfusionformatter.py",
"copies": "2",
"size": "2042",
"license": "mit",
"hash": -2893107343198580700,
"line_mean": 26.5945945946,
"line_max": 99,
"alpha_frac": 0.5592556317,
"autogenerated":... |
import re
import cssbeautifier
class CssFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.options = cssbeautifier.default_options()
# parse custom options from settings file
self.fill_custom_options(formatter.settings.get('codeformatter_css_options'))
... | {
"repo_name": "crlang/sublime-text---front-end-config",
"path": "Data/Packages/CodeFormatter/codeformatter/cssformatter.py",
"copies": "2",
"size": "2260",
"license": "mit",
"hash": -5176470515749901000,
"line_mean": 29.5405405405,
"line_max": 99,
"alpha_frac": 0.5389380531,
"autogenerated": false,... |
import re
import jsbeautifier
class JsFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.opts = formatter.settings.get('codeformatter_js_options')
def format(self, text):
text = text.decode('utf-8')
stderr = ''
stdout = ''
options = js... | {
"repo_name": "crlang/sublime-text---front-end-config",
"path": "Data/Packages/CodeFormatter/codeformatter/jsformatter.py",
"copies": "2",
"size": "5640",
"license": "mit",
"hash": 8752688341265374000,
"line_mean": 31.2285714286,
"line_max": 99,
"alpha_frac": 0.5576241135,
"autogenerated": false,
... |
import re
import sublime
st_version = 2
if sublime.version() == '' or int(sublime.version()) > 3000:
st_version = 3
if (st_version == 2):
from pybeautifier import Beautifier
else:
# from .pybeautifier import Beautifier
print('CodeFormatter: formatting python files on ST3 not supported.')
class PyF... | {
"repo_name": "crlang/sublime-text---front-end-config",
"path": "Data/Packages/CodeFormatter/codeformatter/pyformatter.py",
"copies": "2",
"size": "10203",
"license": "mit",
"hash": -7477170203309850000,
"line_mean": 32.2345276873,
"line_max": 99,
"alpha_frac": 0.5581691659,
"autogenerated": false,... |
import re
import vbscriptbeautifier
class VbscriptFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.opts = formatter.settings.get('codeformatter_vbscript_options')
def format(self, text):
text = text.decode('utf-8')
stderr = ''
stdout = ''
... | {
"repo_name": "crlang/sublime-text---front-end-config",
"path": "Data/Packages/CodeFormatter/codeformatter/vbscriptformatter.py",
"copies": "2",
"size": "2662",
"license": "mit",
"hash": 8802153408880483000,
"line_mean": 32.6962025316,
"line_max": 99,
"alpha_frac": 0.5830202855,
"autogenerated": fa... |
import sublime
import sublime_plugin
import string
import re
import sys
import time
import base64
import html.entities as htmlentitydefs
from cgi import escape
from hashlib import md5, sha1, sha224, sha256, sha384, sha512
from datetime import datetime
from random import sample, choice, randrange
import os, socket, url... | {
"repo_name": "akalongman/sublimetext-stringutilities",
"path": "stringutilities.py",
"copies": "1",
"size": "21979",
"license": "mit",
"hash": -6603776844865107000,
"line_mean": 36.3792517007,
"line_max": 137,
"alpha_frac": 0.5859684244,
"autogenerated": false,
"ratio": 3.743655254641458,
"con... |
__author__ = 'awhite'
from datetime import datetime
from pylatex import Document, Section, Subsection, \
Table, Package, Enumerate
document = Document()
stack = []
document.packages.append(Package('geometry', options=['tmargin=1cm', "lmargin=2.4cm"]))
stack.append((document, 0))
document.append("hello")
contex... | {
"repo_name": "jaked122/minuteman",
"path": "main.py",
"copies": "1",
"size": "4247",
"license": "mit",
"hash": -2086963765417656000,
"line_mean": 26.9407894737,
"line_max": 124,
"alpha_frac": 0.4452554745,
"autogenerated": false,
"ratio": 3.6707000864304233,
"config_test": false,
"has_no_key... |
import numpy as np
import random
import itertools
import scipy.misc
# import matplotlib.pyplot as plt
class gameOb():
def __init__(self, coordinates, size, intensity, channel, reward, name):
self.x = coordinates[0]
self.y = coordinates[1]
self.size = size
self.intensity = intensit... | {
"repo_name": "gourie/training_RL",
"path": "gridworld.py",
"copies": "1",
"size": "4761",
"license": "bsd-3-clause",
"hash": 397467847107681000,
"line_mean": 33.2589928058,
"line_max": 114,
"alpha_frac": 0.5345515648,
"autogenerated": false,
"ratio": 3.482809070958303,
"config_test": false,
... |
__author__ = 'Axion'
def _check_duplicates_in_path():
"""Check the $PATH environmental variable for duplicates."""
import os
path = os.environ['PATH']
path_list = [piece for piece in path.split(":")]
print('duplicates: {} items'.format(len(path_list)-len(set(path_list))))
path_count = {part... | {
"repo_name": "devinbarry/yellow-worktracker",
"path": "environ_path.py",
"copies": "1",
"size": "1075",
"license": "apache-2.0",
"hash": -3699288535244386300,
"line_mean": 30.6470588235,
"line_max": 293,
"alpha_frac": 0.6344186047,
"autogenerated": false,
"ratio": 3.287461773700306,
"config_te... |
__author__ = "Aymen SHABOU, Nourhene MAALEL"
__license__ = "BSD"
__maintainer__ = "Auymen SHABOU"
__email__ = "aymen.shabou@gmail.com"
__status__ = "Dev"
from setuptools import setup
from setuptools.command.test import test as TestCommand
import io
import os
import sys
import kaggler
here = os.path.abspath(os.path.d... | {
"repo_name": "aymen82/kaggler-competitions-scripts",
"path": "setup.py",
"copies": "1",
"size": "1998",
"license": "bsd-3-clause",
"hash": -8572356153580306000,
"line_mean": 26.3698630137,
"line_max": 79,
"alpha_frac": 0.6311311311,
"autogenerated": false,
"ratio": 3.6526508226691043,
"config_... |
# Copyright (c) 2009-2012 Advanced Micro Devices, Inc.
# Copyright (c) 2012-2013 Mark D. Hill and David A. Wood
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code mu... | {
"repo_name": "ayoubg/gem5-graphics",
"path": "gem5-gpu/configs/soc_arm.py",
"copies": "1",
"size": "8668",
"license": "bsd-3-clause",
"hash": -6888815840372322000,
"line_mean": 29.4140350877,
"line_max": 92,
"alpha_frac": 0.7249653899,
"autogenerated": false,
"ratio": 3.372762645914397,
"confi... |
__author__ = 'azad'
def ComputeResult(categories , booleanAns):
result = []
color = []
category = list(set(categories))
print category
assoc_answer=zip(categories,booleanAns)
print assoc_answer
for y in category:
# print y
# print y==assoc_answer[0][0]
total = len([x... | {
"repo_name": "saifulazad/myApp",
"path": "app/ResultProcessor.py",
"copies": "1",
"size": "1780",
"license": "bsd-3-clause",
"hash": 7919570361682186000,
"line_mean": 29.1694915254,
"line_max": 118,
"alpha_frac": 0.6039325843,
"autogenerated": false,
"ratio": 3.4165067178502877,
"config_test":... |
__author__ = 'azad'
import os
from flask import Flask, request, redirect, url_for
from werkzeug import secure_filename
UPLOAD_FOLDER = '/home/azad/myApp/app/static/img'
ALLOWED_EXTENSIONS = set(['png', 'jpeg', 'jpg'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
def allowed_file(filename):
r... | {
"repo_name": "saifulazad/myApp",
"path": "app/uploa.py",
"copies": "1",
"size": "1184",
"license": "bsd-3-clause",
"hash": 5497421564379432000,
"line_mean": 31.027027027,
"line_max": 74,
"alpha_frac": 0.6148648649,
"autogenerated": false,
"ratio": 3.3925501432664755,
"config_test": false,
"h... |
__author__ = 'azenk'
from math import log
class Controller(object):
"""
This class models a raid controller or hba
"""
def __init__(self):
# Enclosure dict, keys are enclosure ids
self._enclosures = dict()
# Array Dict, keys are array_id
self._arrays = dict()
def ... | {
"repo_name": "azenk/linuxdisktools",
"path": "disktools/base.py",
"copies": "1",
"size": "8018",
"license": "cc0-1.0",
"hash": -4261677775385076000,
"line_mean": 25.2026143791,
"line_max": 119,
"alpha_frac": 0.5824395111,
"autogenerated": false,
"ratio": 3.94392523364486,
"config_test": false,... |
from django.conf.urls import url
from django.conf.urls import handler404, handler500
from . import views
from jaspar import settings
from django.views.static import serve
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^search/?$', views.search, name='search'),
url(r'^docs/$', views.document... | {
"repo_name": "asntech/jaspar",
"path": "portal/urls.py",
"copies": "1",
"size": "2967",
"license": "bsd-3-clause",
"hash": -3478099893597289000,
"line_mean": 42.6323529412,
"line_max": 134,
"alpha_frac": 0.6423997304,
"autogenerated": false,
"ratio": 3.2320261437908497,
"config_test": false,
... |
from django.contrib import admin
from .models import Matrix, MatrixAnnotation, MatrixData, Tffm, Post
class MatrixAdmin(admin.ModelAdmin):
list_display = ('base_id', 'id','name','collection','version',)
search_fields = ['collection', 'id', 'name', 'base_id']
list_filter = ('collection',)
admin.site.register(Mat... | {
"repo_name": "asntech/jaspar",
"path": "portal/admin.py",
"copies": "1",
"size": "1254",
"license": "bsd-3-clause",
"hash": 5996565469843459000,
"line_mean": 26.2826086957,
"line_max": 70,
"alpha_frac": 0.7073365231,
"autogenerated": false,
"ratio": 3.142857142857143,
"config_test": false,
"... |
"""jaspar URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | {
"repo_name": "asntech/jaspar",
"path": "jaspar/urls.py",
"copies": "1",
"size": "2251",
"license": "bsd-3-clause",
"hash": 2784801447216899000,
"line_mean": 30.2638888889,
"line_max": 84,
"alpha_frac": 0.6974677921,
"autogenerated": false,
"ratio": 3.3397626112759644,
"config_test": false,
"... |
__author__ = 'azo0502'
# import Raspberry Pi GPIO support into Python environment
import RPi.GPIO as GPIO
# import a sleep function from time module
from time import sleep
led = 18 # GPIO number where the led is connected
# Tell the GPIO module to use GPIO numbering used by processor
GPIO.setmode(GPIO.BCM)
# Set G... | {
"repo_name": "TonyMcTony/raspberry_pi_led",
"path": "server_led.py",
"copies": "1",
"size": "1400",
"license": "mit",
"hash": 1922082169256376000,
"line_mean": 30.8409090909,
"line_max": 99,
"alpha_frac": 0.6864285714,
"autogenerated": false,
"ratio": 3.626943005181347,
"config_test": false,
... |
__author__ = 'azo0502'
# import Raspberry Pi GPIO support into Python environment
import RPi.GPIO as GPIO
# import a sleep function from time module
from time import sleep
red_led = 10 # GPIO number where the red led channel is connected
green_led = 22 # GPIO number where the green led channel is connected
blue_led ... | {
"repo_name": "TonyMcTony/raspberry_pi_led",
"path": "server_rgb_led.py",
"copies": "1",
"size": "2356",
"license": "mit",
"hash": -338882202333692700,
"line_mean": 34.7121212121,
"line_max": 99,
"alpha_frac": 0.6578947368,
"autogenerated": false,
"ratio": 3.658385093167702,
"config_test": fals... |
__author__ = 'azu'
import random
import numpy as np
from practices.config import SELECTED_FUNCTION, POPULATION_SIZE, NUMBER_OF_GENERATIONS, EPSILON, PRINTING_INTERVAL
from escom.pepo.utils import measure_time
from practices.second.particle_swarm_optimization.pso_fitness import function
from escom.pepo.config import N... | {
"repo_name": "pepo27/EvolutionaryComputing",
"path": "practices/second/particle_swarm_optimization/pso_evaluation.py",
"copies": "2",
"size": "4196",
"license": "apache-2.0",
"hash": 3317765030147564500,
"line_mean": 37.1545454545,
"line_max": 116,
"alpha_frac": 0.6391801716,
"autogenerated": fals... |
__author__ = 'b03418'
import sys
try:
from functools import partial
except ImportError: # python < 2.5
class partial(object): #Simple partial object to replace
def __init__(self, func, *args, **keywords):
self.func = func
self.args = args
self.keywords = keywords
... | {
"repo_name": "bossiernesto/python-snipplets",
"path": "decorator.py",
"copies": "1",
"size": "1669",
"license": "bsd-3-clause",
"hash": 4655643276479839000,
"line_mean": 24.6769230769,
"line_max": 83,
"alpha_frac": 0.6309167166,
"autogenerated": false,
"ratio": 3.684326710816777,
"config_test"... |
__author__ = 'bagrat'
from setuptools import setup, find_packages
tests_require = ['nose', 'coverage']
install_requires = ['pyflect']
classifiers = ['License :: OSI Approved :: MIT License',
'Intended Audience :: Developers',
'Natural Language :: English',
'Programming L... | {
"repo_name": "n9code/pyerarchy",
"path": "setup.py",
"copies": "1",
"size": "1252",
"license": "mit",
"hash": -8266065246034002000,
"line_mean": 32.8378378378,
"line_max": 78,
"alpha_frac": 0.5878594249,
"autogenerated": false,
"ratio": 4.051779935275081,
"config_test": false,
"has_no_keywor... |
__author__ = 'bagrat'
def replace_version(content, from_version, to_version):
"""
Replaces the value of the version specification value in the contents of
``contents`` from ``from_version`` to ``to_version``.
:param content: The string containing version specification
:param to_version: The new v... | {
"repo_name": "n9code/pylease",
"path": "pylease/filemgmt.py",
"copies": "1",
"size": "1731",
"license": "mit",
"hash": -7185312423096885000,
"line_mean": 27.3770491803,
"line_max": 83,
"alpha_frac": 0.6331600231,
"autogenerated": false,
"ratio": 3.8127753303964758,
"config_test": false,
"has... |
__author__ = 'bajai'
import bestaplayer
import os
from time import sleep
class GameMaster:
def __init__(self, fichier, player):
self.bot_player = bestaplayer.BestaPlayer(fichier, player)
self.grid = self.bot_player.grille
self.fichier = fichier
def displayGrid(self):
"""
... | {
"repo_name": "KeserOner/puissance4",
"path": "gamemaster.py",
"copies": "1",
"size": "8478",
"license": "mit",
"hash": -5057292824000454000,
"line_mean": 28.3356401384,
"line_max": 107,
"alpha_frac": 0.4407879217,
"autogenerated": false,
"ratio": 4.511974454497073,
"config_test": false,
"has... |
__author__ = 'bakalor'
__maintainer__ = "Igor Bakalo"
__email__ = "bigorigor.ua@gmail.com"
__status__ = "Development"
from defusedxml import ElementTree as ET
import re
from dojo.models import Finding
class SpotbugsXMLParser(object):
def __init__(self, filename, test):
bug_patterns = dict()
dup... | {
"repo_name": "rackerlabs/django-DefectDojo",
"path": "dojo/tools/spotbugs/parser.py",
"copies": "1",
"size": "1965",
"license": "bsd-3-clause",
"hash": -126224618506014770,
"line_mean": 29.2307692308,
"line_max": 136,
"alpha_frac": 0.4900763359,
"autogenerated": false,
"ratio": 4.154334038054968... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.