text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Jossef Harush'
import abc
import socket
import logging
from networking_helper import *
from banner_helper import *
class BannerGrabber(object):
__metaclass__ = abc.ABCMeta
def __init__(self, address, port, timeout_in_milliseconds=500):
self.address = address
self.port = port
... | {
"repo_name": "Jossef/power-scanner",
"path": "powscan_common/banner_grabber.py",
"copies": "1",
"size": "4323",
"license": "mit",
"hash": 5107652298809509,
"line_mean": 28.2162162162,
"line_max": 102,
"alpha_frac": 0.6007402267,
"autogenerated": false,
"ratio": 4.172779922779923,
"config_test"... |
__author__ = 'Jossef Harush'
from powscan_common.packet_helper import *
import abc
import socket
import logging
from networking_helper import *
from banner_helper import *
import time
class PortScanner(object):
__metaclass__ = abc.ABCMeta
@staticmethod
def create(type,
source_ip,
... | {
"repo_name": "Jossef/power-scanner",
"path": "powscan_common/port_scanner.py",
"copies": "1",
"size": "14174",
"license": "mit",
"hash": 4471067834132706000,
"line_mean": 32.6674584323,
"line_max": 111,
"alpha_frac": 0.4796811063,
"autogenerated": false,
"ratio": 4.786896318811213,
"config_tes... |
__author__ = 'Jossef Harush'
def get_ftp_banner_info(banner):
# Lower the banner's case in order to get case insensitive match
banner = banner.lower()
server = None
operating_system = None
if any(hint for hint, os in ftp_servers.iteritems() if hint in banner):
server, operating_system = (... | {
"repo_name": "Jossef/power-scanner",
"path": "powscan_common/banner_helper.py",
"copies": "1",
"size": "30146",
"license": "mit",
"hash": -2467981538632099300,
"line_mean": 52.0757042254,
"line_max": 118,
"alpha_frac": 0.6025675048,
"autogenerated": false,
"ratio": 2.171902017291066,
"config_t... |
__author__ = 'Jossef'
__url__ = 'https://gist.github.com/Jossef/0ee20314577925b4027f'
def color(text, **user_styles):
styles = {
# styles
'reset': '\033[0m',
'bold': '\033[01m',
'disabled': '\033[02m',
'underline': '\033[04m',
'reverse': '\033[07m',
'strike_... | {
"repo_name": "pollow/CoreSML",
"path": "src/colors.py",
"copies": "1",
"size": "1679",
"license": "mit",
"hash": -8968182541579514000,
"line_mean": 26.0806451613,
"line_max": 84,
"alpha_frac": 0.496128648,
"autogenerated": false,
"ratio": 2.92,
"config_test": false,
"has_no_keywords": false,... |
__author__ = 'João Batista Pereira Matos Júnior'
from old.project import FILE_NAMES
from old.project import ROOT_PATH
from old.project import exists
from old.project import find_mode
from old.project import get_standard_deviation
from old.project import makedirs
from old.project import probability
from old.project impo... | {
"repo_name": "jblupus/PyLoyaltyProject",
"path": "old/project.backup/old/alters_per_interval.py",
"copies": "1",
"size": "2709",
"license": "bsd-2-clause",
"hash": -5218635615535796000,
"line_mean": 26.07,
"line_max": 79,
"alpha_frac": 0.6084226081,
"autogenerated": false,
"ratio": 3.37952559300... |
__author__ = 'João Batista Pereira Matos Júnior'
from os import mkdir
from os.path import exists, expanduser
import pandas as pd
from neo4jrestclient.client import GraphDatabase
from old.project import CassandraUtils
from old.project import get_time
RTD_STS_KEY = 'retweetedStatus'
MT_STS_KEY = 'userMentionEntities'
... | {
"repo_name": "jblupus/PyLoyaltyProject",
"path": "old/tests/test_neo.py",
"copies": "1",
"size": "5640",
"license": "bsd-2-clause",
"hash": 593226885220688900,
"line_mean": 34.0186335404,
"line_max": 100,
"alpha_frac": 0.5769776516,
"autogenerated": false,
"ratio": 3.4025347012673506,
"config_... |
"""
* This code implement the Hamming code:
https://en.wikipedia.org/wiki/Hamming_code - In telecommunication,
Hamming codes are a family of linear error-correcting codes. Hamming
codes can detect up to two-bit errors or correct one-bit errors
without detection of uncorrected errors. By contras... | {
"repo_name": "TheAlgorithms/Python",
"path": "hashes/hamming_code.py",
"copies": "1",
"size": "9403",
"license": "mit",
"hash": -8691812071680176000,
"line_mean": 30.7635135135,
"line_max": 88,
"alpha_frac": 0.5684960647,
"autogenerated": false,
"ratio": 3.6740914419695194,
"config_test": fals... |
# Imports
import numpy as np
# Class implemented to calculus the index
class IndexCalculation:
"""
# Class Summary
This algorithm consists in calculating vegetation indices, these
indices can be used for precision agriculture for example (or remote
sensing). There are functions to... | {
"repo_name": "TheAlgorithms/Python",
"path": "digital_image_processing/index_calculation.py",
"copies": "1",
"size": "19709",
"license": "mit",
"hash": -3794127555918518000,
"line_mean": 33.2083333333,
"line_max": 96,
"alpha_frac": 0.5189301665,
"autogenerated": false,
"ratio": 3.302161890397184... |
#!/usr/bin/python
import sys
import itertools
dictFile = '/usr/share/dict/web2'
charSet =""
wordLen =0
if (len (sys.argv) <2):
charSet = input ("Please enter the character Set:")
wordLen = len(charSet);
else:
charSet = sys.argv[1]
print "==================================================================... | {
"repo_name": "joydeep/4pics-1word-solver",
"path": "4pics1word.py",
"copies": "1",
"size": "1601",
"license": "mit",
"hash": -7305409338754792000,
"line_mean": 27.5892857143,
"line_max": 84,
"alpha_frac": 0.5808869457,
"autogenerated": false,
"ratio": 3.3705263157894736,
"config_test": false,
... |
__author__ = 'jpablo'
from django.db import connection, transaction
from django.db.models.fields import NOT_PROVIDED
def bulk_insert(object_list, show_sql = False):
"""
Generate the sql code for bulk insertion
@param object_list: Django model objects
"""
if not len(object_list):
return
... | {
"repo_name": "raonyguimaraes/mendelmd",
"path": "genes/mysql_bulk_insert.py",
"copies": "1",
"size": "1634",
"license": "bsd-3-clause",
"hash": 8989163128177869000,
"line_mean": 34.5434782609,
"line_max": 118,
"alpha_frac": 0.5746634027,
"autogenerated": false,
"ratio": 3.544468546637744,
"con... |
__author__ = 'JPate'
import random
import pyprimes
from datetime import datetime
startTime = datetime.now()
size = 20000
fileInt = open('20kBits_Int.txt', 'w')
fileList = open('20kBits_List.txt', 'w')
hugeint = []
num = pyprimes.primes_above(10**6)
for i in range(0, random.randint(0, 100)):
p = next(num)
print(p... | {
"repo_name": "st123ss/schoolwork",
"path": "CIS3362 (Cryptography and Information Security)/HW3/20kBitGen.py",
"copies": "1",
"size": "1320",
"license": "mit",
"hash": -3407387651331023400,
"line_mean": 21,
"line_max": 109,
"alpha_frac": 0.6212121212,
"autogenerated": false,
"ratio": 3.034482758... |
__author__ = 'jpi'
from django.conf import settings
from django.utils.importlib import import_module
from rest_framework.authentication import get_authorization_header, SessionAuthentication
from django.http.response import HttpResponseBadRequest
from django.contrib.sessions.middleware import SessionMiddleware
class... | {
"repo_name": "codeforeurope/stadtgedaechtnis_backend",
"path": "services/authentication/middleware.py",
"copies": "1",
"size": "3935",
"license": "mit",
"hash": -7637871057878456000,
"line_mean": 40,
"line_max": 93,
"alpha_frac": 0.665819568,
"autogenerated": false,
"ratio": 4.924906132665832,
... |
__author__ = 'jpi'
from django.conf.urls import patterns, url
from stadtgedaechtnis_backend.services.views.locations import *
urlpatterns = patterns(
'',
url(r'^(?P<lat>\d{1,3}\.\d{1,10})/(?P<lon>\d{1,3}\.\d{1,10})/$', LocationListNearby.as_view(),
name="get-locations"),
url(r'^(?P<lat>\d{1,3}\.... | {
"repo_name": "codeforeurope/stadtgedaechtnis_backend",
"path": "services/urlpatterns/locations.py",
"copies": "1",
"size": "3196",
"license": "mit",
"hash": 9157436350687973000,
"line_mean": 61.6862745098,
"line_max": 118,
"alpha_frac": 0.5948060075,
"autogenerated": false,
"ratio": 2.5425616547... |
__author__ = 'jpi'
from django import template
from stadtgedaechtnis_backend.models import ImportLogEntry
register = template.Library()
class ImportLogNode(template.Node):
"""
Node that renders the list of log entries to the template.
"""
def __init__(self, varname, limit=None):
self.limit... | {
"repo_name": "codeforeurope/stadtgedaechtnis_backend",
"path": "templatetags/import_log.py",
"copies": "1",
"size": "1723",
"license": "mit",
"hash": -6626969349303279000,
"line_mean": 24.7313432836,
"line_max": 82,
"alpha_frac": 0.5832849681,
"autogenerated": false,
"ratio": 4.006976744186047,
... |
__author__ = 'jpi'
from django import template
from stadtgedaechtnis_backend.models import Story
register = template.Library()
class NewEntriesCountNode(template.Node):
"""
Node that renders the list of log entries to the template.
"""
def __init__(self, varname):
self.varname = varname
... | {
"repo_name": "codeforeurope/stadtgedaechtnis_backend",
"path": "templatetags/new_entries.py",
"copies": "1",
"size": "1112",
"license": "mit",
"hash": 8997030557547863000,
"line_mean": 21.7142857143,
"line_max": 83,
"alpha_frac": 0.6321942446,
"autogenerated": false,
"ratio": 3.847750865051903,
... |
__author__ = 'jpi'
from rest_framework import permissions
from django.conf import settings
from rest_framework.permissions import SAFE_METHODS
from stadtgedaechtnis_backend.services.serializer.fields import create_secret_signature
class IsSameSessionAsLoggedIn(permissions.BasePermission):
"""
Permission tha... | {
"repo_name": "codeforeurope/stadtgedaechtnis_backend",
"path": "services/authentication/permissions.py",
"copies": "1",
"size": "2544",
"license": "mit",
"hash": 3900182554006078500,
"line_mean": 37.5606060606,
"line_max": 103,
"alpha_frac": 0.7075471698,
"autogenerated": false,
"ratio": 4.34871... |
__author__ = 'jpi'
import json
from django.views.generic import View
from django.http import HttpResponse
from SPARQLWrapper import SPARQLWrapper, JSON
from rest_framework.generics import GenericAPIView, ListCreateAPIView, RetrieveUpdateDestroyAPIView, ListAPIView
from stadtgedaechtnis_backend.utils import get_nearb... | {
"repo_name": "codeforeurope/stadtgedaechtnis_backend",
"path": "services/views/locations.py",
"copies": "1",
"size": "5986",
"license": "mit",
"hash": 8176412603569396000,
"line_mean": 32.6292134831,
"line_max": 122,
"alpha_frac": 0.6605412629,
"autogenerated": false,
"ratio": 4.369343065693431,... |
__author__ = 'jpi'
import re
from decimal import Decimal
from stadtgedaechtnis_backend.models import Location
def replace_multiple(text, dictionary):
"""
Replaces different words in a string using a dictionary.
"""
# escape for regular expressions
dictionary = dict((re.escape(key), value) for ke... | {
"repo_name": "codeforeurope/stadtgedaechtnis_backend",
"path": "utils.py",
"copies": "1",
"size": "1715",
"license": "mit",
"hash": 3081928488873219600,
"line_mean": 34.7291666667,
"line_max": 110,
"alpha_frac": 0.5469387755,
"autogenerated": false,
"ratio": 4.1525423728813555,
"config_test": ... |
__author__ = 'jpi'
import urllib2
import json
import time
import os
import re
from datetime import datetime
from decimal import Decimal
from urllib2 import HTTPError
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib.auth import get_user_model
from stadtgedaechtnis_back... | {
"repo_name": "codeforeurope/stadtgedaechtnis_backend",
"path": "import_entries/importers.py",
"copies": "1",
"size": "12409",
"license": "mit",
"hash": -5595217495118964000,
"line_mean": 35.6076696165,
"line_max": 120,
"alpha_frac": 0.5408171488,
"autogenerated": false,
"ratio": 4.11985391766268... |
__author__ = 'jpi'
# This file contains sensitive settings that should never be shared via a version control system.
# Note that before using this app, you need to set these values respectively and rename this file
# to local_settings.py. Django will not work unless doing so. Never put the resulting file under version... | {
"repo_name": "fraunhoferfokus/mobile-city-memory",
"path": "Mobiles_Stadtgedaechtnis/local_settings.template.py",
"copies": "2",
"size": "1289",
"license": "mit",
"hash": -8637953955020461000,
"line_mean": 36.9411764706,
"line_max": 113,
"alpha_frac": 0.7657098526,
"autogenerated": false,
"ratio... |
__author__ = 'jpi'
from django.views.generic.detail import DetailView
from django.views.generic import TemplateView
from django.views.generic.edit import FormView
from stadtgedaechtnis_backend.models import Story, Asset
from stadtgedaechtnis_frontend.forms import NewStoryImageForm
class EntryView(DetailVi... | {
"repo_name": "codeforeurope/stadtgedaechtnis_frontend",
"path": "views.py",
"copies": "1",
"size": "1650",
"license": "mit",
"hash": 5405980227483044000,
"line_mean": 26.4827586207,
"line_max": 93,
"alpha_frac": 0.6987878788,
"autogenerated": false,
"ratio": 3.6830357142857144,
"config_test": ... |
__author__ = 'jpsh'
from maps import Tile
class GridTools(object):
@staticmethod
def n(pos):
return pos[0], pos[1]-1
@staticmethod
def ne(pos):
return pos[0]+1, pos[1]-1
@staticmethod
def e(pos):
return pos[0]+1, pos[1]
@staticmethod
def se(pos):
ret... | {
"repo_name": "joaohenriques/dungeon_generator",
"path": "maps/grid.py",
"copies": "1",
"size": "3528",
"license": "mit",
"hash": -3902496933906701000,
"line_mean": 24.3884892086,
"line_max": 99,
"alpha_frac": 0.4804421769,
"autogenerated": false,
"ratio": 3.3251649387370406,
"config_test": fal... |
__author__ = 'jpsh'
from renderers import MapRenderer
from maps import Tile
from pygame import Surface
from pygame.color import Color
class PygameRenderer(MapRenderer):
def __init__(self, block_size):
self.block_size = block_size
self._earth = Surface((block_size, block_size))
self._eart... | {
"repo_name": "joaohenriques/dungeon_generator",
"path": "renderers/gui_pygame.py",
"copies": "1",
"size": "1168",
"license": "mit",
"hash": 1650826307519539000,
"line_mean": 29.7631578947,
"line_max": 70,
"alpha_frac": 0.5881849315,
"autogenerated": false,
"ratio": 3.65,
"config_test": false,
... |
__author__ = 'jpsh'
import os
from renderers.text import TextRenderer
from renderers.gui_pygame import PygameRenderer
from generators.cellular_automata import *
from maps.grid import GridMapLog, GridMap
import logging
logger = logging.getLogger('dungeon_generation')
logger.setLevel(logging.DEBUG)
# create file handle... | {
"repo_name": "joaohenriques/dungeon_generator",
"path": "generate.py",
"copies": "1",
"size": "3527",
"license": "mit",
"hash": 5281162213580698000,
"line_mean": 24.5579710145,
"line_max": 85,
"alpha_frac": 0.6186560817,
"autogenerated": false,
"ratio": 3.562626262626263,
"config_test": false,... |
__author__ = 'jramapuram'
from theano.tensor.signal import downsample
from keras.utils.theano_utils import shared_zeros
from keras.layers.core import Layer
import theano
import theano.tensor as T
import keras.initializations as initializations
import keras.activations as activations
class Convolution1D(Layer):
... | {
"repo_name": "jramapuram/LSTM_Anomaly_Detector",
"path": "convolutional.py",
"copies": "1",
"size": "2773",
"license": "mit",
"hash": -4373742203776072700,
"line_mean": 34.1139240506,
"line_max": 91,
"alpha_frac": 0.5723043635,
"autogenerated": false,
"ratio": 3.8301104972375692,
"config_test"... |
__author__ = 'jramapuram'
import numpy as np
import matplotlib.pyplot as plt
from itertools import islice
from keras.models import Sequential
from keras.layers.core import Dense
from keras.regularizers import l2
input_size = 256
hidden_size = input_size / 2
max_samples = input_size * 1000
batch_size = 128
def spli... | {
"repo_name": "jramapuram/gradient_approximator",
"path": "gradient_approximator.py",
"copies": "1",
"size": "2347",
"license": "mit",
"hash": -6924026523506883000,
"line_mean": 33.0144927536,
"line_max": 89,
"alpha_frac": 0.6510438858,
"autogenerated": false,
"ratio": 2.948492462311558,
"confi... |
__author__ = 'jramapuram'
import numpy as np
from data_source import DataSource
from random import randint
from math import sin, pi
from data_manipulator import window, split, normalize
# from sklearn.cross_validation import train_test_split
class DataGenerator(DataSource):
def __init__(self, conf, plotter):
... | {
"repo_name": "jramapuram/LSTM_Anomaly_Detector",
"path": "data_generator.py",
"copies": "1",
"size": "2121",
"license": "mit",
"hash": -6824753901459921000,
"line_mean": 36.2105263158,
"line_max": 101,
"alpha_frac": 0.5978312117,
"autogenerated": false,
"ratio": 3.465686274509804,
"config_test... |
__author__ = 'jramapuram'
import os
import shutil
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import Normalizer
from scipy.signal import wiener
from itertools import islice
class Plot:
def __init__(self, conf, autoencoder):
self.conf = conf
self.plots = []
... | {
"repo_name": "jramapuram/LSTM_Anomaly_Detector",
"path": "data_manipulator.py",
"copies": "1",
"size": "3042",
"license": "mit",
"hash": -3991511994743229400,
"line_mean": 28.25,
"line_max": 89,
"alpha_frac": 0.5857988166,
"autogenerated": false,
"ratio": 3.1987381703470033,
"config_test": fal... |
__author__ = 'jramapuram'
import os.path
import scipy
import statsmodels.api as sm
from time import time
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.layers.embeddings import Embedding
from keras.layers.recurrent import LSTM
class Classifier:
def __init__(self, c... | {
"repo_name": "jramapuram/LSTM_Anomaly_Detector",
"path": "classifier.py",
"copies": "1",
"size": "4578",
"license": "mit",
"hash": 4615077066271734000,
"line_mean": 39.5221238938,
"line_max": 106,
"alpha_frac": 0.5281782438,
"autogenerated": false,
"ratio": 4.188472095150961,
"config_test": fa... |
__author__ = 'jramapuram'
import os.path
import numpy as np
from data_manipulator import elementwise_square, roll_rows
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, AutoEncoder, Activation
from keras.layers.recurrent import LSTM, GRU
from keras.regularizers import l2
from convolut... | {
"repo_name": "jramapuram/LSTM_Anomaly_Detector",
"path": "autoencoder.py",
"copies": "1",
"size": "9334",
"license": "mit",
"hash": -5019525882264436000,
"line_mean": 42.212962963,
"line_max": 98,
"alpha_frac": 0.5306406685,
"autogenerated": false,
"ratio": 4.104661389621811,
"config_test": fa... |
__author__ = 'jrc'
import mimetypes
import json
import logging
import sys
logger = logging.getLogger('utils')
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler('utils')
fh.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter(
'%(asctime)s - %(levelname... | {
"repo_name": "jcallegari/raspberry_pi",
"path": "utils.py",
"copies": "1",
"size": "1259",
"license": "unlicense",
"hash": -889001290062873500,
"line_mean": 23.2115384615,
"line_max": 76,
"alpha_frac": 0.6266878475,
"autogenerated": false,
"ratio": 3.393530997304582,
"config_test": false,
"h... |
__author__ = 'jrc'
import os
#Application Detail - Put Your App Info Here
APP_SCOPES = 'SPEECH,STTC,TTS'
APP_KEY = 'xiprzvi7s0kg5lhb0kqybkm92cqy805q'
APP_SECRET = 'migubmxi0gk9ebgiodkuo46a6xvsquis'
#APP_KEY = 'your app key here'
#APP_SECRET = 'your app secret here'
APP_GRANT_TYPE = 'client_credentials'
#API URLs
URL_... | {
"repo_name": "jcallegari/raspberry_pi",
"path": "config.py",
"copies": "1",
"size": "1965",
"license": "unlicense",
"hash": -2771713680727855600,
"line_mean": 40.8085106383,
"line_max": 100,
"alpha_frac": 0.6427480916,
"autogenerated": false,
"ratio": 2.9593373493975905,
"config_test": false,
... |
__author__ = 'jrc'
import time
import threading
import math
from collections import deque
import logging
import audioop
import alsaaudio
import RPi.GPIO as GPIO
import config
from speech import AccessToken, SpeechToText, TextToSpeech
from utils import get_content_type
import sys
#audio constants
SAMPLE_RATE = 16000
SA... | {
"repo_name": "jcallegari/raspberry_pi",
"path": "speechapp.py",
"copies": "1",
"size": "22858",
"license": "unlicense",
"hash": 6234069308226554000,
"line_mean": 37.2881072027,
"line_max": 100,
"alpha_frac": 0.5750284364,
"autogenerated": false,
"ratio": 4.013696224758561,
"config_test": true,... |
__author__ = 'jrc'
import urllib
import httplib2
import pycurl
import os
import sys
import config
import pickle
import copy
import cStringIO
from utils import convert_json, get_content_type
from collections import deque
import logging
import time
#log to file and console
LOGGING_LEVEL = logging.DEBUG
logger = logging.g... | {
"repo_name": "jcallegari/raspberry_pi",
"path": "speech.py",
"copies": "1",
"size": "20107",
"license": "unlicense",
"hash": 461957226741562900,
"line_mean": 38.1949317739,
"line_max": 113,
"alpha_frac": 0.5622420053,
"autogenerated": false,
"ratio": 4.179380586156724,
"config_test": true,
"... |
__author__ = 'jrparks'
from django.utils.translation import ugettext_lazy as _
from django.db import models as db_models
import rest_framework.serializers
import relations
class NestedHyperlinkedModelSerializer(rest_framework.serializers.HyperlinkedModelSerializer):
default_error_messages = {
'invalid': ... | {
"repo_name": "jrjparks/django-rest-framework-nested",
"path": "rest_framework_nested/serializers.py",
"copies": "3",
"size": "2733",
"license": "apache-2.0",
"hash": 8861048921598426000,
"line_mean": 41.71875,
"line_max": 118,
"alpha_frac": 0.6523966337,
"autogenerated": false,
"ratio": 4.276995... |
__author__ = 'jrparks'
import rest_framework.relations
from django.core.urlresolvers import NoReverseMatch
from django.core.exceptions import ImproperlyConfigured
class NestedHyperlinkedRelatedField(rest_framework.relations.HyperlinkedRelatedField):
parent_lookup_field = "parent__pk"
def __init__(self, view_... | {
"repo_name": "jrjparks/django-rest-framework-nested",
"path": "rest_framework_nested/relations.py",
"copies": "3",
"size": "4014",
"license": "apache-2.0",
"hash": 1290207316971510300,
"line_mean": 41.2631578947,
"line_max": 119,
"alpha_frac": 0.6387643249,
"autogenerated": false,
"ratio": 4.344... |
__author__ = 'jrparks'
import rest_framework.routers
class SimpleRouter(rest_framework.routers.SimpleRouter):
"""
SimpleRouter for nested routers.
"""
def __init__(self, trailing_slash=True):
self.nested_routers = []
super(SimpleRouter, self).__init__(trailing_slash)
def _register... | {
"repo_name": "pombredanne/django-rest-framework-nested",
"path": "rest_framework_nested/routers.py",
"copies": "3",
"size": "2586",
"license": "apache-2.0",
"hash": -2238008092477615600,
"line_mean": 34.9305555556,
"line_max": 123,
"alpha_frac": 0.6279969064,
"autogenerated": false,
"ratio": 4.1... |
__author__ = 'jrx'
import argparse
import PIL.Image as Image
import numpy as np
from encoder.algorithms.xor_encoding import XorEncoding
def instantiate_algorithm(args):
""" Instantiate algorithm object from given args """
if args.algorithm == 'xor_encoding':
return XorEncoding(block_size=args.block... | {
"repo_name": "MillionIntegrals/image-data-encode",
"path": "encoder/main.py",
"copies": "1",
"size": "3459",
"license": "mit",
"hash": 4802171125507609000,
"line_mean": 30.1621621622,
"line_max": 117,
"alpha_frac": 0.6585718416,
"autogenerated": false,
"ratio": 3.9621993127147768,
"config_test... |
__author__ = 'jrx'
import collections
import numpy as np
import pandas as pd
import common.base as base
import common.math as cm_math
def classification_error_rate(classifier, coords, values):
""" Calculate classification error rate """
y_hat = classifier.classify(coords)
return np.mean(y_hat != values... | {
"repo_name": "MillionIntegrals/ESL",
"path": "chapter_04/classification.py",
"copies": "1",
"size": "4423",
"license": "mit",
"hash": 4494839001298574300,
"line_mean": 32.0074626866,
"line_max": 115,
"alpha_frac": 0.6215238526,
"autogenerated": false,
"ratio": 3.701255230125523,
"config_test":... |
__author__ = 'jrx'
import contextlib
import inspect
import os
import urllib2
import urlparse
import common.constants as constants
def this_script_directory():
""" Return directory this script is in """
return os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
def download_data_file... | {
"repo_name": "MillionIntegrals/ESL",
"path": "common/data.py",
"copies": "1",
"size": "1214",
"license": "mit",
"hash": -2822301880975319000,
"line_mean": 26.5909090909,
"line_max": 89,
"alpha_frac": 0.7026359143,
"autogenerated": false,
"ratio": 3.781931464174455,
"config_test": false,
"has... |
__author__ = 'jrx'
import itertools as it
import numpy as np
import pandas as pd
import common.base as base
def test_error(model, coords, values):
""" Calculate the error of the model using methodology from the book """
residuals = values - model.calculate(coords)
residuals2 = residuals * residuals
... | {
"repo_name": "MillionIntegrals/ESL",
"path": "chapter_03/regression.py",
"copies": "1",
"size": "3669",
"license": "mit",
"hash": 6025066596938759000,
"line_mean": 28.5887096774,
"line_max": 103,
"alpha_frac": 0.5966203325,
"autogenerated": false,
"ratio": 3.8060165975103732,
"config_test": fa... |
__author__ = 'jrx'
import numpy as np
from encoder.bit_density import pad_bit_array, convert_to_bit_density, convert_from_bit_density
from encoder.constants import BITS_PER_BYTE, BYTES_PER_UINT64
from encoder.utilities import add_length_info, strip_length_info
class XorEncoding:
def __init__(self, block_size, ... | {
"repo_name": "MillionIntegrals/image-data-encode",
"path": "encoder/algorithms/xor_encoding.py",
"copies": "1",
"size": "4672",
"license": "mit",
"hash": -321494888988745900,
"line_mean": 39.275862069,
"line_max": 119,
"alpha_frac": 0.6380565068,
"autogenerated": false,
"ratio": 3.59938366718027... |
__author__ = 'jrx'
import numpy as np
from encoder.constants import BITS_PER_BYTE
def truncate_bit_array(bit_array, bit_length):
""" Truncate given bit-array (uint8), so that the length can be divided by bit_length without a remainder """
overflow = bit_array.shape[0] % bit_length
if overflow > 0:
... | {
"repo_name": "MillionIntegrals/image-data-encode",
"path": "encoder/bit_density.py",
"copies": "1",
"size": "1935",
"license": "mit",
"hash": -2660354695963432400,
"line_mean": 35.5094339623,
"line_max": 119,
"alpha_frac": 0.6759689922,
"autogenerated": false,
"ratio": 3.347750865051903,
"conf... |
__author__ = 'jrx'
import pandas as pd
import chapter_04.data as data
import chapter_04.classification as classification
import common.profiling as profiling
import common.ui as ui
import common.math as cm_math
def vowel_classification(train_data, test_data):
""" Run the vowel classification algorithms """
... | {
"repo_name": "MillionIntegrals/ESL",
"path": "chapter_04/main.py",
"copies": "1",
"size": "3384",
"license": "mit",
"hash": 8934067466287121000,
"line_mean": 35.7826086957,
"line_max": 144,
"alpha_frac": 0.6385933806,
"autogenerated": false,
"ratio": 3.722772277227723,
"config_test": true,
"... |
__author__ = 'jrx'
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import assert_equal
from encoder.bit_density import convert_from_bit_density, convert_to_bit_density
def test_small_input():
initial = np.array([0, 1, 255], dtype=np.uint8)
converted = convert_to_bit_densit... | {
"repo_name": "MillionIntegrals/image-data-encode",
"path": "tests/test_bit_density.py",
"copies": "1",
"size": "1165",
"license": "mit",
"hash": 1288138616383703300,
"line_mean": 28.125,
"line_max": 101,
"alpha_frac": 0.6875536481,
"autogenerated": false,
"ratio": 3.2005494505494507,
"config_t... |
__author__ = 'jrx'
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import assert_greater, assert_equal
from encoder.algorithms.xor_encoding import XorEncoding
def test_capacity_monotonic():
shape = (640, 480, 3)
base = XorEncoding(block_size=6, intensity=4)
low_block ... | {
"repo_name": "MillionIntegrals/image-data-encode",
"path": "tests/test_xor_encoder.py",
"copies": "1",
"size": "2441",
"license": "mit",
"hash": 7133315062382900000,
"line_mean": 27.0574712644,
"line_max": 82,
"alpha_frac": 0.7050389185,
"autogenerated": false,
"ratio": 3.224570673712021,
"con... |
__author__ = 'jschulz'
from .py3compat import string_types
class _NA_DEFAULT_CLASS(object):
pass
_NA_DEFAULT = _NA_DEFAULT_CLASS()
def get_by_name(dict_like, name, na="<n/a"):
res = dict_like
for part in name.split("."):
try:
res = res.get(part, _NA_DEFAULT)
except:
... | {
"repo_name": "JanSchulz/knitpy",
"path": "knitpy/utils.py",
"copies": "1",
"size": "2663",
"license": "bsd-3-clause",
"hash": 4050118499745081000,
"line_mean": 29.9651162791,
"line_max": 88,
"alpha_frac": 0.5625234698,
"autogenerated": false,
"ratio": 3.1740166865315853,
"config_test": false,
... |
__author__ = 'jschumacher'
from flask import Flask, jsonify, request, send_from_directory
import processes as bsh
import filesystem as fsh
import platform
import os
from werkzeug.utils import secure_filename
DEBUG = False
RESOURCES_ROOT = ""
app = Flask(__name__)
ps_helpers = bsh.Processes(resources_root=RESOURCES_ROO... | {
"repo_name": "PPAPI/ppapi",
"path": "ppapi_server.py",
"copies": "1",
"size": "6397",
"license": "mit",
"hash": 8299389678887156000,
"line_mean": 32.1450777202,
"line_max": 125,
"alpha_frac": 0.6487415976,
"autogenerated": false,
"ratio": 3.365071015255129,
"config_test": false,
"has_no_keyw... |
__author__ = 'jschumacher'
import os
import subprocess
import threading
import time
import shutil
import psutil
import platform
import filesystem as fsh
if platform.system() == "Windows":
from subprocess import CREATE_NEW_CONSOLE
## Control and monitor system processes.
# This class provides functionality to st... | {
"repo_name": "PPAPI/ppapi",
"path": "processes.py",
"copies": "1",
"size": "13656",
"license": "mit",
"hash": 2051448972296413400,
"line_mean": 41.9465408805,
"line_max": 109,
"alpha_frac": 0.5864089045,
"autogenerated": false,
"ratio": 3.7734180712904117,
"config_test": false,
"has_no_keywo... |
__author__ = 'jschumacher'
import zipfile
from shutil import rmtree
from werkzeug.utils import secure_filename
req_version=None
try:
# For Python 3.0 and later
from urllib.request import urlopen
req_version=3
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import urlopen
req_v... | {
"repo_name": "PPAPI/ppapi",
"path": "filesystem.py",
"copies": "1",
"size": "7659",
"license": "mit",
"hash": 1970690761567908900,
"line_mean": 37.3,
"line_max": 102,
"alpha_frac": 0.5729207468,
"autogenerated": false,
"ratio": 3.5823199251637043,
"config_test": false,
"has_no_keywords": fal... |
__author__ = 'jschumacher'
import unittest
import processes as ph
from mock import patch
import psutil
from subprocess import PIPE
import os
import time
import shutil
class TestProcesses(unittest.TestCase):
def create_one_run_art(self,cmd_f, case_s, run_id):
file_sleep="sleep.py"
file_cmd_content=... | {
"repo_name": "PPAPI/ppapi",
"path": "tests/test_processes.py",
"copies": "1",
"size": "2443",
"license": "mit",
"hash": -7904466830135382000,
"line_mean": 34.9264705882,
"line_max": 99,
"alpha_frac": 0.6328284896,
"autogenerated": false,
"ratio": 2.9756394640682093,
"config_test": true,
"has... |
__author__ = 'jsgreenwell'
from random import randrange
from decimal import Decimal, ROUND_HALF_UP # using decimal and quantize we can get much better accuracy in rounding
def pround(num):
"""
Internal function that rounds a decimal to two place percision with rounding up capabilities
This is ... | {
"repo_name": "jsgreenwell/teaching-python",
"path": "classnotes/Knapsack/POSFunctions.py",
"copies": "1",
"size": "5568",
"license": "mit",
"hash": -5146720509164019000,
"line_mean": 40.8646616541,
"line_max": 124,
"alpha_frac": 0.6142241379,
"autogenerated": false,
"ratio": 4.046511627906977,
... |
__author__ = 'jsgreenwell'
import POSFunctions #our custom class
from collections import OrderedDict
"""Basic change making program using 100 base (American Currency): will create full knapsack version in
later example. This example will also be expanded, in steps, until it becomes a simple OO-based
(ie. we'll ... | {
"repo_name": "jsgreenwell/teaching-python",
"path": "classnotes/Knapsack/make_change.a1.py",
"copies": "1",
"size": "2969",
"license": "mit",
"hash": 680585873252903600,
"line_mean": 42.6617647059,
"line_max": 118,
"alpha_frac": 0.6608285618,
"autogenerated": false,
"ratio": 3.7869897959183674,
... |
__author__ = 'jslvtr'
import pymongo
import pymongo.errors
class Database(object):
def __init__(self, uri):
client = pymongo.MongoClient(uri)
self.db = client.get_default_database()
self.collection = None
def insert(self, data):
if self.collection is not None:
sel... | {
"repo_name": "jslvtr/FriendFinderBackend",
"path": "src/db/database.py",
"copies": "1",
"size": "1287",
"license": "mit",
"hash": 1036297121935527400,
"line_mean": 26.3829787234,
"line_max": 50,
"alpha_frac": 0.5936285936,
"autogenerated": false,
"ratio": 4.484320557491289,
"config_test": fals... |
__author__ = 'jstevenson' #jstevenson says "I'm gonna save so much time, no matter how long it takes!" as he spends hours writing this module
from datetime import date
import re
class Stubs:
# Create or overwrite stub files, adding file headers
def __init__( self, stubbedModuleName, cppDir, hDir ):
# O... | {
"repo_name": "denniswjackson/embedded-tools",
"path": "apollo/bin/stubFactory/genStubs.py",
"copies": "1",
"size": "10710",
"license": "mit",
"hash": -2685926372815880000,
"line_mean": 44.5744680851,
"line_max": 154,
"alpha_frac": 0.527264239,
"autogenerated": false,
"ratio": 3.2405446293494706,... |
__author__ = 'jsubirat'
__date__ ="$Mar 25, 2014 11:34:42 AM$"
import subprocess
import re
import gmetric
import threading
from logging import handlers
from time import sleep
import logging
from wattsUpProcess import WUProcessWrapper
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# create a file ... | {
"repo_name": "bsc-renewit/d2.2",
"path": "monitoringFramework/wattsUp.py",
"copies": "1",
"size": "5549",
"license": "apache-2.0",
"hash": -1081933833895058000,
"line_mean": 38.6357142857,
"line_max": 206,
"alpha_frac": 0.6329068301,
"autogenerated": false,
"ratio": 3.3367408298256165,
"config... |
__author__ = 'jsubirat'
__date__ ="$May 22, 2014 17:37:42 AM$"
import subprocess
import threading
import logging
import re
import pexpect
#If the process emits many errors, it's better to restart it, as it tends to work better
MAX_ERRORS = 5
class WUProcessWrapper:
def __init__(self, logger, wattsup_path, wattsu... | {
"repo_name": "bsc-renewit/d2.2",
"path": "monitoringFramework/wattsUpProcess.py",
"copies": "1",
"size": "1643",
"license": "apache-2.0",
"hash": 6065872143366138000,
"line_mean": 32.5510204082,
"line_max": 118,
"alpha_frac": 0.5636031649,
"autogenerated": false,
"ratio": 3.8209302325581396,
"... |
__author__ = 'jsun'
# coding: utf-8
from flask import Blueprint, render_template, Response, request
from utils.basic_auth import requires_auth
import json
from bs4 import BeautifulSoup
bp_wechat_formatter = Blueprint('bp_wechat_formatter', __name__, template_folder = 'templates')
# load formats
from wechat_formatte... | {
"repo_name": "STEMgirlsChina/flask-tools",
"path": "wechat_formatter/formatter.py",
"copies": "1",
"size": "4823",
"license": "apache-2.0",
"hash": 6791263686265312000,
"line_mean": 35.2706766917,
"line_max": 163,
"alpha_frac": 0.5121293801,
"autogenerated": false,
"ratio": 3.905263157894737,
... |
from geodetics import arc_length_to_latitude
import numpy as np
from sklearn.cluster import DBSCAN
def findstacks(input_scenes, min_depth=2, max_sep_km=2, method="centers"):
"""
Takes in a list of dictionaries that correspond to scenes. Returns stacks
of scenes, which are (likely) smaller lists of dictio... | {
"repo_name": "planetlabs/planet_stack_finder",
"path": "stackfinder/__init__.py",
"copies": "1",
"size": "2835",
"license": "apache-2.0",
"hash": -5604721794050390000,
"line_mean": 36.3026315789,
"line_max": 77,
"alpha_frac": 0.6275132275,
"autogenerated": false,
"ratio": 3.67704280155642,
"co... |
__author__ = 'jtromo'
#Developed at : SEFCOM Labs by James Romo
from bluetooth import *
from Crypto.Cipher import AES
import threading
import time
import base64
import os
import uuid
# /////////////////////////////////////////////////////////////////////////////
# Configuration
# ////////... | {
"repo_name": "jtromo/ASU-Thesis-RaspberryPiSmartKey",
"path": "RaspberryPiSmartKey/.sync/Archive/RaspberryPiService/SmartKeyService.8.py",
"copies": "1",
"size": "8829",
"license": "apache-2.0",
"hash": 2187442319096903700,
"line_mean": 36.4110169492,
"line_max": 100,
"alpha_frac": 0.5535168196,
"... |
__author__ = 'jtromo'
#Developed at : SEFCOM Labs by James Romo
from bluetooth import *
import threading
import time
from Crypto.Cipher import AES
import base64
import os
import uuid
# /////////////////////////////////////////////////////////////////////////////
# Configuration
# ///////... | {
"repo_name": "jtromo/ASU-Thesis-RaspberryPiSmartKey",
"path": "RaspberryPiSmartKey/.sync/Archive/SmartKeyService_backup.py",
"copies": "1",
"size": "8746",
"license": "apache-2.0",
"hash": -7141333301000207000,
"line_mean": 36.0593220339,
"line_max": 100,
"alpha_frac": 0.5587697233,
"autogenerated... |
__author__ = 'jtromo'
#Developed at : SEFCOM Labs by James Romo
#With assistance from : JJ SEO and Clinton Dsouza
from bluetooth import *
import threading
import time
from Crypto.Cipher import AES
import base64
import os
from math import *
# the block size for the cipher object; must be 16, 24, or 32 for AES
BLOCK_SI... | {
"repo_name": "jtromo/ASU-Thesis-RaspberryPiSmartKey",
"path": "RaspberryPiSmartKey/.sync/Archive/SmartKeyService2.18.py",
"copies": "1",
"size": "3877",
"license": "apache-2.0",
"hash": 6929271234921111000,
"line_mean": 28.3712121212,
"line_max": 92,
"alpha_frac": 0.6535981429,
"autogenerated": fa... |
#Copyright (c) 2013, Intel Corporation
#
#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 to in writin... | {
"repo_name": "abad623/verbalucce",
"path": "verbalucce/Verbalucce/cloudsql_relational_db.py",
"copies": "1",
"size": "15252",
"license": "apache-2.0",
"hash": 973454657787545500,
"line_mean": 31.9416846652,
"line_max": 139,
"alpha_frac": 0.5697613428,
"autogenerated": false,
"ratio": 3.668109668... |
__author__ = 'jtsreinaldo'
from radio_constants import *
from validation_constants import *
class RXConfigRadioGenerator(object):
"""
A class for the reception configuration of a radio.
"""
def __init__(self):
"""
CTOR
"""
pass
@staticmethod
def rx_generator(r... | {
"repo_name": "ComputerNetworks-UFRGS/OpERA",
"path": "python/experiment_design/reception_config.py",
"copies": "1",
"size": "3486",
"license": "apache-2.0",
"hash": 4771149055034259000,
"line_mean": 29.5789473684,
"line_max": 115,
"alpha_frac": 0.5372920252,
"autogenerated": false,
"ratio": 3.96... |
__author__ = 'jtsreinaldo'
from radio_constants import *
from validation_constants import *
class SSConfigRadioGenerator(object):
"""
A class for the reception configuration of a radio.
"""
def __init__(self):
"""
CTOR
"""
pass
@staticmethod
def ss_generator(r... | {
"repo_name": "ComputerNetworks-UFRGS/OpERA",
"path": "python/experiment_design/ss_config.py",
"copies": "1",
"size": "1867",
"license": "apache-2.0",
"hash": -4598343508836863500,
"line_mean": 28.171875,
"line_max": 115,
"alpha_frac": 0.5881092662,
"autogenerated": false,
"ratio": 3.734,
"conf... |
__author__ = 'jtsreinaldo'
from radio_constants import *
from validation_constants import *
class TXConfigRadioGenerator(object):
"""
A class for the reception configuration of a radio.
"""
def __init__(self):
"""
CTOR
"""
pass
@staticmethod
def tx_generator(... | {
"repo_name": "ComputerNetworks-UFRGS/OpERA",
"path": "python/experiment_design/transmission_config.py",
"copies": "1",
"size": "3622",
"license": "apache-2.0",
"hash": 7092481523944528000,
"line_mean": 29.4453781513,
"line_max": 115,
"alpha_frac": 0.5303699613,
"autogenerated": false,
"ratio": 3... |
__author__ = 'jtsreinaldo'
"""
Copyright 2013 OpERA
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 a... | {
"repo_name": "ComputerNetworks-UFRGS/OpERA",
"path": "python/decision/graph.py",
"copies": "1",
"size": "4543",
"license": "apache-2.0",
"hash": 367990521125107460,
"line_mean": 25.1149425287,
"line_max": 108,
"alpha_frac": 0.5414924059,
"autogenerated": false,
"ratio": 3.974628171478565,
"con... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
adjustingPercent = 0.1
scoreDiscount = 0.05
class SingleObjectLocalizer():
# Actions
ACCEPT = 0
REJECT = 1
EXPAND_TOP = 2
EXPAND_BOTTOM = 3
EXPAND_LEFT = 4
EXPAND_RIGHT = 5
REDUCE_TOP = 6
REDUCE_BOTTOM = 7
REDUC... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/regionagents/SingleObjectLocalizer.py",
"copies": "1",
"size": "3872",
"license": "mit",
"hash": 6750776156793831000,
"line_mean": 33.5714285714,
"line_max": 141,
"alpha_frac": 0.6503099174,
"autogenerated": false,
"ratio": 3.160816... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
from pybrain.rl.agents.logging import LoggingAgent
import numpy as np
#class ObjectLocalizationAgent(LoggingAgent):
class ObjectLocalizationAgent():
image = None
observation = None
action = None
reward = None
cumReward = 0
memory = []
t = 0
def ... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/regionagents/ObjectLocalizationAgent.py",
"copies": "1",
"size": "1896",
"license": "mit",
"hash": -4611182716156956000,
"line_mean": 28.1692307692,
"line_max": 128,
"alpha_frac": 0.6592827004,
"autogenerated": false,
"ratio": 3.524... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
from pybrain.rl.environments import Task
import BoxSearchState as bss
import utils as cu
import libDetection as det
import numpy as np
import RLConfig as config
MIN_ACCEPTABLE_IOU = config.getf('minAcceptableIoU')
def center(box):
return [ (box[2] + box[0])/2.... | {
"repo_name": "jccaicedo/localization-agent",
"path": "tracking/TrackerTask.py",
"copies": "1",
"size": "5032",
"license": "mit",
"hash": -9048165493946252000,
"line_mean": 32.3245033113,
"line_max": 124,
"alpha_frac": 0.5999602544,
"autogenerated": false,
"ratio": 3.0985221674876846,
"config_t... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
from pybrain.rl.environments import Task
import BoxSearchState as bss
import utils.utils as cu
import utils.libDetection as det
import numpy as np
import learn.rl.RLConfig as config
MIN_ACCEPTABLE_IOU = config.getf('minAcceptableIoU')
DETECTION_REWARD = config.ge... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/boxsearch/BoxSearchTask.py",
"copies": "1",
"size": "6198",
"license": "mit",
"hash": -528893333191531700,
"line_mean": 32.1443850267,
"line_max": 124,
"alpha_frac": 0.5945466279,
"autogenerated": false,
"ratio": 3.1318847902981304,... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
from pybrain.rl.environments import Task
import utils as cu
import libDetection as det
import numpy as np
class RegionFilteringTask(Task):
minAcceptableIoU = 0.5
def __init__(self, environment, groundTruthFile):
Task.__init__(self, environment)
self.... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/regionagents/RegionFilteringTask.py",
"copies": "1",
"size": "2370",
"license": "mit",
"hash": 5265578298043735000,
"line_mean": 27.5542168675,
"line_max": 114,
"alpha_frac": 0.6637130802,
"autogenerated": false,
"ratio": 3.21573948... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
from pybrain.rl.environments import Task
import utils as cu
import libDetection as det
class MDPObjectLocalizerTask(Task):
minAcceptableIoU = 0.7
maxRejectableIoU = 0.2
def __init__(self, environment, groundTruthFile):
Task.__init__(self, environment)
... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/regionagents/MDPObjectLocalizerTask.py",
"copies": "1",
"size": "2176",
"license": "mit",
"hash": -3497725735858959400,
"line_mean": 26.8974358974,
"line_max": 73,
"alpha_frac": 0.6231617647,
"autogenerated": false,
"ratio": 3.08652... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
from pybrain.rl.learners.valuebased.interface import ActionValueInterface
import caffe
import os
import utils as cu
import numpy as np
import random
import RLConfig as config
EXPLORE = 0
EXPLOIT = 1
def defaultSampler():
return np.random.random([1, config.geti(... | {
"repo_name": "jccaicedo/localization-agent",
"path": "tracking/QNetwork.py",
"copies": "1",
"size": "1878",
"license": "mit",
"hash": 3100351282023942000,
"line_mean": 27.4545454545,
"line_max": 141,
"alpha_frac": 0.6831735889,
"autogenerated": false,
"ratio": 3.3898916967509027,
"config_test"... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
from pybrain.rl.learners.valuebased.interface import ActionValueInterface
import caffe
import os
import utils.utils as cu
import numpy as np
import random
import learn.rl.RLConfig as config
EXPLORE = 0
EXPLOIT = 1
def defaultSampler():
return np.random.random([... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/boxsearch/QNetwork.py",
"copies": "1",
"size": "1913",
"license": "mit",
"hash": 341998215220610900,
"line_mean": 27.552238806,
"line_max": 141,
"alpha_frac": 0.682697334,
"autogenerated": false,
"ratio": 3.409982174688057,
"confi... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
from pybrain.utilities import Named
from pybrain.rl.environments.environment import Environment
from PriorMemory import PriorMemory
import BoxSearchState as bs
import ConvNet as cn
import random
import numpy as np
import json
import utils.utils as cu
import utils... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/boxsearch/BoxSearchEnvironment.py",
"copies": "1",
"size": "8285",
"license": "mit",
"hash": -1476373321368866000,
"line_mean": 40.425,
"line_max": 171,
"alpha_frac": 0.6576946288,
"autogenerated": false,
"ratio": 3.4506455643481884... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
from pybrain.utilities import Named
from pybrain.rl.environments.environment import Environment
from RelationsDB import RelationsDB, CompactRelationsDB
import SimplifiedLayoutHandler as lh
import random
import numpy as np
import json
import utils as cu
import lib... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/regionagents/RegionFilteringEnvironment.py",
"copies": "1",
"size": "3378",
"license": "mit",
"hash": -5537989725550019000,
"line_mean": 37.3863636364,
"line_max": 111,
"alpha_frac": 0.6921255181,
"autogenerated": false,
"ratio": 3.... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
from pybrain.utilities import Named
from pybrain.rl.environments.environment import Environment
import BoxSearchState as bs
import ConvNet as cn
import random
import numpy as np
import json
import utils as cu
import libDetection as det
import RLConfig as config
... | {
"repo_name": "jccaicedo/localization-agent",
"path": "tracking/TrackerEnvironment.py",
"copies": "1",
"size": "8849",
"license": "mit",
"hash": -2721912543280553000,
"line_mean": 41.9563106796,
"line_max": 171,
"alpha_frac": 0.6643688552,
"autogenerated": false,
"ratio": 3.462050078247261,
"co... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
import os
import utils as cu
import numpy as np
import caffe
from caffe import wrapperv0
import RLConfig as config
LAYER = config.get('convnetLayer')
class ConvNet():
def __init__(self):
self.net = None
self.image = ''
self.id = 0
self.loadNet... | {
"repo_name": "jccaicedo/localization-agent",
"path": "tracking/ConvNet.py",
"copies": "1",
"size": "1774",
"license": "mit",
"hash": 5948884044022605000,
"line_mean": 31.8518518519,
"line_max": 153,
"alpha_frac": 0.6877113867,
"autogenerated": false,
"ratio": 3.0273037542662116,
"config_test":... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
import PIL.ImageDraw as ImageDraw,PIL.Image as Image, PIL.ImageShow as ImageShow
import os,sys
from multiprocessing import Process, JoinableQueue, Queue
import time
import utils as cu
import libDetection as det
import numpy as np
# LAYOUT CONFIGURATION
SCALES = 1... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/regionagents/GraphBasedLayoutHandler.py",
"copies": "1",
"size": "6105",
"license": "mit",
"hash": -4665630364746739000,
"line_mean": 34.9117647059,
"line_max": 121,
"alpha_frac": 0.6407862408,
"autogenerated": false,
"ratio": 3.005... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
import PIL.ImageDraw as ImageDraw,PIL.Image as Image, PIL.ImageShow as ImageShow
import time
import utils as cu
import libDetection as det
import numpy as np
# LAYOUT CONFIGURATION
SCALES = 10
HORIZONTAL_BINS = 3
VERTICAL_BINS = 3
NUM_ACTIONS = 13
NUM_BOXES = 3
... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/regionagents/LayoutHandler.py",
"copies": "1",
"size": "5204",
"license": "mit",
"hash": -1529035275162939100,
"line_mean": 38.1278195489,
"line_max": 127,
"alpha_frac": 0.6568024596,
"autogenerated": false,
"ratio": 3.0557839107457... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
import RLConfig as config
import numpy as np
import scipy.io
import MemoryUsage
import RLConfig as config
import BoxSearchState as bss
import random
STATE_FEATURES = config.geti('stateFeatures')/config.geti('temporalWindow')
NUM_ACTIONS = config.geti('outputActio... | {
"repo_name": "jccaicedo/localization-agent",
"path": "tracking/TrackerAgent.py",
"copies": "1",
"size": "4294",
"license": "mit",
"hash": 1634869347640734000,
"line_mean": 33.6290322581,
"line_max": 142,
"alpha_frac": 0.6816488123,
"autogenerated": false,
"ratio": 3.440705128205128,
"config_te... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
import RLConfig as config
import numpy as np
import scipy.io
import MemoryUsage
import RLConfig as config
NUM_ACTIONS = config.geti('outputActions')
class RegionFilteringAgent():
image = None
observation = None
action = None
reward = None
timer = 0
... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/regionagents/RegionFilteringAgent.py",
"copies": "1",
"size": "3562",
"license": "mit",
"hash": 6294432357132657000,
"line_mean": 28.9327731092,
"line_max": 142,
"alpha_frac": 0.6493542953,
"autogenerated": false,
"ratio": 3.3891531... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
import RLConfig as config
import numpy as np
import scipy.io
import MemoryUsage
import SimplifiedLayoutHandler as lh
THRESHOLD = -0.5
def getCategories():
categories = 'aeroplane bicycle bird boat bottle bus car cat chair cow diningtable dog horse motorbike pe... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/regionagents/RegionFilteringGreedyAgent.py",
"copies": "1",
"size": "4280",
"license": "mit",
"hash": -6039923966090372000,
"line_mean": 32.4375,
"line_max": 159,
"alpha_frac": 0.6401869159,
"autogenerated": false,
"ratio": 3.491027... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
import time
import utils as cu
import libDetection as det
import numpy as np
import Image
import random
import BoxSearchTask as bst
import RLConfig as config
# ACTIONS
X_COORD_UP = 0
Y_COORD_UP = 1
SCALE_UP = 2
ASPECT_RATIO_UP = 3
X_CO... | {
"repo_name": "jccaicedo/localization-agent",
"path": "tracking/TrackerState.py",
"copies": "1",
"size": "10113",
"license": "mit",
"hash": -9101855956660763000,
"line_mean": 31.7281553398,
"line_max": 136,
"alpha_frac": 0.6209828933,
"autogenerated": false,
"ratio": 3.08793893129771,
"config_t... |
__author__ = "Juan C. Caicedo, caicedo@illinois.edu"
import time
import utils.utils as cu
import utils.libDetection as det
import numpy as np
import Image
import random
import BoxSearchTask as bst
import learn.rl.RLConfig as config
# ACTIONS
X_COORD_UP = 0
Y_COORD_UP = 1
SCALE_UP = 2
ASPECT... | {
"repo_name": "jccaicedo/localization-agent",
"path": "detection/boxsearch/BoxSearchStateExtra.py",
"copies": "1",
"size": "10941",
"license": "mit",
"hash": -7351290583298847000,
"line_mean": 31.8558558559,
"line_max": 90,
"alpha_frac": 0.6180422265,
"autogenerated": false,
"ratio": 3.0880609652... |
__author__ = 'Juan Manuel Bermúdez Cabrera'
try:
from builtins import callable
except ImportError:
# callable builtin not present, replace with __call__ attribute check
def callable(obj):
return hasattr(obj, '__call__')
try:
from enum import Enum
except ImportError:
# enum module not prese... | {
"repo_name": "jbermudezcabrera/campos",
"path": "campos/utils.py",
"copies": "1",
"size": "1789",
"license": "mit",
"hash": -3532888207929654300,
"line_mean": 26.9375,
"line_max": 78,
"alpha_frac": 0.5604026846,
"autogenerated": false,
"ratio": 4.925619834710743,
"config_test": false,
"has_n... |
__author__ = 'juan'
# -*- coding: utf-8 -*-
import json
from termcolor import colored
import mysql.connector
import time
config = {
'user': 'elec',
'password': 'elec',
'host': 'thor.deusto.es',
'database': 'eu_test2',
}
class database:
def __init__(self):
self.con = mysql.connector.connec... | {
"repo_name": "aitoralmeida/eu-elections",
"path": "analyzer/mem_database.py",
"copies": "1",
"size": "24954",
"license": "apache-2.0",
"hash": 8850630786868381000,
"line_mean": 46.0849056604,
"line_max": 245,
"alpha_frac": 0.4970345436,
"autogenerated": false,
"ratio": 3.9359621451104103,
"con... |
__author__ = 'juan'
import mem_database
import glob
import os.path, time
files = glob.glob("../wrapper/*.txt")
readed_files = []
current_file = ''
starting_point = time.time()
while True:
with open('read_files.log', 'r') as logfile:
for line in logfile:
readed_files.append(line.replace('\n',... | {
"repo_name": "aitoralmeida/eu-elections",
"path": "analyzer/analyzer_cron.py",
"copies": "1",
"size": "1149",
"license": "apache-2.0",
"hash": -7148468016068667000,
"line_mean": 23.4468085106,
"line_max": 65,
"alpha_frac": 0.5161009574,
"autogenerated": false,
"ratio": 3.8817567567567566,
"con... |
__author__ = 'juan'
import numpy as np
from Vertex import Vertex, FineVertex
from Edge import Edge
from Quad import Quad
def quad_vert_generator(_verts, _quads, _fine_verts, _parameters, refinement_level ):
assert type(_verts) is np.ndarray
assert type(_quads) is np.ndarray
assert type(_fine_verts) is np.... | {
"repo_name": "BGCECSE2015/CADO",
"path": "PYTHON/NURBSReconstruction/PetersScheme/quadvertGenerator.py",
"copies": "1",
"size": "3245",
"license": "bsd-3-clause",
"hash": 6715554513594189000,
"line_mean": 30.8137254902,
"line_max": 121,
"alpha_frac": 0.5473035439,
"autogenerated": false,
"ratio"... |
__author__ = 'juan'
import json
from termcolor import colored
import mysql.connector
import time
config = {
'user': 'elec',
'password': 'elec',
'host': 'thor.deusto.es',
'database': 'eu_test2',
}
class database:
def __init__(self):
self.con = mysql.connector.connect(**config)
def in... | {
"repo_name": "aitoralmeida/eu-elections",
"path": "analyzer/remote_database.py",
"copies": "1",
"size": "9695",
"license": "apache-2.0",
"hash": 7749390892002365000,
"line_mean": 49.7591623037,
"line_max": 230,
"alpha_frac": 0.5056214544,
"autogenerated": false,
"ratio": 3.8456961523205075,
"c... |
__author__ = 'juan'
import sqlite3 as lite
import json
from termcolor import colored
import mysql.connector
config = {
'user': 'elec',
'password': 'elec',
'host': 'thor.deusto.es',
'database': 'eu_test2',
}
class database:
def __init__(self, db):
self.db = db
self.groups = []
... | {
"repo_name": "aitoralmeida/eu-elections",
"path": "analyzer/database.py",
"copies": "1",
"size": "15671",
"license": "apache-2.0",
"hash": -6650368835926537000,
"line_mean": 48.9076433121,
"line_max": 276,
"alpha_frac": 0.5098589752,
"autogenerated": false,
"ratio": 4.008953696597596,
"config_... |
from subprocess import check_output
import hashlib, os, random, string, winreg, binascii
def main():
query_file_locations()
with open("srp_blacklist.txt") as f_in:
lines = list(line for line in (l.strip() for l in f_in) if line) # only read non-blank lines
for line in lines:
try:... | {
"repo_name": "ucatech/SRP_Automater",
"path": "SRP_Automater.py",
"copies": "1",
"size": "2815",
"license": "mit",
"hash": -8007870955652966000,
"line_mean": 33.7530864198,
"line_max": 101,
"alpha_frac": 0.6088809947,
"autogenerated": false,
"ratio": 3.540880503144654,
"config_test": false,
... |
__author__ = 'Jubin & Raghava'
import os
import zipfile
import shutil
def zipFun(src, dst):
if not os.path.exists(os.getcwd() + "/output"):
os.makedirs(os.getcwd() + "/output")
zf = zipfile.ZipFile("temp.zip", "w")
for fil in src:
zf.write(fil, os.path.basename(fil))
zf.close()
wit... | {
"repo_name": "jubinmathew1995/FileHide",
"path": "zipper.py",
"copies": "1",
"size": "1511",
"license": "mit",
"hash": -4839272949501375000,
"line_mean": 29.22,
"line_max": 62,
"alpha_frac": 0.5645268034,
"autogenerated": false,
"ratio": 3.0280561122244487,
"config_test": false,
"has_no_keyw... |
__author__ = 'Jubin & Raghava'
import Tkinter as tk
import os
import tkFileDialog as fd
import zipper
import tkMessageBox
import ttk
Top = tk.Tk()
Top.title("FileHide")
logo = tk.PhotoImage(file="ic_launcher.gif")
Top.tk.call('wm', 'iconphoto', Top._w, logo)
src = tk.StringVar()
dst = tk.StringVar()
workVar=tk.StringV... | {
"repo_name": "jubinmathew1995/FileHide",
"path": "main.py",
"copies": "1",
"size": "5355",
"license": "mit",
"hash": -6645602672979574000,
"line_mean": 32.46875,
"line_max": 111,
"alpha_frac": 0.6707749767,
"autogenerated": false,
"ratio": 3.0775862068965516,
"config_test": false,
"has_no_ke... |
__author__ = 'judywawira'
from django import forms
from OMRS.models import Jobs,UserFeed,JobErrors
class Test2Form(forms.Form):
#Load form fields
serverAddress = forms.URLField(label="You are currently connected to")
location = forms.ChoiceField(label="Select location")
encounterType = forms.ChoiceFie... | {
"repo_name": "omiltoro/testkenyacap",
"path": "working/forms.py",
"copies": "1",
"size": "1035",
"license": "apache-2.0",
"hash": 5560426690666054000,
"line_mean": 28.5714285714,
"line_max": 82,
"alpha_frac": 0.690821256,
"autogenerated": false,
"ratio": 4.0588235294117645,
"config_test": fals... |
__author__ = 'judyw'
from django import forms
from django.forms.extras.widgets import SelectDateWidget
from django.forms import ModelForm
from django.contrib.auth.models import User
from OMRS.models import UserProfile,Server
from OMRS import omrsfunctions
class LoadServerForm(forms.Form):
"""
Class to load u... | {
"repo_name": "omiltoro/testkenyacap",
"path": "OMRS/forms.py",
"copies": "1",
"size": "3272",
"license": "apache-2.0",
"hash": 8298760075324653000,
"line_mean": 33.4421052632,
"line_max": 144,
"alpha_frac": 0.6775672372,
"autogenerated": false,
"ratio": 4.333774834437086,
"config_test": false,... |
__author__ = 'judyw'
from django import forms
from django.forms import ModelForm
from OMRS.models import UserProfile,Server
from django.contrib.auth.models import User
class serverParams(forms.Form):
#need to specify the server details
class Meta:
model = Server
fields = ('serverAddress','ser... | {
"repo_name": "omiltoro/softbrew",
"path": "OMRS/forms.py",
"copies": "1",
"size": "1157",
"license": "apache-2.0",
"hash": 743722027517745200,
"line_mean": 26.5714285714,
"line_max": 79,
"alpha_frac": 0.6611927398,
"autogenerated": false,
"ratio": 4.285185185185185,
"config_test": false,
"ha... |
__author__ = 'judyw'
import requests,json,re
from requests.auth import HTTPBasicAuth
#import functions existing in other apps
from OMRS.models import Server
import django.views
#variables
url = str('http://localhost:8081/openmrs-standalone/ws/rest/v1/')
url2 = str('http://162.222.179.9:8080/kenyacaptricity/ws/rest/v... | {
"repo_name": "omiltoro/testkenyacap",
"path": "OMRS/omrsfunctions.py",
"copies": "1",
"size": "1250",
"license": "apache-2.0",
"hash": -1404853803723356700,
"line_mean": 24.5102040816,
"line_max": 93,
"alpha_frac": 0.7,
"autogenerated": false,
"ratio": 3.5112359550561796,
"config_test": false,... |
__author__ = 'judyw'
import requests,json,re
from requests.auth import HTTPBasicAuth
#variables
url = str('http://localhost:8081/openmrs-standalone/ws/rest/v1/')
url2 = str('http://162.222.179.9:8080/kenyacaptricity/ws/rest/v1/')
headers = {'content-type': 'application/json'}
username = 'admin'
pw = 'test'
def searc... | {
"repo_name": "omiltoro/softbrew",
"path": "OMRS/omrsfunctions.py",
"copies": "1",
"size": "1083",
"license": "apache-2.0",
"hash": 2952536173584672000,
"line_mean": 28.2972972973,
"line_max": 93,
"alpha_frac": 0.7045244691,
"autogenerated": false,
"ratio": 3.4935483870967743,
"config_test": fa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.