text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'matic'
from collections import defaultdict
from wordification import Wordification
from services.webservice import WebService
def get_cross_validation_accuracy(arff):
acs=[]
for a in range(10):
j48 = WebService("http://vihar.ijs.si:8092/Classification?wsdl")
j48_response = j48.c... | {
"repo_name": "Alshak/clowdflows",
"path": "workflows/ilp/wordification/wordification_features_text.py",
"copies": "1",
"size": "4391",
"license": "mit",
"hash": 2182878715200882200,
"line_mean": 35.5916666667,
"line_max": 138,
"alpha_frac": 0.6251423366,
"autogenerated": false,
"ratio": 3.433150... |
__author__ = 'MatrixRev'
class OWL():
def __init__(self, namespace, outfile, propurl):
self.namespace = str(namespace)
self.outfile = outfile
#self.outfile = 'output.owl'
#self.propurl = 'http://staff.washington.edu/ngopal/prenatal.owl'
self.propurl = propurl
self.doc = ''
... | {
"repo_name": "ibrahimsh/final-project-software-programming",
"path": "OWL.py",
"copies": "1",
"size": "5217",
"license": "apache-2.0",
"hash": 1181311289789260800,
"line_mean": 39.765625,
"line_max": 96,
"alpha_frac": 0.5324899367,
"autogenerated": false,
"ratio": 3.2045454545454546,
"config_t... |
__author__ = 'MatrixRev'
import codecs
import json
import re
from collections import Mapping
from collections import defaultdict
from collections import Counter
import Levenshtein
import nltk
from nltk.corpus import stopwords
import fileinput
import string
import os
import collections
import rdflib
from rdflib.namespa... | {
"repo_name": "ibrahimsh/final-project-software-programming",
"path": "rdfontology.py",
"copies": "1",
"size": "67938",
"license": "apache-2.0",
"hash": -997005605173381900,
"line_mean": 65.1518987342,
"line_max": 124,
"alpha_frac": 0.3662898525,
"autogenerated": false,
"ratio": 4.423910920101583... |
__author__ = 'MatrixRev'
import json
import codecs
import glob
import os
import sys
#path = u"C://Users//MatrixRev//Desktop//library_5//"
path="C://Users//MatrixRev//Desktop//mainLib//" # input file
outFile='C:/Users/MatrixRev/Desktop/books/output/mainsubjects.txt' #output file
pathNew = u"C://Users//MatrixRev//Deskt... | {
"repo_name": "ibrahimsh/final-project-software-programming",
"path": "jasonParser.py",
"copies": "1",
"size": "2874",
"license": "apache-2.0",
"hash": 6531882246567302000,
"line_mean": 40.0571428571,
"line_max": 126,
"alpha_frac": 0.4669450244,
"autogenerated": false,
"ratio": 3.9696132596685083... |
__author__ = 'MatrixRev'
import os
import re
import json
import codecs
from collections import defaultdict
import string
library_path="C://Users//MatrixRev//Desktop//library_12//" # output file path
data_path="C://Users//MatrixRev//Dropbox//data" # input Marc file director
error_log="C://Users//MatrixRev//Desktop//lo... | {
"repo_name": "ibrahimsh/final-project-software-programming",
"path": "MarcParser.py",
"copies": "1",
"size": "12787",
"license": "apache-2.0",
"hash": 2034946410417546800,
"line_mean": 32.212987013,
"line_max": 132,
"alpha_frac": 0.5375772269,
"autogenerated": false,
"ratio": 3.616233031674208,
... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 6 / 10 / 13
__version__ = '0.1'
__status__ = 'Development'
import sys
import os
import json
import fnmatch
import traceback
import re
import pickle
import log
import libraryList
import Analysis
"""
This... | {
"repo_name": "mclarkelauer/AndroidAnalyzer",
"path": "analyzer.py",
"copies": "1",
"size": "3643",
"license": "bsd-3-clause",
"hash": 2157866967479570400,
"line_mean": 31.2389380531,
"line_max": 124,
"alpha_frac": 0.6044468844,
"autogenerated": false,
"ratio": 3.896256684491979,
"config_test":... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 6 / 17 / 13
__version__ = '0.1'
__status__ = 'Development'
"""
Dictionary containing android permissions and description string.
Reference: http://developer.android.com/reference/android/Manifest.permis... | {
"repo_name": "mclarkelauer/AndroidAnalyzer",
"path": "AndroidPermissions.py",
"copies": "1",
"size": "12233",
"license": "bsd-3-clause",
"hash": 8574670625162088000,
"line_mean": 83.3655172414,
"line_max": 194,
"alpha_frac": 0.781737922,
"autogenerated": false,
"ratio": 4.153820033955857,
"con... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 6 / 30 / 13
__version__ = '0.1'
__status__ = 'Development'
import sys
import traceback
import log
import util
import pdb
import subprocess
def parseSmaliFiles(content):
"""
Parse smali code into... | {
"repo_name": "mclarkelauer/AndroidAnalyzer",
"path": "parser.py",
"copies": "1",
"size": "5273",
"license": "bsd-3-clause",
"hash": 5947503136970581000,
"line_mean": 39.2519083969,
"line_max": 93,
"alpha_frac": 0.4843542575,
"autogenerated": false,
"ratio": 4.286991869918699,
"config_test": fa... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 6 / 30 / 13
__version__ = '0.1'
__status__ = 'Development'
import sys,os
import disassembly,parser,analyzer,log,apktool
import json
from datetime import datetime
import Analysis
import pdb
from docopt im... | {
"repo_name": "mclarkelauer/AndroidAnalyzer",
"path": "DexScope.py",
"copies": "1",
"size": "3990",
"license": "bsd-3-clause",
"hash": 9110206428431993000,
"line_mean": 33.1025641026,
"line_max": 125,
"alpha_frac": 0.5822055138,
"autogenerated": false,
"ratio": 3.896484375,
"config_test": true,... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 8 / 1 / 13
__version__ = '0.1'
__status__ = 'Development'
import imp
import os
import json
import sys
import log
import pdb
RoutineName = "__init__"
try:
plugins_conf = json.loads(open('plugins.j... | {
"repo_name": "mclarkelauer/AndroidAnalyzer",
"path": "Analysis/__init__.py",
"copies": "1",
"size": "2423",
"license": "bsd-3-clause",
"hash": 713325200887541900,
"line_mean": 26.5340909091,
"line_max": 103,
"alpha_frac": 0.6372265786,
"autogenerated": false,
"ratio": 3.7507739938080493,
"conf... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 8 / 1 / 13
__version__ = '0.1'
__status__ = 'Development'
import log
from Analysis import analysisUtils
name = "checksForJavaCryptoLib"
description = "Determines whether a Java crypto library is used"
r... | {
"repo_name": "mclarkelauer/AndroidAnalyzer",
"path": "Analysis/plugins/checksForJavaCryptoLib/__init__.py",
"copies": "1",
"size": "4462",
"license": "bsd-3-clause",
"hash": 5060304906257237000,
"line_mean": 22,
"line_max": 79,
"alpha_frac": 0.6201255043,
"autogenerated": false,
"ratio": 2.84929... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 8 / 1 / 13
__version__ = '0.1'
__status__ = 'Development'
'''
Example analysis
'''
name = "Class Metrics"
description = "Collect number of class metrics"
result = {}
def getName():
"return analysis... | {
"repo_name": "mclarkelauer/AndroidAnalyzer",
"path": "Analysis/plugins/Metrics/__init__.py",
"copies": "1",
"size": "1155",
"license": "bsd-3-clause",
"hash": 573953956525691300,
"line_mean": 24.6666666667,
"line_max": 93,
"alpha_frac": 0.5939393939,
"autogenerated": false,
"ratio": 3.6206896551... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 8 / 1 / 13
__version__ = '0.1'
__status__ = 'Development'
'''
Storage Usage Analysis
----------------------
Matches method invocations with storage lookups
'''
import log
from Analysis import analysisUt... | {
"repo_name": "mclarkelauer/AndroidAnalyzer",
"path": "Analysis/plugins/UsesExternalStorage/__init__.py",
"copies": "1",
"size": "1662",
"license": "bsd-3-clause",
"hash": -8896603604915916000,
"line_mean": 23.4411764706,
"line_max": 99,
"alpha_frac": 0.6931407942,
"autogenerated": false,
"ratio"... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 8 / 6 / 13
__version__ = '0.1'
__status__ = 'Development'
import re
import log
import subprocess
def findFunctionsBySignature(classes,funcSig):
methods=[]
for cl in classes:
for method i... | {
"repo_name": "mclarkelauer/AndroidAnalyzer",
"path": "Analysis/analysisUtils.py",
"copies": "1",
"size": "2340",
"license": "bsd-3-clause",
"hash": -5910459214282013000,
"line_mean": 30.2,
"line_max": 84,
"alpha_frac": 0.5679487179,
"autogenerated": false,
"ratio": 3.6792452830188678,
"config_... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 8 / 8 / 13
__version__ = '0.1'
__status__ = 'Development'
'''
Obfuscation Analysis Routines
-----------------------------
Detects proguard based obfuscations using name heuristics
Method : proguard does... | {
"repo_name": "mclarkelauer/AndroidAnalyzer",
"path": "Analysis/plugins/ObfuscationAnalysis/__init__.py",
"copies": "1",
"size": "2565",
"license": "bsd-3-clause",
"hash": -4002606741817490000,
"line_mean": 29.1764705882,
"line_max": 90,
"alpha_frac": 0.6643274854,
"autogenerated": false,
"ratio"... |
__author__ = 'Matt Clark'
try:
from rdflib import Literal, XSD
# type conversion based on lists at http://simplejson.readthedocs.org/en/latest/#encoders-and-decoders
# and at http://www.w3.org/TR/xmlschema-2/#built-in-datatypes
literal_type_converters = {
XSD.boolean: bool,
XSD.byte: in... | {
"repo_name": "mattclarkdotnet/rdfdict",
"path": "rdfdict.py",
"copies": "1",
"size": "2734",
"license": "mit",
"hash": -2325070899687903700,
"line_mean": 28.3978494624,
"line_max": 111,
"alpha_frac": 0.5903438186,
"autogenerated": false,
"ratio": 3.5785340314136125,
"config_test": false,
"ha... |
__author__ = 'Matt Clark'
with open('README.md') as f:
long_desc = f.read()
from setuptools import setup
setup(
name = "RDFdict",
version = "0.1.6",
py_modules = ['rdfdict'],
# metadata for upload to PyPI
author = "Matt Clark",
author_email = "matt@mattclark.net",
description = "A cla... | {
"repo_name": "mattclarkdotnet/rdfdict",
"path": "setup.py",
"copies": "1",
"size": "1030",
"license": "mit",
"hash": -56603698364223096,
"line_mean": 34.5172413793,
"line_max": 102,
"alpha_frac": 0.5747572816,
"autogenerated": false,
"ratio": 4.273858921161826,
"config_test": false,
"has_no_... |
__author__ = 'Matt Clark'
with open('README.rst') as f:
long_desc = f.read()
from setuptools import setup
setup(
name = "HALEasy",
version = "0.4.3",
py_modules = ['haleasy'],
# metadata for upload to PyPI
author = "Matt Clark",
author_email = "matt@mattclark.net",
description = "A HA... | {
"repo_name": "mattclarkdotnet/haleasy",
"path": "setup.py",
"copies": "1",
"size": "1039",
"license": "mit",
"hash": 1489410487759826000,
"line_mean": 30.4848484848,
"line_max": 82,
"alpha_frac": 0.5601539942,
"autogenerated": false,
"ratio": 3.737410071942446,
"config_test": false,
"has_no_... |
__author__ = 'Matt Croydon, Mikhail Korobov, Pawel Tomasiewicz, Petr Dlouhy'
__version__ = (0, 7, 0)
import warnings
from functools import partial
from dateutil.relativedelta import relativedelta
from dateutil.parser import parse
from django.db.models import Count
from django.db import DatabaseError, transaction
from... | {
"repo_name": "kmike/django-qsstats-magic",
"path": "qsstats/__init__.py",
"copies": "1",
"size": "6496",
"license": "bsd-3-clause",
"hash": -6534612324816709000,
"line_mean": 36.7674418605,
"line_max": 106,
"alpha_frac": 0.5983682266,
"autogenerated": false,
"ratio": 4.0778405524168235,
"confi... |
__author__ = 'Matt Croydon'
__version__ = (0, 3, 1)
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.db.models import Count
import datetime
class InvalidInterval(Exception):
pass
class InvalidOperator(Exception):
pass
class DateFieldMissing(Exception):
pass
... | {
"repo_name": "mcroydon/django-qsstats",
"path": "qsstats/__init__.py",
"copies": "1",
"size": "6586",
"license": "bsd-3-clause",
"hash": 1221974197316994800,
"line_mean": 41.2179487179,
"line_max": 135,
"alpha_frac": 0.6691466748,
"autogenerated": false,
"ratio": 3.7763761467889907,
"config_te... |
__author__ = 'Matt David'
from addressimo.plugin import BasePlugin
class BaseResolver(BasePlugin):
def get_id_obj(self, id):
raise NotImplementedError
def get_all_keys(self):
raise NotImplementedError
def get_branches(self, id):
raise NotImplementedError
def get_lg_index(se... | {
"repo_name": "netkicorp/addressimo",
"path": "addressimo/resolvers/BaseResolver.py",
"copies": "1",
"size": "1971",
"license": "bsd-3-clause",
"hash": -3963550685673288700,
"line_mean": 26.7746478873,
"line_max": 87,
"alpha_frac": 0.66463724,
"autogenerated": false,
"ratio": 4.469387755102041,
... |
__author__ = 'Matt David'
from attrdict import AttrDict
from datetime import datetime, timedelta
from addressimo.config import config
# Used Datapoints:
#
# id
#
# bip70_static_amount
# bip70_enabled
# last_generated_index
# last_used_index
# master_public_key
# master_public_key_source
# private_key
# private_key_s... | {
"repo_name": "netkicorp/addressimo",
"path": "addressimo/data.py",
"copies": "1",
"size": "1506",
"license": "bsd-3-clause",
"hash": -3350100100935944000,
"line_mean": 25.8928571429,
"line_max": 111,
"alpha_frac": 0.6314741036,
"autogenerated": false,
"ratio": 3.70935960591133,
"config_test": ... |
__author__ = 'Matt David'
from datetime import datetime
from redis import Redis
from addressimo.config import config
from addressimo.util import LogUtil
from BaseLogger import BaseLogger
log = LogUtil.setup_logging()
class RedisLogger(BaseLogger):
@classmethod
def get_plugin_name(cls):
return 'REDI... | {
"repo_name": "netkicorp/addressimo",
"path": "addressimo/logger/RedisLogger.py",
"copies": "1",
"size": "1042",
"license": "bsd-3-clause",
"hash": -502087987856119300,
"line_mean": 27.1891891892,
"line_max": 102,
"alpha_frac": 0.6199616123,
"autogenerated": false,
"ratio": 3.8308823529411766,
... |
__author__ = 'Matt David'
from ecdsa.util import sigencode_der
from mock import patch, Mock, MagicMock
from test import AddressimoTestCase
from addressimo.util import *
TEST_PRIVKEY = '9d5a020344dd6dffc8a79e9c0bce8148ab0bce08162b6a44fec40cb113e16647'
TEST_PUBKEY = 'ac79cd6b0ac5f2a6234996595cb2d91fceaa0b9d9a6495f12f1... | {
"repo_name": "netkicorp/addressimo",
"path": "test/test_util.py",
"copies": "1",
"size": "24289",
"license": "bsd-3-clause",
"hash": -2154163908775052500,
"line_mean": 45.8015414258,
"line_max": 184,
"alpha_frac": 0.6861953971,
"autogenerated": false,
"ratio": 3.4748211731044347,
"config_test"... |
__author__ = 'Matt David'
from mock import patch, Mock
from test import AddressimoTestCase
from addressimo.crypto import *
class TestDeriveBranch(AddressimoTestCase):
def setUp(self):
self.patcher1 = patch('addressimo.crypto.iptools')
self.patcher2 = patch('addressimo.crypto.request')
se... | {
"repo_name": "netkicorp/addressimo",
"path": "test/test_crypto.py",
"copies": "1",
"size": "18726",
"license": "bsd-3-clause",
"hash": 446249572184413950,
"line_mean": 40.3399558499,
"line_max": 154,
"alpha_frac": 0.6788422514,
"autogenerated": false,
"ratio": 3.3427347375937164,
"config_test"... |
__author__ = 'Matt David'
import json
import requests
from datetime import datetime
from redis import Redis
from addressimo.config import config
from addressimo.util import LogUtil
from BaseLogger import BaseLogger
log = LogUtil.setup_logging()
class APILogger(BaseLogger):
@classmethod
def get_plugin_name(... | {
"repo_name": "netkicorp/addressimo",
"path": "addressimo/logger/APILogger.py",
"copies": "1",
"size": "1841",
"license": "bsd-3-clause",
"hash": -5951053756965617000,
"line_mean": 35.0980392157,
"line_max": 160,
"alpha_frac": 0.6061922868,
"autogenerated": false,
"ratio": 4.1002227171492205,
"... |
__author__ = 'Matt David'
import json
import requests
from OpenSSL import crypto
from BaseSigner import BaseSigner
from addressimo.config import config
from addressimo.util import LogUtil
log = LogUtil.setup_logging()
# This is example code, which can be used as a boilerplate for integrating with your own
# API-ba... | {
"repo_name": "netkicorp/addressimo",
"path": "addressimo/signer/APISigner.py",
"copies": "1",
"size": "1427",
"license": "bsd-3-clause",
"hash": 7085080633576564000,
"line_mean": 28.1428571429,
"line_max": 172,
"alpha_frac": 0.6454099509,
"autogenerated": false,
"ratio": 3.658974358974359,
"co... |
__author__ = 'Matteo Dell\'Amico'
from heapq import heapify, heappush, heappop
class PriorityDict(dict):
"""Dictionary that can be used as a priority queue.
Keys of the dictionary are items to be put into the queue, and values
are their respective priorities. All dictionary methods work as expected.
... | {
"repo_name": "sushanttripathy/graphene",
"path": "graphene/prioritydict.py",
"copies": "1",
"size": "2774",
"license": "mit",
"hash": -2094127847840817400,
"line_mean": 30.5227272727,
"line_max": 77,
"alpha_frac": 0.5991348234,
"autogenerated": false,
"ratio": 3.962857142857143,
"config_test":... |
__author__ = 'matteo'
import json
import os
import subprocess
from pywps import Process, ComplexInput, LiteralOutput, get_format
from pywps.wpsserver import temp_dir
class Area(Process):
def __init__(self):
inputs = [ComplexInput('layer', 'Layer', [get_format('GML')])]
outputs = [Lite... | {
"repo_name": "jachym/pywps-4-demo",
"path": "processes/area.py",
"copies": "1",
"size": "1441",
"license": "mit",
"hash": 4084140564128251000,
"line_mean": 34.025,
"line_max": 94,
"alpha_frac": 0.5371269951,
"autogenerated": false,
"ratio": 4.340361445783133,
"config_test": false,
"has_no_ke... |
__author__ = 'mattesnider'
__version__ = (0, 1, 10)
def autodiscover():
"""
Auto-discover INSTALLED_APPS backends.py modules that inherit from
GenericSocialUserBackend and fail silently when not present.
This forces an import on them to register any backend classes.
"""
from copy import copy
... | {
"repo_name": "mattsnider/django-simple-social",
"path": "django_simple_social/__init__.py",
"copies": "1",
"size": "1376",
"license": "mit",
"hash": -3234036912041254000,
"line_mean": 36.1891891892,
"line_max": 77,
"alpha_frac": 0.6337209302,
"autogenerated": false,
"ratio": 4.664406779661017,
... |
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, Boolean, Float, DateTime
from sqlalchemy.orm import sessionmaker
import datetime
Base = declarative_base()
class StallEvent(Base):
__tablename__ = 'events'
id = Column... | {
"repo_name": "MattFerraro/scatdat",
"path": "models.py",
"copies": "1",
"size": "1488",
"license": "apache-2.0",
"hash": -5671868262250442000,
"line_mean": 26.5555555556,
"line_max": 72,
"alpha_frac": 0.6196236559,
"autogenerated": false,
"ratio": 3.4364896073903,
"config_test": false,
"has_... |
from __future__ import division, absolute_import, print_function
import numpy as np
from scipy.linalg import solve
from .optimize import _check_unknown_options
from ._bglu_dense import LU
from ._bglu_dense import BGLU as BGLU
from scipy.linalg import LinAlgError
from numpy.linalg.linalg import LinAlgError as LinAlgErr... | {
"repo_name": "Eric89GXL/scipy",
"path": "scipy/optimize/_linprog_rs.py",
"copies": "2",
"size": "21769",
"license": "bsd-3-clause",
"hash": 4346299739317955000,
"line_mean": 39.6897196262,
"line_max": 79,
"alpha_frac": 0.6124764573,
"autogenerated": false,
"ratio": 4.094226067331202,
"config_t... |
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
n_dim = 10
n_samples = 150
variance = 0.5**2
rs = np.random.RandomState(1234)
true_w = rs.randn(n_dim); true_w /= np.linalg.norm(true_w)
true_t = rs.rand()*5
true_Q = np.c_[true_w, np.zeros((n_dim,n_dim-1))]
true_Q,R = np.linalg.qr(true_Q)
tru... | {
"repo_name": "notmatthancock/notmatthancock.github.io",
"path": "code/py/boundary-preserving-pca.py",
"copies": "1",
"size": "1797",
"license": "mit",
"hash": -7052719264596945000,
"line_mean": 27.078125,
"line_max": 80,
"alpha_frac": 0.6316082359,
"autogenerated": false,
"ratio": 2.087108013937... |
author = 'Matt Harasymczuk'
email = 'matt@astrotech.io'
project = 'DevOps and CI/CD with Docker'
description = "Matt Harasymczuk's DevOps and CI/CD with Docker"
language = 'en'
todo_emit_warnings = False
todo_include_todos = True
numfig_format = {
'section': 'Section %s.',
'figure': 'Figure %s.',
'table': ... | {
"repo_name": "MattAgile/workshop-ecosystem",
"path": "__ecosystem/conf.py",
"copies": "2",
"size": "3410",
"license": "apache-2.0",
"hash": -5427515395070215000,
"line_mean": 23.8905109489,
"line_max": 128,
"alpha_frac": 0.5967741935,
"autogenerated": false,
"ratio": 3.189897100093545,
"config... |
author = 'Matt Harasymczuk'
email = 'matt@astrotech.io'
project = 'DevOps and CI/CD wtih Docker'
description = "Matt Harasymczuk's DevOps and CI/CD wtih Docker"
extensions = [
# 'sphinx.ext.doctest',
'sphinx.ext.todo',
# 'sphinx.ext.imgmath',
# 'sphinx.ext.autosectionlabel',
# 'sphinx.ext.viewcode'... | {
"repo_name": "MattAgile/ecosystem-workshop",
"path": "conf.py",
"copies": "1",
"size": "3017",
"license": "apache-2.0",
"hash": -1855450128796954600,
"line_mean": 25.0086206897,
"line_max": 128,
"alpha_frac": 0.6062313557,
"autogenerated": false,
"ratio": 3.2232905982905984,
"config_test": fal... |
author = 'Matt Harasymczuk'
email = 'matt@astrotech.io'
project = 'Python 3: from None to Machine Learning'
description = "Matt Harasymczuk's Python 3: from None to Machine Learning"
language = 'en'
todo_emit_warnings = False
todo_include_todos = True
numfig_format = {
'section': 'Section %s.',
'figure': 'Figu... | {
"repo_name": "AstroTech/workshop-python",
"path": "conf.py",
"copies": "1",
"size": "3290",
"license": "mit",
"hash": 6587025417324573000,
"line_mean": 23.552238806,
"line_max": 128,
"alpha_frac": 0.5954407295,
"autogenerated": false,
"ratio": 3.299899699097292,
"config_test": false,
"has_no... |
author = 'Matt Harasymczuk'
email = 'matt@astrotech.io'
project = 'Python 3: from None to Machine Learning'
description = "Matt Harasymczuk's Python 3: from None to Machine Learning"
extensions = [
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.imgmath',
# 'sphinx.ext.autosectionlabel',
# 'sp... | {
"repo_name": "AstroTech/workshop-python",
"path": "_book/conf.py",
"copies": "1",
"size": "3091",
"license": "mit",
"hash": 2576808613306298400,
"line_mean": 26.5982142857,
"line_max": 128,
"alpha_frac": 0.612423164,
"autogenerated": false,
"ratio": 3.2674418604651163,
"config_test": false,
... |
"""
Recaster class for recasting numeric arrays
"""
from numpy import *
def sctype_attributes():
''' Return dictionary describing numpy scalar types '''
d_dict = {}
for sc_type in ('complex','float'):
t_list = sctypes[sc_type]
for T in t_list:
F = finfo(T)
dt = dty... | {
"repo_name": "stefanv/scipy3",
"path": "scipy/io/recaster.py",
"copies": "2",
"size": "17823",
"license": "bsd-3-clause",
"hash": -3870115982194209000,
"line_mean": 37.164882227,
"line_max": 82,
"alpha_frac": 0.4868989508,
"autogenerated": false,
"ratio": 4.101956271576524,
"config_test": true... |
__author__ = 'matthewgalligan'
from Tkinter import *
from phrase_generator import PhraseGenerator
from communicator import Communicator
from popup_window import InputDialog
from doodle import Doodle
import sys
import tkMessageBox
class GUI(object):
'''
The GUI Object contains a paintable canvas, a "get new wo... | {
"repo_name": "Yablargo/Pyctionary",
"path": "gui.py",
"copies": "1",
"size": "5803",
"license": "mit",
"hash": 2448581832743571000,
"line_mean": 32.9356725146,
"line_max": 120,
"alpha_frac": 0.6133034637,
"autogenerated": false,
"ratio": 3.7103580562659846,
"config_test": false,
"has_no_keyw... |
__author__ = 'matthewgarden'
import datetime
import logging
import requests
from review import Review
from bs4 import BeautifulSoup
class ReviewParser:
"""
Class to parse an album review from an RSS feed's DOM.
:param title_re: Regular expression object that can be used to get the artist and album from the RSS i... | {
"repo_name": "gardenm/hypetra.in",
"path": "rvws/wordof/management/wordof/reviewparser.py",
"copies": "1",
"size": "3656",
"license": "bsd-3-clause",
"hash": -4727918671145758000,
"line_mean": 35.198019802,
"line_max": 122,
"alpha_frac": 0.7097921225,
"autogenerated": false,
"ratio": 3.341864716... |
__author__ = 'matthewgarden'
import logging
import requests
from bs4 import BeautifulSoup
from wordof import models
class ReviewSite:
"""
Class to represent a music review site.
"""
def __init__(self, source, parser, ignore_before, logger=logging):
"""
:param url: URL for the site's RSS feed.
:param pars... | {
"repo_name": "gardenm/hypetra.in",
"path": "rvws/wordof/management/wordof/reviewsite.py",
"copies": "1",
"size": "1422",
"license": "bsd-3-clause",
"hash": -2672101853274032600,
"line_mean": 31.3181818182,
"line_max": 202,
"alpha_frac": 0.7130801688,
"autogenerated": false,
"ratio": 3.2916666666... |
__author__ = 'matthewgarden'
import logging
import requests
from bs4 import BeautifulSoup
class ReviewSite:
"""
Class to represent a music review site.
"""
def __init__(self, url, parser, ignore_before, logger=logging):
"""
:param url: URL for the site's RSS feed.
:type url: basestring
:param parser: O... | {
"repo_name": "gardenm/hypetra.in",
"path": "reviews/wordof/reviewsite.py",
"copies": "1",
"size": "1027",
"license": "bsd-3-clause",
"hash": -8963955716350113000,
"line_mean": 24.0731707317,
"line_max": 105,
"alpha_frac": 0.6971762415,
"autogenerated": false,
"ratio": 3.2916666666666665,
"conf... |
__author__ = 'matthew howland'
from bs4 import BeautifulSoup
#from datetime import datetime
import unicodedata
import urllib2
import iso8601
import datetime
import copy
from decimal import *
class noaa(object):
unitType = 'e'
startTime = ''
endTime = ''
product = 'time-series'
latitude = ''
long... | {
"repo_name": "IgorKoltunov/python-noaa-weather",
"path": "noaaweather/weather.py",
"copies": "1",
"size": "6709",
"license": "mit",
"hash": -8103577071203867000,
"line_mean": 34.6861702128,
"line_max": 255,
"alpha_frac": 0.6352660605,
"autogenerated": false,
"ratio": 3.9816023738872404,
"confi... |
__author__ = 'matthewpang'
from Tkinter import *
import pickle
import time
root = Tk()
root.title("Stretch Test Interface")
# Define Frame
control_frame = Frame(root)
button_frame = Frame(control_frame)
mode_frame = Frame(control_frame)
switch_frame = Frame(control_frame)
slider_frame = Frame(root)
reset = IntVar()... | {
"repo_name": "matthewpang/stretch_tester",
"path": "Python/UI.py",
"copies": "1",
"size": "4321",
"license": "mit",
"hash": 2420648033674169000,
"line_mean": 26.8774193548,
"line_max": 125,
"alpha_frac": 0.6757694978,
"autogenerated": false,
"ratio": 2.850263852242744,
"config_test": false,
... |
__author__ = 'matthewpang'
import serial
import time
import pickle
import struct
serStepper = serial.Serial('/dev/cu.usbmodem14231', 230400)
def output_encoder(value):
"""
Takes a 16 bit integer value, packs it little endian, then encapsulates it in the defined format
[0xAA,LSByte,MSByte,OxFF]
"""
... | {
"repo_name": "matthewpang/stretch_tester",
"path": "Python/actuator.py",
"copies": "1",
"size": "4420",
"license": "mit",
"hash": 8297583746781929000,
"line_mean": 24.2571428571,
"line_max": 141,
"alpha_frac": 0.620361991,
"autogenerated": false,
"ratio": 3.4913112164297,
"config_test": false,... |
"""Author: Matthew Russell
Setup file for Spomato
"""
from setuptools import setup, find_packages
def readme():
"""Opens the readme file and returns it as a string
Returns
-------
string:
A string representation of the readme file
"""
with open('README.md') as file:
return ... | {
"repo_name": "pm8k/Spomato",
"path": "setup.py",
"copies": "1",
"size": "1053",
"license": "mit",
"hash": -401968585519752000,
"line_mean": 21.8913043478,
"line_max": 90,
"alpha_frac": 0.6030389364,
"autogenerated": false,
"ratio": 3.418831168831169,
"config_test": false,
"has_no_keywords": ... |
"""Author: Matthew Russell
This contains the main Spomato class to be used to access the Spotify API and create new playlists based on the user's
defined criteria.
"""
import os
import pandas as pd
import spotipy
class Spomato():
"""Object used to access spotify API through spotipy and generate playlists.
... | {
"repo_name": "pm8k/Spomato",
"path": "spomato/spomato.py",
"copies": "1",
"size": "31484",
"license": "mit",
"hash": -2805565479243283500,
"line_mean": 37.301703163,
"line_max": 120,
"alpha_frac": 0.5680345572,
"autogenerated": false,
"ratio": 4.74228046392529,
"config_test": false,
"has_no_... |
__author__ = 'Matthias Grawinkel'
import calendar
import time
import dateutil
from datetime import datetime
from dateutil.rrule import rrule, DAILY, MONTHLY
class Timer():
def __init__(self, s):
self.s = s
def __enter__(self):
self.start = time.time()
def __exit__(self, *args):
... | {
"repo_name": "zdvresearch/fast15-paper-extras",
"path": "tape_mounts/robot_mount_logs/src/TimeTools.py",
"copies": "1",
"size": "2260",
"license": "mit",
"hash": 6440327343807557000,
"line_mean": 26.2289156627,
"line_max": 92,
"alpha_frac": 0.5845132743,
"autogenerated": false,
"ratio": 2.857142... |
__author__ = 'Matthias Grawinkel'
import calendar
import time
from datetime import datetime
from dateutil.rrule import rrule, DAILY, MONTHLY
class Timer():
def __init__(self, s):
self.s = s
def __enter__(self):
self.start = time.time()
def __exit__(self, *args):
print ("%s: %fs... | {
"repo_name": "zdvresearch/fast15-paper-extras",
"path": "tape_mounts/whpss/src/TimeTools.py",
"copies": "1",
"size": "2244",
"license": "mit",
"hash": -8643063859909944000,
"line_mean": 26.3658536585,
"line_max": 92,
"alpha_frac": 0.5824420677,
"autogenerated": false,
"ratio": 2.8477157360406093... |
__author__ = 'Matthieu'
from Instance import Instance
import scipy.io
import h5py
import numpy as np
class EEGData(object):
"""
Simple object that reads in the concatenated data, outputs slices and instances.
path : path to the stitched (concatenated) data.
eeg_data : the actual eeg_data. 2d array ... | {
"repo_name": "vincentadam87/gatsby-hackathon-seizure",
"path": "code/python/seizures/data/EEGData.py",
"copies": "1",
"size": "4529",
"license": "bsd-2-clause",
"hash": 4761322430527362000,
"line_mean": 38.0431034483,
"line_max": 120,
"alpha_frac": 0.588430117,
"autogenerated": false,
"ratio": 3... |
__author__ = 'matthi'
import operator
import copy
from collections import deque
from pyspeechgrammar import model
from pyspeechgrammar.fst import model as fst_model
class FSTPart:
def __init__(self):
self.input_arcs = []
self.output_arcs = []
self.is_optional = False
class FSTSerial... | {
"repo_name": "ynop/pyspeechgrammar",
"path": "pyspeechgrammar/fst/serialize.py",
"copies": "1",
"size": "7164",
"license": "mit",
"hash": -2667916535434637000,
"line_mean": 27.7710843373,
"line_max": 136,
"alpha_frac": 0.567839196,
"autogenerated": false,
"ratio": 3.796502384737679,
"config_te... |
__author__ = 'matth'
import ctypes.util
import os
import shutil
import subprocess
import sys
import tempfile
if sys.version_info[0] == 2:
from .custom_py2exe_py2 import custom_py2exe
else:
from .custom_py2exe_py3 import custom_py2exe
def in_directory(f, directory):
#make both absolute
directory = os.... | {
"repo_name": "j5int/py-exe-builder",
"path": "pyexebuilder/ExeBuilder.py",
"copies": "1",
"size": "5999",
"license": "apache-2.0",
"hash": -8632308141245553000,
"line_mean": 38.9933333333,
"line_max": 155,
"alpha_frac": 0.6377729622,
"autogenerated": false,
"ratio": 3.5793556085918854,
"config... |
__author__ = 'Matt Holland'
from src.core.stateMachine.transition import *
#TODO: enforce state requirements (We won't go into transfer state when excavator is still on board the transport)
class state:
nextStateId = 0
##
# state
#
# Parameters:
# name - The human readable name of the stat... | {
"repo_name": "MarsRobotics/Otto-Pylot",
"path": "src/core/stateMachine/state.py",
"copies": "1",
"size": "1675",
"license": "bsd-3-clause",
"hash": -8902893265886164000,
"line_mean": 27.8965517241,
"line_max": 114,
"alpha_frac": 0.6531343284,
"autogenerated": false,
"ratio": 4.419525065963061,
... |
__author__ = 'Matt Holland'
from src.core.stateMachine.state import *
def doNothing():
return
class stateMachine:
def __init__(self):
self.states = []
self.startState = self.addState("start", lambda: doNothing())
self.currentState = self.startState
return
##
# add... | {
"repo_name": "MarsRobotics/Otto-Pylot",
"path": "src/core/stateMachine/stateMachine.py",
"copies": "1",
"size": "1972",
"license": "bsd-3-clause",
"hash": 8678276000114934000,
"line_mean": 24.9605263158,
"line_max": 105,
"alpha_frac": 0.6343813387,
"autogenerated": false,
"ratio": 4.296296296296... |
__author__ = 'Mattias Hellborg Arthursson'
from time import sleep
from fabric.api import task, settings, sudo, execute
from boto.ec2 import EC2Connection, get_region, connect_to_region
BASE_AMI_ID = 'ami-6d0be61a'
KEYPAIR = 'dev-keypair'
SECURITY_GROUPS = ['default']
INSTANCE_TYPE = "m1.small"
KEY_FILE = '~/.ssh/dev-... | {
"repo_name": "hakansel05/spring-ldap",
"path": "etc/ec2/fabfile.py",
"copies": "13",
"size": "2635",
"license": "apache-2.0",
"hash": -505470330390122050,
"line_mean": 30.7590361446,
"line_max": 99,
"alpha_frac": 0.6777988615,
"autogenerated": false,
"ratio": 3.3396704689480354,
"config_test":... |
__author__ = 'Mattias Lidman'
import logging
import json
import urllib
import httplib2
import time
from oauth2 import Request as OAuthRequest
from oauth2 import SignatureMethod_HMAC_SHA1, Consumer, generate_nonce
class GlobusOnlineRestClient():
# NOTE: GraphRestClient would be more accurate, but if we want to rel... | {
"repo_name": "kbase/auth_service",
"path": "python-libs/python-nexus-client/lib/nexus/go_rest_client.py",
"copies": "5",
"size": "20873",
"license": "mit",
"hash": 3372187491967127600,
"line_mean": 41.9485596708,
"line_max": 103,
"alpha_frac": 0.610262061,
"autogenerated": false,
"ratio": 4.1905... |
__author__ = 'Mattias'
import time
from utils import coloursweep
from colourbynumbers import api
from neopixel import *
# LED strip configuration:
LED_COUNT = 10 # Number of LED pixels.
LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!).
LED_FREQ_HZ = 800000 # LED signal fre... | {
"repo_name": "indiecosmic/rpi-tiny-cbn",
"path": "main.py",
"copies": "1",
"size": "1209",
"license": "mit",
"hash": -1466914502898987800,
"line_mean": 30.8157894737,
"line_max": 96,
"alpha_frac": 0.688172043,
"autogenerated": false,
"ratio": 2.8992805755395685,
"config_test": false,
"has_no... |
__author__ = 'mattias'
from sys import stdout
global label_length
global label_style
def new_columns(columns, style):
if style == 1:
label_style = '='
elif style == 2:
label_style = '~'
elif style == 3:
label_style = '-'
elif style == 4:
label_style = '#'
elif st... | {
"repo_name": "MattiasZurkovic/PyTbl",
"path": "table.py",
"copies": "2",
"size": "2075",
"license": "mit",
"hash": -9009298503649609000,
"line_mean": 22.5340909091,
"line_max": 110,
"alpha_frac": 0.4823756639,
"autogenerated": false,
"ratio": 3.40625,
"config_test": false,
"has_no_keywords":... |
__author__ = 'matti'
from common.database import db
class VideoModel(db.Model):
__tablename__ = 'video'
id = db.Column(db.Integer, primary_key=True)
views = db.Column(db.Integer)
title = db.Column(db.String(80))
description = db.Column(db.Text)
nicoid = db.Column(db.S... | {
"repo_name": "melonmanchan/gachimuch.io-api",
"path": "api/models/video.py",
"copies": "1",
"size": "1086",
"license": "mit",
"hash": -6535492679258999000,
"line_mean": 36.4827586207,
"line_max": 91,
"alpha_frac": 0.6197053407,
"autogenerated": false,
"ratio": 3.4150943396226414,
"config_test"... |
import networkx as nx
import matplotlib.pyplot as plt
import Queue as qu
import pygraphviz
import scipy, numpy, math
##########################Properties########################
debug = False
threshold = 0.9
##########################Helper Methods########################
def sigmoid(t):
return 1 / (1 + math.e... | {
"repo_name": "GccX11/machine-learning",
"path": "nn.py",
"copies": "1",
"size": "4705",
"license": "mit",
"hash": 8586591218595530000,
"line_mean": 28.4125,
"line_max": 175,
"alpha_frac": 0.5268862912,
"autogenerated": false,
"ratio": 3.111772486772487,
"config_test": false,
"has_no_keywords... |
'''
This class is an implementation of the k-means clustering algorithm.
'''
import math, random
class KMeans(object):
centroids = []
assignments = dict()
def __init__(self, k, dim, r):
#initialize the centroids to random points in the range
for _ in range(0, k):
self.centroids.append((random.random()*r,)... | {
"repo_name": "GccX11/machine-learning",
"path": "kmeans.py",
"copies": "1",
"size": "1742",
"license": "mit",
"hash": 530393356903716500,
"line_mean": 23.5352112676,
"line_max": 100,
"alpha_frac": 0.5970149254,
"autogenerated": false,
"ratio": 2.485021398002853,
"config_test": false,
"has_no... |
'''
This program will learn and predict words and sentences using a Hierarchical Hidden Markov Model (HHMM).
Implement a Baum-Welch algorithm (like EM?) to learn parameters
Implement a Viterbi algorithm to learn structure.
Implement a forward-backward algorithm (like BP) to do inference over the evidence.
'''
'''
ca... | {
"repo_name": "GccX11/machine-learning",
"path": "hmm.py",
"copies": "1",
"size": "3184",
"license": "mit",
"hash": -7174855606496732000,
"line_mean": 19.9473684211,
"line_max": 104,
"alpha_frac": 0.6140075377,
"autogenerated": false,
"ratio": 2.5229793977812993,
"config_test": false,
"has_no... |
__author__ = 'mattjmorris'
import logging
import traceback
import json
from datetime import datetime
import pandas as pd
from pandas import DataFrame
import os
import numpy as np
from serialize.amazon_sender import AmazonSender
from collections import OrderedDict
class KhanLogger(object):
@classmethod
def g... | {
"repo_name": "thorwhalen/ut",
"path": "serialize/khan_logger.py",
"copies": "1",
"size": "10432",
"license": "mit",
"hash": -7515716842933969000,
"line_mean": 35.8657243816,
"line_max": 131,
"alpha_frac": 0.580904908,
"autogenerated": false,
"ratio": 3.7270453733476243,
"config_test": false,
... |
__author__ = 'Matt'
# cPicke is faster
try:
import cPickle as pickle
except ImportError:
import pickle
from socket import error as socket_error
# How big of a string should we use to send the data body size
BODY_SIZE_STRING_SIZE = 10
##
# sendData
#
# Description: Send a object over the network
#
# Paramet... | {
"repo_name": "MarsRobotics/ROSta-Bot",
"path": "src/command2ros/src/DataTransferProtocol.py",
"copies": "1",
"size": "1645",
"license": "bsd-3-clause",
"hash": 2967834869638866400,
"line_mean": 22.5,
"line_max": 83,
"alpha_frac": 0.6930091185,
"autogenerated": false,
"ratio": 3.816705336426914,
... |
__author__ = 'Matt'
# cPicke is faster
try:
import cPickle as pickle
except ImportError:
import pickle
from UI.RobotData import RobotData
from socket import error as socket_error
# How big of a string should we use to send the data body size
BODY_SIZE_STRING_SIZE = 10
##
# sendData
#
# Description: Send a... | {
"repo_name": "MarsRobotics/Experiments",
"path": "UI/network/DataTransferProtocol.py",
"copies": "1",
"size": "1688",
"license": "bsd-3-clause",
"hash": 8944146448998999000,
"line_mean": 22.4444444444,
"line_max": 83,
"alpha_frac": 0.6931279621,
"autogenerated": false,
"ratio": 3.827664399092970... |
__author__ = 'matt'
from copy import deepcopy
from os.path import join, split, exists
import numpy as np
from cvwrap import cv2
from chumpy.utils import row, col
from utils import wget
def get_earthmesh(trans, rotation):
from serialization import load_mesh
from copy import deepcopy
if not hasattr(get_ea... | {
"repo_name": "dimatura/opendr",
"path": "util_tests.py",
"copies": "1",
"size": "1392",
"license": "mit",
"hash": 4458797438387989500,
"line_mean": 26.84,
"line_max": 85,
"alpha_frac": 0.6034482759,
"autogenerated": false,
"ratio": 2.9,
"config_test": false,
"has_no_keywords": false,
"few_... |
__author__ = 'matt'
from copy import deepcopy
from os.path import join, split, exists
import numpy as np
from .cvwrap import cv2
from chumpy.utils import row, col
from .utils import wget
def get_earthmesh(trans, rotation):
from .serialization import load_mesh
from copy import deepcopy
if not hasattr(get... | {
"repo_name": "mattloper/opendr",
"path": "opendr/util_tests.py",
"copies": "1",
"size": "1395",
"license": "mit",
"hash": 4922374618238967000,
"line_mean": 26.9,
"line_max": 85,
"alpha_frac": 0.6021505376,
"autogenerated": false,
"ratio": 2.888198757763975,
"config_test": false,
"has_no_keyw... |
__author__ = 'matt'
from databaseAccess import *
import requests
ECHONEST_API_KEY="S0QUTXZNEZ6GNVKST"
BASE_URL="http://developer.echonest.com/api/v4/song/profile?api_key="
POST_URL="&format=json&bucket=id:spotify&track_id="
class DatabaseUtils:
def getCurrentPlaylistURIs(self, partyID):
playlist = Playl... | {
"repo_name": "akers77/pyplytrello",
"path": "src/databaseUtils.py",
"copies": "1",
"size": "1349",
"license": "mit",
"hash": -6139232923312229000,
"line_mean": 30.3953488372,
"line_max": 103,
"alpha_frac": 0.6367679763,
"autogenerated": false,
"ratio": 3.503896103896104,
"config_test": false,
... |
__author__ = 'matt'
from . import ch
import numpy as np
from .utils import row, col
import scipy.sparse as sp
import scipy.special
class Interp3D(ch.Ch):
dterms = 'locations'
terms = 'image'
def on_changed(self, which):
if 'image' in which:
self.gx, self.gy, self.gz = np.gradient(self... | {
"repo_name": "mattloper/chumpy",
"path": "chumpy/extras.py",
"copies": "1",
"size": "2406",
"license": "mit",
"hash": 1203126561191252500,
"line_mean": 32.4166666667,
"line_max": 82,
"alpha_frac": 0.5673316708,
"autogenerated": false,
"ratio": 3.422475106685633,
"config_test": false,
"has_no... |
__author__ = 'Matt'
# from RobotData import RobotData
from DataTransferProtocol import receiveData
import socket
import threading
# from DataTransferProtocol import sendData, receiveData
# test_dataBox = [RobotData()]
SERVER_IP = '192.168.1.137'
##
# A class that manages data transfer to the server(probably the ... | {
"repo_name": "MarsRobotics/Experiments",
"path": "UI/network/RobotDataClient.py",
"copies": "1",
"size": "1069",
"license": "bsd-3-clause",
"hash": 4121321286145129500,
"line_mean": 22.2391304348,
"line_max": 93,
"alpha_frac": 0.6407857811,
"autogenerated": false,
"ratio": 3.8592057761732854,
... |
__author__ = 'Matt'
import cmath
from MathHelpers import *
import numpy
from UI.RobotData import ManualControlData
# hard coded
FL_WHEEL_POS = (-67/2.0, -49)
ML_WHEEL_POS = (-67/2.0, 0.0)
RL_WHEEL_POS = (-67/2.0, 49)
FR_WHEEL_POS = (67/2.0, -49)
MR_WHEEL_POS = (67/2.0, 0.0)
RR_WHEEL_POS = (67/2.0, 49)
WHEEL_MATRIX... | {
"repo_name": "MarsRobotics/Experiments",
"path": "UI/WheelComputation.py",
"copies": "1",
"size": "2834",
"license": "bsd-3-clause",
"hash": 3569005184823080400,
"line_mean": 23.8684210526,
"line_max": 101,
"alpha_frac": 0.6016231475,
"autogenerated": false,
"ratio": 2.9831578947368422,
"confi... |
__author__ = 'matt'
import cv2
import numpy as np
from opendr.contexts._constants import *
import platform
if platform.system()=='Darwin':
from ctx_mac import OsContext
else:
from ctx_mesa import OsContext
fs_source = """
#version 120
void main(void) {
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
"""
vs_... | {
"repo_name": "mattloper/opendr",
"path": "opendr/contexts/draw_triangle_shaders_2_1.py",
"copies": "1",
"size": "1926",
"license": "mit",
"hash": 7355160970822399000,
"line_mean": 21.9404761905,
"line_max": 84,
"alpha_frac": 0.6355140187,
"autogenerated": false,
"ratio": 2.963076923076923,
"co... |
__author__ = 'matt'
import json
import spotipy
import spotipy.util as util
import sys
import os
datapath = os.path.dirname(os.path.realpath(__file__)) + '/data'
sys.path.insert(0, datapath)
DATA_PATH = os.path.join(datapath, "API_info")
class APIUtils():
def __init__(self):
self.apiInfo = json.load(open... | {
"repo_name": "prakharbahuguna/PyPlyServer",
"path": "src/apiUtils.py",
"copies": "1",
"size": "1194",
"license": "mit",
"hash": 6414838773774129000,
"line_mean": 28.1463414634,
"line_max": 141,
"alpha_frac": 0.6792294807,
"autogenerated": false,
"ratio": 3.5535714285714284,
"config_test": fals... |
__author__ = 'Matt'
import math
import cmath
from UI.network.DataTransferProtocol import sendData
import UI.WheelComputation as WheelComputation
from MathHelpers import *
import numpy
class DriveControl:
def __init__(self, x, y, size, data, data_client):
self.x = x
self.y = y
self.size =... | {
"repo_name": "MarsRobotics/Experiments",
"path": "UI/ManualControl.py",
"copies": "1",
"size": "20302",
"license": "bsd-3-clause",
"hash": -5049108827287745000,
"line_mean": 46.9952718676,
"line_max": 153,
"alpha_frac": 0.5812235248,
"autogenerated": false,
"ratio": 3.5124567474048445,
"config... |
__author__ = 'Matt'
import math
import numpy
def drawRockerBogie(canvas, x, y, size, armData, flip):
HORIZONTAL_SHIFT = size/2
VERTICAL_SHIFT = size/3
bogieTheta = armData.bogieTheta
rockerTheta = armData.rockerTheta
shortArmLength = size/6
longArmLength = size/3
width = size/100
... | {
"repo_name": "MarsRobotics/Experiments",
"path": "UI/drawing/RockerBogieSide.py",
"copies": "1",
"size": "2056",
"license": "bsd-3-clause",
"hash": 6171229102524330000,
"line_mean": 24.3950617284,
"line_max": 93,
"alpha_frac": 0.6254863813,
"autogenerated": false,
"ratio": 3.0917293233082708,
... |
__author__ = 'Matt'
import threading
from UI.drawing.TopDisplay import *
from UI.RobotData import RobotData
from Tkinter import *
test = [0]
class A(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
return
def run(self):
while True:
test[0] += 1
... | {
"repo_name": "MarsRobotics/Experiments",
"path": "UI/oldCode/threadDemo.py",
"copies": "1",
"size": "1216",
"license": "bsd-3-clause",
"hash": 6705845940140790000,
"line_mean": 16.8823529412,
"line_max": 65,
"alpha_frac": 0.5740131579,
"autogenerated": false,
"ratio": 3.5348837209302326,
"conf... |
__author__ = 'matt'
import urllib2
from databaseAccess import Playlist, UserLikes, User
import random
import json
class PlaylistUtils:
def __init__(self):
self.baseURL="http://developer.echonest.com/api/v4/playlist/static?"
self.api_key="S0QUTXZNEZ6GNVKST"
self.lastparams="&format=json&re... | {
"repo_name": "prakharbahuguna/PyPlyServer",
"path": "src/playlistUtils.py",
"copies": "1",
"size": "1930",
"license": "mit",
"hash": 9190046871192818000,
"line_mean": 30.1451612903,
"line_max": 99,
"alpha_frac": 0.6373056995,
"autogenerated": false,
"ratio": 3.634651600753296,
"config_test": f... |
__author__ = 'Matt'
class RobotData:
def __init__(self):
self.frontLeftWheel = wheel(0, 0.5, 0)
self.frontRightWheel = wheel(0, 0.5, 0)
self.midLeftWheel = wheel(0, 0.5, 0)
self.midRightWheel = wheel(0, 0.5, 0)
self.rearLeftWheel = wheel(0, 0.5, 0)
self.rearRightW... | {
"repo_name": "MarsRobotics/Experiments",
"path": "UI/RobotData.py",
"copies": "1",
"size": "3418",
"license": "bsd-3-clause",
"hash": -8114020577965434000,
"line_mean": 26.5725806452,
"line_max": 108,
"alpha_frac": 0.5889409011,
"autogenerated": false,
"ratio": 3.194392523364486,
"config_test"... |
__author__ = 'matt'
import motorCommands
import networkReciever
import time
#import autonomyDemo
print "E-Week Demo: Started"
# Network socket for relieving commands
net = networkReciever.networkReciever()
net.openClientSocket()
# Open a serial connection to the motors
con = motorCommands.motorController('/dev/tty... | {
"repo_name": "MarsRobotics/Experiments",
"path": "joystickDemo/Robot/main.py",
"copies": "1",
"size": "2299",
"license": "bsd-3-clause",
"hash": 5338599197773098000,
"line_mean": 26.369047619,
"line_max": 93,
"alpha_frac": 0.6272292301,
"autogenerated": false,
"ratio": 3.708064516129032,
"conf... |
__author__ = 'matt'
import socket
import struct
class networkReciever:
IP = "10.2.0.1"
# UDP_IP = "224.0.0.1"
# UDP_PORT = 6000
def openClientSocket(self):
tcpSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
tcpSock.bind(('', 6000))
tcpSock.listen(1)
# tcpS... | {
"repo_name": "MarsRobotics/Experiments",
"path": "joystickDemo/Robot/networkReciever.py",
"copies": "1",
"size": "1217",
"license": "bsd-3-clause",
"hash": 8596055086472962000,
"line_mean": 23.8571428571,
"line_max": 86,
"alpha_frac": 0.5743631882,
"autogenerated": false,
"ratio": 3.307065217391... |
__author__ = 'Matt'
import threading
# from UI.ManualControl import drawDriveControl, handleDriveClick
from ManualControl import DriveControl
try:
# for Python2
from Tkinter import *
except ImportError:
try:
# for Python3
from tkinter import *
except ImportError:
exit()
##
# ... | {
"repo_name": "MarsRobotics/Experiments",
"path": "UI/UiRunner.py",
"copies": "1",
"size": "3183",
"license": "bsd-3-clause",
"hash": -4324438218072026000,
"line_mean": 27.4285714286,
"line_max": 105,
"alpha_frac": 0.5852968897,
"autogenerated": false,
"ratio": 3.7271662763466042,
"config_test"... |
__author__ = 'Matt'
try:
# for Python2
from Tkinter import *
except ImportError:
try:
# for Python3
from tkinter import *
except ImportError:
exit()
from TopDisplay import drawWheelDisplay
from RockerBogieSide import drawRockerBogie
from UI.ManualControl import drawManualContro... | {
"repo_name": "MarsRobotics/Experiments",
"path": "UI/drawing/MainWindow.py",
"copies": "1",
"size": "2275",
"license": "bsd-3-clause",
"hash": -2509545121550374000,
"line_mean": 23.4623655914,
"line_max": 101,
"alpha_frac": 0.589010989,
"autogenerated": false,
"ratio": 3.616852146263911,
"conf... |
__author__ = 'Matt Stibbs'
__version__ = '1.27.00'
target_schema_version = '1.25.00'
from flask import Flask
import logging
from os.path import dirname
import sys
sys.path.append(dirname(__file__))
import bb_auditlogger as audit
logger = logging.getLogger(__name__)
app = Flask(__name__)
def startup():
import... | {
"repo_name": "mattstibbs/blockbuster-server",
"path": "blockbuster/__init__.py",
"copies": "1",
"size": "1373",
"license": "mit",
"hash": -3731598788508176400,
"line_mean": 27.0204081633,
"line_max": 114,
"alpha_frac": 0.6642388929,
"autogenerated": false,
"ratio": 3.867605633802817,
"config_t... |
__author__ = 'mauceri2'
from database_builder.core.timing import tic
from database_builder.core.timing import toc
from database_builder.tools.cmd_arguments_helper import CmdArgumentsHelper
import os, math, re
import numpy as np
from numpy import inf
import crawler.config as cfg
import scipy.io as spio
from itertools im... | {
"repo_name": "crmauceri/VisualCommonSense",
"path": "code/run_extract_semantics_multiple_query.py",
"copies": "1",
"size": "16935",
"license": "mit",
"hash": -7701296178864431000,
"line_mean": 47.8069164265,
"line_max": 243,
"alpha_frac": 0.6801889578,
"autogenerated": false,
"ratio": 3.41569181... |
__author__ = 'mauceri2'
import numpy as np
import scipy.io as sp
import scipy.stats as stat
import itertools as it
from nltk.stem import WordNetLemmatizer
from nltk.stem import PorterStemmer
from nltk.corpus import wordnet as wn
import json
import os
wnl = WordNetLemmatizer()
pst = PorterStemmer()
def task_gen_lemma_... | {
"repo_name": "crmauceri/VisualCommonSense",
"path": "code/database_builder/gen_concept_structure.py",
"copies": "1",
"size": "9914",
"license": "mit",
"hash": -2326374074409591300,
"line_mean": 43.2633928571,
"line_max": 137,
"alpha_frac": 0.6165019165,
"autogenerated": false,
"ratio": 3.4447533... |
__author__ = 'mauceri2'
import numpy as np
import scipy.sparse as sparse
import scipy.io as spio
import os
def pmi(A, totalPerRow, total):
(w, h) = np.shape(totalPerRow)
pxy = A/total #joint probability
px = totalPerRow/total #probability of x
px_mat = np.tile(px, (1, w))
py_mat = np.tile(px.transp... | {
"repo_name": "crmauceri/VisualCommonSense",
"path": "code/analysis/python_pmi.py",
"copies": "1",
"size": "2559",
"license": "mit",
"hash": 3555980333434364400,
"line_mean": 38.984375,
"line_max": 155,
"alpha_frac": 0.652989449,
"autogenerated": false,
"ratio": 3.057347670250896,
"config_test"... |
__author__ = 'mauceri2'
import os
import json
import urllib
import time
from multiprocessing import Process, Lock, Queue
from math import ceil
from core.stl import getFileOfType
from database_builder.core.timing import tic
from database_builder.core.timing import toc
class curl_Freebase_Thread(Process):
def __init... | {
"repo_name": "crmauceri/VisualCommonSense",
"path": "code/structured_knowledge/download_structured_knowledge.py",
"copies": "1",
"size": "7660",
"license": "mit",
"hash": 2380721166149017600,
"line_mean": 43.0229885057,
"line_max": 144,
"alpha_frac": 0.5433420366,
"autogenerated": false,
"ratio"... |
__author__ = 'mauceri2'
import xml.etree.ElementTree as ET
from nltk.corpus import wordnet as wn
import numpy as np
import scipy.io as sp
import os
import json
import csv
def parse_scene_concepts(knowledge_root, save_dir, concept_list, search_descriptor):
print "begin SUN scene labeling"
scenes = set([])
s... | {
"repo_name": "crmauceri/VisualCommonSense",
"path": "code/structured_knowledge/parse_object_scene.py",
"copies": "1",
"size": "5025",
"license": "mit",
"hash": -8077749126677564000,
"line_mean": 45.1009174312,
"line_max": 159,
"alpha_frac": 0.6523383085,
"autogenerated": false,
"ratio": 3.241935... |
__author__ = 'mauceri2'
__author__ = 'mauceri2'
import numpy as np
import scipy.sparse as sparse
import scipy.io as spio
import itertools
import os
def get_freq(comatrix_path, countstr, knowledge_root, save_description, candidate_vocab, image_threshold):
co_object = spio.loadmat(comatrix_path)
#Mask diagonal... | {
"repo_name": "crmauceri/VisualCommonSense",
"path": "code/analysis/get_freq.py",
"copies": "1",
"size": "1759",
"license": "mit",
"hash": -795094708910276600,
"line_mean": 42.975,
"line_max": 117,
"alpha_frac": 0.6861853326,
"autogenerated": false,
"ratio": 3.281716417910448,
"config_test": fa... |
__author__ = 'mauceri2'
import os
import numpy as np
from numpy import ix_
import scipy.io as sp
from nltk.stem import WordNetLemmatizer
from nltk.stem.porter import PorterStemmer
from nltk.corpus import wordnet as wn
import collections
ps = PorterStemmer()
wnl = WordNetLemmatizer()
POS = 'NVAvCP!rDIo'
def parse_la... | {
"repo_name": "crmauceri/VisualCommonSense",
"path": "code/structured_knowledge/parts_of_speech.py",
"copies": "1",
"size": "8316",
"license": "mit",
"hash": -9108413568642340000,
"line_mean": 41.0050505051,
"line_max": 163,
"alpha_frac": 0.5782828283,
"autogenerated": false,
"ratio": 3.408196721... |
__author__ = "Mauricio Collazos"
tasks = list()
def extraction(raw_text):
entities = {
"indexes": list(),
"tasks": list()
}
words = raw_text.split()
# Extract indexes:
for word in words:
try:
task_index = int(word)
entities["indexes"].append(task_i... | {
"repo_name": "contraslash/chatbots-intro",
"path": "basado_en_reglas/app.py",
"copies": "1",
"size": "2088",
"license": "mit",
"hash": -3250000961775561700,
"line_mean": 25.4303797468,
"line_max": 76,
"alpha_frac": 0.4966475096,
"autogenerated": false,
"ratio": 3.8810408921933086,
"config_test... |
import sys
# procedure for parsing file in FASTA format
def parseFastaFile(path):
f = open(path,'r')
sequence = ""
readingSequence = False
for row in f.readlines():
if (row[0] == ','):
continue
elif (row[0] == '>' and readingSequence == False):
readingSequence =... | {
"repo_name": "MauroBaresic/bioinf-string-matching-with-k-differences",
"path": "python2/MinNumbOfDiffBetween2StringsEfficient.py",
"copies": "1",
"size": "9266",
"license": "mit",
"hash": 3611639521941430000,
"line_mean": 33.9660377358,
"line_max": 115,
"alpha_frac": 0.3909993525,
"autogenerated":... |
import sys
import numpy as np
class MinDifference():
Cch = 1
Cde = 1
Cin = 1
m = 0
n = 0
R = ''
B = ''
D = None
def __init__(self,R,B):
self.R = R
self.B = B
self.m = len(R)
self.n = len(B)
self.D = np.zeros((self.m+1,self.n+1),dtype = n... | {
"repo_name": "MauroBaresic/bioinf-string-matching-with-k-differences",
"path": "python2/other/MinNumbOfDiffBetween2Strings.py",
"copies": "1",
"size": "2004",
"license": "mit",
"hash": -3243101708602482000,
"line_mean": 22.3023255814,
"line_max": 134,
"alpha_frac": 0.4481037924,
"autogenerated": f... |
import sys
class MinDifferenceImproved():
R = ''
B = ''
m = 0
n = 0
k = 0
L = None
def __init__(self,R,B,k):
self.R = R
self.B = B
self.k = k
self.m = len(R)
self.n = len(B)
self.L = dict()
def calculate(self):
#1
fo... | {
"repo_name": "MauroBaresic/bioinf-string-matching-with-k-differences",
"path": "python2/other/MinNumbOfDiffBetween2StringsImproved.py",
"copies": "1",
"size": "2117",
"license": "mit",
"hash": -2318040942666190300,
"line_mean": 25.1358024691,
"line_max": 90,
"alpha_frac": 0.3816721776,
"autogenera... |
__author__ = 'maxb'
import socket
import thread
import threading
import Queue
import time
import random
from sigils import heiroglyphs, futhark, combo
from sigil_util import *
from wizard import Wizard
# for later:
# import ssl
class Player:
def __init__(self):
self.ctos_queue = None
self.stoc_qu... | {
"repo_name": "maxburkhardt/wizard-game",
"path": "server.py",
"copies": "1",
"size": "9313",
"license": "mit",
"hash": 4717641590562690000,
"line_mean": 34.6819923372,
"line_max": 95,
"alpha_frac": 0.5520240524,
"autogenerated": false,
"ratio": 4.252511415525114,
"config_test": false,
"has_n... |
__author__ = 'maxb'
import socket
import uuid
import thread
import Queue
import time
client_uuid = str(uuid.uuid4())
ctos_connection = None
stoc_connection = None
send_queue = Queue.Queue()
recv_queue = Queue.Queue()
def establish_connection(server, port):
thread.start_new_thread(establish_ctos_connection, (ser... | {
"repo_name": "maxburkhardt/wizard-game",
"path": "client_networking.py",
"copies": "1",
"size": "1238",
"license": "mit",
"hash": -88644385141856690,
"line_mean": 28.4761904762,
"line_max": 70,
"alpha_frac": 0.6340872375,
"autogenerated": false,
"ratio": 3.60932944606414,
"config_test": false,... |
__author__ = 'Maxim Dutkin (max@dutkin.ru)'
from collections import defaultdict
from tornado.web import RequestHandler
from typing import Type
from m2core.common.permissions import PermissionsEnum
from m2core.utils.url_parser import UrlParser
class Rules(defaultdict):
def validator(self, human_route: str=None):... | {
"repo_name": "mdutkin/m2core",
"path": "m2core/common/rules.py",
"copies": "1",
"size": "1717",
"license": "mit",
"hash": -827471159680087300,
"line_mean": 39.880952381,
"line_max": 115,
"alpha_frac": 0.6307513104,
"autogenerated": false,
"ratio": 4.25,
"config_test": false,
"has_no_keywords... |
__author__ = 'Maxim Dutkin (max@dutkin.ru)'
from enum import IntEnum
from sqlalchemy.types import TypeDecorator, Integer
class IntEnumType(TypeDecorator):
"""
SQLAlchemy enum column type. Makes simple mapping between `IntEnum` structures and SQLAlchemy columns.
When enum member is specified - saves it t... | {
"repo_name": "mdutkin/m2core",
"path": "m2core/db/custom_types.py",
"copies": "1",
"size": "1299",
"license": "mit",
"hash": -6432170522348177000,
"line_mean": 24.98,
"line_max": 106,
"alpha_frac": 0.6173979985,
"autogenerated": false,
"ratio": 4.110759493670886,
"config_test": false,
"has_n... |
__author__ = 'Maxim Dutkin (max@dutkin.ru)'
from m2core.common import Permission, PermissionsEnum
class PlatformPermissions(PermissionsEnum):
AUTHORIZED = Permission(
name='Authorized users',
sys_name='authorized',
description='All authorized users will have this permission by default (o... | {
"repo_name": "mdutkin/m2core",
"path": "example/common/permissions.py",
"copies": "1",
"size": "1033",
"license": "mit",
"hash": 7522310292347462000,
"line_mean": 30.303030303,
"line_max": 113,
"alpha_frac": 0.6321393998,
"autogenerated": false,
"ratio": 4.340336134453781,
"config_test": false... |
__author__ = 'Maxim Dutkin (max@dutkin.ru)'
from os import environ
from tornado.options import OptionParser
class M2OptionParser(OptionParser):
def parse_environment(self, final=True):
"""
Searches for option names in environment variables list. Assuming that all environment variable names
... | {
"repo_name": "mdutkin/m2core",
"path": "m2core/common/options.py",
"copies": "1",
"size": "1043",
"license": "mit",
"hash": 2351832875264114000,
"line_mean": 31.59375,
"line_max": 109,
"alpha_frac": 0.6222435283,
"autogenerated": false,
"ratio": 4.896713615023474,
"config_test": false,
"has_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.