text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'ben'
from pprint import pprint
import os
import json
import pandas as pd
from os import walk
import os
import sys
data = {}
phase = 'phase1'
prac = False
mypath = '../build/img/' + phase + '/900'
data['batchMeta'] = {
'numBatches':404,
'imgPerSet':10,
'batchPerSet':2,
'imgPerBatch':5,
... | {
"repo_name": "bdyetton/MODA",
"path": "Tools/parseFolderOfImagesToMetaJson.py",
"copies": "1",
"size": "3681",
"license": "mit",
"hash": 1664541129081770000,
"line_mean": 32.1621621622,
"line_max": 90,
"alpha_frac": 0.5707688128,
"autogenerated": false,
"ratio": 2.9237490071485306,
"config_tes... |
__author__ = 'ben'
from pprint import pprint
import os
import json
import pandas as pd
from os import walk
import os
import sys
data = {}
phase = 'practice'
easyPrac = [10,12,17,30,34]
hardPrac = [25,26,35,37,42]
mypath = '../build/img/' + phase + '/900'
prac = True
data['batchMeta'] = {
'numBatches':2,
'img... | {
"repo_name": "bdyetton/MODA",
"path": "Tools/parseFolderOfImagesPracSet.py",
"copies": "1",
"size": "2905",
"license": "mit",
"hash": 3011582155490640400,
"line_mean": 26.6666666667,
"line_max": 79,
"alpha_frac": 0.5449225473,
"autogenerated": false,
"ratio": 2.902097902097902,
"config_test": ... |
__author__ = 'Ben'
import urllib2
import json
from collections import defaultdict
import time
import random
try:
from urllib import quote_plus
except ImportError:
from urllib.parse import quote_plus
GCM_URL = 'https://android.googleapis.com/gcm/send'
class GCMException(Exception):
pass
class GCMMalfo... | {
"repo_name": "itielshwartz/BackendApi",
"path": "gcm.py",
"copies": "1",
"size": "10846",
"license": "apache-2.0",
"hash": -5261743307571401000,
"line_mean": 33.4317460317,
"line_max": 125,
"alpha_frac": 0.6177392587,
"autogenerated": false,
"ratio": 4.281879194630872,
"config_test": false,
... |
__author__ = 'Ben'
import logging
from gcm import *
API_KEY = 'AIzaSyB_YcUTTKUI2x51g9HiqApT1qpaQ5nWR3o'
URL = 'https://android.googleapis.com/gcm/send'
#basic util for gcm
def sendMessageToServer(registration_ids,messageType, data=None):
headers = {'Authorization': 'key=%s' % API_KEY}
headers['Content-Type'... | {
"repo_name": "itielshwartz/BackendApi",
"path": "Utilities.py",
"copies": "1",
"size": "1258",
"license": "apache-2.0",
"hash": 7210750328800122000,
"line_mean": 26.347826087,
"line_max": 81,
"alpha_frac": 0.666136725,
"autogenerated": false,
"ratio": 3.465564738292011,
"config_test": false,
... |
__author__ = 'Ben'
"""
Polynomial manipulations.
Polynomials are represented as lists of coefficients, 0 order first.
"""
def evaluate(x, poly):
"""
Evaluate the polynomial at the value x.
poly is a list of coefficients from lowest to highest.
:param x: Argument at which to evaluate
:param p... | {
"repo_name": "dhruvaldarji/InternetProgramming",
"path": "Assignment_7/polynomials.py",
"copies": "1",
"size": "1365",
"license": "mit",
"hash": -6992419932681066000,
"line_mean": 27.4375,
"line_max": 82,
"alpha_frac": 0.5926739927,
"autogenerated": false,
"ratio": 3.5454545454545454,
"config_... |
__author__ = 'Ben'
"""
Polynomial manipulations.
Polynomials are represented as lists of coefficients, 0 order first.
"""
def evaluate(x, poly):
"""
Evaluate the polynomial at the value x.
poly is a list of coefficients from lowest to highest.
:param x: Argument at which to evaluate
:param ... | {
"repo_name": "dhruvaldarji/InternetProgramming",
"path": "Assignment_7/Assignment7/polynomials.py",
"copies": "1",
"size": "1366",
"license": "mit",
"hash": 2906812206988880000,
"line_mean": 26.8775510204,
"line_max": 82,
"alpha_frac": 0.5922401171,
"autogenerated": false,
"ratio": 3.54805194805... |
"""
Build arguments parser for the scripts (mapper, reducers and command builder).
"""
import argparse
def get_map_argparser():
"""Build command line arguments parser for a mapper.
Arguments parser compatible with the commands builder workflows.
"""
parser = argparse.ArgumentParser()
parser.add_... | {
"repo_name": "BenoitDamota/mempamal",
"path": "mempamal/arguments.py",
"copies": "1",
"size": "2611",
"license": "bsd-3-clause",
"hash": 886761547384171100,
"line_mean": 32.4743589744,
"line_max": 78,
"alpha_frac": 0.5928762926,
"autogenerated": false,
"ratio": 4.712996389891697,
"config_test"... |
def dynamic_import(str_import):
"""Take a string representing a python function or class and import it.
Parameters:
-----------
str_import : str
the string representing the import (e.g. "sklearn.metrics.f1_score")
"""
mod, cla = str_import.rsplit('.', 1)
dyn_import = getattr(__imp... | {
"repo_name": "BenoitDamota/mempamal",
"path": "mempamal/dynamic.py",
"copies": "1",
"size": "1796",
"license": "bsd-3-clause",
"hash": -958779197670906000,
"line_mean": 27.0625,
"line_max": 79,
"alpha_frac": 0.631403118,
"autogenerated": false,
"ratio": 3.8376068376068377,
"config_test": false... |
"""
Simple GridSearch for a pipelined estimator (without warm restart).
"""
import numpy as np
class GenericGridSearch(object):
"""Simple GridSearch for a pipelined estimator.
Note: see sklearn.pipeline.Pipeline
"""
def __init__(self, est, params, score_func,
est_kwargs=None,
... | {
"repo_name": "BenoitDamota/mempamal",
"path": "mempamal/gridsearch.py",
"copies": "1",
"size": "3108",
"license": "bsd-3-clause",
"hash": -4484260092727330300,
"line_mean": 29.7722772277,
"line_max": 75,
"alpha_frac": 0.5215572716,
"autogenerated": false,
"ratio": 4.025906735751295,
"config_te... |
"""
Workflow generation.
"""
import os.path as path
import numpy as np
def _create_generic(folds_dic, cv_cfg, method_cfg, in_out_dir,
mapper="./scripts/mapper.py",
i_red="./scripts/inner_reducer.py",
o_red="./scripts/outer_reducer.py",
ve... | {
"repo_name": "BenoitDamota/mempamal",
"path": "mempamal/workflow.py",
"copies": "1",
"size": "5092",
"license": "bsd-3-clause",
"hash": -7485452908564282000,
"line_mean": 35.1134751773,
"line_max": 72,
"alpha_frac": 0.5542026709,
"autogenerated": false,
"ratio": 3.471029311520109,
"config_test... |
__author__ = 'Benoit'
#Computer attempts to guess a number you choose between 1 and 100 in 10 tries
answer = 'yes'
print ("Please, think of a number between 1 and 100. I am about to try to guess it in 10 tries.")
while answer == "yes":
NumOfTry = 10
NumToGuess = 50
LimitLow = 1
LimitHigh = 100
while... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578963_Guess_number_2__computer_attempts_guess_your/recipe-578963.py",
"copies": "1",
"size": "2068",
"license": "mit",
"hash": -5295704188604435000,
"line_mean": 41.2040816327,
"line_max": 97,
"alpha_frac": 0.5101547389,
"autogenerated": fa... |
__author__ = 'Benoit'
# guess a number between 1 and 100 in ten tries
import random
answer = 'yes'
while answer == "yes":
NumToGuess = random.randint(1, 100)
NumOfTry = 10
print ("Try to guess a number between 1 and 100 in 10 tries")
while NumOfTry != 0:
try:
x = int (input ("Please ... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578962_Guess_a_number/recipe-578962.py",
"copies": "1",
"size": "1152",
"license": "mit",
"hash": 9121099768657498000,
"line_mean": 36.1612903226,
"line_max": 101,
"alpha_frac": 0.5243055556,
"autogenerated": false,
"ratio": 3.972413793103... |
__author__ = 'Benqing'
users = {
"Angelica": {"Blues Traveler": 3.5, "Broken Bells": 2.0, "Norah Jones": 4.5, "Phoenix": 5.0,
"Slightly Stoopid": 1.5, "The Strokes": 2.5, "Vampire Weekend": 2.0},
"Bill": {"Blues Traveler": 2.0, "Broken Bells": 3.5, "Deadmau5": 4.0, "Phoenix": 2.0, "Slightly St... | {
"repo_name": "timmyshen/Guide_To_Data_Mining",
"path": "Chapter2/SharpenYourPencil/distance.py",
"copies": "1",
"size": "4916",
"license": "mit",
"hash": -1601900371452491800,
"line_mean": 40.6694915254,
"line_max": 120,
"alpha_frac": 0.6061838893,
"autogenerated": false,
"ratio": 2.755605381165... |
__author__ = 'Ben, Ryan'
# -*- coding: utf-8 -*-
import numpy as np
import time
import math
from scipy import stats
from matplotlib import pylab as plt
import stockrollover
def time_stamp(t):
"""Prints the difference between the parameter and current time.
This is useful for timing program execution if times... | {
"repo_name": "energyPATHWAYS/energyPATHWAYS",
"path": "energyPATHWAYS/_obsolete/tests/test_stockrollover.py",
"copies": "1",
"size": "1520",
"license": "mit",
"hash": 2980738695666142000,
"line_mean": 23.5161290323,
"line_max": 101,
"alpha_frac": 0.6881578947,
"autogenerated": false,
"ratio": 2.... |
__author__ = 'bensoer'
from crypto.algorithms.algorithminterface import AlgorithmInterface
from tools.argparcer import ArgParcer
'''
CaesarCipher is an Algorithm using the CaesarCipher encryption techniques.
Letters are replaced with equivelent letters in the alphabet by a certain offset off. For example A is replace... | {
"repo_name": "bensoer/pychat",
"path": "crypto/algorithms/caesarcipher.py",
"copies": "1",
"size": "2611",
"license": "mit",
"hash": -7700421505056912000,
"line_mean": 48.2641509434,
"line_max": 121,
"alpha_frac": 0.7127537342,
"autogenerated": false,
"ratio": 4.889513108614232,
"config_test":... |
__author__ = 'bensoer'
from socket import *
import threading
import sys
bufferSize = 2048
serverName = 'localhost'
serverPort = 1400
serverSocket = socket(AF_INET, SOCK_DGRAM)
serverSocket.bind((serverName, serverPort))
canCheck = 1
def checkForReceiving():
message, clientAddress = serverSocket.recvfrom(buffe... | {
"repo_name": "bensoer/pychat",
"path": "example/client.py",
"copies": "1",
"size": "1099",
"license": "mit",
"hash": 724141581404880900,
"line_mean": 19.7358490566,
"line_max": 71,
"alpha_frac": 0.6715195632,
"autogenerated": false,
"ratio": 3.4559748427672954,
"config_test": false,
"has_no_... |
__author__ = 'bensoer'
import select
from tools.commandtype import CommandType
class ListenerMultiProcess:
__keepListening = True
__connections = {}
__firstMessageReceived = False
__firstMessage = b''
__rejectFirstMessageMatches = False
__replySent = False
def __init__(self, socket, decry... | {
"repo_name": "bensoer/pychat",
"path": "client/listenermultiprocess.py",
"copies": "1",
"size": "5668",
"license": "mit",
"hash": -1604016339900006000,
"line_mean": 46.6386554622,
"line_max": 117,
"alpha_frac": 0.5462244178,
"autogenerated": false,
"ratio": 5.32206572769953,
"config_test": fal... |
__author__ = 'bensoer'
import select
class ListenerProcess:
__keepListening = True
__connections = {}
__firstMessageReceived = False
__firstMessage = b''
__rejectFirstMessageMatches = False
__replySent = False
def __init__(self, socket, decryptor):
'''
constructor. This se... | {
"repo_name": "bensoer/pychat",
"path": "client/listenerprocess.py",
"copies": "1",
"size": "4653",
"license": "mit",
"hash": 2518791073674094600,
"line_mean": 42.9056603774,
"line_max": 117,
"alpha_frac": 0.544594885,
"autogenerated": false,
"ratio": 5.526128266033254,
"config_test": false,
... |
__author__ = 'bensoer'
from crypto.algorithms.algorithminterface import AlgorithmInterface
from tools.argparcer import ArgParcer
from collections import deque
import sys
import string
class TranspositionCipher(AlgorithmInterface):
__key = ""
'''
__mapper stores the dynamic mapping of letters and values ... | {
"repo_name": "bensoer/pychat",
"path": "crypto/algorithms/transpositioncipher.py",
"copies": "1",
"size": "7792",
"license": "mit",
"hash": -5323237938713533000,
"line_mean": 30.8040816327,
"line_max": 113,
"alpha_frac": 0.5939425051,
"autogenerated": false,
"ratio": 4.384918401800788,
"config... |
__author__ = 'bergundy'
class LayerDict(object):
def __init__(self):
self._layers = {}
"""
:type self._layers: dict(dict)
"""
def set_layer(self, key, dct):
prev = self._layers.get(key, {})
self._layers[key] = dct
return self._calc_changes(key, prev, dc... | {
"repo_name": "pombredanne/click-config",
"path": "click_config/inotify/layers.py",
"copies": "2",
"size": "1173",
"license": "bsd-2-clause",
"hash": -5305270114808743000,
"line_mean": 26.2790697674,
"line_max": 82,
"alpha_frac": 0.5481670929,
"autogenerated": false,
"ratio": 3.3706896551724137,
... |
__author__ = "Berserker66"
langversion = 1
langname = "German"
##updater
# text construct: "Version "+version+available+changelog
#example: Version 3 available, click here to download, or for changelog click here
available = " verfügbar, clicke hier für den Download"
changelog = ", oder hier für den Changelog"
##wor... | {
"repo_name": "Berserker66/omnitool",
"path": "omnitool/Language/german.py",
"copies": "1",
"size": "3251",
"license": "mit",
"hash": -6408815863629089000,
"line_mean": 19.9155844156,
"line_max": 83,
"alpha_frac": 0.6895374107,
"autogenerated": false,
"ratio": 2.2571829011913103,
"config_test":... |
### VMware advanced memory stats
### Displays memory stats coming from the hypervisor inside VMware VMs.
### The vmGuestLib API from VMware Tools needs to be installed
class dstat_plugin(dstat):
def __init__(self):
self.name = 'vmware advanced memory'
self.vars = ('active', 'ballooned', 'mapped', ... | {
"repo_name": "SpamapS/dstat-plugins",
"path": "dstat_plugins/plugins/dstat_vm_mem_adv.py",
"copies": "4",
"size": "1514",
"license": "apache-2.0",
"hash": -657400665017646800,
"line_mean": 39.9459459459,
"line_max": 117,
"alpha_frac": 0.5964332893,
"autogenerated": false,
"ratio": 3.349557522123... |
### VMware cpu stats
### Displays CPU stats coming from the hypervisor inside VMware VMs.
### The vmGuestLib API from VMware Tools needs to be installed
class dstat_plugin(dstat):
def __init__(self):
self.name = 'vm cpu'
self.vars = ('used', 'stolen', 'elapsed')
self.nick = ('usd', 'stl')
... | {
"repo_name": "SpamapS/dstat-plugins",
"path": "dstat_plugins/plugins/dstat_vm_cpu.py",
"copies": "4",
"size": "1168",
"license": "apache-2.0",
"hash": -602730013198174800,
"line_mean": 29.7631578947,
"line_max": 131,
"alpha_frac": 0.5761986301,
"autogenerated": false,
"ratio": 3.308781869688385,... |
### VMware ESX kernel interrupt stats
### Displays kernel interrupt statistics on VMware ESX servers
# NOTE TO USERS: command-line plugin configuration is not yet possible, so I've
# "borrowed" the -I argument.
# EXAMPLES:
# # dstat --vmkint -I 0x46,0x5a
# You can even combine the Linux and VMkernel interrupt stats
... | {
"repo_name": "barzan/dbseer",
"path": "middleware_old/dstat_for_server/plugins/dstat_vmk_int.py",
"copies": "3",
"size": "3205",
"license": "apache-2.0",
"hash": -8144581516616198000,
"line_mean": 32.3854166667,
"line_max": 94,
"alpha_frac": 0.5235569423,
"autogenerated": false,
"ratio": 3.34900... |
### VMware ESX kernel vmhba stats
### Displays kernel vmhba statistics on VMware ESX servers
# NOTE TO USERS: command-line plugin configuration is not yet possible, so I've
# "borrowed" the -D argument.
# EXAMPLES:
# # dstat --vmkhba -D vmhba1,vmhba2,total
# # dstat --vmkhba -D vmhba0
# You can even combine the Linu... | {
"repo_name": "dongyoungy/dbseer_middleware",
"path": "rs-sysmon2/plugins/dstat_vmk_hba.py",
"copies": "1",
"size": "2966",
"license": "apache-2.0",
"hash": -7434976194438366000,
"line_mean": 35.1707317073,
"line_max": 111,
"alpha_frac": 0.5148347943,
"autogenerated": false,
"ratio": 3.4976415094... |
__author__ = 'bert'
import sys
import requests
import csv
import json
import handle_json
import handle_csv
import compare
import logging
from datetime import datetime
# Set up logging file to receive Update record
stake_list = [
'Garden',
'Grove Creek',
'Lindon',
'Lindon Central',
'Lindon West',
... | {
"repo_name": "hisPeople/ducking-avenger",
"path": "Comp2MBCdb.py",
"copies": "1",
"size": "6427",
"license": "mit",
"hash": -8294596487308976000,
"line_mean": 45.2446043165,
"line_max": 210,
"alpha_frac": 0.615995021,
"autogenerated": false,
"ratio": 3.2824310520939735,
"config_test": false,
... |
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from ..util import assert_Xy
__all__ = ['split_data']
def split_data(X, y=None, frac=2/3):
"""
Randomly split the dataset in two subsets with sizes proportional to `frac`
and `1 - frac`.
Paramete... | {
"repo_name": "bertrand-l/LearnML",
"path": "learnml/cross_validation/data_utils.py",
"copies": "1",
"size": "1362",
"license": "bsd-3-clause",
"hash": 6066509997623786000,
"line_mean": 25.1923076923,
"line_max": 82,
"alpha_frac": 0.5660792952,
"autogenerated": false,
"ratio": 3.4307304785894206,... |
__author__ = 'besta'
class BestaPlayer:
def __init__(self, fichier, player):
self.fichier = fichier
self.grille = self.getFirstGrid()
self.best_hit = 0
self.players = player
def getFirstGrid(self):
"""
Implements function to get the first grid.
:retur... | {
"repo_name": "KeserOner/puissance4",
"path": "bestaplayer.py",
"copies": "1",
"size": "9518",
"license": "mit",
"hash": 922085073882328200,
"line_mean": 31.9342560554,
"line_max": 121,
"alpha_frac": 0.4655389788,
"autogenerated": false,
"ratio": 4.202207505518764,
"config_test": false,
"has_... |
__author__ = 'bethard'
import argparse
import collections
import copy
import functools
import glob
import logging
import os
import re
import anafora
import anafora.select
class Scores(object):
def __init__(self):
self.reference = 0
self.predicted = 0
self.correct = 0
def add(self, ... | {
"repo_name": "bethard/anaforatools",
"path": "anafora/evaluate.py",
"copies": "1",
"size": "35734",
"license": "apache-2.0",
"hash": -7133460854526977000,
"line_mean": 44.8716302953,
"line_max": 120,
"alpha_frac": 0.5931605754,
"autogenerated": false,
"ratio": 4.1282347504621075,
"config_test"... |
__author__ = 'BeyondSky'
# circular linked list + dictionary
class LRUCache(object):
def __init__(self, capacity):
"""
:type capacity: int
"""
self.hm = {}
self.CAPACITY = capacity
self.head = Node(-1, -1) # dummy head
self.head.next = self.head
... | {
"repo_name": "BeyondSkyCoder/BeyondCoder",
"path": "leetcode/python/LRUcache_design.py",
"copies": "1",
"size": "2005",
"license": "apache-2.0",
"hash": -490887249364260700,
"line_mean": 21.032967033,
"line_max": 48,
"alpha_frac": 0.4872817955,
"autogenerated": false,
"ratio": 3.652094717668488,... |
__author__ = 'BeyondSky'
from trie import Trie
from trie import TrieNode
class WordsearchI(object):
def exist(self, board, word):
"""
:type board: List[List[str]]
:type word: str
:rtype: bool
"""
row = len(board)
col = len(board[0])
if row == 0 or c... | {
"repo_name": "BeyondSkyCoder/BeyondCoder",
"path": "leetcode/python/word_search_I_II_bt.py",
"copies": "1",
"size": "4215",
"license": "apache-2.0",
"hash": -3195767723217396000,
"line_mean": 29.1142857143,
"line_max": 106,
"alpha_frac": 0.4778173191,
"autogenerated": false,
"ratio": 3.337292161... |
__author__ = 'BeyondSky'
import re
class Solution:
# @param {string} s
# @return {integer}
def calculate_I(self, s):
tokens = self.toRPN(s)
return self.evalRPN(tokens)
operators = ['+', '-', '*', '/']
def toRPN(self, s):
tokens, stack = [], []
number = ''
... | {
"repo_name": "BeyondSkyCoder/BeyondCoder",
"path": "leetcode/python/basic_calculator.py",
"copies": "1",
"size": "2636",
"license": "apache-2.0",
"hash": -6817870075601150000,
"line_mean": 27.3548387097,
"line_max": 125,
"alpha_frac": 0.4074355083,
"autogenerated": false,
"ratio": 3.893648449039... |
__author__ = 'BeyondSky'
class Trie:
def __init__(self):
self.root = TrieNode('z')
def add_word(self, word):
node = self.root
for c in word:
child = node.children.get(c)
if child is None:
child = TrieNode(c)
child.father = node
... | {
"repo_name": "BeyondSkyCoder/BeyondCoder",
"path": "leetcode/python/trie.py",
"copies": "1",
"size": "1400",
"license": "apache-2.0",
"hash": -7895977707106036000,
"line_mean": 23.5789473684,
"line_max": 70,
"alpha_frac": 0.4814285714,
"autogenerated": false,
"ratio": 4.117647058823529,
"confi... |
__author__ = 'bgrace'
class Token(object):
def __init__(self, contents):
self.contents = contents
class DocumentDelimiterToken(Token):
pass
class DocumentTypeToken(Token):
pass
class DocumentAntecedentToken(Token):
pass
class DocumentBody(Token):
pass
class Tokenizer(object):
... | {
"repo_name": "bgrace/wagtail-commons",
"path": "wagtail_commons/core/management/commands/hd_parser.py",
"copies": "1",
"size": "1090",
"license": "bsd-3-clause",
"hash": 8281343669131658000,
"line_mean": 19.9807692308,
"line_max": 97,
"alpha_frac": 0.6018348624,
"autogenerated": false,
"ratio": ... |
__author__ = 'BH4101'
import data
import feature_extraction
data = data.posts()
features_train, features_test, label_train, label_test = feature_extraction.extract_features(data, train_size=0.8, with_stemmer=True, tfidf=True)
print "Training the model"
from sklearn.dummy import DummyClassifier
from sklearn.metrics ... | {
"repo_name": "rux-pizza/discourse-analysis",
"path": "like_prediction.py",
"copies": "1",
"size": "1030",
"license": "mit",
"hash": 7020325440131694000,
"line_mean": 27.6111111111,
"line_max": 145,
"alpha_frac": 0.7368932039,
"autogenerated": false,
"ratio": 3.311897106109325,
"config_test": f... |
__author__ = 'bharathramh'
from Vertex import *
from Edges import *
from Graph import *
from MinHeap import *
import sys
class Dijkstra:
def __init__(self):
pass
def dijkstra(self):
self.initializeSingleSource()
S = [] #a set of vertices who... | {
"repo_name": "bharathramh92/dijkstra_test",
"path": "Dijkstra.py",
"copies": "1",
"size": "2431",
"license": "mit",
"hash": 4974293569293766000,
"line_mean": 37.6031746032,
"line_max": 139,
"alpha_frac": 0.550802139,
"autogenerated": false,
"ratio": 4.287477954144621,
"config_test": false,
"... |
__author__ = 'bharathramh'
import sys
class Vertex:
""" Vertex class to store vertex details
"""
def __init__(self, name):
self.name = name
self.adj = []
self.status = True
self.d = [sys.maxsize]
self.pi = None
self.reset()
def setKeyForHeap(self, d):
... | {
"repo_name": "bharathramh92/dijkstra_test",
"path": "Vertex.py",
"copies": "1",
"size": "1054",
"license": "mit",
"hash": -1299653222844346000,
"line_mean": 21.4255319149,
"line_max": 100,
"alpha_frac": 0.5322580645,
"autogenerated": false,
"ratio": 3.6095890410958904,
"config_test": false,
... |
__author__ = 'bharathramh'
import sys
WHITE = 255
GREY = 100
BLACK = 0
class BFS:
def __init__(self, graph):
self.graph = graph
def BFS(self, graph, source): #Running of BFS will be O(V+E)
if source.status == False:
return
# Initial... | {
"repo_name": "bharathramh92/dijkstra_test",
"path": "BFS.py",
"copies": "1",
"size": "1124",
"license": "mit",
"hash": 3718190244089621000,
"line_mean": 23.4347826087,
"line_max": 102,
"alpha_frac": 0.4822064057,
"autogenerated": false,
"ratio": 4.043165467625899,
"config_test": false,
"has_... |
__author__ = 'bharathramh'
class MinHeap:
"""This Method is for Object and key for which the heap has to built should be passed while initializing.
Build heap method will be called once the object is instantiated.
updateData will also call the build heap method with the new data."""
def __init__(sel... | {
"repo_name": "bharathramh92/dijkstra_test",
"path": "MinHeap.py",
"copies": "1",
"size": "3372",
"license": "mit",
"hash": 8277617937476494000,
"line_mean": 32.73,
"line_max": 129,
"alpha_frac": 0.524911032,
"autogenerated": false,
"ratio": 3.742508324084351,
"config_test": false,
"has_no_ke... |
__author__ = 'bharathramh'
from Vertex import *
from Edges import *
from Graph import *
from Dijkstra import *
from MinHeap import *
from BFS import *
import sys
class main:
""" Initial graph can be populated by providing a text file with source, destination, and transit_time.
eg: Belk Grigg 1.2"""
def ... | {
"repo_name": "bharathramh92/dijkstra_test",
"path": "GraphMainClass.py",
"copies": "1",
"size": "7081",
"license": "mit",
"hash": -7524306168783180000,
"line_mean": 41.9212121212,
"line_max": 160,
"alpha_frac": 0.5092501059,
"autogenerated": false,
"ratio": 4.559562137797811,
"config_test": fa... |
__author__ = "bhargavchava97(github), Andrew Jewett"
try:
from ..nbody_graph_search import Ugraph
except:
# not installed as a module
from nbody_graph_search import Ugraph
# This file defines how improper interactions are generated in AMBER (GAFF).
# To use it, add "(gaff_imp.py)" to the name of the... | {
"repo_name": "smsaladi/moltemplate",
"path": "moltemplate/nbody_alt_symmetry/gaff_imp.py",
"copies": "1",
"size": "4075",
"license": "bsd-3-clause",
"hash": -7498646425575640000,
"line_mean": 41.8947368421,
"line_max": 84,
"alpha_frac": 0.6549693252,
"autogenerated": false,
"ratio": 3.4978540772... |
from PIL import Image
i = Image.open("input.png")
#store pixels of input image
pixels = i.load()
width, height = i.size
k=Image.new(i.mode,i.size)
print "Filter size should be an odd positive number"
filtersize=input("Choose the Size of Filter: ")
print "Type (True) or (False) without braces"
applyred=input ("Choo... | {
"repo_name": "BhargavGamit/ImageManipulationAlgorithms",
"path": "AverageColoursFilter.py",
"copies": "1",
"size": "2806",
"license": "mit",
"hash": 5284153036884624000,
"line_mean": 29.1720430108,
"line_max": 81,
"alpha_frac": 0.5374198147,
"autogenerated": false,
"ratio": 3.240184757505774,
... |
from PIL import Image
i = Image.open("input1.png")
j = Image.open("input2.png")
#store pixels of first image
pixels_first = i.load()
width_first, height_first = i.size
k=Image.new(i.mode,i.size)
#store pixels of second image
pixels_second = j.load()
width_second,height_second = j.size
blue=0
green=0
red=0
print "... | {
"repo_name": "BhargavGamit/ImageManipulationAlgorithms",
"path": "Bitwise Blending.py",
"copies": "1",
"size": "2167",
"license": "mit",
"hash": 2117137718516641300,
"line_mean": 27.1428571429,
"line_max": 81,
"alpha_frac": 0.6022150438,
"autogenerated": false,
"ratio": 3.1542940320232895,
"co... |
from PIL import Image
i = Image.open("input.png")
#store pixels of input image
pixels = i.load()
width, height = i.size
k=Image.new(i.mode,i.size)
print "1 Blur3x3Filter"
print "2 Blur5x5Filter"
print "3 Gaussian3x3BlurFilter"
print "4 Gaussian5x5BlurFilter"
print "5 SoftenFilter"
print "6 MotionBlurFilter"
print ... | {
"repo_name": "BhargavGamit/ImageManipulationAlgorithms",
"path": "Image Convolution.py",
"copies": "1",
"size": "5988",
"license": "mit",
"hash": -8870577213870692000,
"line_mean": 30.1875,
"line_max": 271,
"alpha_frac": 0.5288911156,
"autogenerated": false,
"ratio": 2.281142857142857,
"config... |
from PIL import Image
i = Image.open("input.jpg")
#pixel data is stored in pixels in form of two dimensional array
pixels = i.load()
width, height = i.size
k=Image.new(i.mode,i.size)
filtersize=input('Enter the size of the filter: ')
filterOffset=(filtersize-1)/2
filterheight=filtersize
filterwidth=filtersize
offset... | {
"repo_name": "BhargavGamit/ImageManipulationAlgorithms",
"path": "Median Filter.py",
"copies": "1",
"size": "2275",
"license": "mit",
"hash": -5120743367206795000,
"line_mean": 31.5,
"line_max": 77,
"alpha_frac": 0.5441758242,
"autogenerated": false,
"ratio": 3.240740740740741,
"config_test": ... |
from PIL import Image
i = Image.open("input.jpg")
#pixel data is stored in pixels in form of two dimensional array
pixels = i.load()
width, height = i.size
k=Image.new(i.mode,i.size)
sol=Image.new(i.mode,i.size)
filtersize=input('Enter the size of the median filter: ')
filterOffset=(filtersize-1)/2
filterheight=filt... | {
"repo_name": "BhargavGamit/ImageManipulationAlgorithms",
"path": "Min-Max Filter.py",
"copies": "1",
"size": "4183",
"license": "mit",
"hash": -5987652014637668000,
"line_mean": 34.1512605042,
"line_max": 91,
"alpha_frac": 0.5639493187,
"autogenerated": false,
"ratio": 3.1737481031866466,
"con... |
import sys
from PIL import Image
i = Image.open("input.png")
#store pixels of input image
pixels = i.load()
width, height = i.size
k=Image.new(i.mode,i.size)
print "Choose BooleanFilterType"
print "1 None"
print "2 EdgeDetect"
print "3 Sharpen"
filtertype=input()
filtersize=input("Choose the Size of Filter (Usually ... | {
"repo_name": "BhargavGamit/ImageManipulationAlgorithms",
"path": "BooleanEdgeDetectionFilter.py",
"copies": "1",
"size": "4276",
"license": "mit",
"hash": 8428933371966168000,
"line_mean": 31.8923076923,
"line_max": 85,
"alpha_frac": 0.5388213283,
"autogenerated": false,
"ratio": 3.5812395309882... |
from PIL import Image
i = Image.open("input.png")
#store pixels of input image
pixels = i.load()
width, height = i.size
k=Image.new(i.mode,i.size)
print "Filter size should be an odd positive number"
filtersize=input("Choose the Size of Filter: ")
print "Type (True) or (False) without braces"
applyred=input("Choose... | {
"repo_name": "BhargavGamit/ImageManipulationAlgorithms",
"path": "DilateAndErodeFilter.py",
"copies": "1",
"size": "3901",
"license": "mit",
"hash": 6930523914477182000,
"line_mean": 30.208,
"line_max": 77,
"alpha_frac": 0.5037169956,
"autogenerated": false,
"ratio": 3.4522123893805308,
"confi... |
__author__="Bhaskar Kalia"
__date__="Mon Sep 14"
__description__="Find and Replace Tool/gui interface"
#!/usr/bin/env
from Tkinter import *
import tkMessageBox
import subprocess
from Replacer import *
"""
###testing without gui###
filename="/home/bhaskar/Documents/test.txt"
replacer=Replacer(filename,"kalia","bhas... | {
"repo_name": "BHASKARSDEN277GITHUB/python-find-replace-gui",
"path": "main.py",
"copies": "1",
"size": "4102",
"license": "mit",
"hash": 7337751425700187000,
"line_mean": 27.8873239437,
"line_max": 99,
"alpha_frac": 0.6535836177,
"autogenerated": false,
"ratio": 3.1626831148804935,
"config_tes... |
# numItemsPurchased = int(input("How many items? "))
# totalCostItems = 0
# for numItemsPurchased in range(numItemsPurchased):
# itemCost = float(input("Enter the cost of the item: $"))
# totalCostItems = totalCostItems + itemCost
# print("Total cost of items is $" + str(totalCostItems))
# totalCostItems... | {
"repo_name": "sentientredstripe/sentientredstripe.github.io",
"path": "py/Chapter2_Program4_ForLoops3.py",
"copies": "1",
"size": "1484",
"license": "mit",
"hash": -7909935077823801000,
"line_mean": 31.2826086957,
"line_max": 129,
"alpha_frac": 0.6563342318,
"autogenerated": false,
"ratio": 3.45... |
"""Base Model configurations"""
import os
import json
import os.path as osp
import numpy as np
from easydict import EasyDict as edict
'''
KEEP_PROB # Probability to keep a node in dropout
BATCH_SIZE # batch size
PROB_THRESH # Only keep boxes with probability higher than this threshold
P... | {
"repo_name": "getnexar/squeezeDet",
"path": "src/config/config.py",
"copies": "1",
"size": "2388",
"license": "bsd-2-clause",
"hash": -8043827318102169000,
"line_mean": 33.1142857143,
"line_max": 97,
"alpha_frac": 0.6959798995,
"autogenerated": false,
"ratio": 3.713841368584759,
"config_test":... |
"""Base Model configurations"""
import os
import os.path as osp
import numpy as np
from easydict import EasyDict as edict
def base_model_config(dataset='PASCAL_VOC'):
assert dataset.upper() in ['PASCAL_VOC', 'VID', 'KITTI', 'ILSVRC2013'], \
'Either PASCAL_VOC / VID / KITTI / ILSVRC2013'
cfg = edict()
#... | {
"repo_name": "goan15910/ConvDet",
"path": "src/config/config.py",
"copies": "1",
"size": "4449",
"license": "bsd-2-clause",
"hash": -159872735802428540,
"line_mean": 26.80625,
"line_max": 85,
"alpha_frac": 0.645088784,
"autogenerated": false,
"ratio": 3.2285921625544267,
"config_test": false,
... |
"""Base Model configurations"""
import os
import os.path as osp
import numpy as np
from easydict import EasyDict as edict
def base_model_config(dataset='PASCAL_VOC'):
assert dataset.upper()=='PASCAL_VOC' or dataset.upper()=='KITTI', \
'Currently only support PASCAL_VOC or KITTI dataset'
cfg = edict()
#... | {
"repo_name": "Walter1218/self_driving_car_ND",
"path": "squeezeDet/src/config/config.py",
"copies": "1",
"size": "3497",
"license": "mit",
"hash": -140527273754779410,
"line_mean": 25.2932330827,
"line_max": 79,
"alpha_frac": 0.6720045754,
"autogenerated": false,
"ratio": 3.3084200567644277,
"... |
"""Evaluation"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
from datetime import datetime
import os.path
import sys
import time
import numpy as np
from six.moves import xrange
import tensorflow as tf
from config import *
from dataset impo... | {
"repo_name": "Walter1218/self_driving_car_ND",
"path": "squeezeDet/src/eval.py",
"copies": "1",
"size": "8100",
"license": "mit",
"hash": -8995617380902348000,
"line_mean": 35.6515837104,
"line_max": 82,
"alpha_frac": 0.5960493827,
"autogenerated": false,
"ratio": 3.403361344537815,
"config_te... |
"""Image data base class for kitti"""
import cv2
import os
import numpy as np
import subprocess
from dataset.imdb import imdb
from utils.util import bbox_transform_inv, batch_iou
class kitti(imdb):
def __init__(self, image_set, data_path, mc):
imdb.__init__(self, 'kitti_'+image_set, mc)
self._image_set = ... | {
"repo_name": "Walter1218/self_driving_car_ND",
"path": "squeezeDet/src/dataset/kitti.py",
"copies": "1",
"size": "11098",
"license": "mit",
"hash": 3404431137493731300,
"line_mean": 34.2317460317,
"line_max": 82,
"alpha_frac": 0.5352315733,
"autogenerated": false,
"ratio": 3.2289787605469886,
... |
"""Image data base class for kitti"""
import cv2
import os
import numpy as np
import subprocess
from dataset.imdb import imdb
from utils.util import bbox_transform_inv, batch_iou
class kitti(imdb):
def __init__(self, image_set, data_path, mc):
imdb.__init__(self, 'kitti_'+image_set, mc)
self._image_set =... | {
"repo_name": "goan15910/ConvDet",
"path": "src/dataset/kitti.py",
"copies": "1",
"size": "11103",
"license": "bsd-2-clause",
"hash": 857754909008375900,
"line_mean": 34.2476190476,
"line_max": 82,
"alpha_frac": 0.5350806088,
"autogenerated": false,
"ratio": 3.2285548124454784,
"config_test": f... |
"""Image data base class for pascal voc"""
import cv2
import os
import numpy as np
import xml.etree.ElementTree as ET
from utils.util import bbox_transform_inv
from dataset.imdb import imdb
from dataset.voc_eval import voc_eval
class pascal_voc(imdb):
def __init__(self, image_set, year, data_path, mc):
imdb._... | {
"repo_name": "Walter1218/self_driving_car_ND",
"path": "squeezeDet/src/dataset/pascal_voc.py",
"copies": "1",
"size": "5019",
"license": "mit",
"hash": -3438374078338747400,
"line_mean": 35.3695652174,
"line_max": 82,
"alpha_frac": 0.5847778442,
"autogenerated": false,
"ratio": 3.231809401159047... |
"""Image data base class for pascal voc"""
import cv2
import os
import numpy as np
import xml.etree.ElementTree as ET
from utils.util import bbox_transform_inv
from dataset.imdb import imdb
from dataset.voc_eval import voc_eval
class pascal_voc(imdb):
def __init__(self, image_set, year, data_path, mc):
imdb.... | {
"repo_name": "BichenWuUCB/squeezeDet",
"path": "src/dataset/pascal_voc.py",
"copies": "1",
"size": "4989",
"license": "bsd-2-clause",
"hash": 2842205434112637000,
"line_mean": 35.4160583942,
"line_max": 82,
"alpha_frac": 0.5846863099,
"autogenerated": false,
"ratio": 3.2333117303953336,
"confi... |
"""Image data base class for pascal voc"""
import os
import xml.etree.ElementTree as ET
import numpy as np
from dataset.imdb import imdb
from dataset.voc_eval import voc_eval
from utils.util import bbox_transform_inv
class fpascal_voc(imdb):
def __init__(self, image_set, data_path, mc):
imdb.__init__(self, ... | {
"repo_name": "fyhtea/squeezeDet-hand",
"path": "src/dataset/fpascal_voc.py",
"copies": "1",
"size": "4937",
"license": "bsd-2-clause",
"hash": -3214644608159848000,
"line_mean": 34.7826086957,
"line_max": 82,
"alpha_frac": 0.5849706299,
"autogenerated": false,
"ratio": 3.239501312335958,
"conf... |
"""Model configuration for pascal dataset"""
import numpy as np
from config.config import base_model_config
def kitti_res50_config():
"""Specify the parameters to tune below."""
mc = base_model_config('KITTI')
mc.IMAGE_WIDTH = 1242
mc.IMAGE_HEIGHT = 375
mc.BATCH_S... | {
"repo_name": "Walter1218/self_driving_car_ND",
"path": "squeezeDet/src/config/kitti_res50_config.py",
"copies": "1",
"size": "2029",
"license": "mit",
"hash": 1218731503395744800,
"line_mean": 24.6835443038,
"line_max": 77,
"alpha_frac": 0.4751108921,
"autogenerated": false,
"ratio": 2.833798882... |
"""Model configuration for pascal dataset"""
import numpy as np
from config import base_model_config
def kitti_model_config():
"""Specify the parameters to tune below."""
mc = base_model_config('KITTI')
# mc.IMAGE_WIDTH = 1864 # half width 621
# mc.IMAGE_HEIGHT = 562... | {
"repo_name": "goan15910/ConvDet",
"path": "src/config/kitti_model_config.py",
"copies": "1",
"size": "2263",
"license": "bsd-2-clause",
"hash": -5782812523437378000,
"line_mean": 27.6455696203,
"line_max": 77,
"alpha_frac": 0.4803358374,
"autogenerated": false,
"ratio": 2.8828025477707007,
"co... |
"""Model configuration for pascal dataset"""
import numpy as np
from config import base_model_config
def kitti_res50_config():
"""Specify the parameters to tune below."""
mc = base_model_config('KITTI')
mc.IMAGE_WIDTH = 1242
mc.IMAGE_HEIGHT = 375
mc.BATCH_SIZE ... | {
"repo_name": "BichenWuUCB/squeezeDet",
"path": "src/config/kitti_res50_config.py",
"copies": "2",
"size": "2023",
"license": "bsd-2-clause",
"hash": -8995766064910847000,
"line_mean": 24.6075949367,
"line_max": 77,
"alpha_frac": 0.4735541275,
"autogenerated": false,
"ratio": 2.8293706293706293,
... |
"""Model configuration for pascal dataset"""
import numpy as np
from config import base_model_config
def kitti_squeezeDet_config():
"""Specify the parameters to tune below."""
mc = base_model_config('KITTI')
mc.IMAGE_WIDTH = 1242
mc.IMAGE_HEIGHT = 375
mc.BATCH_SIZ... | {
"repo_name": "goan15910/ConvDet",
"path": "src/config/kitti_squeezeDet_config.py",
"copies": "1",
"size": "2028",
"license": "bsd-2-clause",
"hash": 2602234770618667000,
"line_mean": 24.6708860759,
"line_max": 77,
"alpha_frac": 0.474852071,
"autogenerated": false,
"ratio": 2.8403361344537816,
... |
"""Model configuration for pascal dataset"""
import numpy as np
from config import base_model_config
def kitti_squeezeDetPlus_config():
"""Specify the parameters to tune below."""
mc = base_model_config('KITTI')
mc.IMAGE_WIDTH = 1242
mc.IMAGE_HEIGHT = 375
mc.BATCH... | {
"repo_name": "goan15910/ConvDet",
"path": "src/config/kitti_squeezeDetPlus_config.py",
"copies": "2",
"size": "2032",
"license": "bsd-2-clause",
"hash": -2631181191224948000,
"line_mean": 24.7215189873,
"line_max": 77,
"alpha_frac": 0.4758858268,
"autogenerated": false,
"ratio": 2.84195804195804... |
"""Model configuration for pascal dataset"""
import numpy as np
from config import base_model_config
def kitti_vgg16_config():
"""Specify the parameters to tune below."""
mc = base_model_config('KITTI')
mc.IMAGE_WIDTH = 1242
mc.IMAGE_HEIGHT = 375
mc.BATCH_SIZE ... | {
"repo_name": "BichenWuUCB/squeezeDet",
"path": "src/config/kitti_vgg16_config.py",
"copies": "2",
"size": "2022",
"license": "bsd-2-clause",
"hash": 4172640554345742300,
"line_mean": 24.5949367089,
"line_max": 77,
"alpha_frac": 0.4732937685,
"autogenerated": false,
"ratio": 2.831932773109244,
... |
"""Neural network model base class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
from utils import util
from easydict import EasyDict as edict
import numpy as np
import tensorflow as tf
def _add_loss_summaries(total_loss):
"... | {
"repo_name": "BichenWuUCB/squeezeDet",
"path": "src/nn_skeleton.py",
"copies": "1",
"size": "27924",
"license": "bsd-2-clause",
"hash": -5864975339788389000,
"line_mean": 35.9854304636,
"line_max": 86,
"alpha_frac": 0.6036026357,
"autogenerated": false,
"ratio": 3.5571974522292993,
"config_tes... |
# Original license text is below
# BSD 2-Clause License
#
# Copyright (c) 2016, Bichen Wu
# 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 must retain the ab... | {
"repo_name": "dsavenko/ck-tensorflow",
"path": "program/squeezedet/continuous.py",
"copies": "1",
"size": "19890",
"license": "bsd-3-clause",
"hash": 8111823255399025000,
"line_mean": 35.6298342541,
"line_max": 147,
"alpha_frac": 0.6179487179,
"autogenerated": false,
"ratio": 3.4358265676282604,... |
"""ResNet50+ConvDet model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import joblib
from utils import util
from easydict import EasyDict as edict
import numpy as np
import tensorflow as tf
from nn_skeleton import ModelSkeleton... | {
"repo_name": "BichenWuUCB/squeezeDet",
"path": "src/nets/resnet50_convDet.py",
"copies": "1",
"size": "6837",
"license": "bsd-2-clause",
"hash": -3284377319621639700,
"line_mean": 39.4556213018,
"line_max": 76,
"alpha_frac": 0.6081614743,
"autogenerated": false,
"ratio": 3.1711502782931356,
"c... |
"""SqueezeDet Demo.
In image detection mode, for a given image, detect objects and draw bounding
boxes around them. In video detection mode, perform real-time detection on the
video stream.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
im... | {
"repo_name": "Walter1218/self_driving_car_ND",
"path": "squeezeDet/src/demo.py",
"copies": "2",
"size": "6683",
"license": "mit",
"hash": 4769277836595081000,
"line_mean": 29.797235023,
"line_max": 79,
"alpha_frac": 0.5816250187,
"autogenerated": false,
"ratio": 3.3018774703557314,
"config_tes... |
"""SqueezeDet model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import joblib
from utils import util
from easydict import EasyDict as edict
import numpy as np
import tensorflow as tf
from nn_skeleton import ModelSkeleton
clas... | {
"repo_name": "BichenWuUCB/squeezeDet",
"path": "src/nets/squeezeDet.py",
"copies": "1",
"size": "3765",
"license": "bsd-2-clause",
"hash": 1974240793766151700,
"line_mean": 34.5188679245,
"line_max": 74,
"alpha_frac": 0.6379814077,
"autogenerated": false,
"ratio": 2.8674790555978675,
"config_t... |
"""SqueezeDet+ model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import joblib
from utils import util
from easydict import EasyDict as edict
import numpy as np
import tensorflow as tf
from nn_skeleton import ModelSkeleton
cla... | {
"repo_name": "BichenWuUCB/squeezeDet",
"path": "src/nets/squeezeDetPlus.py",
"copies": "1",
"size": "3782",
"license": "bsd-2-clause",
"hash": -1726244074204250000,
"line_mean": 34.679245283,
"line_max": 74,
"alpha_frac": 0.6393442623,
"autogenerated": false,
"ratio": 2.876045627376426,
"confi... |
"""The data base wrapper class"""
import os
import random
import shutil
from PIL import Image, ImageFont, ImageDraw
import cv2
import numpy as np
from utils.util import iou, batch_iou, drift_dist, recolor, scale_trans, rand_flip
class imdb(object):
"""Image database."""
def __init__(self, name, mc):
self._... | {
"repo_name": "goan15910/ConvDet",
"path": "src/dataset/imdb.py",
"copies": "1",
"size": "9449",
"license": "bsd-2-clause",
"hash": -200703213310001280,
"line_mean": 31.3595890411,
"line_max": 86,
"alpha_frac": 0.5669383003,
"autogenerated": false,
"ratio": 3.0889179470415167,
"config_test": fa... |
"""The data base wrapper class"""
import os
import random
import shutil
from PIL import Image, ImageFont, ImageDraw
import cv2
import numpy as np
from utils.util import iou, batch_iou
class imdb(object):
"""Image database."""
def __init__(self, name, mc):
self._name = name
self._classes = []
self._... | {
"repo_name": "BichenWuUCB/squeezeDet",
"path": "src/dataset/imdb.py",
"copies": "1",
"size": "9980",
"license": "bsd-2-clause",
"hash": 6584210963973892000,
"line_mean": 31.614379085,
"line_max": 82,
"alpha_frac": 0.5578156313,
"autogenerated": false,
"ratio": 3.0566615620214397,
"config_test"... |
"""Train"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os.path
import shutil
import sys
import time
from datetime import datetime
import tempfile
import json
import cv2
import numpy as np
import tensorflow as tf
from config import *... | {
"repo_name": "getnexar/squeezeDet",
"path": "src/train.py",
"copies": "1",
"size": "20175",
"license": "bsd-2-clause",
"hash": 8071640660885272000,
"line_mean": 42.7635574837,
"line_max": 195,
"alpha_frac": 0.5872614622,
"autogenerated": false,
"ratio": 3.4742552092302392,
"config_test": true,... |
"""Utility functions."""
import numpy as np
import time
import tensorflow as tf
import cv2
def iou(box1, box2):
"""Compute the Intersection-Over-Union of two given boxes.
Args:
box1: array of 4 elements [cx, cy, width, height].
box2: same as above
Returns:
iou: a float number in range [0, 1]. iou ... | {
"repo_name": "goan15910/ConvDet",
"path": "src/utils/util.py",
"copies": "1",
"size": "8776",
"license": "bsd-2-clause",
"hash": -3360748288548132400,
"line_mean": 27.9636963696,
"line_max": 80,
"alpha_frac": 0.5754329991,
"autogenerated": false,
"ratio": 2.859563375692408,
"config_test": fals... |
"""Utility functions."""
import numpy as np
import time
import tensorflow as tf
def iou(box1, box2):
"""Compute the Intersection-Over-Union of two given boxes.
Args:
box1: array of 4 elements [cx, cy, width, height].
box2: same as above
Returns:
iou: a float number in range [0, 1]. iou of the two ... | {
"repo_name": "fyhtea/squeezeDet-hand",
"path": "src/utils/util.py",
"copies": "3",
"size": "6444",
"license": "bsd-2-clause",
"hash": 626075610747182000,
"line_mean": 26.775862069,
"line_max": 80,
"alpha_frac": 0.6000931099,
"autogenerated": false,
"ratio": 3.0126227208976157,
"config_test": f... |
"""VGG16+ConvDet model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import joblib
from utils import util
from easydict import EasyDict as edict
import numpy as np
import tensorflow as tf
from nn_skeleton import ModelSkeleton
... | {
"repo_name": "BichenWuUCB/squeezeDet",
"path": "src/nets/vgg16_convDet.py",
"copies": "1",
"size": "3184",
"license": "bsd-2-clause",
"hash": -5984719655860090000,
"line_mean": 34.3777777778,
"line_max": 81,
"alpha_frac": 0.6140075377,
"autogenerated": false,
"ratio": 2.926470588235294,
"confi... |
"""VGG16-ConvDet-v2 model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import joblib
from utils import util
from easydict import EasyDict as edict
import numpy as np
import tensorflow as tf
from nn_skeleton import ModelSkeleton... | {
"repo_name": "goan15910/ConvDet",
"path": "src/nets/vgg16_convDet_v2.py",
"copies": "1",
"size": "3721",
"license": "bsd-2-clause",
"hash": -3732553369005036500,
"line_mean": 35.1262135922,
"line_max": 81,
"alpha_frac": 0.6062886321,
"autogenerated": false,
"ratio": 2.9093041438623923,
"config... |
__author__ = 'Bieliaievskyi Sergey'
__credits__ = ["Bieliaievskyi Sergey"]
__license__ = "Apache License"
__version__ = "1.0.0"
__maintainer__ = "Bieliaievskyi Sergey"
__email__ = "magelan09@gmail.com"
__status__ = "Release"
import urllib.parse
import mimetypes
import base64
import pycurl
import json
import io
class... | {
"repo_name": "pymag09/pushbullet",
"path": "pushbullet.py",
"copies": "1",
"size": "3902",
"license": "apache-2.0",
"hash": -9188806091319095000,
"line_mean": 34.8073394495,
"line_max": 117,
"alpha_frac": 0.6022552537,
"autogenerated": false,
"ratio": 3.238174273858921,
"config_test": false,
... |
__author__ = 'bigyan'
import logging
from multiFileLogging import class2
def setup_logger(loggerName, logFile, level=logging.DEBUG):
logger = logging.getLogger(loggerName)
formatter = \
logging.Formatter('[%(asctime)s]' + ' ' +
'{%(threadName)s/%(filename)s/%(module)s/%(fun... | {
"repo_name": "bigyanbhar/single-file-code",
"path": "multiFileLogging2.py",
"copies": "1",
"size": "1233",
"license": "apache-2.0",
"hash": 8533825570394326000,
"line_mean": 23.1960784314,
"line_max": 100,
"alpha_frac": 0.600973236,
"autogenerated": false,
"ratio": 3.261904761904762,
"config_t... |
__author__ = 'bigyan'
import logging
import os
class class2:
__logger = None
def __init__(self):
self.__logger = logging.getLogger("class2Log")
def log(self, message):
self.__logger.info(message)
#logging.basicConfig(
# filename=self.__expId + ".log",
# format='[%(asctime)s]' + ... | {
"repo_name": "bigyanbhar/single-file-code",
"path": "multiFileLogging.py",
"copies": "1",
"size": "2184",
"license": "apache-2.0",
"hash": -7488991883897003000,
"line_mean": 27.3766233766,
"line_max": 100,
"alpha_frac": 0.5934065934,
"autogenerated": false,
"ratio": 3.299093655589124,
"config_... |
__author__ = "Biju Joseph"
import logging
import os
import json
logger = logging.getLogger('repo')
class Repository:
"""
Provides a unified interface for repositories
"""
def __init__(self, name):
"""
Will initialize the repository
:param name: name of the data store
... | {
"repo_name": "semanticbits/owh-ds",
"path": "software/owh/backoffice/obsolete/repositories.py",
"copies": "1",
"size": "3928",
"license": "apache-2.0",
"hash": 5486056497046489000,
"line_mean": 29.9291338583,
"line_max": 94,
"alpha_frac": 0.5814663951,
"autogenerated": false,
"ratio": 4.32599118... |
__author__ = "Biju Joseph"
import logging
import elasticsearch
import elasticsearch.helpers
from repositories import Repository
logger = logging.getLogger('elastic')
INDEX_SETTINGS = {
"settings": {
"refresh_interval" : "60s"
}
}
class ElasticSearchRepository(Repository, object):
""" A facad... | {
"repo_name": "semanticbits/owh-ds",
"path": "software/owh/backoffice/obsolete/elasticsearch_repository.py",
"copies": "1",
"size": "3022",
"license": "apache-2.0",
"hash": 3535152110464983600,
"line_mean": 30.1649484536,
"line_max": 100,
"alpha_frac": 0.6082064858,
"autogenerated": false,
"ratio... |
__author__ = "Biju Joseph"
import logging
import elasticsearch
import time
from elasticsearch.helpers import bulk, scan
from repositories import Repository
logger = logging.getLogger('elastic')
logging.getLogger('elasticsearch').setLevel("WARN")
INDEX_SETTINGS = {
"settings": {
"refresh_interval" : "-1"... | {
"repo_name": "semanticbits/owh-ds",
"path": "software/owh/backoffice/owh/etl/common/elasticsearch_repository.py",
"copies": "1",
"size": "5204",
"license": "apache-2.0",
"hash": -6509440737295635000,
"line_mean": 35.9078014184,
"line_max": 120,
"alpha_frac": 0.6154880861,
"autogenerated": false,
... |
__author__ = 'Bill French'
import argparse
from mi.idk.da_server import DirectAccessServer
from mi.idk.exceptions import ParameterRequired
def run():
opts = parseArgs()
app = DirectAccessServer(opts.launch_monitor)
if(opts.telnet and opts.vps):
ParameterRequired("-t and -v are mutually exclusive... | {
"repo_name": "danmergens/mi-instrument",
"path": "mi/idk/scripts/da_server.py",
"copies": "11",
"size": "1122",
"license": "bsd-2-clause",
"hash": -1626588792605931000,
"line_mean": 25.0930232558,
"line_max": 75,
"alpha_frac": 0.61942959,
"autogenerated": false,
"ratio": 3.8958333333333335,
"c... |
__author__ = 'Bill French'
import argparse
from mi.idk.platform.nose_test import NoseTest
from mi.idk.platform.metadata import Metadata
from mi.core.log import get_logger ; log = get_logger()
import yaml
import time
import os
import re
from glob import glob
from mi.idk.config import Config
DEFAULT_DIR='/tmp/dsa_ing... | {
"repo_name": "danmergens/mi-instrument",
"path": "mi/idk/scripts/platform/test_driver.py",
"copies": "11",
"size": "5044",
"license": "bsd-2-clause",
"hash": 4986639524029693000,
"line_mean": 31.7532467532,
"line_max": 91,
"alpha_frac": 0.5729579699,
"autogenerated": false,
"ratio": 3.9810576164... |
__author__ = "Bill Riehl (briehl@gmail.com)"
__version__ = "0.0.1"
__date__ = "$Date: 2014/07/09 $"
from cell import Cell
class Playground(object):
"""
An abstract Cell playground.
"""
def __init__(self, n):
"""
This default initializer inits with n random cells.
In general, in... | {
"repo_name": "briehl/cell-playground",
"path": "cellplayground/playground/playground.py",
"copies": "1",
"size": "1123",
"license": "mit",
"hash": -5507456094921245000,
"line_mean": 30.2222222222,
"line_max": 104,
"alpha_frac": 0.5734639359,
"autogenerated": false,
"ratio": 3.8197278911564627,
... |
__author__ = "Bill Riehl (briehl@gmail.com)"
__version__ = "0.0.1"
__date__ = "$Date: 2014/07/09 $"
from cellplayground.playground.cell import Cell
import unittest
class CellTestCase(unittest.TestCase):
def setUp(self):
pass
def test_cell_1d(self):
types = ["random", "min", "max"]
for... | {
"repo_name": "briehl/cell-playground",
"path": "cellplayground/test/test_basecell.py",
"copies": "1",
"size": "1232",
"license": "mit",
"hash": 5401789747439984000,
"line_mean": 28.3333333333,
"line_max": 66,
"alpha_frac": 0.5568181818,
"autogenerated": false,
"ratio": 3.027027027027027,
"conf... |
__author__ = "Bill Riehl (briehl@gmail.com)"
__version__ = "0.0.1"
__date__ = "$Date: 2014/07/09 $"
import random
class Cell(object):
"""
A generic (abstract?) Cell class
A Cell should be initialized with a location, at least.
Subclasses of Cell should implement the play() function,
which does an ... | {
"repo_name": "briehl/cell-playground",
"path": "cellplayground/playground/cell.py",
"copies": "1",
"size": "1358",
"license": "mit",
"hash": 3838257006086835700,
"line_mean": 30.5813953488,
"line_max": 83,
"alpha_frac": 0.5257731959,
"autogenerated": false,
"ratio": 3.4035087719298245,
"config... |
__author__ = 'billryan'
from feedgen.feed import FeedGenerator
class Atom:
"""GitHub Atom"""
def __init__(self):
self.atom = True
def init_fg(self, repo_info):
fg = FeedGenerator()
title = 'Recent commits to ' + repo_info['full_name']
fg.title(title)
fg.link(href=r... | {
"repo_name": "billryan/github-rss",
"path": "rss_gen/rss_gen.py",
"copies": "1",
"size": "1185",
"license": "mit",
"hash": -8694095825909693000,
"line_mean": 31.027027027,
"line_max": 61,
"alpha_frac": 0.576371308,
"autogenerated": false,
"ratio": 3.356940509915014,
"config_test": false,
"ha... |
from flask import Flask
from flask import request, redirect
import requests
app = Flask(__name__)
cas = {
'name': 'demo',
'secret': '977beed4-ab6f-4e1f-b60c-9d84c60e1d5a',
'identify': '24a03e6e-d1ad-4f11-bd02-566b06b39481',
};
@app.route('/')
def hello_world():
return redirect('http://example.com/... | {
"repo_name": "detailyang/cas-server",
"path": "examples/python/index.py",
"copies": "2",
"size": "1133",
"license": "mit",
"hash": -8316867894907096000,
"line_mean": 28.8157894737,
"line_max": 102,
"alpha_frac": 0.6443071492,
"autogenerated": false,
"ratio": 2.8903061224489797,
"config_test": ... |
__author__ = 'bingxinfan'
# Best Time to Buy and Sell Stocks III
# Best Time to Buy and Sell Stocks IV
'''
class Solution {
public:
int maxProfit(int k, vector<int> &prices) {
int n = (int)prices.size(), ret = 0, v, p = 0;
priority_queue<int> profits;
stack<pair<int, int> > vp_pairs;
... | {
"repo_name": "misscindy/Interview",
"path": "DP_Backtrack_Recursion/LC12x_Stocks.py",
"copies": "1",
"size": "1783",
"license": "cc0-1.0",
"hash": 1286495685343913000,
"line_mean": 36.1458333333,
"line_max": 127,
"alpha_frac": 0.5098149187,
"autogenerated": false,
"ratio": 3.283609576427256,
"... |
import re
import sys
def printlist(list):
for value,key in list :
print str(key) + " : " + str(value)
with open(sys.argv[1],'r') as file :
data = file.read()
words = re.compile('[a-zA-Z0-9]+')
dict = {}
for x in words.findall(data) :
if x not in dict :
dict[x] = 1
... | {
"repo_name": "CADTS-Bachelor/playbook",
"path": "grade-2015/WangPeng/count.py",
"copies": "1",
"size": "1163",
"license": "mit",
"hash": -8695332359487664000,
"line_mean": 22.3125,
"line_max": 63,
"alpha_frac": 0.4530831099,
"autogenerated": false,
"ratio": 2.9140625,
"config_test": false,
"... |
__author__ = 'BisharaKorkor'
import numpy as np
from math import exp, pow, sqrt, pi, fmod
def movingaverage(a, w):
""" An array b of length len(a)-w is returned where b_n = (a_n + a_n-1 + ... + a_n-w)/w """
return [np.mean(a[i:i+w]) for i in range(len(a)-w)]
def gaussiankernel(sigma, width):
"""Generates... | {
"repo_name": "BishKor/pyboon",
"path": "arrayoperations.py",
"copies": "1",
"size": "2659",
"license": "mit",
"hash": 1430280231814263000,
"line_mean": 30.2823529412,
"line_max": 111,
"alpha_frac": 0.6126363294,
"autogenerated": false,
"ratio": 3.408974358974359,
"config_test": false,
"has_n... |
__author__ = 'Bitvis AS'
__copyright__ = "Copyright 2017, Bitvis AS"
__version__ = "1.0.0"
__email__ = "support@bitvis.no"
import os
import glob
import fileinput
def print_help():
print("\rPlease place the VVC which is to be modified into the \"vvc_to_be_modified\" directory")
print("- Place the source files... | {
"repo_name": "AndyMcC0/UVVM_All",
"path": "uvvm_vvc_framework/script/vvc_name_modifier/vvc_name_modifier.py",
"copies": "3",
"size": "10061",
"license": "mit",
"hash": 9083887708208410000,
"line_mean": 42.3405172414,
"line_max": 126,
"alpha_frac": 0.6251243286,
"autogenerated": false,
"ratio": 3... |
__author__ = 'Bitvis AS'
__copyright__ = "Copyright 2017, Bitvis AS"
__version__ = "1.1.1"
__email__ = "support@bitvis.no"
import os
division_line = "--========================================================================================================================"
class Channel:
def __init__(self, name... | {
"repo_name": "AndyMcC0/UVVM_All",
"path": "uvvm_vvc_framework/script/vvc_generator/vvc_generator.py",
"copies": "1",
"size": "80022",
"license": "mit",
"hash": 5375977851871328000,
"line_mean": 58.5349702381,
"line_max": 244,
"alpha_frac": 0.5860151222,
"autogenerated": false,
"ratio": 3.2620571... |
__author__ = 'BJHaibo'
import os
import scrapy
# from scrapy.spider import Request
from scrapy.pipelines.images import ImagesPipeline
from scrapy.exceptions import DropItem
class MyImagePipeline(ImagesPipeline):
def __init__(self,store_uri,download_func=None):
# store_uri is automatically ... | {
"repo_name": "haipersist/webspider",
"path": "spider/jobspider/pipelines/down_image.py",
"copies": "1",
"size": "1075",
"license": "mit",
"hash": 7759712044162594000,
"line_mean": 27.8611111111,
"line_max": 81,
"alpha_frac": 0.6130232558,
"autogenerated": false,
"ratio": 3.923357664233577,
"co... |
__author__ = 'BJ'
from behave import *
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support import expected_conditions
@given('I am browsing "{url}"')
def step_impl(context, url... | {
"repo_name": "bjtallguy/FP_u1qJXqn0m31A6v0beo4",
"path": "q2/tests/features/steps/q2.py",
"copies": "1",
"size": "1883",
"license": "bsd-2-clause",
"hash": -4903319061603585000,
"line_mean": 32.0350877193,
"line_max": 115,
"alpha_frac": 0.7227827934,
"autogenerated": false,
"ratio": 3.5935114503... |
__author__ = 'bj'
import unittest
from timeit import Timer
from q1 import find_longest_inc_subsequence as fls
class TestFindLongestIncrementingSubSequence(unittest.TestCase):
def test_example_one(self):
self.assertEqual(fls([1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7]), 4)
def test_example_two(self):
... | {
"repo_name": "bjtallguy/FP_u1qJXqn0m31A6v0beo4",
"path": "q1/tests/tests.py",
"copies": "1",
"size": "1220",
"license": "bsd-2-clause",
"hash": -7352055570909805000,
"line_mean": 26.7272727273,
"line_max": 70,
"alpha_frac": 0.5885245902,
"autogenerated": false,
"ratio": 3.0272952853598016,
"co... |
__author__ = 'bj'
"""
Q2 Web Front-End Test
Automate the following functional test using Selenium:
1. Navigate to the Wikipedia home page, http://www.wikipedia.org/.
2. Search for a given string in English:
(a) Type in a string given as parameter in the search input field.
(b) Select English as the search language.
(c... | {
"repo_name": "bjtallguy/FP_u1qJXqn0m31A6v0beo4",
"path": "q2/q2.py",
"copies": "1",
"size": "3270",
"license": "bsd-2-clause",
"hash": 8728535580024423000,
"line_mean": 37.9285714286,
"line_max": 122,
"alpha_frac": 0.7107033639,
"autogenerated": false,
"ratio": 3.762945914844649,
"config_test"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.