text
stringlengths
0
1.05M
meta
dict
__author__ = 'admin' class Contact: def __init__(self, firstname=None, middlename=None, lastname=None, nickname=None, title=None, company=None, address=None, phone_home=None, ...
{ "repo_name": "dimchenkoAlexey/python_training", "path": "model/contact.py", "copies": "1", "size": "1888", "license": "apache-2.0", "hash": -62076236253906664, "line_mean": 33.3272727273, "line_max": 70, "alpha_frac": 0.5296610169, "autogenerated": false, "ratio": 4.1677704194260485, "config_t...
__author__ = 'admin' class GroupHelper: def __init__(self, app): self.app = app def open_groups_page(self): wd = self.app.wd if not (wd.current_url.endswith("groups.php") and len(wd.find_elements_by_name("new")) > 0 ): # open groups page wd.find_element_by_link...
{ "repo_name": "dimchenkoAlexey/python_training", "path": "fixture/group.py", "copies": "1", "size": "2151", "license": "apache-2.0", "hash": 4080216671805314000, "line_mean": 31.1044776119, "line_max": 101, "alpha_frac": 0.5788005579, "autogenerated": false, "ratio": 3.5262295081967214, "config...
__author__ = 'admin' from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS from ResumeViewer.models import Job from tastypie.authentication import SessionAuthentication from tastypie.authorization import Authorization from django.contrib.auth.models import User from tastypie import fields from Re...
{ "repo_name": "fawazn/Resume-Viewer", "path": "ResumeViewer/api.py", "copies": "1", "size": "1230", "license": "mit", "hash": 4851212037286071000, "line_mean": 35.2727272727, "line_max": 84, "alpha_frac": 0.6723577236, "autogenerated": false, "ratio": 4.315789473684211, "config_test": false, ...
__author__ = 'admiral0' import os.path as path from os import walk from .Common import read_json, mod_file_name import re from .Exceptions import JsonNotValid, RepositoryDirectoryDoesNotExist, RepositoryDoesNotHaveMetaJson, ModDoesNotExistInRepo from .Mod import Mod class ModRepository: _metaname = 'meta.json' ...
{ "repo_name": "admiral0/AntaniRepos", "path": "antanirepos/ModRepository.py", "copies": "1", "size": "2121", "license": "bsd-2-clause", "hash": -7735896267788268000, "line_mean": 34.35, "line_max": 123, "alpha_frac": 0.5799151344, "autogenerated": false, "ratio": 4.00945179584121, "config_test"...
__author__ = 'admiral0' import os.path as path import re from .Exceptions import JsonNotValid, ModDoesNotExist, ModJsonDoesNotExist, ModVersionDoesNotExistInRepo from .Common import * def validate_version(ver): assert type(ver) is str if not re.match(r'^[a-zA-Z_0-9\.\-()]+$', ver): return ['Version ' ...
{ "repo_name": "admiral0/AntaniRepos", "path": "antanirepos/Mod.py", "copies": "1", "size": "3351", "license": "bsd-2-clause", "hash": -4919725087683980000, "line_mean": 32.8484848485, "line_max": 117, "alpha_frac": 0.5455088033, "autogenerated": false, "ratio": 3.6864686468646863, "config_test"...
__author__ = 'admiral0' from .Exceptions import JsonNotValid as JsonError import json mod_file_name = 'mod.json' minecraft_version_regex = r'^\d+\.\d+(\.\d+)?$' url_regex = r'^https?:.*$' def validate(entities, json, obj): assert type(entities) is dict assert type(json) is dict errors = [] for key ...
{ "repo_name": "admiral0/AntaniRepos", "path": "antanirepos/Common.py", "copies": "1", "size": "1115", "license": "bsd-2-clause", "hash": 8982802856973529000, "line_mean": 28.3684210526, "line_max": 101, "alpha_frac": 0.5264573991, "autogenerated": false, "ratio": 3.8054607508532423, "config_tes...
__author__ = 'admiral0' from . import * from .Exceptions import JsonNotValid import argparse import os.path as path def is_mod_repo(x): if path.isdir(x): return x raise argparse.ArgumentTypeError(x + ' is not a Directory') def validate(args): try: repo = ModRepository(args.mod_repo) ...
{ "repo_name": "admiral0/AntaniRepos", "path": "antanirepos/Util.py", "copies": "1", "size": "1509", "license": "bsd-2-clause", "hash": -669733687798787700, "line_mean": 24.593220339, "line_max": 108, "alpha_frac": 0.6037110669, "autogenerated": false, "ratio": 3.5011600928074245, "config_test":...
__author__ = 'admiral0' from os import path import re from .Exceptions import RepositoryDirectoryDoesNotExist from .Exceptions import JsonNotValid from .Exceptions import RepositoryDoesNotHaveMetaJson from .Exceptions import ModDoesNotExistInRepo, ModVersionDoesNotExistInRepo from .Exceptions import BranchDoesNotExist...
{ "repo_name": "admiral0/AntaniRepos", "path": "antanirepos/PackRepository.py", "copies": "1", "size": "3328", "license": "bsd-2-clause", "hash": -3360804042245640700, "line_mean": 33.6666666667, "line_max": 118, "alpha_frac": 0.5522836538, "autogenerated": false, "ratio": 3.9199057714958774, "c...
__author__ = 'admiral0' class RepositoryDirectoryDoesNotExist(Exception): def __init__(self, path): self.path = path def __str__(self): return 'The mod repository does not exist. Missing directory:' + self.path class RepositoryDoesNotHaveMetaJson(Exception): def __init__(self, path): ...
{ "repo_name": "admiral0/AntaniRepos", "path": "antanirepos/Exceptions.py", "copies": "1", "size": "2222", "license": "bsd-2-clause", "hash": 168683478481213950, "line_mean": 23.4285714286, "line_max": 104, "alpha_frac": 0.5814581458, "autogenerated": false, "ratio": 3.8442906574394464, "config_...
__author__ = 'Adnan Siddiqi<kadnanATgmail.com>' import os import json def get_json(jsondata): json_object = None try: json_object = json.loads(jsondata) except ValueError, e: return None return json_object def generate_manifest_text(json_dict): content = '' content = '{\n' ...
{ "repo_name": "kadnan/extGen", "path": "extgen.py", "copies": "1", "size": "3399", "license": "mit", "hash": 8086151418734336000, "line_mean": 32.6534653465, "line_max": 142, "alpha_frac": 0.496616652, "autogenerated": false, "ratio": 4.175675675675675, "config_test": false, "has_no_keywords"...
__author__ = 'ad' from abc import ABCMeta from collections import OrderedDict import importhelpers class BaseField(object): __metaclass__ = ABCMeta def __init__(self, required=False, field_name=None): super(BaseField, self).__init__() self.required = required self.field_name = field...
{ "repo_name": "mpetyx/pyapi", "path": "pyapi/libraries/pyraml_parser_master/pyraml/fields.py", "copies": "1", "size": "15212", "license": "mit", "hash": 4171094303208123400, "line_mean": 26.3615107914, "line_max": 121, "alpha_frac": 0.5474625296, "autogenerated": false, "ratio": 4.482027106658809...
__author__ = 'ad' from collections import OrderedDict from pyapi.libraries.pyraml_parser_master.pyraml.model import Model from pyapi.libraries.pyraml_parser_master.pyraml.fields import List, String, Reference, Map, Or, Float def test_model_structure_inheritance(): class Thing(Model): inner = List(String...
{ "repo_name": "mpetyx/pyapi", "path": "tests/unit/raml/tests/test_model.py", "copies": "1", "size": "2243", "license": "mit", "hash": -1278097456890495000, "line_mean": 25.4, "line_max": 102, "alpha_frac": 0.6495764601, "autogenerated": false, "ratio": 3.5101721439749607, "config_test": true, ...
__author__ = 'ad' from fields import BaseField, String, List class ValidationError(StandardError): def __init__(self, validation_errors): self.errors = validation_errors def __repr__(self): return u"ValidationError: " + repr(self.errors) class BaseModel(object): pass class Schema(typ...
{ "repo_name": "mpetyx/pyapi", "path": "pyapi/libraries/pyraml_parser_master/pyraml/model.py", "copies": "1", "size": "4247", "license": "mit", "hash": -5772385761777201000, "line_mean": 32.7063492063, "line_max": 101, "alpha_frac": 0.5669884624, "autogenerated": false, "ratio": 4.255511022044089,...
__author__ = 'ad' from model import Model from fields import String, Reference, Map, List, Bool, Int, Float, Or class RamlDocumentation(Model): content = String() title = String() class RamlSchema(Model): name = String() type = String() schema = String() example = String() class RamlQuery...
{ "repo_name": "mpetyx/pyapi", "path": "pyapi/libraries/pyraml_parser_master/pyraml/entities.py", "copies": "1", "size": "3805", "license": "mit", "hash": -8072963671755983000, "line_mean": 25.4305555556, "line_max": 106, "alpha_frac": 0.5802890933, "autogenerated": false, "ratio": 4.2466517857142...
__author__ = 'ad' import contextlib import urllib2 import mimetypes import os.path import urlparse from collections import OrderedDict import yaml from raml_elements import ParserRamlInclude from fields import String, Reference from entities import RamlRoot, RamlResource, RamlMethod, RamlBody, RamlResourceType, Raml...
{ "repo_name": "mpetyx/pyapi", "path": "pyapi/libraries/pyraml_parser_master/pyraml/parser.py", "copies": "1", "size": "17263", "license": "mit", "hash": 3258387050526762000, "line_mean": 31.5103578154, "line_max": 120, "alpha_frac": 0.6459479812, "autogenerated": false, "ratio": 3.903007008817544...
__author__ = 'ad' import os.path from collections import OrderedDict from pyapi.libraries.pyraml_parser_master import pyraml from pyapi.libraries.pyraml_parser_master.pyraml import parser from pyapi.libraries.pyraml_parser_master.pyraml.entities import RamlResource, RamlMethod, RamlQueryParameter fixtures_dir = os....
{ "repo_name": "mpetyx/pyapi", "path": "tests/unit/raml/tests/test_resources.py", "copies": "1", "size": "5323", "license": "mit", "hash": 5145549093047658000, "line_mean": 46.954954955, "line_max": 109, "alpha_frac": 0.7422506106, "autogenerated": false, "ratio": 3.8544532947139754, "config_tes...
__author__ = 'ad' import os.path from pyapi.libraries.pyraml_parser_master import pyraml from pyapi.libraries.pyraml_parser_master.pyraml import parser from pyapi.libraries.pyraml_parser_master.pyraml.entities import RamlRoot, RamlDocumentation fixtures_dir = os.path.join(os.path.dirname(__file__), '../', 'samples'...
{ "repo_name": "mpetyx/pyapi", "path": "tests/unit/raml/tests/test_documentation.py", "copies": "1", "size": "1551", "license": "mit", "hash": 5138264116498412000, "line_mean": 39.8157894737, "line_max": 93, "alpha_frac": 0.7137330754, "autogenerated": false, "ratio": 3.3426724137931036, "config...
__author__ = 'ad' import os.path import pyraml.parser from pyraml.entities import RamlRoot, RamlDocumentation fixtures_dir = os.path.join(os.path.dirname(__file__), '..', 'samples') def test_include_raml(): p = pyraml.parser.load(os.path.join(fixtures_dir, 'root-elements-includes.yaml')) assert isinstance...
{ "repo_name": "mpetyx/pyapi", "path": "pyapi/libraries/pyraml_parser_master/tests/test_documentation.py", "copies": "1", "size": "1400", "license": "mit", "hash": 3066141277163579000, "line_mean": 36.8378378378, "line_max": 86, "alpha_frac": 0.7021428571, "autogenerated": false, "ratio": 3.341288...
__author__ = 'ad' import os.path import pyraml.parser from pyraml.entities import RamlRoot, RamlTrait, RamlBody, RamlResourceType fixtures_dir = os.path.join(os.path.dirname(__file__), '..', 'samples') def test_parse_traits_with_schema(): p = pyraml.parser.load(os.path.join(fixtures_dir, 'media-type.yaml')) ...
{ "repo_name": "mpetyx/pyapi", "path": "pyapi/libraries/pyraml_parser_master/tests/test_traits.py", "copies": "1", "size": "2161", "license": "mit", "hash": -8278884886732771000, "line_mean": 39.037037037, "line_max": 105, "alpha_frac": 0.6968995835, "autogenerated": false, "ratio": 3.309341500765...
import os.path as op import numpy as np import pytest from numpy.testing import assert_allclose from mne.chpi import read_head_pos from mne.datasets import testing from mne.io import read_raw_fif from mne.preprocessing import (annotate_movement, compute_average_dev_head_t, annotate_musc...
{ "repo_name": "bloyl/mne-python", "path": "mne/preprocessing/tests/test_artifact_detection.py", "copies": "3", "size": "7531", "license": "bsd-3-clause", "hash": 1854888127119699500, "line_mean": 34.0279069767, "line_max": 79, "alpha_frac": 0.6154561147, "autogenerated": false, "ratio": 3.4403837...
__author__ = "Adrian 'LucidCharts' Campos, Johnson Nguyen, Josh Hicken" from string import punctuation as punc_chars # this is a string of punctuation chars from python standard lib from collections import OrderedDict # noinspection SpellCheckingInspection ALPHABET = 'abcdefghijklmnopqrstuvwxyz' def get_frequency_di...
{ "repo_name": "adriancampos/LetsPlotMoby", "path": "dist_calculators.py", "copies": "1", "size": "3086", "license": "mit", "hash": 2544198012438133000, "line_mean": 40.1466666667, "line_max": 112, "alpha_frac": 0.6824368114, "autogenerated": false, "ratio": 4.136729222520107, "config_test": fal...
__author__ = 'adrianmo' import string import re import codecs,sys, unicodedata import pprint import MySQLdb import os xuser = "root" xpasswd = "cRe33Eth" xhost = '127.0.0.1' xport = 3334 class MMICProgram(): def openFile(self, fileName): with codecs.open (fileName, "r", "utf-8") as line: ...
{ "repo_name": "maplechori/pyblasv3", "path": "MMICProgram.py", "copies": "1", "size": "1173", "license": "mit", "hash": 5552391818719018000, "line_mean": 16.5074626866, "line_max": 99, "alpha_frac": 0.5549872123, "autogenerated": false, "ratio": 3.3901734104046244, "config_test": false, "has_...
__author__ = 'adrian' from PyQt4 import QtGui from parking_app.UI.PlatformUI import PlatformUI import parking_app.Common as Common class CylinderUI(QtGui.QWidget): def __init__(self, cylinder): super(CylinderUI, self).__init__() self.cylinder = cylinder self.init_ui() def init_ui(se...
{ "repo_name": "Nebla/cylindricalParkingPrototype", "path": "parking_app/UI/CylinderUI.py", "copies": "1", "size": "1177", "license": "mit", "hash": 4083419530887316500, "line_mean": 30, "line_max": 87, "alpha_frac": 0.5972812234, "autogenerated": false, "ratio": 3.7129337539432177, "config_test...
__author__ = 'adrian' from PyQt4 import QtGui from PyQt4 import QtCore import parking_app.Common as Common import random class WithdrawFormUI(QtGui.QWidget): # level, column, vehicle id, vehicle weight update = QtCore.pyqtSignal(int, str, int) def __init__(self, parking_slot, parent=None): supe...
{ "repo_name": "Nebla/cylindricalParkingPrototype", "path": "parking_app/UI/WithdrawFormUI.py", "copies": "1", "size": "1733", "license": "mit", "hash": -7218549468163006000, "line_mean": 27.4098360656, "line_max": 65, "alpha_frac": 0.64050779, "autogenerated": false, "ratio": 3.617954070981211, ...
__author__ = 'adrian' from PyQt4 import QtGui from PyQt4 import QtCore from parking_app.UI.WarningConfirmationUI import WarningConfirmationUI import parking_app.Common as Common import random class PlatformUI(QtGui.QWidget): def __init__(self): super(PlatformUI, self).__init__() self.initUI() ...
{ "repo_name": "Nebla/cylindricalParkingPrototype", "path": "parking_app/UI/PlatformUI.py", "copies": "1", "size": "4814", "license": "mit", "hash": 31891601509830390, "line_mean": 31.7551020408, "line_max": 109, "alpha_frac": 0.6186123806, "autogenerated": false, "ratio": 3.910641754670999, "co...
__author__ = 'adrian' from PyQt4 import QtGui from PyQt4 import QtCore import random class WarningConfirmationUI(QtGui.QWidget): stopAlarm = QtCore.pyqtSignal() def __init__(self,parent=None): super(WarningConfirmationUI, self).__init__(parent) self.initUI() def initUI(self): ...
{ "repo_name": "Nebla/cylindricalParkingPrototype", "path": "parking_app/UI/WarningConfirmationUI.py", "copies": "1", "size": "1515", "license": "mit", "hash": 763752386227031800, "line_mean": 25.1206896552, "line_max": 85, "alpha_frac": 0.6501650165, "autogenerated": false, "ratio": 3.97637795275...
__author__ = 'adrian' from PyQt4 import QtGui import parking_app.Common as Common from multiprocessing import Queue class CarFormUI(QtGui.QWidget): def __init__(self, input_queue): super(CarFormUI, self).__init__() self.__input_queue = input_queue self.initUI() def initUI(self): ...
{ "repo_name": "Nebla/cylindricalParkingPrototype", "path": "parking_app/UI/CarFormUI.py", "copies": "1", "size": "3836", "license": "mit", "hash": -8870239060691166000, "line_mean": 31.7863247863, "line_max": 78, "alpha_frac": 0.6470281543, "autogenerated": false, "ratio": 3.7644749754661433, "...
__author__ = 'adrian' import sys from PyQt4 import QtGui from PyQt4 import QtCore import time from parking_app.UI.CylinderUI import CylinderUI from parking_app.UI.CarFormUI import CarFormUI from parking_app.UI.ParkingSlotsUI import ParkingSlotsUI from parking_app.UI.WithdrawFormUI import WithdrawFormUI import park...
{ "repo_name": "Nebla/cylindricalParkingPrototype", "path": "parking_app/application.py", "copies": "1", "size": "9061", "license": "mit", "hash": 5700877106391525000, "line_mean": 36.601659751, "line_max": 125, "alpha_frac": 0.6618474782, "autogenerated": false, "ratio": 3.514740108611327, "con...
__author__ = 'adria' #!/usr/bin/python from dataBase import * import sys sys.path.insert(0, '../model') #sino no deixa importar... from owner import * class UserLogin: def __init__(self, owner): self.owner = owner self.db = DataBase() self.registered = False #si l'usuari ja ha fet loguin ...
{ "repo_name": "aramusss/contableplus", "path": "controller/userLogin.py", "copies": "1", "size": "4041", "license": "apache-2.0", "hash": 7223837244720342000, "line_mean": 32.6833333333, "line_max": 98, "alpha_frac": 0.5288294976, "autogenerated": false, "ratio": 4.024900398406374, "config_test...
__author__ = 'adria' #!/usr/bin/python import os.path, random class DataBase: def __init__(self, rutaUsers="../database/usuaris.txt", rutaComptes="../database/comptes.txt"): self.rutaUsers = rutaUsers self.rutaComptes = rutaComptes #User management methods: def creaUsers(self): "...
{ "repo_name": "aramusss/contableplus", "path": "controller/dataBase.py", "copies": "1", "size": "8241", "license": "apache-2.0", "hash": 4140672061878445600, "line_mean": 34.9781659389, "line_max": 119, "alpha_frac": 0.5162034227, "autogenerated": false, "ratio": 3.9084440227703983, "config_tes...
# import the necessary packages import numpy as np class Searcher: def __init__(self, index): # store our index of images self.index = index def search(self, queryFeatures): # initialize our dictionary of results results = {} # loop over the index for (k, features) in self.index.items(): # compute ...
{ "repo_name": "fffy2366/image-processing", "path": "bin/python/pyimagesearch/searcher.py", "copies": "3", "size": "1417", "license": "mit", "hash": 7234219419886892000, "line_mean": 30.5111111111, "line_max": 61, "alpha_frac": 0.691601976, "autogenerated": false, "ratio": 3.430992736077482, "co...
# USAGE # python index.py --dataset images --index index.cpickle # import the necessary packages from pyimagesearch.rgbhistogram import RGBHistogram import argparse import cPickle import glob import cv2 # construct the argument parser and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-d", "--da...
{ "repo_name": "fffy2366/image-processing", "path": "bin/python/search_index.py", "copies": "1", "size": "1551", "license": "mit", "hash": -222828673452366000, "line_mean": 30.04, "line_max": 71, "alpha_frac": 0.7272727273, "autogenerated": false, "ratio": 3.525, "config_test": false, "has_no_...
# USAGE # python search_external.py --dataset images --index index.cpickle --query queries/rivendell-query.png # import the necessary packages from pyimagesearch.rgbhistogram import RGBHistogram from pyimagesearch.searcher import Searcher import numpy as np import argparse import cPickle import cv2 import time from p...
{ "repo_name": "fffy2366/image-processing", "path": "bin/python/search_external.py", "copies": "1", "size": "2821", "license": "mit", "hash": -7159670178026951000, "line_mean": 30.3444444444, "line_max": 107, "alpha_frac": 0.6621765331, "autogenerated": false, "ratio": 3.1484375, "config_test": ...
# USAGE # python search_index_one.py --dataset ../../public/uploads/similar --index ../../public/uploads/similar.cpickle --file 1464318452058AFC4E73.jpg # import the necessary packages from pyimagesearch.rgbhistogram import RGBHistogram import argparse import cPickle import glob import cv2 import os import sys import...
{ "repo_name": "fffy2366/image-processing", "path": "bin/python/search_index_one.py", "copies": "1", "size": "2159", "license": "mit", "hash": -2060498738231572700, "line_mean": 28.1756756757, "line_max": 144, "alpha_frac": 0.6873552571, "autogenerated": false, "ratio": 3.4324324324324325, "conf...
# USAGE # python search.py --dataset images --index index.cpickle # import the necessary packages from pyimagesearch.searcher import Searcher import numpy as np import argparse import cPickle import cv2 import time from pyimagesearch import logger conf = logger.Logger() # construct the argument parser and parse the...
{ "repo_name": "fffy2366/image-processing", "path": "bin/python/search.py", "copies": "1", "size": "2710", "license": "mit", "hash": 2786086098621288000, "line_mean": 31.2619047619, "line_max": 86, "alpha_frac": 0.6180811808, "autogenerated": false, "ratio": 3.465473145780051, "config_test": fal...
# import the necessary packages from __future__ import print_function import imutils import cv2 # print the current OpenCV version on your system print("Your OpenCV version: {}".format(cv2.__version__)) # check to see if you are using OpenCV 2.X print("Are you using OpenCV 2.X? {}".format(imutils.is_cv2())) # check...
{ "repo_name": "jrosebr1/imutils", "path": "demos/opencv_versions.py", "copies": "1", "size": "1166", "license": "mit", "hash": 8573881915434662000, "line_mean": 36.6451612903, "line_max": 86, "alpha_frac": 0.7152658662, "autogenerated": false, "ratio": 2.9974293059125965, "config_test": false, ...
# import the necessary packages from scipy.spatial import distance as dist import numpy as np import cv2 def order_points(pts): # sort the points based on their x-coordinates xSorted = pts[np.argsort(pts[:, 0]), :] # grab the left-most and right-most points from the sorted # x-roodinate points le...
{ "repo_name": "jrosebr1/imutils", "path": "imutils/perspective.py", "copies": "2", "size": "2785", "license": "mit", "hash": -8267604286048441000, "line_mean": 37.6944444444, "line_max": 70, "alpha_frac": 0.6427289048, "autogenerated": false, "ratio": 3.355421686746988, "config_test": false, ...
# import the necessary packages import cv2 def sort_contours(cnts, method="left-to-right"): # initialize the reverse flag and sort index reverse = False i = 0 # handle if we need to sort in reverse if method == "right-to-left" or method == "bottom-to-top": reverse = True # handle if...
{ "repo_name": "zhanggyb/imutils", "path": "imutils/contours.py", "copies": "3", "size": "1505", "license": "mit", "hash": -444586085024175300, "line_mean": 32.4444444444, "line_max": 84, "alpha_frac": 0.6279069767, "autogenerated": false, "ratio": 3.4049773755656108, "config_test": false, "ha...
# import the necessary packages import numpy as np import cv2 import sys # import any special Python 2.7 packages if sys.version_info.major == 2: from urllib import urlopen # import any special Python 3 packages elif sys.version_info.major == 3: from urllib.request import urlopen def translate(image, x, y):...
{ "repo_name": "xuanhan863/imutils", "path": "imutils/convenience.py", "copies": "1", "size": "4565", "license": "mit", "hash": -279873061204399400, "line_mean": 30.0612244898, "line_max": 72, "alpha_frac": 0.6556407448, "autogenerated": false, "ratio": 3.637450199203187, "config_test": false, ...
# import the necessary packages import numpy as np import cv2 def order_points(pts): # initialize a list of coordinates that will be ordered # such that the first entry in the list is the top-left, # the second entry is the top-right, the third is the # bottom-right, and the fourth is the bottom-left ...
{ "repo_name": "zhanggyb/imutils", "path": "imutils/perspective.py", "copies": "3", "size": "2554", "license": "mit", "hash": -99463562443379180, "line_mean": 37.1194029851, "line_max": 70, "alpha_frac": 0.6405638215, "autogenerated": false, "ratio": 3.338562091503268, "config_test": false, "h...
# import the necessary packages import numpy as np import urllib import cv2 def translate(image, x, y): # define the translation matrix and perform the translation M = np.float32([[1, 0, x], [0, 1, y]]) shifted = cv2.warpAffine(image, M, (image.shape[1], image.shape[0])) # return the translated image...
{ "repo_name": "PanTomaszRoszczynialski/imutils", "path": "imutils/convenience.py", "copies": "2", "size": "4357", "license": "mit", "hash": 7126762098372383000, "line_mean": 30.3525179856, "line_max": 72, "alpha_frac": 0.65182465, "autogenerated": false, "ratio": 3.6278101582014988, "config_tes...
# USAGE # BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND # python fps_demo.py # python fps_demo.py --display 1 # import the necessary packages from __future__ import print_function from imutils.video import VideoStream from imutils.video import FPS import argparse import imutils import cv2 # construct ...
{ "repo_name": "jrosebr1/imutils", "path": "demos/fps_demo.py", "copies": "1", "size": "2426", "license": "mit", "hash": -2168471019115952600, "line_mean": 28.5975609756, "line_max": 70, "alpha_frac": 0.7135201979, "autogenerated": false, "ratio": 3.2005277044854883, "config_test": false, "has...
# USAGE # BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND # python image_basics.py # import the necessary packages import matplotlib.pyplot as plt import imutils import cv2 # load the example images bridge = cv2.imread("../demo_images/bridge.jpg") cactus = cv2.imread("../demo_images/cactus.jpg") logo = ...
{ "repo_name": "jrosebr1/imutils", "path": "demos/image_basics.py", "copies": "2", "size": "2621", "license": "mit", "hash": 3774586243874028000, "line_mean": 28.1222222222, "line_max": 69, "alpha_frac": 0.7428462419, "autogenerated": false, "ratio": 2.9549041713641486, "config_test": false, "...
# USAGE # BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND # python picamera_fps_demo.py # python picamera_fps_demo.py --display 1 # import the necessary packages from __future__ import print_function from imutils.video import VideoStream from imutils.video import FPS from picamera.array import PiRGBArray...
{ "repo_name": "jrosebr1/imutils", "path": "demos/picamera_fps_demo.py", "copies": "1", "size": "2980", "license": "mit", "hash": -895183849479864700, "line_mean": 28.2254901961, "line_max": 71, "alpha_frac": 0.7231543624, "autogenerated": false, "ratio": 3.225108225108225, "config_test": false,...
# USAGE # BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND # python sorting_contours.py # import the necessary packages from imutils import contours import imutils import cv2 # load the shapes image clone it, convert it to grayscale, and # detect edges in the image image = cv2.imread("../demo_images/shap...
{ "repo_name": "jrosebr1/imutils", "path": "demos/sorting_contours.py", "copies": "1", "size": "1343", "license": "mit", "hash": -7837198840968445000, "line_mean": 28.1956521739, "line_max": 83, "alpha_frac": 0.7297096054, "autogenerated": false, "ratio": 2.8333333333333335, "config_test": false...
__author__ = "Adrian Soghoian & Omar Ahmad" import subprocess import reference import models """ This subsystem contains functionality to scan the local network for connected devices, their OS fingerprints, and any open ports that they may have. """ def scan_network(range, gateway="Unknown"): """ This m...
{ "repo_name": "adriansoghoian/security-at-home", "path": "scanner.py", "copies": "1", "size": "3395", "license": "mit", "hash": -7437007821162580000, "line_mean": 29.0442477876, "line_max": 120, "alpha_frac": 0.6159057437, "autogenerated": false, "ratio": 3.7144420131291027, "config_test": fals...
__author__ = 'Adrian Strilchuk' from datetime import datetime, date import json def jsonify(obj): return json.dumps(obj, ensure_ascii=False, separators=(u",", u":")) # http://stackoverflow.com/questions/14163399/convert-list-of-datestrings-to-datetime-very-slow-with-python-strptime def parse_datetime(dt_str): ...
{ "repo_name": "astrilchuk/sd2xmltv", "path": "libschedulesdirect/__init__.py", "copies": "1", "size": "1338", "license": "mit", "hash": -5098791886143433000, "line_mean": 24.7307692308, "line_max": 117, "alpha_frac": 0.620328849, "autogenerated": false, "ratio": 3.3118811881188117, "config_test...
__author__ = 'adrie_000' # -*- coding: utf8 -*- import numpy as np class StrategicMind(): def __init__(self, data_center): self.data_center = data_center def set_objective(self): best_obj = None best_score = 0 for objective in self.data_center.objectives: score = ...
{ "repo_name": "adrien-bellaiche/ia-cdf-rob-2015", "path": "Strategy.py", "copies": "1", "size": "1044", "license": "apache-2.0", "hash": 9211860640672674000, "line_mean": 29.7058823529, "line_max": 101, "alpha_frac": 0.5632183908, "autogenerated": false, "ratio": 4.261224489795918, "config_test...
__author__ = 'adrie_000' import numpy as np class Pathfinder(): def __init__(self, data_center): self.data_center = data_center def get_orders(self, objective): # Renvoie les ordres en [direction, vitesse, vitesse_rotation] objective_location = objective.position v = np.array...
{ "repo_name": "adrien-bellaiche/ia-cdf-rob-2015", "path": "Pathfinding.py", "copies": "1", "size": "1326", "license": "apache-2.0", "hash": 8245232157281335000, "line_mean": 41.8064516129, "line_max": 119, "alpha_frac": 0.5739064857, "autogenerated": false, "ratio": 3.3400503778337534, "config_...
__author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os import sys import pickle # Third-party from astropy import log as logger import astropy.coordinates as coord import astropy.units as u import emcee import matplotlib.pyplot as pl import numpy as np import scipy.optimize as so import h5py impor...
{ "repo_name": "adrn/StreamBFE", "path": "scripts/fit-streams.py", "copies": "1", "size": "15207", "license": "mit", "hash": -7465350424517582000, "line_mean": 41.0082872928, "line_max": 117, "alpha_frac": 0.5885447491, "autogenerated": false, "ratio": 3.442055228610231, "config_test": false, ...
__author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os # Third-party from astropy.constants import G from astropy import log as logger from astropy.coordinates.angles import rotation_matrix import astropy.coordinates as coord import astropy.units as u import matplotlib.pyplot as pl import numpy as...
{ "repo_name": "adrn/StreamBFE", "path": "scripts/make-streams.py", "copies": "1", "size": "8752", "license": "mit", "hash": 4981783500701987000, "line_mean": 41.6926829268, "line_max": 96, "alpha_frac": 0.5631855576, "autogenerated": false, "ratio": 3.3700423565652677, "config_test": false, "...
__author__ = "aemerick <emerick@astro.columbia.edu>" class constants: """ Helpful contants. In cgs or cgs conversions except ionization energies (eV) """ def __init__(self): self.eV_erg = 6.24150934326E11 self.k_boltz = 1.380658E-16 self.c = 2.99792458E10 s...
{ "repo_name": "aemerick/onezone", "path": "constants.py", "copies": "1", "size": "1446", "license": "mit", "hash": 3753205545507099000, "line_mean": 28.5102040816, "line_max": 94, "alpha_frac": 0.5380359613, "autogenerated": false, "ratio": 2.6386861313868613, "config_test": false, "has_no_ke...
__author__ = "aemerick <emerick@astro.columbia.edu>" # --- external --- from collections import OrderedDict # --- internal --- from constants import CONST as const import imf as imf # # --------- Superclass for all parameters ------- # class _parameters(object): def __init__(self): pass def help(s...
{ "repo_name": "aemerick/onezone", "path": "config.py", "copies": "1", "size": "12565", "license": "mit", "hash": 3984535296525362700, "line_mean": 32.0657894737, "line_max": 93, "alpha_frac": 0.5671309192, "autogenerated": false, "ratio": 3.9901556049539537, "config_test": false, "has_no_keyw...
__author__ = "aemerick <emerick@astro.columbia.edu>" # --- external --- import numpy as np # --- internal --- from constants import CONST as const # helper functions for computing physics models def s99_wind_velocity(L, M, T, Z): """ Starburt99 stellar wind velocity model which computes the stellar wind...
{ "repo_name": "aemerick/onezone", "path": "physics.py", "copies": "1", "size": "4845", "license": "mit", "hash": 9168840922944632000, "line_mean": 35.7045454545, "line_max": 94, "alpha_frac": 0.4811145511, "autogenerated": false, "ratio": 2.7311161217587374, "config_test": false, "has_no_keyw...
__author__ = 'aerospike' import copy import ntpath from lib import logutil import os from lib.logsnapshot import LogSnapshot from lib.serverlog import ServerLog from lib.logreader import LogReader, SHOW_RESULT_KEY, COUNT_RESULT_KEY, END_ROW_KEY, TOTAL_ROW_HEADER from lib import terminal import re DT_FMT = "%b %d %Y %...
{ "repo_name": "tejassp/asadmn-web", "path": "webapp/lib/logger.py", "copies": "1", "size": "27000", "license": "unlicense", "hash": 4269503029939395600, "line_mean": 42.2692307692, "line_max": 194, "alpha_frac": 0.516, "autogenerated": false, "ratio": 4.184100418410042, "config_test": false, ...
__author__ = 'Afief' from datetime import datetime from peewee import CharField, TextField, BooleanField, ForeignKeyField, \ DateField from apps.models import db from apps.models.auth import User class Phile(db.Model): filename = CharField(max_length=100) filetype = CharField(max_length=100) filepa...
{ "repo_name": "ap13p/elearn", "path": "apps/models/others.py", "copies": "1", "size": "1428", "license": "bsd-3-clause", "hash": 4063173094192638500, "line_mean": 22.4098360656, "line_max": 73, "alpha_frac": 0.6862745098, "autogenerated": false, "ratio": 3.230769230769231, "config_test": false,...
__author__ = 'aftab' import atom import basisset import molecule import pertabdict import shell #Basis set parser for standard basis set files in Quantum Chemistry #Tested as working on 2/3/2014 by Aftab Patel #TODO: Add some safety #utility function to count no of lines in a file def file_len(file_reference): p...
{ "repo_name": "stringtheorist/chem_parser", "path": "parser.py", "copies": "1", "size": "3090", "license": "mit", "hash": -8491390544762819000, "line_mean": 29.2941176471, "line_max": 79, "alpha_frac": 0.5598705502, "autogenerated": false, "ratio": 4.0025906735751295, "config_test": false, "h...
__author__ = 'agopalak' import forecastio import datetime import pytz import json import os from geopy import geocoders import logging # Setting up logging logger = logging.getLogger(__name__) logging.basicConfig(format='%(levelname)s: %(name)s: %(message)s', level=logging.INFO) # Forecast.io API key forecastIO_api_...
{ "repo_name": "agopalak/football_pred", "path": "pre_proc/get_weather.py", "copies": "1", "size": "1742", "license": "mit", "hash": 642985710849296900, "line_mean": 27.0967741935, "line_max": 86, "alpha_frac": 0.6549942595, "autogenerated": false, "ratio": 3.1730418943533696, "config_test": fal...
__author__ = 'agopalak' import nflgame import csv import get_weather import stadium_info import os.path import json import logging # Setting up logging logger = logging.getLogger(__name__) logging.basicConfig(format='%(levelname)s: %(name)s: %(message)s', level=logging.INFO) # Get NFL data from NFLgame package def ...
{ "repo_name": "agopalak/football_pred", "path": "pre_proc/get_nfldata.py", "copies": "1", "size": "5551", "license": "mit", "hash": 260221441578181600, "line_mean": 36.2617449664, "line_max": 137, "alpha_frac": 0.5379210953, "autogenerated": false, "ratio": 3.865598885793872, "config_test": fal...
__author__ = 'agostino' from pycomm.ab_comm.slc import Driver as SlcDriver import logging if __name__ == '__main__': logging.basicConfig( filename="SlcDriver.log", format="%(levelname)-10s %(asctime)s %(message)s", level=logging.DEBUG ) c = SlcDriver() if c.open('192.168.1.15')...
{ "repo_name": "bpaterni/pycomm", "path": "examples/test_slc_only.py", "copies": "3", "size": "2520", "license": "mit", "hash": -7070770079832689000, "line_mean": 32.6, "line_max": 63, "alpha_frac": 0.4222222222, "autogenerated": false, "ratio": 2.9612220916568743, "config_test": false, "has_n...
__author__ = 'agross' import pandas as pd import scipy as sp import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from Figures.Pandas import series_scatter from Figures.FigureHelpers import init_ax, prettify_ax from Helpers.Pandas import match_series def linear_regression(a, b): a, b = m...
{ "repo_name": "theandygross/Figures", "path": "src/Figures/Regression.py", "copies": "1", "size": "4411", "license": "mit", "hash": 8430698963059050000, "line_mean": 29.0136054422, "line_max": 78, "alpha_frac": 0.5477216051, "autogenerated": false, "ratio": 2.888670595939751, "config_test": fal...
__author__ = 'agross' import re import itertools as itertools import urllib import pandas as pd from matplotlib.colors import rgb2hex from matplotlib.cm import RdBu KEGG_PATH = 'http://www.kegg.jp/kegg-bin/' from Figures.KEGG import * def pull_pathway_info_from_kegg(kegg_id): o = urllib.urlopen('http://rest.ke...
{ "repo_name": "theandygross/Figures", "path": "src/Figures/KEGG.py", "copies": "1", "size": "2832", "license": "mit", "hash": -7338090559315704000, "line_mean": 32.3176470588, "line_max": 76, "alpha_frac": 0.5434322034, "autogenerated": false, "ratio": 3.2108843537414966, "config_test": false, ...
__author__ = 'agross' """ Code taken from MinRK's Gist. http://nbviewer.ipython.org/gist/minrk/6011986 """ import io, os, sys, types #from IPython import nbformat import nbformat as nbformat from IPython.core.interactiveshell import InteractiveShell from IPython.display import display_html def find_notebook(fullna...
{ "repo_name": "theandygross/NotebookImport", "path": "NotebookImport.py", "copies": "1", "size": "2806", "license": "apache-2.0", "hash": 6419217960560200000, "line_mean": 29.5, "line_max": 90, "alpha_frac": 0.5894511761, "autogenerated": false, "ratio": 3.886426592797784, "config_test": false,...
__author__ = 'agross' """ Code taken from MinRK's Gist. http://nbviewer.ipython.org/gist/minrk/6011986 """ import io, os, sys, types from IPython.nbformat import current from IPython.core.interactiveshell import InteractiveShell def find_notebook(fullname, path=None): """find a notebook, given its fully qualif...
{ "repo_name": "PeterUlz/TCGA_analysis", "path": "NotebookImport.py", "copies": "1", "size": "2547", "license": "mit", "hash": -2941774650132067000, "line_mean": 28.275862069, "line_max": 86, "alpha_frac": 0.5928543384, "autogenerated": false, "ratio": 3.8826219512195124, "config_test": false, ...
__author__ = "aguha@colgate.edu" from numpy import * from scipy.integrate import odeint import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages def deriv(vector, t, beta_I, beta_H, beta_F, alpha, gamma_H, gamma_I, gamma_D, gamma_DH, gamma_F, gamma_IH, delta1, delta2, delta3, iota): ...
{ "repo_name": "anindyabd/ebola_eradication", "path": "diff_eq.py", "copies": "1", "size": "3447", "license": "mit", "hash": -8056049991920374000, "line_mean": 45.5810810811, "line_max": 232, "alpha_frac": 0.5955903684, "autogenerated": false, "ratio": 2.4104895104895103, "config_test": false, ...
__author__ = 'aguzun' from flask import json import requests from uwsgi_tasks import task, TaskExecutor from core import app SLACK_NOTIFY_HOOK_CONFIG = "SLACK_NOTIFY_HOOK_CONFIG" @task(executor=TaskExecutor.AUTO) def notify_camera_state_changed(camera): # some long running task here if SLACK_NOTIFY_HOOK_C...
{ "repo_name": "SillentTroll/rascam_server", "path": "wsgi/notifier.py", "copies": "1", "size": "1493", "license": "apache-2.0", "hash": -8414024506077243000, "line_mean": 32.1777777778, "line_max": 93, "alpha_frac": 0.6128600134, "autogenerated": false, "ratio": 3.779746835443038, "config_test"...
__author__ = 'aguzun' from urlparse import urljoin import requests class ControlOption(object): def __init__(self, option_name): self.option_name = option_name self.control_url = "http://localhost:8080" # change the port in motion.config self.thread_nr = "0" # multiple cameras can be c...
{ "repo_name": "SillentTroll/rascam_client", "path": "motion/motion_control.py", "copies": "1", "size": "1503", "license": "apache-2.0", "hash": -3247739610879324000, "line_mean": 26.8333333333, "line_max": 97, "alpha_frac": 0.6141051231, "autogenerated": false, "ratio": 3.9448818897637796, "con...
__author__ = 'aharvey' import serial import string import ystockquote import time INIT = chr(170) + chr(170)+ chr(170)+chr(170)+chr(170)+chr(187)+chr(146) CLEAR = chr(140) + chr(140) def cvtStr(msg): msg = string.replace(msg," ", "%20") msg = string.replace(msg, ":", " ") msg = string.replace(...
{ "repo_name": "infamy/ledsignstockticker", "path": "ticker.py", "copies": "1", "size": "1471", "license": "mit", "hash": 1075729989474509400, "line_mean": 31.4318181818, "line_max": 72, "alpha_frac": 0.578518015, "autogenerated": false, "ratio": 2.9186507936507935, "config_test": false, "has_...
__author__ = "Ahmad Al-Sajid" __email__ = "ahmadalsajid@gmail.com" distance = { 'a': 366, 'b': 0, 'c': 160, 'd': 242, 'e': 161, 'f': 176, 'g': 77, 'h': 151, 'i': 226, 'l': 244, 'm': 241, 'n': 234, 'o': 380, 'p': 10, 'r': 193, 's': 253, 't': 329, '...
{ "repo_name": "ahmadalsajid/PythonNotes", "path": "GreedyBestFastSearch.py", "copies": "1", "size": "2090", "license": "mit", "hash": -8747873405934222000, "line_mean": 21.2340425532, "line_max": 95, "alpha_frac": 0.4933014354, "autogenerated": false, "ratio": 2.7718832891246685, "config_test":...
__author__ = 'Ahmad Syarif' import pika import json class CommandHandler(object): avatarKey = 'avatar.NAO.command' def __init__(self): credential = pika.PlainCredentials('lumen', 'lumen') connection = pika.BlockingConnection(pika.ConnectionParameters('localhost', 5672, '/', credential)) ...
{ "repo_name": "ahmadsyarif/Python-Agent", "path": "Command.py", "copies": "2", "size": "1230", "license": "apache-2.0", "hash": 1528711197354987000, "line_mean": 38.6774193548, "line_max": 117, "alpha_frac": 0.6317073171, "autogenerated": false, "ratio": 3.649851632047478, "config_test": false,...
__author__ = 'Ahmad Syarif' import pika import json from pydispatch import dispatcher VISUAL_FACE_DETECTION = 'VISUAL_FACE_DETECTION' VISUAL_FACE_DETECTION = 'VISUAL_FACE_DETECTION' VISUAL_FACE_RECOGNITION ='VISUAL_FACE_RECOGNITION' VISUAL_FACE_TRACKING = 'VISUAL_FACE_TRACKING' VISUAL_HUMAN_TRACKING = 'VISUAL_HUMAN_TR...
{ "repo_name": "ahmadsyarif/Python-AgentIntelligent", "path": "Data.py", "copies": "2", "size": "8882", "license": "apache-2.0", "hash": -1902323057293045200, "line_mean": 57.4342105263, "line_max": 172, "alpha_frac": 0.713578023, "autogenerated": false, "ratio": 3.5886868686868687, "config_test...
__author__ = 'Ahmed G. Ali' import dbms def retrieve_connection(db): """ Retrieves Database connection object for a given connection parameters. :param db: Json object containing connection parameters :type db: dict :return: oracle.dbms.Connection object """ con = dbm...
{ "repo_name": "arrayexpress/ae_auto", "path": "dal/oracle/common.py", "copies": "1", "size": "2045", "license": "apache-2.0", "hash": -5602979348798659000, "line_mean": 27.8028169014, "line_max": 123, "alpha_frac": 0.5828850856, "autogenerated": false, "ratio": 4.09, "config_test": false, "ha...
__author__ = 'Ahmed G. Ali' import MySQLdb as mdb def retrieve_connection(db): """ Retrieves Database connection object for a given connection parameters. :param db: Json object containing connection parameters :type db: dict :return: MySQLDB.Connection object """ con = mdb.connect(host=...
{ "repo_name": "arrayexpress/ae_auto", "path": "dal/mysql/common.py", "copies": "1", "size": "1612", "license": "apache-2.0", "hash": -9083614565205179000, "line_mean": 24.1875, "line_max": 114, "alpha_frac": 0.6073200993, "autogenerated": false, "ratio": 3.688787185354691, "config_test": false,...
__author__ = 'Ahmed G. Ali' f = open('/home/gemmy/E-GEOD-16256_NIH_epigenome_cells_RNA-seq.sdrf.txt', 'r') lines = f.readlines() f.close() extra_header = ['sample_term_id', 'assay_term_id', 'nucleic_acid_term_id', 'Design_description', 'Library_name', 'EDACC_Genboree_Experiment_Page', 'EDACC_Genbor...
{ "repo_name": "arrayexpress/ae_auto", "path": "misc/extract_combined_columns.py", "copies": "1", "size": "1572", "license": "apache-2.0", "hash": 945249577302342500, "line_mean": 43.9142857143, "line_max": 114, "alpha_frac": 0.5655216285, "autogenerated": false, "ratio": 3.2081632653061223, "co...
__author__ = 'Ahmed G. Ali' def geo_email_parse(email_body): ids = {} for word in email_body.split(" "): word = word.replace(',', '') if word.startswith('GSE'): geo_id = word ae_id = 'E-GEOD-%s' % word.replace('GSE', '') ids[geo_id] = ae_id elif word...
{ "repo_name": "arrayexpress/ae_auto", "path": "utils/email/parser.py", "copies": "1", "size": "62039", "license": "apache-2.0", "hash": 4712202046893401000, "line_mean": 25.2210481826, "line_max": 191, "alpha_frac": 0.7554763939, "autogenerated": false, "ratio": 3.084369096151934, "config_test"...
__author__ = 'Ahmed G. Ali' if __name__ == '__main__': import argparse parser = argparse.ArgumentParser(description='submits and loads sequencing experiment to ENA and ArrayExpress') parser.add_argument('dir_name', metavar='MAGE-TAB_xxxx', type=str, help='''The directory name wher...
{ "repo_name": "arrayexpress/ae_auto", "path": "automation/ena/replace_runs.py", "copies": "1", "size": "1426", "license": "apache-2.0", "hash": 6264442848415832000, "line_mean": 66.9523809524, "line_max": 119, "alpha_frac": 0.6051893408, "autogenerated": false, "ratio": 4.194117647058824, "conf...
__author__ = 'Ahmed Hani Ibrahim' from LearningAlgorithm import * class Backpropagation(LearningAlgorithm): def learn(self, learningRate, input, output, network): """ :param learningRate: double :param input: list :param output: list :param network: [[Neuron]] :retu...
{ "repo_name": "AhmedHani/Python-Neural-Networks-API", "path": "OptimizationAlgorithms/Backpropagation.py", "copies": "1", "size": "2236", "license": "mit", "hash": -8875118512977930000, "line_mean": 39.6727272727, "line_max": 112, "alpha_frac": 0.5348837209, "autogenerated": false, "ratio": 4.454...
__author__ = 'Ahmed Hani Ibrahim' from NeuralNetwork.Neuron import Neuron from ActivationFunctions.Sigmoid import * import numpy as np class FeedforwardNeuralNetwork(object): __numberOfLayers = 0 __numberOfInput = 0 __network = [[Neuron]] __numberOfNeuronsPerLayer = 0 def __init__(self, numberOfLa...
{ "repo_name": "AhmedHani/Python-Neural-Networks-API", "path": "NeuralNetwork/FeedforwardNeuralNetwork.py", "copies": "1", "size": "3553", "license": "mit", "hash": -7092574169344296000, "line_mean": 31.8981481481, "line_max": 121, "alpha_frac": 0.6296087813, "autogenerated": false, "ratio": 4.543...
__author__ = 'Ahmed Hani Ibrahim' from State import State from Transition import Transition class QLearning(object): def train(self, initState, actions): currentState = initState foundState = False #iterator = iter(actions) for action in actions: for transition in cu...
{ "repo_name": "AhmedHani/Deep-Q-Learning", "path": "DeepQLearning/QLearning.py", "copies": "1", "size": "2097", "license": "mit", "hash": -5623856706218656000, "line_mean": 28.5352112676, "line_max": 108, "alpha_frac": 0.582260372, "autogenerated": false, "ratio": 4.733634311512415, "config_tes...
__author__ = 'Ahmed Hani Ibrahim' from Structures.Cell import Cell from Structures.Point import Point from Utilities.Utilities import * class Astar(object): __directions = [] __path = [[]] __source = Cell __destination = Cell __map = [[]] def __init__(self, map): self.__map = map ...
{ "repo_name": "AhmedHani/Frontier-based-Multi-Agent-Map-Exploration", "path": "Frontier-based Map Exploration/PathFinder/Astar.py", "copies": "1", "size": "4872", "license": "apache-2.0", "hash": 8406026599532931000, "line_mean": 43.6972477064, "line_max": 109, "alpha_frac": 0.5632183908, "autogene...
__author__ = 'Ahmed Hani Ibrahim' from Structures.MultipleArmedBandit import MultipleArmedBandit import numpy as np class Player(object): __Q = dict() __game = 0 __epsilon = 0.0 __numberOfBandits = 0 __numberOfGames = dict() __rewardValue = 0.0 __saveAction = [] __saveActionValue = [] ...
{ "repo_name": "AhmedHani/Banditology", "path": "Banditology/Player.py", "copies": "1", "size": "1956", "license": "mit", "hash": -6590180677935649000, "line_mean": 30.5483870968, "line_max": 93, "alpha_frac": 0.5715746421, "autogenerated": false, "ratio": 3.873267326732673, "config_test": false...
__author__ = 'Ahmed Hani Ibrahim' import pandas as pnd import numpy as np import matplotlib.pyplot as plt import seaborn as sb def get_train_data(): training_data = pnd.read_csv("./train.csv", header=0, parse_dates=['Dates']) #training_data = pnd.read_csv("./train.csv", header=0) return training_data de...
{ "repo_name": "AhmedHani/Kaggle-Machine-Learning-Competitions", "path": "Easy/SanFranciscoCrimeClassification/get_data.py", "copies": "1", "size": "3368", "license": "mit", "hash": -6884163420428945000, "line_mean": 49.2835820896, "line_max": 111, "alpha_frac": 0.6802256532, "autogenerated": false,...
__author__ = 'Ahmed Hani Ibrahim' from read_data import * import numpy as np import pickle from draw_data import * from get_image import * from sklearn.linear_model import LogisticRegression, LinearRegression from sklearn import svm labels, train_features = read_train_data( "G:\\Github Repositories\\KaggleMachin...
{ "repo_name": "AhmedHani/Kaggle-Machine-Learning-Competitions", "path": "Easy/DigitRecognizer/main.py", "copies": "1", "size": "2414", "license": "mit", "hash": -5345464781353137000, "line_mean": 31.6216216216, "line_max": 148, "alpha_frac": 0.6694283347, "autogenerated": false, "ratio": 2.951100...
__author__ = 'Ahmed Hani Ibrahim' from sklearn.cross_validation import cross_val_score from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression, LinearRegression from sklearn.naive_bayes import BernoulliNB from sklearn import svm from get_data import * from get_data_2 imp...
{ "repo_name": "AhmedHani/Kaggle-Machine-Learning-Competitions", "path": "Easy/What's Cooking/linear_svc.py", "copies": "1", "size": "1063", "license": "mit", "hash": -3008878360568274000, "line_mean": 26.9736842105, "line_max": 93, "alpha_frac": 0.7591721543, "autogenerated": false, "ratio": 3.23...
__author__ = 'Ahmed Hani Ibrahim' import random class GeneralizedHebbian(object): __input = [] __numberOfFeatures = 0 __output = [] __weights = [[]] __learningRate = 0.0 @property def Weights(self): pass @Weights.getter def Weights(self): return self.__weights ...
{ "repo_name": "AhmedHani/Python-Neural-Networks-API", "path": "DimensionalityReduction/GeneralizedHebbian.py", "copies": "1", "size": "2167", "license": "mit", "hash": -7934239786521102000, "line_mean": 30.4057971014, "line_max": 119, "alpha_frac": 0.5823719428, "autogenerated": false, "ratio": 4...
__author__ = 'ahmedlawi92@gmail.com' import json import requests import url_constants class NBAStatsScraper: player_ids = {} def __init__(self): self.populate_players_dict() def get_player_tracking_stats(self, **kwargs): base, args = self.build_url(url_constants.player_tracking_url) ...
{ "repo_name": "ahmedlawi92/basketball-stats", "path": "bballstats/statsnba/stats_nba_scraper.py", "copies": "1", "size": "2460", "license": "apache-2.0", "hash": 777384893442659700, "line_mean": 33.6478873239, "line_max": 93, "alpha_frac": 0.6235772358, "autogenerated": false, "ratio": 3.59124087...
__author__ = 'ahmedlawi92@gmail.com' import json import string from enum import Enum from bs4 import BeautifulSoup import requests class BBRefScraper: __base_url = 'http://www.basketball-reference.com{s}' __url_key = 'info_page' def __init__(self, json_file): self.players = json.load(file(json_...
{ "repo_name": "ahmedlawi92/basketball-stats", "path": "bballstats/bballreference/bbref_scraper.py", "copies": "1", "size": "2169", "license": "apache-2.0", "hash": -3160957800398579700, "line_mean": 31.3731343284, "line_max": 139, "alpha_frac": 0.6090364223, "autogenerated": false, "ratio": 3.362...
__author__ = 'Ahmed' from pymongo import MongoClient import json import re from os import listdir from os.path import isfile, join client = MongoClient() db = client.hotelinfo j = 0 for i in [ f for f in listdir('json') if isfile(join('json',f)) ]: if i.find(".json") == -1: continue print i ...
{ "repo_name": "ahmedshabib/evergreen-gainsight-hack", "path": "mongodumper.py", "copies": "1", "size": "1275", "license": "mit", "hash": 8569189593942164000, "line_mean": 26.7173913043, "line_max": 71, "alpha_frac": 0.5262745098, "autogenerated": false, "ratio": 3.581460674157303, "config_test"...
__author__ = 'Ahmed' import time import calendar from flask import Flask, request, session, g, redirect, url_for, render_template, flash from pymongo import MongoClient import json import uuid from werkzeug.utils import secure_filename from werkzeug.security import check_password_hash, generate_password_hash import ran...
{ "repo_name": "ahmedshabib/evergreen-gainsight-hack", "path": "webapi.py", "copies": "1", "size": "2483", "license": "mit", "hash": -5947337194787184000, "line_mean": 30.4303797468, "line_max": 87, "alpha_frac": 0.6653242046, "autogenerated": false, "ratio": 3.069221260815822, "config_test": fa...
__author__ = 'ahmed' import boto3, argparse, yaml from time import sleep import os.path def tag_instances(awsTags): reservations = ec2Client.describe_instances() instances = [ i['Instances'] for i in reservations['Reservations']] # Iterate EC2 instances ... # if instance is part of Clou...
{ "repo_name": "borkit/scriptdump", "path": "AWS/tag_aw_resources.py", "copies": "1", "size": "11248", "license": "mit", "hash": 2657007533907976700, "line_mean": 42.2834645669, "line_max": 138, "alpha_frac": 0.5090682788, "autogenerated": false, "ratio": 4.366459627329193, "config_test": false,...
import json, time, logging from os import path, getcwd, system, chdir from sys import stdout from shutil import copyfile from subprocess import check_call, STDOUT, DEVNULL from update_values_helpers import * logging.basicConfig(stream=stdout, level=logging.INFO) logger = logging.getLogger("build_resume") # set abso...
{ "repo_name": "atla5/resume", "path": "src/build_resume.py", "copies": "1", "size": "6189", "license": "mit", "hash": -1120989275830357100, "line_mean": 32.6141304348, "line_max": 114, "alpha_frac": 0.6740501213, "autogenerated": false, "ratio": 3.5586881472957423, "config_test": false, "has_...
import logging logger = logging.getLogger(__name__) months = ["Jan", "Feb", "March", "April", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"] months_full = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] def humanize_date(yyyy_mm,...
{ "repo_name": "atla5/resume", "path": "src/update_values_helpers.py", "copies": "1", "size": "5687", "license": "mit", "hash": -5475702164675141000, "line_mean": 36.9133333333, "line_max": 136, "alpha_frac": 0.6135044839, "autogenerated": false, "ratio": 3.6199872692552515, "config_test": false...
__author__ = "Aishwarya Sharma" # This class represents the "posts" table in the blog database. class Post: def __init__(self, post_id=None, title=None, content=None, create_date=None, edit_date=None, summary=None): self.post_id = post_id self.title = title self.summary = summary ...
{ "repo_name": "aishsharma/Weirdo_Blog", "path": "src/database/tables.py", "copies": "1", "size": "1518", "license": "mit", "hash": 4089009249247639000, "line_mean": 34.1428571429, "line_max": 111, "alpha_frac": 0.5177865613, "autogenerated": false, "ratio": 3.9224806201550386, "config_test": fa...
__author__ = 'Ajay' from django.conf.urls import url, patterns, include from . import views from blog.views import Index, PeopleList from django.contrib import admin admin.autodiscover() urlpatterns = [ #url(r'^$', views.post_list, name='post_list'), url(r'^hello$', views.hello, name='post_list'), url (r'^...
{ "repo_name": "ajaycode/django1", "path": "blog/urls.py", "copies": "1", "size": "1338", "license": "apache-2.0", "hash": 53830016138077830, "line_mean": 45.1724137931, "line_max": 108, "alpha_frac": 0.6434977578, "autogenerated": false, "ratio": 2.966740576496674, "config_test": false, "has_...
__author__ = 'Ajay' import re, collections def words(text): return re.findall('[a-z]+', text.lower()) def train(features): model = collections.defaultdict(lambda: 1) for f in features: model[f] += 1 return model NWORDS = train(words(open('big.txt').read())) alphabet = 'abcdefghijklmnopqrstuvwxy...
{ "repo_name": "ajaycode/django1", "path": "blog/spell_check.py", "copies": "1", "size": "1108", "license": "apache-2.0", "hash": -9200422109785398000, "line_mean": 29.8055555556, "line_max": 85, "alpha_frac": 0.6263537906, "autogenerated": false, "ratio": 2.9546666666666668, "config_test": fals...
#********************************************List of Dependencies******************************************************* #The following code has been tested with the indicated versions on 64bit Linux and PYTHON 2.7.3 #os: Use standard library with comes with python. #pint: 0.5.1 #************************************...
{ "repo_name": "DaisukeMiyamoto/python-Lmeasure", "path": "LMIO/util/morphometricMeasurements.py", "copies": "1", "size": "2053", "license": "apache-2.0", "hash": 8812055204942862000, "line_mean": 37.037037037, "line_max": 152, "alpha_frac": 0.5353141744, "autogenerated": false, "ratio": 3.7531992...
#********************************************List of Dependencies******************************************************* #The following code has been tested with the indicated versions on 64bit Linux and PYTHON 2.7.3 #blender: 2.6.9 #***********************************************************************************...
{ "repo_name": "dEvasEnApati/BlenderSWCVizualizer", "path": "blenderHelper.py", "copies": "2", "size": "24404", "license": "apache-2.0", "hash": 7811701832075533000, "line_mean": 41.0051635112, "line_max": 475, "alpha_frac": 0.5535977709, "autogenerated": false, "ratio": 4.022416350749959, "conf...
__author__ = 'ajdanelz' import subprocess from datetime import * from dateutil.relativedelta import relativedelta pipeline = [] pipeline.append("git tag") pipeline.append("xargs -I@ git log --format=format:'%ai @%n' -1 @") pipeline.append("sort") pipeline.append("awk '{print $1,$4}'") command = "|".join(pipeline) out...
{ "repo_name": "scoobah36/GitVersionParsing", "path": "VersionsByDate.py", "copies": "1", "size": "1790", "license": "mit", "hash": -2286020013892744200, "line_mean": 26.5384615385, "line_max": 90, "alpha_frac": 0.5530726257, "autogenerated": false, "ratio": 3.4225621414913956, "config_test": fa...
__author__ = 'aje' # # Copyright (c) 2008 - 2013 10gen, Inc. <http://10gen.com> # # 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 re...
{ "repo_name": "jac2130/BettingIsBelieving", "path": "Betting/putsDAO.py", "copies": "1", "size": "3977", "license": "mit", "hash": -542300794793250700, "line_mean": 33.2844827586, "line_max": 125, "alpha_frac": 0.561981393, "autogenerated": false, "ratio": 3.702979515828678, "config_test": fals...
__author__ = 'aje' # # Copyright (c) 2008 - 2013 10gen, Inc. <http://10gen.com> # # 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 r...
{ "repo_name": "KartikKannapur/MongoDB_M101P", "path": "Week_2/homework/homework_2_3/login_logout_signup/sessionDAO.py", "copies": "1", "size": "2481", "license": "mit", "hash": 7494334837058727000, "line_mean": 26.8764044944, "line_max": 85, "alpha_frac": 0.6565900846, "autogenerated": false, "ra...