text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'rvbiljouw'
class Shop:
""" A wrapper for a Dominos shop """
def __init__(self, client, data):
self.client = client
self.id = data['id']
self.name = data['name']
self.address1 = data['address1']
self.address2 = data['address2']
self.address3 = data[... | {
"repo_name": "freecode/dominos-cli",
"path": "dominoscli/shop.py",
"copies": "1",
"size": "1272",
"license": "mit",
"hash": 8785342052089039000,
"line_mean": 36.4117647059,
"line_max": 75,
"alpha_frac": 0.5982704403,
"autogenerated": false,
"ratio": 3.5235457063711912,
"config_test": false,
... |
__author__ = 'rvuine'
from micropsi_core.nodenet.stepoperators import StepOperator, Propagate, Calculate
class DictPropagate(Propagate):
"""
The default dict implementation of the Propagate operator.
"""
def execute(self, nodenet, nodes, netapi):
""" propagate activation from gates to slots v... | {
"repo_name": "ianupright/micropsi2",
"path": "micropsi_core/nodenet/dict_engine/dict_stepoperators.py",
"copies": "2",
"size": "4264",
"license": "mit",
"hash": -7980909978822726000,
"line_mean": 44.3617021277,
"line_max": 134,
"alpha_frac": 0.558630394,
"autogenerated": false,
"ratio": 4.307070... |
__author__ = 'rvuine'
from micropsi_core.world.worldobject import WorldObject
class Shape():
def __init__(self, type, color):
self.type = type
self.color = color
VER_B = Shape("ver", "brown")
COM_G = Shape("com", "green")
CIR_P = Shape("cir", "purple")
CIR_B = Shape("cir", "brown")
CIR_R = Shap... | {
"repo_name": "printedheart/micropsi2",
"path": "micropsi_core/world/island/structured_objects/objects.py",
"copies": "3",
"size": "5818",
"license": "mit",
"hash": -4824005106973636000,
"line_mean": 37.2763157895,
"line_max": 100,
"alpha_frac": 0.3361980062,
"autogenerated": false,
"ratio": 3.37... |
__author__ = 'rvuine'
GRIDSIZE = 5
HALFGRID = int((GRIDSIZE-1) / 2)
class Scene():
@property
def fovea_x(self):
return self.__fovea_x
@property
def fovea_y(self):
return self.__fovea_y
def __init__(self, world, agent_id):
self.__fovea_x = 0
self.__fovea_y = 0
... | {
"repo_name": "ianupright/micropsi2",
"path": "micropsi_core/world/island/structured_objects/scene.py",
"copies": "3",
"size": "4597",
"license": "mit",
"hash": -7052380343998111000,
"line_mean": 34.3615384615,
"line_max": 116,
"alpha_frac": 0.5433978682,
"autogenerated": false,
"ratio": 3.613993... |
__author__ = 'rvuine'
import json
import os
import warnings
import micropsi_core
from micropsi_core.nodenet import monitor
from micropsi_core.nodenet.node import Nodetype
from micropsi_core.nodenet.nodenet import Nodenet, NODENET_VERSION, NodenetLockException
from micropsi_core.nodenet.stepoperators import Doernerian... | {
"repo_name": "ianupright/micropsi2",
"path": "micropsi_core/nodenet/dict_engine/dict_nodenet.py",
"copies": "2",
"size": "29742",
"license": "mit",
"hash": 3061804400317697500,
"line_mean": 39.2994579946,
"line_max": 121,
"alpha_frac": 0.5796039138,
"autogenerated": false,
"ratio": 3.94338371784... |
__author__ = 'rvuine'
import logging
from micropsi_core.world.island import island
from micropsi_core.world.island.structured_objects.objects import *
from micropsi_core.world.island.structured_objects.scene import Scene
from micropsi_core.world.worldadapter import WorldAdapter
class StructuredObjects(WorldAdapter):... | {
"repo_name": "ianupright/micropsi2",
"path": "micropsi_core/world/island/structured_objects/structured_objects.py",
"copies": "2",
"size": "4355",
"license": "mit",
"hash": 2658243357091846000,
"line_mean": 42.55,
"line_max": 116,
"alpha_frac": 0.6429391504,
"autogenerated": false,
"ratio": 3.84... |
__author__ = 'rvuine'
import math
def gentle_sigmoid(x):
return 2 * ((1 / (1 + math.exp(-0.5 * x))) - 0.5)
def calc_emoexpression_parameters(nodenet):
emoexpression = dict()
emo_selection_threshold = nodenet.get_modulator("emo_selection_threshold")
emo_securing_rate = nodenet.get_modulator("emo_s... | {
"repo_name": "printedheart/micropsi2",
"path": "micropsi_core/emoexpression.py",
"copies": "2",
"size": "1816",
"license": "mit",
"hash": 8504932748586982000,
"line_mean": 38.5,
"line_max": 102,
"alpha_frac": 0.6844713656,
"autogenerated": false,
"ratio": 3.1042735042735043,
"config_test": fal... |
__author__ = 'rvuine'
import micropsi_core.tools
import math
from abc import ABCMeta, abstractmethod
class StepOperator(metaclass=ABCMeta):
"""
A step operator will be executed once per net step on all nodes.
"""
@property
@abstractmethod
def priority(self):
"""
Returns a num... | {
"repo_name": "ianupright/micropsi2",
"path": "micropsi_core/nodenet/stepoperators.py",
"copies": "2",
"size": "7888",
"license": "mit",
"hash": -3638606346809366500,
"line_mean": 43.3033707865,
"line_max": 161,
"alpha_frac": 0.6413898047,
"autogenerated": false,
"ratio": 3.5992697398448197,
"c... |
__author__ = 'rwechsler'
import codecs
import gensim
import re
import numpy as np
from scipy.stats import spearmanr
def load_word2vecmodel(file_name):
return gensim.models.Word2Vec.load_word2vec_format(file_name, binary=True)
def load_prototypes(file_name):
prototypes = dict()
infile = codecs.open(file_na... | {
"repo_name": "jodaiber/semantic_compound_splitting",
"path": "visualization_and_test/similarity.py",
"copies": "1",
"size": "3510",
"license": "apache-2.0",
"hash": -6331000876410015000,
"line_mean": 26.2170542636,
"line_max": 86,
"alpha_frac": 0.5341880342,
"autogenerated": false,
"ratio": 3.30... |
__author__ = 'rwechsler'
import cPickle as pickle
import itertools
import random
from annoy import AnnoyIndex
import multiprocessing as mp
import sys
import argparse
import time
import datetime
import numpy as np
import gensim
def timestamp():
return datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%... | {
"repo_name": "jodaiber/semantic_compound_splitting",
"path": "visualization_and_test/evaluate_candidates.py",
"copies": "1",
"size": "5035",
"license": "apache-2.0",
"hash": 4607514825821920000,
"line_mean": 32.3443708609,
"line_max": 132,
"alpha_frac": 0.657795432,
"autogenerated": false,
"rati... |
__author__ = 'rwechsler'
import datetime
import time
import cPickle as pickle
from annoy import AnnoyIndex
import gensim
import argparse
import numpy as np
import sys
import random
from scipy import spatial
import multiprocessing as mp
from collections import defaultdict
import codecs
def timestamp():
return datet... | {
"repo_name": "jodaiber/semantic_compound_splitting",
"path": "visualization_and_test/evaluate_prototypes.py",
"copies": "1",
"size": "8096",
"license": "apache-2.0",
"hash": 7221705057155233000,
"line_mean": 36.1422018349,
"line_max": 217,
"alpha_frac": 0.6679841897,
"autogenerated": false,
"rat... |
__author__ = 'rwechsler'
import gensim
import cPickle as pickle
import argparse
import sys
import codecs
def load_word2vecmodel(file_name):
return gensim.models.Word2Vec.load_word2vec_format(file_name, binary=True)
def load_prototype_dump(file_name):
return pickle.load(open(file_name, "rb"))
def get_word_... | {
"repo_name": "jodaiber/semantic_compound_splitting",
"path": "visualization_and_test/map_prototypes_to_words.py",
"copies": "1",
"size": "1572",
"license": "apache-2.0",
"hash": -6109152730685275000,
"line_mean": 32.4468085106,
"line_max": 135,
"alpha_frac": 0.6628498728,
"autogenerated": false,
... |
__author__ = 'ryad0m'
# noinspection PyProtectedMember
from preparation.resources.ngram import _raw_data
from preparation.resources.Resource import gen_resource
from hb_res.explanations import Explanation
from preparation import modifiers
ngram_mods = [
modifiers.ensure_russian_title(),
modifiers.re_replace('... | {
"repo_name": "hatbot-team/hatbot_resources",
"path": "preparation/resources/ngram/parse_ngram.py",
"copies": "1",
"size": "1072",
"license": "mit",
"hash": 8323663903320175000,
"line_mean": 34.7,
"line_max": 74,
"alpha_frac": 0.6461251167,
"autogenerated": false,
"ratio": 3.477272727272727,
"c... |
from math import cos, sin
from math import atan
from math import pi
from math import pow
from math import sqrt
import adsk.core, adsk.fusion, traceback
# global set of event handlers to keep them referenced for the duration of the command
handlers = []
defaultAirfoilProfile = '2412'
defaultAirfoilNumPts = 30
default... | {
"repo_name": "arnaudin/fusion360-airfoil-generator",
"path": "fusion360-airfoil-generator-script/fusion360-airfoil-generator-script.py",
"copies": "1",
"size": "15956",
"license": "mit",
"hash": -7786083060196525000,
"line_mean": 33.6869565217,
"line_max": 125,
"alpha_frac": 0.5906868889,
"autogen... |
from math import cos, sin
from math import atan
from math import pi
from math import pow
from math import sqrt
import adsk.core, adsk.fusion, traceback
commandIdOnPanel = 'airfoilCommandOnPanel'
defaultAirfoilProfile = '2412'
defaultAirfoilNumPts = 120
defaultAirfoilHalfCosine = False
defaultAirfoilFT = False
maxNum... | {
"repo_name": "arnaudin/fusion360-airfoil-generator",
"path": "fusion360-airfoil-generator-addin/fusion360-airfoil-generator-addin.py",
"copies": "1",
"size": "20415",
"license": "mit",
"hash": -8201105112911549000,
"line_mean": 37.8136882129,
"line_max": 565,
"alpha_frac": 0.5792309576,
"autogener... |
# Given a value N, if we want to make change for N cents, and we have infinite
# supply of each of S = { S1, S2, .. , Sm} valued coins, how many ways can we make
# the change? The order of coins doesn’t matter.
# For example, for N = 4 and S = {1,2,3}, there are four solutions: {1,1,1,1},{1,1,2},{2,2},{1,3}.
# So ou... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "dynamic_programming/coin_changes.py",
"copies": "1",
"size": "1063",
"license": "apache-2.0",
"hash": 6854193646509310000,
"line_mean": 35.5862068966,
"line_max": 98,
"alpha_frac": 0.5466540999,
"autogenerated": false,
"ratio": 2.55662650602409... |
# Given weights and values of n items, put these items in a knapsack of capacity
# W to get the maximum total value in the knapsack. In other words,
# given two integer arrays val[0..n-1] and wt[0..n-1]
# which represent values and weights associated with n items respectively.
# Also given an integer W which represent... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "dynamic_programming/knapsack_01.py",
"copies": "1",
"size": "1315",
"license": "apache-2.0",
"hash": 2454469071665073000,
"line_mean": 41.3548387097,
"line_max": 87,
"alpha_frac": 0.6329017517,
"autogenerated": false,
"ratio": 3.039351851851851... |
# You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
# You may assume the two numbers do not contain any leading zero, except the number 0 itself.
# ... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "medium/add_two_numbers.py",
"copies": "1",
"size": "2293",
"license": "apache-2.0",
"hash": -8261563696743109000,
"line_mean": 28.0253164557,
"line_max": 221,
"alpha_frac": 0.56519843,
"autogenerated": false,
"ratio": 3.577223088923557,
"conf... |
# Given a string, find the length of the longest substring without repeating characters.
# Examples:
# Given "abcabcbb", the answer is "abc", which the length is 3.
# Given "bbbbb", the answer is "b", with the length of 1.
# Given "pwwkew", the answer is "wke", with the length of 3. Note that the answer must be a ... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "medium/longest_substring_without_repeating_characters.py",
"copies": "1",
"size": "1026",
"license": "apache-2.0",
"hash": -5396125116786296000,
"line_mean": 24.65,
"line_max": 147,
"alpha_frac": 0.5701754386,
"autogenerated": false,
"ratio": 3... |
# Given two sorted arrays of size m and n respectively, you are tasked with finding the element that would be at the k’th position of the final sorted array.
# Examples:
# Input : Array 1 - 2 3 6 7 9
# Array 2 - 1 4 8 10
# k = 5
# Output : 6
#
#
# Input : Array 1 - 100 112 256 349 770
# Array... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "hard/kth_element_of_two_arrays.py",
"copies": "1",
"size": "1041",
"license": "apache-2.0",
"hash": -22183827084889228,
"line_mean": 25.641025641,
"line_max": 157,
"alpha_frac": 0.5640038499,
"autogenerated": false,
"ratio": 2.7198952879581153,... |
# An element in a sorted array can be found in O(log n) time via binary search.
# But suppose we rotate an ascending order sorted array at some pivot unknown
# to you beforehand. So for instance, 1 2 3 4 5 might become 3 4 5 1 2. Devise
# a way to find an element in the rotated array in O(log n) time.
# Input : arr[... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "medium/search_rotated_array.py",
"copies": "1",
"size": "1773",
"license": "apache-2.0",
"hash": -6976186219547076000,
"line_mean": 35.9375,
"line_max": 90,
"alpha_frac": 0.5877044557,
"autogenerated": false,
"ratio": 3.1945945945945944,
"con... |
# An edge in an undirected connected graph is a bridge iff removing it disconnects the graph.
# Write an algorithm which finds all bridges in an undirected, connected simple graph in linear time
# Runtime of my solution is O(V+E)
# It took me like 7 hours to figure out + understand the linear time solution for this... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "impossible/bridges_in_graph.py",
"copies": "1",
"size": "1839",
"license": "apache-2.0",
"hash": 401188988164823300,
"line_mean": 28.6612903226,
"line_max": 106,
"alpha_frac": 0.582925503,
"autogenerated": false,
"ratio": 3.4309701492537314,
... |
# Given K sorted linked lists of size N each, merge them and print the sorted output.
# Example:
# Input: k = 3, n = 4
# list1 = 1->3->5->7
# list2 = 2->4->6->8
# list3 = 0->9->10->11
# Output:
# 0->1->2->3->4->5->6->7->8->9->10->11
class LLNode():
def __init__(self, value):
self.value = value
... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "hard/merge_k_lists.py",
"copies": "1",
"size": "2041",
"license": "apache-2.0",
"hash": -2383621087271296000,
"line_mean": 21.9325842697,
"line_max": 85,
"alpha_frac": 0.6496815287,
"autogenerated": false,
"ratio": 2.464975845410628,
"config_... |
# Given a directed graph, check whether the graph contains a cycle or not.
# Your function should return true if the given graph contains at least one cycle,
# else return false.
from collections import defaultdict
# Represent a directed graph using an adjacency list
class Graph():
def __init__(self):
... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "medium/detect_cycles_in_graph.py",
"copies": "1",
"size": "1271",
"license": "apache-2.0",
"hash": -6692206787965345000,
"line_mean": 26.0425531915,
"line_max": 82,
"alpha_frac": 0.602675059,
"autogenerated": false,
"ratio": 3.5502793296089385,... |
# Implement next permutation, which rearranges numbers into the lexicographically
# next greater permutation of numbers.
# If such arrangement is not possible, it must rearrange it as the lowest possible
# order (ie, sorted in ascending order).
# The replacement must be in-place, do not allocate extra memory.
# Her... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "medium/next_permutation.py",
"copies": "1",
"size": "1343",
"license": "apache-2.0",
"hash": 1118946880745051300,
"line_mean": 24.7115384615,
"line_max": 82,
"alpha_frac": 0.5744203441,
"autogenerated": false,
"ratio": 2.971111111111111,
"con... |
# Given a cost matrix cost[][] and a position (m, n) in cost[][], write a
# function that returns cost of minimum cost path to reach (m, n) from (0, 0).
# Each cell of the matrix represents a cost to traverse through that cell.
# Total cost of a path to reach (m, n) is sum of all the costs on that path
# (including bo... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "dynamic_programming/min_cost_path.py",
"copies": "1",
"size": "1692",
"license": "apache-2.0",
"hash": -6755350643783124000,
"line_mean": 32.1764705882,
"line_max": 114,
"alpha_frac": 0.5910165485,
"autogenerated": false,
"ratio": 2.72903225806... |
# Given two strings str1 and str2 and below operations that can performed on str1.
# Find minimum number of edits (operations) required to convert ‘str1’ into ‘str2’.
# Insert
# Remove
# Replace
# All of the above operations are of equal cost.
def find_edit_distance(str1, str2):
#initialize dp matrix
arr = ... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "dynamic_programming/edit_distance.py",
"copies": "1",
"size": "1377",
"license": "apache-2.0",
"hash": -2628080234642686000,
"line_mean": 26.38,
"line_max": 84,
"alpha_frac": 0.5485756026,
"autogenerated": false,
"ratio": 2.8640167364016738,
... |
# Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
# Note: The solution set must not contain duplicate triplets.
# For example, given array S = [-1, 0, 1, 2, -1, -4],
# A solution set is:
# [
# [-1, 0, 1],
#... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "medium/3sum.py",
"copies": "1",
"size": "1318",
"license": "apache-2.0",
"hash": 2547768661459107300,
"line_mean": 27.0425531915,
"line_max": 157,
"alpha_frac": 0.4256449165,
"autogenerated": false,
"ratio": 3.370843989769821,
"config_test": ... |
# Given a linked list, remove the nth node from the end of list and return its head.
# For example,
# Given linked list: 1->2->3->4->5, and n = 2.
# After removing the second node from the end, the linked list becomes 1->2->3->5.
# Note:
# Given n will always be valid.
# Try to do this in one pass.
class L... | {
"repo_name": "Patchett/Leetcode-Problems",
"path": "medium/remove_nth_node_from_end_of_list.py",
"copies": "1",
"size": "1381",
"license": "apache-2.0",
"hash": 3780286430233830000,
"line_mean": 21.2741935484,
"line_max": 85,
"alpha_frac": 0.5814627082,
"autogenerated": false,
"ratio": 3.1893764... |
import csv
from pylab import *
# editable settings
# csv containing averaged results from batch simulation
filename = 'averages.csv'
# name of csv column to use for x-axis
xcol = 'msgden'
# x axis title
xaxistitle = 'Message Density'
# list of csv columns to use for y-axis (one per graph)
ycols = ['simtime', 'even... | {
"repo_name": "wilseypa/warped-models",
"path": "src/scripts/plot.py",
"copies": "1",
"size": "2538",
"license": "mit",
"hash": -6636392954242782000,
"line_mean": 29.9512195122,
"line_max": 70,
"alpha_frac": 0.5654058314,
"autogenerated": false,
"ratio": 2.982373678025852,
"config_test": false,... |
__author__ = "Ryan Dale"
__copyright__ = "Copyright 2016, Ryan Dale"
__email__ = "dalerr@niddk.nih.gov"
__license__ = "MIT"
from snakemake.shell import shell
from lcdblib.snakemake import aligners
bowtie2_extra = snakemake.params.get('bowtie2_extra', '')
samtools_view_extra = snakemake.params.get('samtools_view_extra... | {
"repo_name": "lcdb/lcdb-wrapper-tests",
"path": "wrappers/bowtie2/align/wrapper.py",
"copies": "1",
"size": "1507",
"license": "mit",
"hash": 2028644449184160500,
"line_mean": 26.9074074074,
"line_max": 79,
"alpha_frac": 0.6615792966,
"autogenerated": false,
"ratio": 2.903660886319846,
"config... |
__author__ = "Ryan Dale"
__copyright__ = "Copyright 2016, Ryan Dale"
__email__ = "dalerr@niddk.nih.gov"
__license__ = "MIT"
from snakemake.shell import shell
extra = snakemake.params.get('extra', '')
log = snakemake.log_fmt_shell()
inputs = snakemake.input
outputs = snakemake.output
if isinstance(inputs, dict) and i... | {
"repo_name": "lcdb/lcdb-wrapper-tests",
"path": "wrappers/atropos/wrapper.py",
"copies": "1",
"size": "2621",
"license": "mit",
"hash": 4238345969196681700,
"line_mean": 31.7625,
"line_max": 102,
"alpha_frac": 0.5887066005,
"autogenerated": false,
"ratio": 3.13142174432497,
"config_test": fals... |
__author__ = "Ryan Dale"
__copyright__ = "Copyright 2016, Ryan Dale"
__email__ = "dalerr@niddk.nih.gov"
__license__ = "MIT"
from tempfile import NamedTemporaryFile
from snakemake.shell import shell
from lcdblib.snakemake import aligners
hisat2_extra = snakemake.params.get('hisat2_extra', '')
samtools_view_extra = sna... | {
"repo_name": "lcdb/lcdb-wrapper-tests",
"path": "wrappers/hisat2/align/wrapper.py",
"copies": "1",
"size": "2293",
"license": "mit",
"hash": 1284736474647062000,
"line_mean": 31.2957746479,
"line_max": 86,
"alpha_frac": 0.6554731792,
"autogenerated": false,
"ratio": 3.1197278911564625,
"config... |
__author__ = "Ryan Dale"
__copyright__ = "Copyright 2016, Ryan Dale"
__email__ = "dalerr@niddk.nih.gov"
__license__ = "MIT"
import os
from snakemake.shell import shell
from snakemake.utils import makedirs
# fastqc creates a zip file and an html file but the filename is hard-coded by
# replacing fastq|fastq.gz|fq|fq.g... | {
"repo_name": "lcdb/lcdb-wrapper-tests",
"path": "wrappers/fastqc/wrapper.py",
"copies": "1",
"size": "1337",
"license": "mit",
"hash": 7913101163891536000,
"line_mean": 26.8541666667,
"line_max": 78,
"alpha_frac": 0.660433807,
"autogenerated": false,
"ratio": 2.9128540305010895,
"config_test":... |
__author__ = "Ryan Dale"
__copyright__ = "Copyright 2016, Ryan Dale"
__email__ = "dalerr@niddk.nih.gov"
__license__ = "MIT"
import os
from snakemake.shell import shell
outdir = os.path.dirname(snakemake.output[0])
# fastqc creates a zip file and an html file but the filename is hard-coded by
# replacing fastq|fastq.g... | {
"repo_name": "lcdb/lcdb-workflows",
"path": "wrappers/fastqc/wrapper.py",
"copies": "1",
"size": "1152",
"license": "mit",
"hash": -3327573990739186700,
"line_mean": 28.5384615385,
"line_max": 78,
"alpha_frac": 0.6631944444,
"autogenerated": false,
"ratio": 2.9844559585492227,
"config_test": f... |
__author__ = 'Ryan Jones'
import unittest
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from pathways.time_series import TimeSeries
class TestTimeSeries(unittest.TestCase):
def test_clean(self):
newindex = np.arange(2000, 2051)
x = np.array([])
y = np.array(... | {
"repo_name": "energyPATHWAYS/energyPATHWAYS",
"path": "energyPATHWAYS/_obsolete/tests/test_time_series.py",
"copies": "1",
"size": "1643",
"license": "mit",
"hash": -3919759807238451700,
"line_mean": 30.0188679245,
"line_max": 108,
"alpha_frac": 0.567863664,
"autogenerated": false,
"ratio": 3.11... |
__author__ = 'Ryan Lonergan'
from flask import render_template, flash, redirect, request, jsonify
from website import app
from .database.db_query import search_for_suburb, get_tax_data, get_crime
from .database.db_exceptions import *
@app.route('/')
@app.route('/index')
def index():
return render_template('index.... | {
"repo_name": "r-portas/govhack2015",
"path": "website/views.py",
"copies": "1",
"size": "2666",
"license": "mit",
"hash": 4055003320132964400,
"line_mean": 29.2954545455,
"line_max": 73,
"alpha_frac": 0.5618904726,
"autogenerated": false,
"ratio": 3.739130434782609,
"config_test": false,
"ha... |
__author__ = 'Ryan Morlok (ryan@docalytics.com)'
from datetime import datetime
try:
import iso8601
except ImportError:
import _local_iso8601 as iso8601
from webob import exc
from pytracts import messages, to_url, util
#
# Decorators used to make handlers more explicit. Enable things like declarative, strongl... | {
"repo_name": "rmorlok/pytracts",
"path": "pytracts/query.py",
"copies": "1",
"size": "14792",
"license": "apache-2.0",
"hash": 8231849323241400000,
"line_mean": 41.8782608696,
"line_max": 314,
"alpha_frac": 0.6485938345,
"autogenerated": false,
"ratio": 4.573902288188003,
"config_test": false,... |
# Last Updated: 6/13/2005
#
# This tutorial provides an example of creating a character
# and having it walk around on uneven terrain, as well
# as implementing a fully rotatable camera.
import direct.directbase.DirectStart
from panda3d.core import CollisionTraverser,CollisionNode
from panda3d.core import CollisionH... | {
"repo_name": "ToonTownInfiniteRepo/ToontownInfinite",
"path": "Panda3D-1.9.0/samples/Roaming-Ralph/Tut-Roaming-Ralph.py",
"copies": "3",
"size": "10730",
"license": "mit",
"hash": -1999695570994312400,
"line_mean": 40.1111111111,
"line_max": 96,
"alpha_frac": 0.6250698975,
"autogenerated": false,
... |
__author__ = 'ryan'
#from config import cfgfile, cur, geo, dnmtr_col_names, drivr_col_names
#import config as cfg
import config as cfg
import util
import numpy as np
import pandas as pd
from time_series import TimeSeries
from collections import OrderedDict
import os
import copy
import time
from util import DfOper
impo... | {
"repo_name": "energyPATHWAYS/energyPATHWAYS",
"path": "energyPATHWAYS/datamapfunctions.py",
"copies": "1",
"size": "25328",
"license": "mit",
"hash": 6111805788620240000,
"line_mean": 63.1215189873,
"line_max": 253,
"alpha_frac": 0.6256317119,
"autogenerated": false,
"ratio": 3.940261356565028,
... |
__author__ = 'ryan'
import config as cfg
import pandas as pd
import numpy as np
import os
import copy
import util
from collections import OrderedDict, defaultdict
import textwrap
import logging
import pdb
from energyPATHWAYS.time_series import TimeSeries
class GeoMapper:
def __init__(self):
self.geographi... | {
"repo_name": "energyPATHWAYS/energyPATHWAYS",
"path": "energyPATHWAYS/geomapper.py",
"copies": "1",
"size": "24160",
"license": "mit",
"hash": 1579339445974907000,
"line_mean": 57.2168674699,
"line_max": 184,
"alpha_frac": 0.654718543,
"autogenerated": false,
"ratio": 3.582974936971674,
"confi... |
__author__ = 'Ryan Perkins'
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from crispy_forms.helper import FormHelper, Layout
from crispy_forms.layout import Submit
from userprofile.models import UserProfile
class MyRegistrationForm(UserCre... | {
"repo_name": "cryanperkins/PoolRyde",
"path": "poolryde/poolryde/forms.py",
"copies": "1",
"size": "1474",
"license": "apache-2.0",
"hash": 4528185001280032300,
"line_mean": 31.7555555556,
"line_max": 65,
"alpha_frac": 0.65807327,
"autogenerated": false,
"ratio": 3.909814323607427,
"config_tes... |
__author__ = 'Ryan Perkins'
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.contrib import auth
from django.core.context_processors import csrf
from userprofile.models import UserProfile
from .forms import MyRegistrationForm
from userprofile.forms import UserPro... | {
"repo_name": "cryanperkins/PoolRyde",
"path": "poolryde/poolryde/views.py",
"copies": "1",
"size": "1870",
"license": "apache-2.0",
"hash": 734075986453156100,
"line_mean": 25.7142857143,
"line_max": 67,
"alpha_frac": 0.6930481283,
"autogenerated": false,
"ratio": 3.961864406779661,
"config_te... |
__author__ = 'ryan'
class UserList(object):
def __init__(self):
self.users = []
self.raw_users = []
def add_users(self, users):
self.users.extend(users)
for user in users:
user = user.replace("@", "").replace("+", "")
self.raw_users.append(user)... | {
"repo_name": "rymate1234/Gnome-IRC",
"path": "gnomeirc/UserList.py",
"copies": "1",
"size": "1354",
"license": "mit",
"hash": -8305849977738575000,
"line_mean": 25.6734693878,
"line_max": 57,
"alpha_frac": 0.5140324963,
"autogenerated": false,
"ratio": 3.913294797687861,
"config_test": false,
... |
__author__ = 'Ryan'
from pymongo import MongoClient
import sys;
import scipy;
import matplotlib.pyplot as plt;
import numpy;
import time;
print("running match processor");
client = MongoClient('mongo',27017)
db = client.urfday
#Should get this through API, Hard coded for now.
champIDs = [1,2,3,4,5,6,7,... | {
"repo_name": "notnarb/LOLScrub",
"path": "matchProcessor/ProcessData/process.py",
"copies": "1",
"size": "12215",
"license": "mpl-2.0",
"hash": -484108086308336960,
"line_mean": 38.5813953488,
"line_max": 889,
"alpha_frac": 0.6158002456,
"autogenerated": false,
"ratio": 3.2340481863913157,
"co... |
__author__ = 'Ryan'
import time;
import sys;
from pymongo import MongoClient
print("Processing Matches into Kill Collection");
client = MongoClient('mongo',27017)
db = client.urfday
def processMatchesIntoKillCollection():
print("Adding matches to our kill Collection")
matchCollection = db.matches... | {
"repo_name": "notnarb/LOLScrub",
"path": "matchProcessor/ProcessMatchesIntoKillCollection/ProcessMatchesIntoKillCollection.py",
"copies": "1",
"size": "9479",
"license": "mpl-2.0",
"hash": -1176150884929660700,
"line_mean": 38.1652542373,
"line_max": 414,
"alpha_frac": 0.5298027218,
"autogenerated... |
from __future__ import absolute_import, division, print_function
import os
# gpi, future
import gpi
from bart.gpi.borg import IFilePath, OFilePath, Command
# bart
import bart
base_path = bart.__path__[0] # library base for executables
import bart.python.cfl as cfl
class ExternalNode(gpi.NodeAPI):
'''Usage: ./e... | {
"repo_name": "nckz/bart",
"path": "gpi/ECalib_GPI.py",
"copies": "1",
"size": "3189",
"license": "bsd-3-clause",
"hash": -4921468065053031000,
"line_mean": 30.2647058824,
"line_max": 157,
"alpha_frac": 0.5851364064,
"autogenerated": false,
"ratio": 3.512114537444934,
"config_test": false,
"h... |
from __future__ import absolute_import, division, print_function
import os
# gpi
import gpi
from bart.gpi.borg import IFilePath, OFilePath, Command
# bart
import bart
base_path = bart.__path__[0] # library base for executables
import bart.python.cfl as cfl
class ExternalNode(gpi.NodeAPI):
'''Usage: calmat [-k ... | {
"repo_name": "nckz/bart",
"path": "gpi/CalMat_GPI.py",
"copies": "1",
"size": "1648",
"license": "bsd-3-clause",
"hash": -6791400651606511000,
"line_mean": 24.75,
"line_max": 81,
"alpha_frac": 0.6098300971,
"autogenerated": false,
"ratio": 3.513859275053305,
"config_test": false,
"has_no_key... |
__author__ = 'ryanrozewski'
import numpy as np
import pandas as pd
from pandas import DataFrame
from Scheduler import Scheduler
from parameters import xR,simNumber,trim_start,trim_end,t_step,x0Vas,start,referenceDate,fee
from MonteCarloSimulators.Vasicek.vasicekMCSim import MC_Vasicek_Sim
from Curves.Corporates.Corpora... | {
"repo_name": "rrozewsk/OurProject",
"path": "Products/Rates/CouponBond.py",
"copies": "1",
"size": "9588",
"license": "mit",
"hash": 487509511791130200,
"line_mean": 34.5111111111,
"line_max": 159,
"alpha_frac": 0.6705256571,
"autogenerated": false,
"ratio": 3.1009055627425615,
"config_test": ... |
__author__ = 'ryanstuntz'
from django.core.management.base import BaseCommand, CommandError
from lyrics.models import Artist, Song
class Command(BaseCommand):
help = 'Creates artists and verses'
def handle(self, *args, **options):
from selenium import webdriver
driver = webdriver.Chrome()
... | {
"repo_name": "stuntman723/rap-analyzer",
"path": "lyrics/management/commands/populate_artists.py",
"copies": "1",
"size": "1433",
"license": "mit",
"hash": 5306324970469990000,
"line_mean": 36.7368421053,
"line_max": 89,
"alpha_frac": 0.5052337753,
"autogenerated": false,
"ratio": 4.129682997118... |
__author__ = 'Ryan Williams'
def abbreviate_target_ids(arr):
"""This method takes a list of strings (e.g. target IDs) and maps them to shortened versions of themselves. The
original strings should consist of '.'-delimited segments, and the abbreviated versions are subsequences of these
segments such that each st... | {
"repo_name": "imsut/commons",
"path": "src/python/twitter/pants/base/abbreviate_target_ids.py",
"copies": "1",
"size": "2603",
"license": "apache-2.0",
"hash": -9127048289867662000,
"line_mean": 29.2674418605,
"line_max": 115,
"alpha_frac": 0.6469458317,
"autogenerated": false,
"ratio": 3.174390... |
__author__ = 'Ryan Williams'
from abbreviate_target_ids import abbreviate_target_ids
# This file contains the implementation for a doubly-linked DAG data structure that is useful for dependency analysis.
class DoubleDagNode(object):
def __init__(self, data):
self.data = data
self.parents = set()
self.c... | {
"repo_name": "imsut/commons",
"path": "src/python/twitter/pants/base/double_dag.py",
"copies": "1",
"size": "4544",
"license": "apache-2.0",
"hash": 6601661226466259000,
"line_mean": 32.1678832117,
"line_max": 118,
"alpha_frac": 0.6401848592,
"autogenerated": false,
"ratio": 3.6352,
"config_te... |
__author__ = 'Ryan Williams'
import unittest
from twitter.pants.base import DoubleDag
from twitter.pants.goal import Context
from twitter.pants.testutils import MockTarget
def make_dag(nodes):
return DoubleDag(nodes, lambda t: t.dependencies, Context.Log())
class DoubleDagTest(unittest.TestCase):
def check_dag... | {
"repo_name": "imsut/commons",
"path": "tests/python/twitter/pants/base/test_double_dag.py",
"copies": "1",
"size": "4094",
"license": "apache-2.0",
"hash": -6511356040650498000,
"line_mean": 31.4920634921,
"line_max": 92,
"alpha_frac": 0.5698583293,
"autogenerated": false,
"ratio": 2.62099871959... |
__author__ = 'Ryba'
import numpy as np
import matplotlib.pyplot as plt
import skimage.exposure as skexp
from skimage.segmentation import mark_boundaries
import os
import glob
import pydicom
# import cv2
# from skimage import measure
import skimage.measure as skimea
import skimage.morphology as skimor
import skimage.fil... | {
"repo_name": "mjirik/lisa",
"path": "lisa/tools.py",
"copies": "1",
"size": "16490",
"license": "bsd-3-clause",
"hash": -8329296878620480000,
"line_mean": 34.7700650759,
"line_max": 137,
"alpha_frac": 0.5599151001,
"autogenerated": false,
"ratio": 3.0943891912178647,
"config_test": false,
"h... |
__author__ = 'Ryba'
import glob
import itertools
import os
import sys
from collections import namedtuple
import matplotlib.pyplot as plt
import numpy as np
import scipy.ndimage.filters as scindifil
import scipy.ndimage.interpolation as scindiint
import scipy.ndimage.measurements as scindimea
impor... | {
"repo_name": "mjirik/imtools",
"path": "imtools/tools.py",
"copies": "1",
"size": "82418",
"license": "mit",
"hash": 4540674974582675500,
"line_mean": 34.1462686567,
"line_max": 137,
"alpha_frac": 0.563420612,
"autogenerated": false,
"ratio": 3.102036207610373,
"config_test": false,
"has_no_... |
__author__ = 's7a'
# All imports
from extras import Logger
from extras import Sanitizer
from os import walk, stat, path
# The N-Gram class
class NGram:
# Constructor for the N-Gram class
def __init__(self, n, in_dir):
self.n = n
self.in_dir = in_dir
self.table = {}
self.neigh... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/lexus/n_gram.py",
"copies": "1",
"size": "3302",
"license": "mit",
"hash": -2675298248833673700,
"line_mean": 28.7477477477,
"line_max": 102,
"alpha_frac": 0.5093882495,
"autogenerated": false,
"ratio": 3.7480136208853576,
"config_test": false,
... |
__author__ = 's7a'
# All imports
from extras import Logger
from lexus import LWLM
from webapp import WebApp
from subprocess import call
import sys
from os import stat
# Clean up all files
def cleanup():
Logger.log_message('Cleaning up')
call(['rm', '-rf', 'out'])
call(['mkdir', 'out'])
Logger.log_suc... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/main.py",
"copies": "1",
"size": "1029",
"license": "mit",
"hash": -3003525727129960000,
"line_mean": 19.1960784314,
"line_max": 57,
"alpha_frac": 0.6229348882,
"autogenerated": false,
"ratio": 3.7148014440433212,
"config_test": false,
"has_no_... |
__author__ = 's7a'
# All imports
from extras import Logger
from n_gram import NGram
from os import path
# The Latent Words Language Model
class LWLM:
# Constructor for the LWLM
def __init__(self, in_file):
# Build up the LWLM tables
input_file = open(in_file)
self.alt_words_table = ... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/lexus/lwlm.py",
"copies": "1",
"size": "2567",
"license": "mit",
"hash": 8405627548231578000,
"line_mean": 29.9277108434,
"line_max": 90,
"alpha_frac": 0.5594078691,
"autogenerated": false,
"ratio": 3.5752089136490253,
"config_test": false,
"ha... |
__author__ = 's7a'
# All imports
from flask import Flask, render_template, request, jsonify
from extras import Logger
from extras import FleschKincaid
from lexus import LexicalSimplifier
from syntax import SyntacticSimplifier
from enrich import Enricher
# The Web Application class
class WebApp:
# Constructor fo... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/webapp/webapp.py",
"copies": "1",
"size": "2793",
"license": "mit",
"hash": -3598694813780303000,
"line_mean": 28.7234042553,
"line_max": 87,
"alpha_frac": 0.5850340136,
"autogenerated": false,
"ratio": 3.9504950495049505,
"config_test": false,
... |
__author__ = 's7a'
# All imports
from nltk.tree import Tree
# Break the sentence according to appositions
class Appositions:
# Constructor for the Appositions class
def __init__(self):
self.has_apposition = False
self.np_subtrees = []
self.other_subtrees = []
# Break the tree
... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/syntax/appositions.py",
"copies": "1",
"size": "2573",
"license": "mit",
"hash": 2746339887024372700,
"line_mean": 33.7837837838,
"line_max": 103,
"alpha_frac": 0.4356781967,
"autogenerated": false,
"ratio": 4.586452762923352,
"config_test": fals... |
__author__ = 's7a'
# All imports
from nltk.tree import Tree
# The infix coordination class
class InfixCoordination:
# Constructor for the infix coordination
def __init__(self):
self.has_infix_coordination = False
self.subtree_list = []
self.has_infix_coordination_1 = False
s... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/syntax/infix_coordination.py",
"copies": "1",
"size": "3591",
"license": "mit",
"hash": 3673244369548529700,
"line_mean": 39.3595505618,
"line_max": 108,
"alpha_frac": 0.4360902256,
"autogenerated": false,
"ratio": 4.592071611253197,
"config_test... |
__author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Infix Subordination class
class InfixSubordination:
# Constructor for Infix Subordination
def __init__(self):
self.has_infix_subordination = False
self.subtree_list = []
# Break the tree
def break_tree(self, tree):
... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/syntax/infix_subordination.py",
"copies": "1",
"size": "2575",
"license": "mit",
"hash": -4982473706421513000,
"line_mean": 38.6307692308,
"line_max": 107,
"alpha_frac": 0.387961165,
"autogenerated": false,
"ratio": 5.129482071713148,
"config_tes... |
__author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Prefix Subordination class
class PrefixSubordination:
# Constructor for Prefix Subordination
def __init__(self):
self.has_prefix_subordination = False
self.subtree_list = []
# Break the tree
def break_tree(self, tree)... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/syntax/prefix_subordination.py",
"copies": "1",
"size": "2462",
"license": "mit",
"hash": -3587341185485939000,
"line_mean": 34.1857142857,
"line_max": 91,
"alpha_frac": 0.4378554021,
"autogenerated": false,
"ratio": 4.80859375,
"config_test": fa... |
__author__ = 's7a'
# All imports
from nltk.tree import Tree
# The Relative clauses class
class RelativeClauses:
# Constructor for the Relative Clauses class
def __init__(self):
self.has_wh_word = False
self.np_subtrees = []
self.wh_subtrees = []
self.other_subtrees = []
... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/syntax/relative_clauses.py",
"copies": "1",
"size": "3221",
"license": "mit",
"hash": -6601691599979633000,
"line_mean": 38.2926829268,
"line_max": 110,
"alpha_frac": 0.3967711891,
"autogenerated": false,
"ratio": 4.778931750741839,
"config_test"... |
__author__ = 's7a'
# All imports
from os import path
from lwlm import LWLM
from extras import KuceraFrancis
from synonyms import Synonyms
# The Replacer class
class Replacer:
# Constructor for the Replacer class
def __init__(self, lwlm_n):
self.kf = KuceraFrancis(path.join('data', 'kucera_francis.... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/lexus/replacer.py",
"copies": "1",
"size": "1386",
"license": "mit",
"hash": -1030357849287623800,
"line_mean": 27.306122449,
"line_max": 118,
"alpha_frac": 0.5670995671,
"autogenerated": false,
"ratio": 3.6473684210526316,
"config_test": false,
... |
__author__ = 's7a'
# All imports
from parser import Parser
from appositions import Appositions
from relative_clauses import RelativeClauses
from prefix_subordination import PrefixSubordination
from infix_subordination import InfixSubordination
from infix_coordination import InfixCoordination
import re
# The breaker... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/syntax/breaker.py",
"copies": "1",
"size": "2523",
"license": "mit",
"hash": -4023891402512963000,
"line_mean": 33.5753424658,
"line_max": 84,
"alpha_frac": 0.6242568371,
"autogenerated": false,
"ratio": 3.9055727554179565,
"config_test": false,
... |
__author__ = 's7a'
# All imports
import syllables_en
from sanitizer import Sanitizer
import re
# The Flesch Kincaid class
class FleschKincaid:
# Constructor for the Flesch Kincaid class
def __init__(self):
pass
# Calculate the Flesch Kincaid grade level
# Formula: 0.39 (Total Words / Total ... | {
"repo_name": "Somsubhra/Simplify",
"path": "src/extras/flesch_kincaid.py",
"copies": "1",
"size": "1587",
"license": "mit",
"hash": -4085155418688410000,
"line_mean": 28.3888888889,
"line_max": 94,
"alpha_frac": 0.5822306238,
"autogenerated": false,
"ratio": 3.606818181818182,
"config_test": f... |
from __future__ import division, print_function, absolute_import
from itertools import chain
import numpy as np
from sklearn.externals.joblib import Parallel, delayed, cpu_count
from utils import scale
def _partition_X(X, n_jobs):
"""Private function used to partition X between jobs."""
n_nodes = X.shape[1... | {
"repo_name": "orlandi/connectomicsPerspectivesPaper",
"path": "participants_codes/aaagv/directivity.py",
"copies": "1",
"size": "2853",
"license": "mit",
"hash": -7646261548305172000,
"line_mean": 29.3510638298,
"line_max": 74,
"alpha_frac": 0.5800911321,
"autogenerated": false,
"ratio": 3.03510... |
from __future__ import division, print_function, absolute_import
import numpy as np
from sklearn.decomposition import PCA
from utils import scale
###########################################
######### SIMPLIFIED METHOD ###############
###########################################
def f1(X):
return X + np.roll(X,... | {
"repo_name": "orlandi/connectomicsPerspectivesPaper",
"path": "participants_codes/aaagv/PCA.py",
"copies": "1",
"size": "8106",
"license": "mit",
"hash": -6980731629666246000,
"line_mean": 30.5408560311,
"line_max": 96,
"alpha_frac": 0.4412780656,
"autogenerated": false,
"ratio": 2.5299625468164... |
__author__ = 'sabata tomas'
import copy
import numpy as np
# compute sigmoid nonlinearity
def sigmoid(x):
output = 1 / (1 + np.exp(-x))
return output
# convert output of sigmoid function to its derivative
def sigmoid_output_to_derivative(output):
return output * (1 - output)
class RNN:
def __init... | {
"repo_name": "SpeedEX505/pyrnn",
"path": "RNN.py",
"copies": "1",
"size": "5536",
"license": "mit",
"hash": 3528513284540826000,
"line_mean": 41.2595419847,
"line_max": 109,
"alpha_frac": 0.5852601156,
"autogenerated": false,
"ratio": 3.8551532033426184,
"config_test": false,
"has_no_keyword... |
__author__ = 'sabata tomas'
import numpy as np
from RNN import RNN, ProblemObject
class BinaryAddition(ProblemObject):
def __init__(self, a, b):
self.iter_pos = 0
self.output = None
self.a = a
self.b = b
self.pred = []
self.d = []
def to_int(self, list):
... | {
"repo_name": "SpeedEX505/pyrnn",
"path": "examples/addition.py",
"copies": "1",
"size": "2125",
"license": "mit",
"hash": -2975410039838677500,
"line_mean": 26.9736842105,
"line_max": 109,
"alpha_frac": 0.5915294118,
"autogenerated": false,
"ratio": 3.125,
"config_test": false,
"has_no_keywo... |
__author__ = 'sabatha'
class DodgeBall:
def __init__(self, n, k, l, balls):
self.n = n # The number of blocks on the court (width)
self.k = k # The number of block the player occupies
self.l = l # Time the game takes in seconds
self.balls = balls # The position in w... | {
"repo_name": "SabathaBapela/dodgeball",
"path": "dodgeball.py",
"copies": "1",
"size": "4121",
"license": "mit",
"hash": 9111746372834967000,
"line_mean": 29.7153846154,
"line_max": 108,
"alpha_frac": 0.4523173987,
"autogenerated": false,
"ratio": 4.133400200601805,
"config_test": false,
"ha... |
__author__ = 'sabe6191'
import json
import datetime
from tempest.common import rest_client
class DnsClient(rest_client.RestClient):
def __init__(self, config, username, password, auth_url,
token_url ,tenant_name=None):
super(DnsClient, self).__init__(config, username, password, auth_ur... | {
"repo_name": "BeenzSyed/tempest",
"path": "tempest/services/orchestration/json/dns_client.py",
"copies": "1",
"size": "1029",
"license": "apache-2.0",
"hash": -852618624060833500,
"line_mean": 32.2258064516,
"line_max": 77,
"alpha_frac": 0.5792031098,
"autogenerated": false,
"ratio": 3.675,
"c... |
__author__ = 'Saber Shokat Fadaee'
from gensim import corpora, models, similarities
from gensim.models import ldamodel
from gensim.models import HdpModel
import tsne
import numpy as np
import os
import logging
from bokeh.server.serverbb import prune
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)... | {
"repo_name": "sabersf/Botnets",
"path": "Load_word2vec_model.py",
"copies": "1",
"size": "3661",
"license": "mit",
"hash": 7178432218267907000,
"line_mean": 23.0855263158,
"line_max": 108,
"alpha_frac": 0.67904944,
"autogenerated": false,
"ratio": 2.6683673469387754,
"config_test": false,
"h... |
__author__ = 'Saber Shokat Fadaee'
#import libraries
from gensim import corpora, models, similarities
from gensim.models import ldamodel
from gensim.models import HdpModel
import tsne
import numpy as np
from numpy import *
import os
import logging
from bokeh.server.serverbb import prune
import logging
logging.basicCon... | {
"repo_name": "sabersf/Botnets",
"path": "Biclustering.py",
"copies": "1",
"size": "8933",
"license": "mit",
"hash": 9032380071912276000,
"line_mean": 24.3059490085,
"line_max": 91,
"alpha_frac": 0.6673010187,
"autogenerated": false,
"ratio": 2.9608882996353993,
"config_test": false,
"has_no_... |
__author__ = 'sabin'
## program to copy the files ( .txt and .gz)
import gzip, sys
filename = sys.argv[1]
newfilename = sys.argv[2]
read_txtFile = ''
def reading_txtFile(filename):
txtFile = open(filename, 'r')
read_txtFile = txtFile.read()
return read_txtFile
def maketxtFile(newfilename, w):
new_... | {
"repo_name": "thinksabin/python_training_scripts",
"path": "PycharmProjects/PythonTraining/playing with files/CopyFiles.py",
"copies": "1",
"size": "1398",
"license": "apache-2.0",
"hash": -4443457576475560000,
"line_mean": 24.8888888889,
"line_max": 69,
"alpha_frac": 0.6795422031,
"autogenerated"... |
__author__ = 'sabin'
#Print the list of all users that can log into the computer.
import os, exceptions
no_bin_acc = '/bin/false\n'
bin_acc = '/bin/bash\n'
def readPasswdFile():
try:
fp = open("/etc/passwd")
except exceptions.UserWarning:
print " no permission Amigo!"
return "some defa... | {
"repo_name": "thinksabin/python_training_scripts",
"path": "PycharmProjects/PythonTraining/playing with os/ListUsers.py",
"copies": "1",
"size": "1492",
"license": "apache-2.0",
"hash": 5447863368127396000,
"line_mean": 23.8833333333,
"line_max": 60,
"alpha_frac": 0.4363270777,
"autogenerated": fa... |
__author__ = 'Sabrina.Luo'
import pygame
import sys
import time
import random
screen_width = 400
screen_height = 600
class Plane:
def __init__(self):
self.image = pygame.image.load('myplane.png').convert_alpha()
self.x = (screen_width - self.image.get_width()) / 2
self.y = (screen_height ... | {
"repo_name": "sabrinaluo/ShootThePlane",
"path": "ShootThePlane.py",
"copies": "1",
"size": "3818",
"license": "mit",
"hash": 807238596934564600,
"line_mean": 26.2714285714,
"line_max": 85,
"alpha_frac": 0.544787847,
"autogenerated": false,
"ratio": 3.088996763754045,
"config_test": false,
"... |
__author__ = 'sachinpatney'
from urllib.request import urlopen
import random
from common import ITask
from common import Bot
from common import Timeline
from common import Icons
from common import IconBackgrounds
template = "Microsoft stock closed at {0}, {1}, {2}.{3}"
motivate = [' Come on people we can do better!'... | {
"repo_name": "sachinio/redalert",
"path": "tasks/stock.py",
"copies": "1",
"size": "1793",
"license": "mit",
"hash": -5389406130134482000,
"line_mean": 34.86,
"line_max": 94,
"alpha_frac": 0.4796430563,
"autogenerated": false,
"ratio": 4.394607843137255,
"config_test": false,
"has_no_keyword... |
__author__ = 'sachinpatney'
import json
import base64
from urllib.request import urlopen
from urllib.request import Request
from common import ITask
from common import BuildNotifier
from common import sync_read_status_file
from common import Timeline
from common import safe_read_dictionary
from common import Icons
fr... | {
"repo_name": "sachinio/redalert",
"path": "tasks/vso.py",
"copies": "1",
"size": "4560",
"license": "mit",
"hash": 3778656405240805400,
"line_mean": 37.3193277311,
"line_max": 128,
"alpha_frac": 0.550877193,
"autogenerated": false,
"ratio": 4.2897460018814675,
"config_test": false,
"has_no_k... |
__author__ = 'sachinpatney'
import os
import subprocess
import csv
import fcntl
import smtplib
import datetime
import json
import threading
from urllib.request import urlopen
from urllib.request import Request
import re
from threading import Lock
REPOSITORY_ROOT = '/var/www/git/redalert'
TMP_FOLDER_PATH = '/var/www/... | {
"repo_name": "sachinio/redalert",
"path": "tasks/common.py",
"copies": "1",
"size": "10308",
"license": "mit",
"hash": -2614090956064668000,
"line_mean": 28.8782608696,
"line_max": 114,
"alpha_frac": 0.5519984478,
"autogenerated": false,
"ratio": 3.585391304347826,
"config_test": false,
"has... |
__author__ = 'sachinpatney'
import sys
sys.path.append('/var/www/git/redalert/tasks')
sys.path.append('/var/www/git/redalert/hardware/watcher/actions')
import serial
import time
import binascii
from party_actions import LetsParty
from missile_actions import FireMissile
ser = serial.Serial('/dev/ttyUSB0', baudrate=96... | {
"repo_name": "sachinio/redalert",
"path": "hardware/watcher/zb_watcher.py",
"copies": "1",
"size": "1151",
"license": "mit",
"hash": 6381925213992230000,
"line_mean": 25.7674418605,
"line_max": 89,
"alpha_frac": 0.5134665508,
"autogenerated": false,
"ratio": 3.5198776758409784,
"config_test": ... |
__author__ = 'sachinpatney'
import unittest
import sys
import ast
import os
import common
sys.path.append('../tasks')
from vso import VSO
from common import write_dictionary_to_csv
from common import read_csv_as_dictionary
from common import sync_write_list_to_csv
from common import read_csv_as_list
from common impo... | {
"repo_name": "sachinio/redalert",
"path": "tests/test_common.py",
"copies": "1",
"size": "3362",
"license": "mit",
"hash": -832136656773338800,
"line_mean": 30.7264150943,
"line_max": 101,
"alpha_frac": 0.5951814396,
"autogenerated": false,
"ratio": 3.2264875239923225,
"config_test": true,
"... |
__author__ = 'sachinpatney'
'''
This runner will be launched very frequently,
typically once per minute via an OS Cron Job.
It will run all registered tasks each time,
it is up to each task to use the time info
and only run when required.
For example the stock closing is only run at
1:15 ... | {
"repo_name": "sachinio/redalert",
"path": "tasks/runner.py",
"copies": "1",
"size": "1218",
"license": "mit",
"hash": 3006443512148675000,
"line_mean": 24.375,
"line_max": 82,
"alpha_frac": 0.6535303777,
"autogenerated": false,
"ratio": 3.5510204081632653,
"config_test": false,
"has_no_keywo... |
__author__ = "Sachin Railhan"
__version__ = "1.0"
#STD Library Imports
from functools import partial
import os
os.environ["KIVY_AUDIO"] = "pygame"
#3rd Party Imports
#Kivy Imports
from kivy.config import Config
Config.set("graphics", "fullscreen", "auto")
from kivy.app import App
from kivy.properties import ObjectP... | {
"repo_name": "nitinsaroha/Kivame",
"path": "main.py",
"copies": "1",
"size": "3369",
"license": "mit",
"hash": 755642728548300400,
"line_mean": 31.7087378641,
"line_max": 92,
"alpha_frac": 0.642623924,
"autogenerated": false,
"ratio": 3.6940789473684212,
"config_test": false,
"has_no_keyword... |
import os
import os.path as op
from collections import OrderedDict
from datetime import datetime, timezone
import numpy as np
from ..base import BaseRaw
from ..constants import FIFF
from ..meas_info import create_info
from ..utils import _mult_cal_one
from ...annotations import Annotations
from ...utils import logger... | {
"repo_name": "wmvanvliet/mne-python",
"path": "mne/io/persyst/persyst.py",
"copies": "1",
"size": "16516",
"license": "bsd-3-clause",
"hash": -5167636201682089000,
"line_mean": 35.0611353712,
"line_max": 77,
"alpha_frac": 0.5586098329,
"autogenerated": false,
"ratio": 4.141424272818456,
"confi... |
import numpy as np
from ..annotations import (Annotations, _annotations_starts_stops)
from ..transforms import (quat_to_rot, _average_quats, _angle_between_quats,
apply_trans, _quat_to_affine)
from ..filter import filter_data
from .. import Transform
from ..utils import (_mask_to_onsets_offs... | {
"repo_name": "wmvanvliet/mne-python",
"path": "mne/preprocessing/artifact_detection.py",
"copies": "11",
"size": "12806",
"license": "bsd-3-clause",
"hash": 4426336489599346000,
"line_mean": 37.2179104478,
"line_max": 79,
"alpha_frac": 0.5966570335,
"autogenerated": false,
"ratio": 3.45187382043... |
import numpy as np
from ..io.base import BaseRaw
from ..annotations import (Annotations, _annotations_starts_stops,
annotations_from_events)
from ..transforms import (quat_to_rot, _average_quats, _angle_between_quats,
apply_trans, _quat_to_affine)
from ..filter imp... | {
"repo_name": "rkmaddox/mne-python",
"path": "mne/preprocessing/artifact_detection.py",
"copies": "3",
"size": "21947",
"license": "bsd-3-clause",
"hash": -79302892698040020,
"line_mean": 38.8221415608,
"line_max": 79,
"alpha_frac": 0.6048673776,
"autogenerated": false,
"ratio": 3.736716621253406... |
__author__ = 'saeedamen & mhockenberger' # Saeed Amen & Marcel Hockenberger
#
# Copyright 2016-2020 Cuemacro - https://www.cuemacro.com / @cuemacro
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the Licens... | {
"repo_name": "cuemacro/finmarketpy",
"path": "finmarketpy/economics/techindicator.py",
"copies": "1",
"size": "19245",
"license": "apache-2.0",
"hash": -8473963264174327000,
"line_mean": 35.7270992366,
"line_max": 125,
"alpha_frac": 0.5439334892,
"autogenerated": false,
"ratio": 3.80561597785248... |
__author__ = 'saeedamen'
from pythalesians.util.loggermanager import LoggerManager
from datetime import datetime
class TimeSeriesRequest:
# properties
#
# data_source eg. bbg, yahoo, quandl
# start_date
# finish_date
# tickers (can be list) eg. EURUSD
# category (eg. fx, equities, fixed_i... | {
"repo_name": "poeticcapybara/pythalesians",
"path": "pythalesians/market/requests/timeseriesrequest.py",
"copies": "1",
"size": "7962",
"license": "apache-2.0",
"hash": 7634627874079911000,
"line_mean": 28.7126865672,
"line_max": 122,
"alpha_frac": 0.5807586034,
"autogenerated": false,
"ratio": ... |
__author__ = 'saeedamen'
from pythalesians.util.loggermanager import LoggerManager
from pythalesians.market.requests.timeseriesrequest import TimeSeriesRequest
from pythalesians.timeseries.techind.techparams import TechParams
class BacktestRequest(TimeSeriesRequest):
def __init__(self):
super(TimeSeries... | {
"repo_name": "poeticcapybara/pythalesians",
"path": "pythalesians/market/requests/backtestrequest.py",
"copies": "1",
"size": "2392",
"license": "apache-2.0",
"hash": 2297658202730595800,
"line_mean": 23.4081632653,
"line_max": 85,
"alpha_frac": 0.618729097,
"autogenerated": false,
"ratio": 3.75... |
__author__ = 'saeedamen'
import datetime
from pythalesians.market.loaders.lighttimeseriesfactory import LightTimeSeriesFactory
from pythalesians.market.requests.timeseriesrequest import TimeSeriesRequest
from pythalesians.timeseries.calcs.timeseriescalcs import TimeSeriesCalcs
from pythalesians.graphics.graphs.plotfa... | {
"repo_name": "poeticcapybara/pythalesians",
"path": "pythalesians-examples/plotly_examples.py",
"copies": "1",
"size": "4222",
"license": "apache-2.0",
"hash": 1489150500633200000,
"line_mean": 42.9895833333,
"line_max": 119,
"alpha_frac": 0.6013737565,
"autogenerated": false,
"ratio": 3.6209262... |
__author__ = 'saeedamen'
#
# Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
... | {
"repo_name": "poeticcapybara/pythalesians",
"path": "pythalesians/graphics/graphs/lowleveladapters/adaptercufflinks.py",
"copies": "1",
"size": "3163",
"license": "apache-2.0",
"hash": -1933214505751017200,
"line_mean": 30.9494949495,
"line_max": 121,
"alpha_frac": 0.6300980082,
"autogenerated": f... |
__author__ = 'saeedamen'
#
# Copyright 2016-2020 Cuemacro
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | {
"repo_name": "cuemacro/finmarketpy",
"path": "finmarketpy/backtest/tradeanalysis.py",
"copies": "1",
"size": "19304",
"license": "apache-2.0",
"hash": 4150848209972168700,
"line_mean": 40.7835497835,
"line_max": 123,
"alpha_frac": 0.5966639039,
"autogenerated": false,
"ratio": 3.929167514756768,... |
__author__ = 'saeedamen'
#
# Copyright 2016 Cuemacro
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | {
"repo_name": "cuemacro/findatapy",
"path": "findatapy/market/marketdatarequest.py",
"copies": "1",
"size": "24852",
"license": "apache-2.0",
"hash": 5181320362794974000,
"line_mean": 32.6292286874,
"line_max": 143,
"alpha_frac": 0.5719459198,
"autogenerated": false,
"ratio": 3.9718715039156147,
... |
__author__ = 'saeedamen'
#
# Copyright 2020 Cuemacro
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | {
"repo_name": "cuemacro/finmarketpy",
"path": "finmarketpy_examples/fx_options_pricing_examples.py",
"copies": "1",
"size": "14004",
"license": "apache-2.0",
"hash": 2866540714457437700,
"line_mean": 45.5249169435,
"line_max": 160,
"alpha_frac": 0.6607397886,
"autogenerated": false,
"ratio": 3.39... |
__author__ = 'saeedamen'
#
# Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0... | {
"repo_name": "poeticcapybara/pythalesians",
"path": "pythalesians-examples/histecondata_examples.py",
"copies": "1",
"size": "3815",
"license": "apache-2.0",
"hash": 4941082800879878000,
"line_mean": 36.7722772277,
"line_max": 121,
"alpha_frac": 0.7121887287,
"autogenerated": false,
"ratio": 3.2... |
__author__ = 'saeedamen' # Saeed Amen
#
# Copyright 2016-2020 Cuemacro - https://www.cuemacro.com / @cuemacro
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at http://www.apache.org/licenses/LI... | {
"repo_name": "cuemacro/finmarketpy",
"path": "finmarketpy/economics/quickchart.py",
"copies": "1",
"size": "6090",
"license": "apache-2.0",
"hash": 6810175408667608000,
"line_mean": 41.2916666667,
"line_max": 126,
"alpha_frac": 0.5866995074,
"autogenerated": false,
"ratio": 3.8181818181818183,
... |
__author__ = 'saeedamen' # Saeed Amen
#
# Copyright 2016-2020 Cuemacro
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | {
"repo_name": "cuemacro/findatapy",
"path": "findatapy_examples/dukascopy_example.py",
"copies": "1",
"size": "2647",
"license": "apache-2.0",
"hash": 8620118644257005000,
"line_mean": 44.6379310345,
"line_max": 121,
"alpha_frac": 0.6305251228,
"autogenerated": false,
"ratio": 4.016691957511381,
... |
__author__ = 'saeedamen' # Saeed Amen
#
# Copyright 2016-2021 Cuemacro - https://www.cuemacro.com / @cuemacro
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at http://www.apache.org/licenses/LI... | {
"repo_name": "cuemacro/finmarketpy",
"path": "finmarketpy/util/marketconstants.py",
"copies": "1",
"size": "6001",
"license": "apache-2.0",
"hash": -4576430401187503000,
"line_mean": 36.9873417722,
"line_max": 136,
"alpha_frac": 0.6258956841,
"autogenerated": false,
"ratio": 3.5073056691992988,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.