text stringlengths 0 1.05M | meta dict |
|---|---|
import sqlite3
from tempfile import NamedTemporaryFile
from nose.tools import assert_equal
from nose.tools import assert_raises
from ..storage import sqlite3_loads
from ..storage import sqlite3_dumps
def test_sqlite3_storage():
with NamedTemporaryFile() as fhandle:
fname = fhandle.name
data = ... | {
"repo_name": "lesteve/clusterlib",
"path": "clusterlib/tests/test_storage.py",
"copies": "1",
"size": "2023",
"license": "bsd-3-clause",
"hash": -8734907411278035000,
"line_mean": 32.1639344262,
"line_max": 72,
"alpha_frac": 0.598615917,
"autogenerated": false,
"ratio": 3.651624548736462,
"con... |
"""
This module implements the G0W0 approximation on top of `pyscf.tdscf.rhf_slow` and `pyscf.tdscf.proxy` TD
implementations. Unlike `gw.py`, all integrals are stored in memory. Several variants of GW are available:
* (this module) `pyscf.gw_slow`: the molecular implementation;
* `pyscf.pbc.gw.gw_slow`: single-kpoi... | {
"repo_name": "gkc1000/pyscf",
"path": "pyscf/gw/gw_slow.py",
"copies": "1",
"size": "11011",
"license": "apache-2.0",
"hash": -34396617920303984,
"line_mean": 30.823699422,
"line_max": 133,
"alpha_frac": 0.5545363727,
"autogenerated": false,
"ratio": 3.5078050334501434,
"config_test": false,
... |
__author__ = 'sashgorokhov'
__email__ = 'sashgorokhov@gmail.com'
from PySide import QtCore, QtGui
from modules import cacher, util
import os.path
class _UserListItem(QtGui.QListWidgetItem):
def __init__(self, user_vkobject, iconfilename):
self.vkobject = user_vkobject
super().__init__(self.get_ca... | {
"repo_name": "sashgorokhov/VK-P-P-Music-Project",
"path": "modules/forms/mainform/components/navmenu/components/userlist.py",
"copies": "1",
"size": "2386",
"license": "mit",
"hash": -2314749463134029000,
"line_mean": 31.2567567568,
"line_max": 95,
"alpha_frac": 0.6487845767,
"autogenerated": fals... |
__author__ = 'sashgorokhov'
__email__ = 'sashgorokhov@gmail.com'
from PySide import QtCore, QtGui
from modules import cacher, util
import os.path, re, threading
class _FriendsListItem(QtGui.QListWidgetItem):
def __init__(self, friend_vkobject, iconfilename):
self.vkobject = friend_vkobject
super(... | {
"repo_name": "sashgorokhov/VK-P-P-Music-Project",
"path": "modules/forms/mainform/components/navmenu/components/friendslist.py",
"copies": "1",
"size": "3593",
"license": "mit",
"hash": -5418481797218549000,
"line_mean": 40.7906976744,
"line_max": 141,
"alpha_frac": 0.6582243251,
"autogenerated": ... |
__author__ = 'sashgorokhov'
__email__ = 'sashgorokhov@gmail.com'
from PySide import QtCore, QtGui
from modules import cacher, util
import os.path,threading, re
class _GroupsListItem(QtGui.QListWidgetItem):
def __init__(self, group_vkobject, iconfilename):
self.vkobject = group_vkobject
super().__... | {
"repo_name": "sashgorokhov/VK-P-P-Music-Project",
"path": "modules/forms/mainform/components/navmenu/components/groupslist.py",
"copies": "1",
"size": "3432",
"license": "mit",
"hash": -2429620083705986000,
"line_mean": 38.4597701149,
"line_max": 115,
"alpha_frac": 0.6518065268,
"autogenerated": f... |
__author__ = 'sashgorokhov'
__email__ = 'sashgorokhov@gmail.com'
from PySide import QtCore, QtGui
from .ui import Ui_Form
from modules.util import VkAudio
class AudioListItemWidget(QtGui.QWidget, Ui_Form):
play_signal = QtCore.Signal(VkAudio)
double_clicked_signal = QtCore.Signal(VkAudio)
pause_signal = Q... | {
"repo_name": "sashgorokhov/VK-P-P-Music-Project",
"path": "modules/forms/mainform/components/audiolist/components/audiolistitemwidget/__init__.py",
"copies": "1",
"size": "2356",
"license": "mit",
"hash": 7263935845343234000,
"line_mean": 33,
"line_max": 84,
"alpha_frac": 0.6447425357,
"autogenera... |
__author__ = 'sashgorokhov'
__email__ = 'sashgorokhov@gmail.com'
import tempfile, pickle, os.path, threading
CACHEFILE = "cache"
__cache = None
__lock = threading.Lock()
if not os.path.exists(CACHEFILE):
pickle.dump(dict(), open(CACHEFILE, 'wb'))
__cache = pickle.load(open(CACHEFILE, 'rb'))
__temp_session = dic... | {
"repo_name": "sashgorokhov/VK-P-P-Music-Project",
"path": "modules/cacher.py",
"copies": "1",
"size": "1326",
"license": "mit",
"hash": 5226826003293986000,
"line_mean": 22.9038461538,
"line_max": 94,
"alpha_frac": 0.5985518906,
"autogenerated": false,
"ratio": 2.7995495495495497,
"config_test... |
import numpy as np
from ._base import _BaseImputer
from ..utils.validation import FLOAT_DTYPES
from ..metrics import pairwise_distances_chunked
from ..metrics.pairwise import _NAN_METRICS
from ..neighbors._base import _get_weights
from ..neighbors._base import _check_weights
from ..utils import check_array
from ..uti... | {
"repo_name": "huzq/scikit-learn",
"path": "sklearn/impute/_knn.py",
"copies": "3",
"size": "11743",
"license": "bsd-3-clause",
"hash": -4444931907257785300,
"line_mean": 38.0132890365,
"line_max": 78,
"alpha_frac": 0.5831559227,
"autogenerated": false,
"ratio": 4.09591907917684,
"config_test":... |
import scipy
import scipy.io as sio
import numpy as np
from sklearn.metrics import zero_one_loss
from sklearn.naive_bayes import MultinomialNB,ComplementNB,CategoricalNB,BernoulliNB,GaussianNB
import matplotlib.pyplot as plt
import os
if os.path.isdir('scripts'):
os.chdir('scripts')
data = None
Xtrain = None
Xtes... | {
"repo_name": "probml/pyprobml",
"path": "scripts/naiveBayesBowDemo.py",
"copies": "1",
"size": "1297",
"license": "mit",
"hash": 217147390110356160,
"line_mean": 28.5,
"line_max": 95,
"alpha_frac": 0.7054741712,
"autogenerated": false,
"ratio": 2.7952586206896552,
"config_test": true,
"has_n... |
"""Recovers some data. This will only work for feature classes.
Problem: A dataset has records that are hidden.
Symptoms:
(1) The attribute table will show OBJECTIDs 1, 2, 4 for example; however, Select By Attribute for OBJECTID = 3 returns a result.
(2) Display issues. Zoom Out and the data disappears.
(... | {
"repo_name": "jgravois/developer-support",
"path": "python/arcpy-python/recover-corrupt-data/recoverCorrupt.py",
"copies": "15",
"size": "2542",
"license": "apache-2.0",
"hash": -953993693930318700,
"line_mean": 35.8405797101,
"line_max": 167,
"alpha_frac": 0.6467348544,
"autogenerated": false,
... |
__author__ = 'sathley'
from abc import ABCMeta
connection_system_properties = ['__relationtype', '__relationid', '__id', '__createdby', '__lastmodifiedby',
'__utcdatecreated', '__utclastupdateddate', '__tags', '__attributes', '__properties',
'__revision',... | {
"repo_name": "appacitive/pyappacitive",
"path": "pyappacitive/entity.py",
"copies": "1",
"size": "5655",
"license": "mit",
"hash": -7816575998675556000,
"line_mean": 33.2727272727,
"line_max": 117,
"alpha_frac": 0.5669319187,
"autogenerated": false,
"ratio": 4.08008658008658,
"config_test": fa... |
__author__ = 'sathley'
from .entity import AppacitiveEntity
from .error import ValidationError
from .utilities import http, urlfactory, customjson
from .response import AppacitiveCollection, PagingInfo
import logging
device_logger = logging.getLogger(__name__)
device_logger.addHandler(logging.NullHandler())
class A... | {
"repo_name": "appacitive/pyappacitive",
"path": "pyappacitive/device.py",
"copies": "1",
"size": "6982",
"license": "mit",
"hash": -6754027080697260000,
"line_mean": 29.3565217391,
"line_max": 85,
"alpha_frac": 0.6154397021,
"autogenerated": false,
"ratio": 3.9490950226244346,
"config_test": f... |
__author__ = 'sathley'
from .entity import AppacitiveEntity
from .error import ValidationError, UserAuthError
from .utilities import http, urlfactory, customjson
from .appcontext import ApplicationContext
from .response import AppacitiveCollection
from .link import Link
import logging
user_logger = logging.getLogger(... | {
"repo_name": "appacitive/pyappacitive",
"path": "pyappacitive/user.py",
"copies": "1",
"size": "16346",
"license": "mit",
"hash": -7637422200691609000,
"line_mean": 30.4951830443,
"line_max": 109,
"alpha_frac": 0.6197234798,
"autogenerated": false,
"ratio": 3.931216931216931,
"config_test": fa... |
__author__ = 'sathley'
from . import AppacitiveObject, AppacitiveConnection, GraphNode
import types
def convert_node(node):
return parse_graph_node(None, None, None, node)
def parse_graph_node(parent, name, parent_label, node):
# parse article
current = GraphNode()
node_clone = node.co... | {
"repo_name": "appacitive/pyappacitive",
"path": "pyappacitive/nodehelper.py",
"copies": "1",
"size": "1999",
"license": "mit",
"hash": -1553400537016983800,
"line_mean": 30.25,
"line_max": 110,
"alpha_frac": 0.6183091546,
"autogenerated": false,
"ratio": 3.904296875,
"config_test": false,
"h... |
__author__ = 'sathley'
from .object import AppacitiveObject
class AppacitiveEndpoint(object):
def __init__(self, endpoint=None):
if endpoint is not None:
self.label = endpoint.get('label', None)
self.type = endpoint.get('type', None)
self.objectid = int(endpoint.get('o... | {
"repo_name": "appacitive/pyappacitive",
"path": "pyappacitive/endpoint.py",
"copies": "1",
"size": "1080",
"license": "mit",
"hash": -7061648960435024000,
"line_mean": 33.8709677419,
"line_max": 60,
"alpha_frac": 0.5314814815,
"autogenerated": false,
"ratio": 4.06015037593985,
"config_test": f... |
__author__ = 'sathley'
from pyappacitive import AppacitiveDevice, AppacitiveError
import random
from pyappacitive import AppacitiveQuery, PropertyFilter
from nose.tools import *
def get_random_string(number_of_characters=10):
arr = [str(i) for i in range(number_of_characters)]
random.shuffle(arr)
return ... | {
"repo_name": "appacitive/pyappacitive",
"path": "tests/device_test.py",
"copies": "1",
"size": "1744",
"license": "mit",
"hash": -2183796546836179500,
"line_mean": 22.5810810811,
"line_max": 66,
"alpha_frac": 0.6788990826,
"autogenerated": false,
"ratio": 3.439842209072978,
"config_test": true... |
__author__ = 'sathley'
from pyappacitive import AppacitiveEmail
import nose
def send_email_with_config_test():
to = ['sathley@appacitive.com']
cc = []
bcc = []
smtp = {
"username": "sathley@appacitive.com",
"password": "########",
"host": "smtp.gmail.com",
"port": 465,
"en... | {
"repo_name": "appacitive/pyappacitive",
"path": "tests/email_test.py",
"copies": "1",
"size": "1523",
"license": "mit",
"hash": 1482391524038524400,
"line_mean": 33.6136363636,
"line_max": 275,
"alpha_frac": 0.6270518713,
"autogenerated": false,
"ratio": 2.923224568138196,
"config_test": false... |
__author__ = 'sathley'
from pyappacitive import AppacitiveGraphSearch, AppacitiveObject, AppacitiveConnection
import nose, random
def get_random_string(number_of_characters=10):
arr = [str(i) for i in range(number_of_characters)]
random.shuffle(arr)
return ''.join(arr)
def projection_test():
val1 =... | {
"repo_name": "appacitive/pyappacitive",
"path": "tests/graph_test.py",
"copies": "1",
"size": "2901",
"license": "mit",
"hash": -143650080267689800,
"line_mean": 35.2625,
"line_max": 118,
"alpha_frac": 0.7138917615,
"autogenerated": false,
"ratio": 3.3929824561403508,
"config_test": false,
"... |
__author__ = 'sathley'
from .utilities import urlfactory, http, customjson
from .error import ValidationError
from .response import AppacitiveCollection
import json, logging
push_logger = logging.getLogger(__name__)
push_logger.addHandler(logging.NullHandler())
class AppacitivePushNotification(object):
def __in... | {
"repo_name": "appacitive/pyappacitive",
"path": "pyappacitive/push.py",
"copies": "1",
"size": "5370",
"license": "mit",
"hash": 4739851739204840000,
"line_mean": 32.1481481481,
"line_max": 93,
"alpha_frac": 0.600744879,
"autogenerated": false,
"ratio": 4.166020170674942,
"config_test": false,... |
__author__ = 'sathley'
from .utilities import urlfactory, http
from .error import ValidationError
import logging
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
class AppacitiveFile(object):
def __init__(self):
pass
@staticmethod
def get_upload_url(content_type, fi... | {
"repo_name": "appacitive/pyappacitive",
"path": "pyappacitive/file.py",
"copies": "1",
"size": "1676",
"license": "mit",
"hash": -3466866593561762000,
"line_mean": 26.4754098361,
"line_max": 79,
"alpha_frac": 0.6264916468,
"autogenerated": false,
"ratio": 4.067961165048544,
"config_test": fals... |
__author__ = 'sathley'
import types
import datetime
from pyappacitive import ValidationError
class FilterBase(object):
def __init__(self):
self.operator = None
self.key = None
self.value = None
def __repr__(self):
raise NotImplementedError('This method should be overridden in... | {
"repo_name": "appacitive/pyappacitive",
"path": "pyappacitive/query/filter.py",
"copies": "1",
"size": "5691",
"license": "mit",
"hash": -5296521442924717000,
"line_mean": 24.8681818182,
"line_max": 99,
"alpha_frac": 0.5605341768,
"autogenerated": false,
"ratio": 3.8740639891082367,
"config_te... |
__author__ = 'sathley'
import types
class AppacitiveQuery(object):
def __init__(self):
self.page_number = None
self.page_size = None
self.order_by = None
self.is_ascending = None
self.free_text_tokens = []
self.free_text_language = None
self.language = ... | {
"repo_name": "appacitive/pyappacitive",
"path": "pyappacitive/query/query.py",
"copies": "1",
"size": "1648",
"license": "mit",
"hash": -1652380377098467300,
"line_mean": 30.0943396226,
"line_max": 114,
"alpha_frac": 0.5752427184,
"autogenerated": false,
"ratio": 3.868544600938967,
"config_tes... |
__author__ = 'sathley'
#class Status(object):
# def __init__(self, status=None):
# self.code = None
# self.message = None
# self.additional_messages = None
# self.reference_id = None
# self.version = None
#
# if status is not None:
# self.code = status.get('code... | {
"repo_name": "appacitive/pyappacitive",
"path": "pyappacitive/response.py",
"copies": "1",
"size": "1176",
"license": "mit",
"hash": 2841266591852107300,
"line_mean": 26.3488372093,
"line_max": 76,
"alpha_frac": 0.5799319728,
"autogenerated": false,
"ratio": 3.4792899408284024,
"config_test": ... |
__author__ = 'satish'
from xml.dom import minidom
import pickle
'''
Feature List:
title
gd:feedLink --- countHint
media:description
yt:duration --- seconds
gd:rating --- average --- max --- numRaters
yt:statistics (--- favoriteCount) --- viewCount
yt:rating --- numDislikes --- numLikes
Feature Tuple:
(title,mediaD... | {
"repo_name": "tpsatish95/Youtube-Comedy-Comparison",
"path": "Project/getFeatures.py",
"copies": "1",
"size": "1894",
"license": "apache-2.0",
"hash": -5147193694517249000,
"line_mean": 22.9873417722,
"line_max": 100,
"alpha_frac": 0.6246040127,
"autogenerated": false,
"ratio": 3.69921875,
"co... |
__author__ = 'satish'
import csv
from collections import defaultdict
import pickle
from xml.dom import minidom
def save_obj(obj, name ):
with open( name + '.pkl', 'wb') as f:
pickle.dump(obj, f, protocol=2)
def load_obj(name ):
with open( name + '.pkl', 'rb') as f:
return pickle.load(f)
ft... | {
"repo_name": "tpsatish95/Youtube-Comedy-Comparison",
"path": "Project/SandBox/TestData.py",
"copies": "1",
"size": "1945",
"license": "apache-2.0",
"hash": -6229630719769135000,
"line_mean": 23.012345679,
"line_max": 97,
"alpha_frac": 0.5907455013,
"autogenerated": false,
"ratio": 3.279932546374... |
__author__ = 'satish'
import numpy as np
from time import time
from sklearn.svm import SVR
from xml.dom import minidom
#### Main Path
p = "./"
import sys
sys.path.append(p + "Processor/")
import PreprocessClass
import pickle
def save_obj(obj, name ):
with open( name + '.pkl', 'wb') as f:
pickle.dump(ob... | {
"repo_name": "tpsatish95/Youtube-Comedy-Comparison",
"path": "Project/PairGuess.py",
"copies": "1",
"size": "2924",
"license": "apache-2.0",
"hash": 4150406426726998000,
"line_mean": 28.24,
"line_max": 104,
"alpha_frac": 0.5653214774,
"autogenerated": false,
"ratio": 3.303954802259887,
"config... |
__author__ = 'Satish'
import os
import json
import logging.config
import locale
import scrapy
from scrapy.selector import Selector, HtmlXPathSelector
from scrapy import signals
from scrapy.xlib.pydispatch import dispatcher
from scrapy import optional_features
import urlparse
class BaseLyricArchiveScraper(scrapy.Spi... | {
"repo_name": "satishkt/rock_on",
"path": "the_lyric_archive_scraper/the_lyric_archive_scraper/spiders/BaseScraper.py",
"copies": "1",
"size": "4110",
"license": "artistic-2.0",
"hash": 5502909397448495000,
"line_mean": 42.2631578947,
"line_max": 136,
"alpha_frac": 0.6345498783,
"autogenerated": fa... |
__author__ = 'satish'
import pickle
import collections
import operator
import math
def save_obj(obj, name ):
with open( name + '.pkl', 'wb') as f:
pickle.dump(obj, f, protocol=2)
def load_obj(name ):
with open( name + '.pkl', 'rb') as f:
return pickle.load(f)
# To Chunkify
def chunks(l, n):... | {
"repo_name": "tpsatish95/Youtube-Comedy-Comparison",
"path": "Project/ranker.py",
"copies": "1",
"size": "2754",
"license": "apache-2.0",
"hash": 5223674961805245000,
"line_mean": 21.7603305785,
"line_max": 115,
"alpha_frac": 0.6521423384,
"autogenerated": false,
"ratio": 2.7874493927125505,
"... |
__author__ = "Satish Palaniappan"
import learner
# # print(str(max(self.y_pred)) + "" + str(min(self.y_pred)))
# # temp = list(self.y_pred)
# # temp = sorted(temp)
# # print(str(sum(temp[:100])/float(len(temp[:100]))) + str(sum(temp[-100:])/float(len(temp[-100:]))))
# Scoring Function
maxmin=1.5
buckets = [maxmin - ... | {
"repo_name": "tpsatish95/Universal-MultiDomain-Sentiment-Classifier",
"path": "Trainers/test.py",
"copies": "1",
"size": "1470",
"license": "apache-2.0",
"hash": -6911428458773860000,
"line_mean": 31.6666666667,
"line_max": 102,
"alpha_frac": 0.6741496599,
"autogenerated": false,
"ratio": 2.5257... |
__author__ = "Satish Palaniappan"
import numpy as np
import matplotlib.pyplot as plt
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_selection import SelectKBest, chi2
from sklearn.svm import LinearSVC
from sklearn.svm import LinearSVR
from sklearn.utils.extmath import density
from skl... | {
"repo_name": "tpsatish95/Universal-MultiDomain-Sentiment-Classifier",
"path": "Trainers/learner.py",
"copies": "1",
"size": "8961",
"license": "apache-2.0",
"hash": -5627106285450866000,
"line_mean": 36.1825726141,
"line_max": 429,
"alpha_frac": 0.5504965964,
"autogenerated": false,
"ratio": 3.3... |
__author__ = "Satish Palaniappan"
import os
import pickle
from os import path
import learner
'''
Pickle Formats
2#review,pos_neg
3#review,pos_neg,score
4#review,pos_neg,score,title
'''
def learn_save(newLearner,feature_i,label_i):
newLearner.clearOld()
newLearner.loadXY(feature_index = feature_i,label_index = labe... | {
"repo_name": "tpsatish95/Universal-MultiDomain-Sentiment-Classifier",
"path": "Trainers/masterReviewsTrainer.py",
"copies": "1",
"size": "2490",
"license": "apache-2.0",
"hash": 8973861157129692000,
"line_mean": 24.1515151515,
"line_max": 114,
"alpha_frac": 0.6638554217,
"autogenerated": false,
... |
__author__ = "Satish Palaniappan"
import pickle
import config
import sys
sys.path.append(config.basePath+config.SocialFilter)
from SocialFilter.TextFilter import Filter
from SocialFilter.Twokenize.twokenize import *
import re
class extractor(object):
def __init__(self):
self.path = config.basePath +config.microbl... | {
"repo_name": "tpsatish95/Universal-MultiDomain-Sentiment-Classifier",
"path": "SentiHandlers/comments.py",
"copies": "1",
"size": "1787",
"license": "apache-2.0",
"hash": -3667099121300217300,
"line_mean": 26.0757575758,
"line_max": 72,
"alpha_frac": 0.6592053721,
"autogenerated": false,
"ratio"... |
__author__ = "Satish Palaniappan"
import pickle
import config
import sys
sys.path.append(config.basePath+config.SocialFilter)
from SocialFilter.TextFilter import Filter
import re
class extractor(object):
def __init__(self):
self.path = config.basePath +config.microblog
self.SentiModel = self.load_obj("_model")
... | {
"repo_name": "tpsatish95/Universal-MultiDomain-Sentiment-Classifier",
"path": "SentiHandlers/microblogs.py",
"copies": "1",
"size": "1385",
"license": "apache-2.0",
"hash": -2453205469828470300,
"line_mean": 27.2653061224,
"line_max": 72,
"alpha_frac": 0.6534296029,
"autogenerated": false,
"rati... |
__author__ = "Satish Palaniappan"
import pickle
import config
import sys
sys.path.append(config.basePath+config.SocialFilter)
from SocialFilter.Twokenize.twokenize import *
import re
class extractor(object):
def __init__(self):
self.path = config.basePath +config.general
self.SentiModel = self.load_obj("_model"... | {
"repo_name": "tpsatish95/Universal-MultiDomain-Sentiment-Classifier",
"path": "SentiHandlers/general.py",
"copies": "1",
"size": "1193",
"license": "apache-2.0",
"hash": 6741432854686314000,
"line_mean": 28.0975609756,
"line_max": 81,
"alpha_frac": 0.7057837385,
"autogenerated": false,
"ratio": ... |
__author__ = "Satish Palaniappan"
import pickle
import config
import sys
sys.path.append(config.basePath+config.SocialFilter)
from SocialFilter.Twokenize.twokenize import *
import re
class Model(object):
def __init__(self,modelPath):
self.path = config.basePath +config.review_Base + modelPath
self.SentiModel = s... | {
"repo_name": "tpsatish95/Universal-MultiDomain-Sentiment-Classifier",
"path": "SentiHandlers/review.py",
"copies": "1",
"size": "4506",
"license": "apache-2.0",
"hash": -3107427121771930600,
"line_mean": 39.5945945946,
"line_max": 409,
"alpha_frac": 0.7201509099,
"autogenerated": false,
"ratio":... |
__author__ = "Satish Palaniappan"
import pickle
import sys
from scoreScaler import scorer
from SocialFilter.Twokenize.twokenize import *
### Insert Current Path
import os, sys, inspect
cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]))
if cmd_folder not in sys.pat... | {
"repo_name": "tpsatish95/PingMyFood",
"path": "PMFSenimentScorer/review.py",
"copies": "2",
"size": "1310",
"license": "apache-2.0",
"hash": -4638217163155747000,
"line_mean": 26.2916666667,
"line_max": 105,
"alpha_frac": 0.7007633588,
"autogenerated": false,
"ratio": 2.9046563192904657,
"conf... |
__author__ = "Satish Palaniappan"
#from __future__ import print_function
import re,sys
mycompile = lambda pat: re.compile(pat, re.UNICODE)
#SMILEY = mycompile(r'[:=].{0,1}[\)dpD]')
#MULTITOK_SMILEY = mycompile(r' : [\)dp]')
NormalEyes = r'[:=]'
Wink = r'[;]'
NoseArea = r'(|o|O|-)' ## rather tight precision, \S ... | {
"repo_name": "tpsatish95/SocialTextFilter",
"path": "old/emoticons.py",
"copies": "1",
"size": "1836",
"license": "apache-2.0",
"hash": -7612549301322662000,
"line_mean": 27.6875,
"line_max": 77,
"alpha_frac": 0.6149237473,
"autogenerated": false,
"ratio": 2.3181818181818183,
"config_test": fa... |
__author__ = "Satish Palaniappan"
import pickle
from bs4 import BeautifulSoup
import urllib.request
import urllib
from urllib.request import Request, urlopen
def save_obj(obj, name):
with open(name + '.pkl', 'wb') as f:
pickle.dump(obj, f, protocol=2)
def load_obj(name):
with open(name ... | {
"repo_name": "tpsatish95/Python-Workshop",
"path": "Python Scripts/web-scraping/acronyms.py",
"copies": "1",
"size": "1095",
"license": "apache-2.0",
"hash": 5988495597861603000,
"line_mean": 25.375,
"line_max": 75,
"alpha_frac": 0.5671232877,
"autogenerated": false,
"ratio": 3.2017543859649122,... |
__author__ = 'satra'
import hashlib
import os
from uuid import uuid1
# PROV API library
import prov.model as prov
import rdflib
# create namespace references to terms used
foaf = prov.Namespace("foaf", "http://xmlns.com/foaf/0.1/")
dcterms = prov.Namespace("dcterms", "http://purl.org/dc/terms/")
fs = prov.Namespace(... | {
"repo_name": "richstoner/incf_engine",
"path": "engine/routes/utils.py",
"copies": "1",
"size": "2333",
"license": "mit",
"hash": 8463367375225870000,
"line_mean": 29.6973684211,
"line_max": 76,
"alpha_frac": 0.6060865838,
"autogenerated": false,
"ratio": 3.395924308588064,
"config_test": fals... |
__author__ = 'satra'
import hashlib
import os
import rdflib
import requests
def hash_infile(afile, crypto=hashlib.sha512, chunk_len=8192):
""" Computes hash of a file using 'crypto' module"""
hex = None
if os.path.isfile(afile):
crypto_obj = crypto()
fp = file(afile, 'rb')
while T... | {
"repo_name": "richstoner/incf_engine",
"path": "virtuoso/tovirtuoso.py",
"copies": "1",
"size": "4216",
"license": "mit",
"hash": -6133297132240352000,
"line_mean": 28.6901408451,
"line_max": 76,
"alpha_frac": 0.5915559772,
"autogenerated": false,
"ratio": 2.829530201342282,
"config_test": fal... |
__Author__ = 'Saumitra Paul Choudhury'
'''
Below code will parse the CFLOW header and exptract the tuple information
'''
import pyshark
import pdb,time,os,sys
import binascii
import struct
import socket
import csv
import argparse
class cflowParser(object):
'''
Input is pcap file (wireshark)
Parser will ... | {
"repo_name": "saumitra1978/pytools",
"path": "cflowHeaderParser.py",
"copies": "1",
"size": "7646",
"license": "unlicense",
"hash": 978079748287954200,
"line_mean": 46.4906832298,
"line_max": 140,
"alpha_frac": 0.4824744965,
"autogenerated": false,
"ratio": 4.039091389329108,
"config_test": fa... |
__author__ = 'Savion Lee'
# The purpose of the new results report is to increase readability for the
# organization admin.
import logging
import models
import webapp2
from google.appengine.ext import db
from google.appengine.api import mail
from algorithms_ import irv, cv
from webapputils import JINJA_ENV
from dateti... | {
"repo_name": "rice-apps/rice-elections",
"path": "src/models/new_results.py",
"copies": "1",
"size": "4060",
"license": "mit",
"hash": 859984350029316400,
"line_mean": 35.5765765766,
"line_max": 116,
"alpha_frac": 0.6325123153,
"autogenerated": false,
"ratio": 3.812206572769953,
"config_test":... |
#!/usr/bin/env python
""" This is a program to run the application on Flask web framework """
import requests, json, re, urllib.request
from flask_googlemaps import Map, GoogleMaps
from flask import Flask, render_template, request, jsonify, abort
from requests.packages.urllib3.exceptions import InsecureRequestWarnin... | {
"repo_name": "savithruml/LocationWebApp",
"path": "flaskApp.py",
"copies": "1",
"size": "3938",
"license": "apache-2.0",
"hash": -234625583384244770,
"line_mean": 45.3294117647,
"line_max": 198,
"alpha_frac": 0.6493143728,
"autogenerated": false,
"ratio": 3.622815087396504,
"config_test": fals... |
#!/usr/bin/env python
""" This is a program to run the flask application on Tornado Server """
import sys, re, logging
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from flaskApp import application
def runLocationApp():
""" FUNCTION TO RUN FLA... | {
"repo_name": "savithruml/LocationWebApp",
"path": "serve.py",
"copies": "1",
"size": "2029",
"license": "apache-2.0",
"hash": 4053296178798095000,
"line_mean": 42.170212766,
"line_max": 146,
"alpha_frac": 0.6781665845,
"autogenerated": false,
"ratio": 3.1215384615384614,
"config_test": false,
... |
__author__ = 'sbeltran'
from flask import Flask
from flask import jsonify
from flask import request
import serial
homeTempArray = [65, 70, 70, 70, 68, 66, 65, 63, 64, 65, 67, 68, 70, 70, 70, 71, 74, 76, 78, 78, 78, 70]
#Connect to Bluetooth Module
try:
bluetoothSerial = serial.Serial( "/dev/tty.HC-06-DevB", baudr... | {
"repo_name": "pojdrovic/Internet-Of-Things-Project",
"path": "app.py",
"copies": "1",
"size": "1552",
"license": "bsd-3-clause",
"hash": 5083777061658275000,
"line_mean": 23.25,
"line_max": 104,
"alpha_frac": 0.6765463918,
"autogenerated": false,
"ratio": 3.2951167728237793,
"config_test": fal... |
from PIL import Image
i = Image.open("input.png")
#pixel data is stored in pixels in form of two dimensional array
pixels = i.load()
width, height = i.size
j=Image.new(i.mode,i.size)
def Truncate(value):
if(value < 0):
value = 0
if(value > 255):
value = 255
return value
def Error(value):
if(valu... | {
"repo_name": "BhargavGamit/ImageManipulationAlgorithms",
"path": "ErrorDiffusionAlgo.py",
"copies": "1",
"size": "1556",
"license": "mit",
"hash": 2574497488548088000,
"line_mean": 34.3636363636,
"line_max": 154,
"alpha_frac": 0.6555269923,
"autogenerated": false,
"ratio": 2.7202797202797204,
... |
"""
First-order DAE solver
User-friendly interface to various numerical integrators for solving an
algebraic system of first order ODEs with prescribed initial conditions:
d y(t)
A * --------- = f(t,y(t)),
d t
y(t=0)[i] = y0[i],
d y(t=0)
---------- [i] = yprime0[i],
... | {
"repo_name": "logicabrity/odes",
"path": "scikits/odes/dae.py",
"copies": "1",
"size": "18778",
"license": "bsd-3-clause",
"hash": -5531273436185028000,
"line_mean": 40.5442477876,
"line_max": 111,
"alpha_frac": 0.5767387368,
"autogenerated": false,
"ratio": 4.2340473506200675,
"config_test": ... |
"""
First-order ODE solver
User-friendly interface to various numerical integrators for solving a
system of first order ODEs with prescribed initial conditions:
d y(t)
--------- = f(t,y(t)),
d t
y(t=0)[i] = y0[i],
where::
i = 0, ..., len(y0) - 1
f(t,y) is a vector of size i
class ode
-... | {
"repo_name": "logicabrity/odes",
"path": "scikits/odes/ode.py",
"copies": "1",
"size": "16040",
"license": "bsd-3-clause",
"hash": 8621217853825155000,
"line_mean": 33.2004264392,
"line_max": 163,
"alpha_frac": 0.5755610973,
"autogenerated": false,
"ratio": 4.331623008371591,
"config_test": fa... |
"""
This example shows how a preconditioned iterative linear solver
is used to solve the Newton iterations arising from the solution
of the free vibration of a simple oscillator::
m \ddot{u} + k u = 0, u(0) = u_0, \dot{u}(0) = \dot{u}_0
using the CVODE solver. The rhs function is given by \dot{u}. The
precondit... | {
"repo_name": "logicabrity/odes",
"path": "docs/src/examples/ode/simpleoscillator_prec.py",
"copies": "1",
"size": "2429",
"license": "bsd-3-clause",
"hash": -1321848365469664500,
"line_mean": 38.8196721311,
"line_max": 129,
"alpha_frac": 0.6080691643,
"autogenerated": false,
"ratio": 2.766514806... |
"""
Example to show the use of stepwise solving, using the ida or the ddaspk
solver. It also shows how a class is used to hold the problem data.
This example shows how to solve the double pendulum in full coordinate space.
This results in a dae system.
The problem is easily stated: a first pendulum must move on a cir... | {
"repo_name": "logicabrity/odes",
"path": "docs/src/examples/doublependulum.py",
"copies": "1",
"size": "21500",
"license": "bsd-3-clause",
"hash": 5794881033747203000,
"line_mean": 36.9858657244,
"line_max": 90,
"alpha_frac": 0.5356744186,
"autogenerated": false,
"ratio": 2.930752453653217,
"c... |
"""
First-order DAE solver
"""
from __future__ import print_function
integrator_info = \
"""
ddaspk
~~~~~~
Solver developed 1989 to 1996, with some corrections from 2000 - Fortran
This code solves a system of differential/algebraic equations of the form
G(t,y,y') = 0 , using a combination of Backward Differentiatio... | {
"repo_name": "logicabrity/odes",
"path": "scikits/odes/ddaspkint.py",
"copies": "1",
"size": "19475",
"license": "bsd-3-clause",
"hash": -6377243640657285000,
"line_mean": 41.3369565217,
"line_max": 101,
"alpha_frac": 0.5661617458,
"autogenerated": false,
"ratio": 3.6710650329877472,
"config_t... |
"""
First-order DAE solver
"""
from __future__ import print_function
integrator_info = \
"""
lsodi
~~~~
Solver developed during the 1980s, this is the version from 1987 - Fortran
Integrator for linearly implicit systems of first-order odes. lsodi
provides the same methods as vode (adams and bdf). This integrator
a... | {
"repo_name": "logicabrity/odes",
"path": "scikits/odes/lsodiint.py",
"copies": "1",
"size": "14028",
"license": "bsd-3-clause",
"hash": -2277397958872121300,
"line_mean": 35.1546391753,
"line_max": 99,
"alpha_frac": 0.5273025378,
"autogenerated": false,
"ratio": 3.4731369150779896,
"config_tes... |
"""
This example shows how to solve the planar pendulum in full coordinate space.
This results in a dae system with one algebraic equation.
The problem is easily stated: a pendulum must move on a circle with radius 1,
it has a mass m, and gravitational accelleration is g.
The Lagragian is L = 1/2 m (u^2 + v^2) - m g y... | {
"repo_name": "logicabrity/odes",
"path": "docs/src/examples/planarpendulum.py",
"copies": "3",
"size": "5001",
"license": "bsd-3-clause",
"hash": -8790797297734364000,
"line_mean": 27.5771428571,
"line_max": 83,
"alpha_frac": 0.6158768246,
"autogenerated": false,
"ratio": 2.6502384737678857,
"... |
"""
This example shows how to solve the planar pendulum in full coordinate space.
This results in a dae system with one algebraic equation.
The problem is easily stated: a pendulum must move on a circle with radius 1,
it has a mass m, and gravitational accelleration is g.
The Lagragian is L = 1/2 m (u^2 + v^2) - m ... | {
"repo_name": "logicabrity/odes",
"path": "docs/src/examples/ddaspk/planarpendulum_ddaspk.py",
"copies": "3",
"size": "3370",
"license": "bsd-3-clause",
"hash": 3181767372863901700,
"line_mean": 27.5593220339,
"line_max": 78,
"alpha_frac": 0.6213649852,
"autogenerated": false,
"ratio": 2.62461059... |
"""
This example shows how to solve the sliding pendulum in full coordinate space.
This results in a dae system.
The problem is easily stated:
A pendulum can slide with friction along a curve in a plane. We take the
curve
y = x^2+1/3 cos(\omega x)
There is a mass M on the top part (on the curve), and a mass m at... | {
"repo_name": "logicabrity/odes",
"path": "docs/src/examples/slidingpendulum.py",
"copies": "3",
"size": "12389",
"license": "bsd-3-clause",
"hash": 3347983910341789700,
"line_mean": 33.0357142857,
"line_max": 91,
"alpha_frac": 0.5198159658,
"autogenerated": false,
"ratio": 2.995406189555126,
"... |
"""
This example shows the most simple way of using a solver.
We solve free vibration of a simple oscillator::
m \ddot{u} + k u = 0, u(0) = u_0, \dot{u}(0) = \dot{u}_0
using the CVODE solver, which means we use a rhs function of \dot{u}.
Solution::
u(t) = u_0*cos(sqrt(k/m)*t)+\dot{u}_0*sin(sqrt(k/m)*t)... | {
"repo_name": "logicabrity/odes",
"path": "docs/src/examples/ode/simpleoscillator_jac.py",
"copies": "1",
"size": "1612",
"license": "bsd-3-clause",
"hash": 1383755680137223000,
"line_mean": 32.5833333333,
"line_max": 108,
"alpha_frac": 0.5595533499,
"autogenerated": false,
"ratio": 2.58747993579... |
"""
This example shows the most simple way of using a solver.
We solve free vibration of a simple oscillator::
m \ddot{u} + k u = 0, u(0) = u_0, \dot{u}(0) = \dot{u}_0
using the CVODE solver, which means we use a rhs function of \dot{u}.
Solution::
u(t) = u_0*cos(sqrt(k/m)*t)+\dot{u}_0*sin(sqrt(k/m)*t)/... | {
"repo_name": "logicabrity/odes",
"path": "docs/src/examples/ode/simpleoscillator_new_api.py",
"copies": "3",
"size": "1561",
"license": "bsd-3-clause",
"hash": -1703434641525067500,
"line_mean": 34.4772727273,
"line_max": 108,
"alpha_frac": 0.5752722614,
"autogenerated": false,
"ratio": 2.636824... |
"""
This example shows the most simple way of using a solver.
We solve free vibration of a simple oscillator::
m \ddot{u} + k u = 0, u(0) = u_0, \dot{u}(0) = \dot{u}_0
using the DDASPK solver, which means we use residuals.
Solution::
u(t) = u_0*cos(sqrt(k/m)*t)+\dot{u}_0*sin(sqrt(k/m)*t)/sqrt(k/m)
... | {
"repo_name": "logicabrity/odes",
"path": "docs/src/examples/ddaspk/simpleoscillator_ddaspk.py",
"copies": "3",
"size": "1634",
"license": "bsd-3-clause",
"hash": -8661581434154464000,
"line_mean": 34.5217391304,
"line_max": 108,
"alpha_frac": 0.5930232558,
"autogenerated": false,
"ratio": 2.5412... |
"""
This example shows the most simple way of using a solver.
We solve free vibration of a simple oscillator::
m \ddot{u} + k u = 0, u(0) = u_0, \dot{u}(0) = \dot{u}_0
using the IDA solver, which means we use residuals.
Solution::
u(t) = u_0*cos(sqrt(k/m)*t)+\dot{u}_0*sin(sqrt(k/m)*t)/sqrt(k/m)
"""
fro... | {
"repo_name": "logicabrity/odes",
"path": "docs/src/examples/simpleoscillator.py",
"copies": "3",
"size": "2524",
"license": "bsd-3-clause",
"hash": -7557286569144257000,
"line_mean": 36.1176470588,
"line_max": 108,
"alpha_frac": 0.5499207607,
"autogenerated": false,
"ratio": 2.702355460385439,
... |
"""
This example shows the most simple way of using a solver.
We solve free vibration of a simple oscillator::
m \ddot{u} + k u = 0, u(0) = u_0, \dot{u}(0) = \dot{u}_0
using the LSODI solver, which means we use residuals.
Solution::
u(t) = u_0*cos(sqrt(k/m)*t)+\dot{u}_0*sin(sqrt(k/m)*t)/sqrt(k/m)
... | {
"repo_name": "logicabrity/odes",
"path": "docs/src/examples/lsodi/simpleoscillator_lsodi.py",
"copies": "3",
"size": "1923",
"license": "bsd-3-clause",
"hash": -751859048244236800,
"line_mean": 33.9636363636,
"line_max": 108,
"alpha_frac": 0.5709828393,
"autogenerated": false,
"ratio": 2.564,
... |
# Creation date : 11/05/2017
# File : astro_v5.py
#a faire : crosscorrelation avec gaia, tester si ça marche bien comme il faut l extinction
# when we are talking about stars data table file, it must be a text file like a csv file, with a special character
# to separate columns and a star associated to each line
fr... | {
"repo_name": "anthonygi13/Recherche_etoiles_chaudes",
"path": "astro_v6(pas a mettre dans le rapport).py",
"copies": "1",
"size": "40152",
"license": "apache-2.0",
"hash": 3731861444603587600,
"line_mean": 48.0244200244,
"line_max": 200,
"alpha_frac": 0.625339344,
"autogenerated": false,
"ratio"... |
from pylab import *
import os
def B3V_line(g_r):
"""
Function which allow plotting the B3V line on the graph
:param x: abscissa of a point of the line
:return: ordinate of the point which abscissa is x in a graph of (u-g) as a function of (g-r)
"""
return 0.9909 * g_r - 0.8901
class Main_se... | {
"repo_name": "anthonygi13/Recherche_etoiles_chaudes",
"path": "astro_essai.py",
"copies": "1",
"size": "23591",
"license": "apache-2.0",
"hash": 3408999823943256600,
"line_mean": 43.9333333333,
"line_max": 352,
"alpha_frac": 0.5935817542,
"autogenerated": false,
"ratio": 3.111594776414721,
"co... |
import os.path as op
import pytest
import numpy as np
from scipy.io import savemat
import mne
from mne.datasets import testing
from mne.beamformer import make_lcmv, apply_lcmv, apply_lcmv_cov
from mne.beamformer.tests.test_lcmv import _get_data
from mne.utils import run_tests_if_main
data_path = testing.data_path(... | {
"repo_name": "adykstra/mne-python",
"path": "mne/beamformer/tests/test_external.py",
"copies": "1",
"size": "3730",
"license": "bsd-3-clause",
"hash": -8597083881441893000,
"line_mean": 36.6767676768,
"line_max": 78,
"alpha_frac": 0.6367292225,
"autogenerated": false,
"ratio": 3.020242914979757,... |
__author__ = 'sbrochet'
def create_config(is_mc):
"""
Create a default CRAB configuration suitable to run the framework
:return:
"""
from CRABClient.UserUtilities import config, getUsernameFromSiteDB
config = config()
config.General.workArea = 'tasks'
config.General.transferOutputs = ... | {
"repo_name": "OlivierBondu/GridIn",
"path": "python/default_crab_config.py",
"copies": "1",
"size": "1121",
"license": "mit",
"hash": 4006142353187718000,
"line_mean": 29.3243243243,
"line_max": 77,
"alpha_frac": 0.6984834969,
"autogenerated": false,
"ratio": 3.5587301587301585,
"config_test":... |
__author__ = 'Scalsol'
from PIL import Image
import numpy as np
import pytesseract
import os
rows = 100
cols = 210
dx = np.array([0, 0, -1, 1])
dy = np.array([-1, 1, 0, 0])
save_dir = "D:\\\Python\\Small_Contribution\\image"
def get_point(ncol):
global rows
for row in range(rows):
i... | {
"repo_name": "Scalsol/XMU_bkxk_Captcha",
"path": "captcha_recognition.py",
"copies": "1",
"size": "4092",
"license": "apache-2.0",
"hash": -4159805559237162500,
"line_mean": 25.8503401361,
"line_max": 97,
"alpha_frac": 0.456744868,
"autogenerated": false,
"ratio": 2.618042226487524,
"config_te... |
__author__ = 'Scalsol'
import tensorflow as tf
import captcha_recognition as cr
import processImg as pI
import numpy as np
from PIL import Image
import os
rows = 70
cols = 46
Model_dir = 'D:\\\Python\\Small_Contribution\\models'
save_dir = "D:\\\Python\\Small_Contribution\\image"
def kill_captcha(data)... | {
"repo_name": "Scalsol/XMU_bkxk_Captcha",
"path": "ocrCaptcha.py",
"copies": "1",
"size": "1478",
"license": "apache-2.0",
"hash": -2037021701639249400,
"line_mean": 26.4615384615,
"line_max": 78,
"alpha_frac": 0.5426251691,
"autogenerated": false,
"ratio": 3.092050209205021,
"config_test": fal... |
__author__ = 'scarroll'
from pygov.usda.enums import *
from pygov.usda.domain import Nutrient, Food, FoodReport
from pygov.base.client import DataGovClientBase, get_response_data
class UsdaClient(DataGovClientBase):
def __init__(self, api_gov_key):
super(UsdaClient, self).__init__('usda/', api_gov_key)
... | {
"repo_name": "skeryl/pygov",
"path": "pygov/usda/client.py",
"copies": "1",
"size": "2192",
"license": "mit",
"hash": -2059337989308391000,
"line_mean": 43.7551020408,
"line_max": 143,
"alpha_frac": 0.6747262774,
"autogenerated": false,
"ratio": 3.096045197740113,
"config_test": false,
"has_... |
__author__ = 'scarroll'
class UsdaObject(object):
def __init__(self):
pass
@staticmethod
def from_response_data(response_data):
raise NotImplemented("This method is not implemented in the base class 'UsdaObject' and must be overriden.")
class Measure(UsdaObject):
@staticmethod
... | {
"repo_name": "skeryl/pygov",
"path": "pygov/usda/domain.py",
"copies": "1",
"size": "3241",
"license": "mit",
"hash": -4199480338841959400,
"line_mean": 31.42,
"line_max": 116,
"alpha_frac": 0.5954952175,
"autogenerated": false,
"ratio": 3.641573033707865,
"config_test": false,
"has_no_keywo... |
__author__ = 'scdozier'
## Pioneer VSX Receiver Proxy Server
##
## Written by csdozier@gmail.com
##
## This code is under the terms of the GPL v3 license.
## Based on alarm server https://github.com/juggie/AlarmServer/tree/smartthings (GPL v3)
import asyncore, asynchat
import ConfigParser
import datetime
import os, s... | {
"repo_name": "csdozier/device-pioneer-vsx",
"path": "vsxproxysrvr_eiscp.py",
"copies": "1",
"size": "29268",
"license": "mit",
"hash": -26286236016618424,
"line_mean": 44.306501548,
"line_max": 186,
"alpha_frac": 0.5538472051,
"autogenerated": false,
"ratio": 3.870916545430499,
"config_test": ... |
#import library
import os
import csv
class Libmng:
def __init__(self,libname):
self.libs =[]
if libname != "":
self.file = libname+'.csv'
# with open(libname+'.csv',"a") as repo
else:
self.file = 'repo.cvs'
# with open("repo.csv","a") as r... | {
"repo_name": "turbinenreiter/ard-lib-inst",
"path": "libmng.py",
"copies": "1",
"size": "2475",
"license": "mit",
"hash": 8367679173374468000,
"line_mean": 29.1829268293,
"line_max": 74,
"alpha_frac": 0.5127272727,
"autogenerated": false,
"ratio": 3.9473684210526314,
"config_test": false,
"h... |
__author__ = 'schlitzer'
from bottle import request, response
import jsonschema
import jsonschema.exceptions
from el_aap_api.app import app
from el_aap_api.errors import InvalidBody
from el_aap_api.schemas import *
@app.get('/elaap/api/v1/permissions/_search')
def search(m_aa, m_permissions):
m_aa.require_admin(... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap_api/controllers/permissions.py",
"copies": "1",
"size": "3808",
"license": "mit",
"hash": -1851198555275094000,
"line_mean": 35.9708737864,
"line_max": 106,
"alpha_frac": 0.6953781513,
"autogenerated": false,
"ratio": 3.461818181818182,
"confi... |
__author__ = 'schlitzer'
import logging
from bottle import request, response
import jsonschema.exceptions
import pymongo.errors
import requests.packages.urllib3.exceptions
__all__ = [
'error_catcher',
'method_wrapper',
'AlreadyAuthenticatedError',
'AuthenticationError',
'BaseError',
'BasicAuthe... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap_api/errors.py",
"copies": "1",
"size": "7213",
"license": "mit",
"hash": 8102972724291837000,
"line_mean": 25.4212454212,
"line_max": 109,
"alpha_frac": 0.5447109386,
"autogenerated": false,
"ratio": 4.205830903790088,
"config_test": false,
... |
__author__ = 'schlitzer'
__all__ = [
'Connection',
'Hash',
'HyperLogLog',
'Key',
'List',
'Publish',
'Scripting',
'Set',
'SSet',
'String',
'Subscribe',
'Transaction'
]
class BaseCommand(object):
def __init__(self):
self._cluster = False
def execute(self... | {
"repo_name": "schlitzered/pyredis",
"path": "pyredis/commands.py",
"copies": "1",
"size": "50939",
"license": "mit",
"hash": 7708712526624320000,
"line_mean": 31.7792792793,
"line_max": 92,
"alpha_frac": 0.5949665286,
"autogenerated": false,
"ratio": 3.964433029807767,
"config_test": false,
... |
__author__ = 'schlitzer'
from el_aap_api.errors import *
import pymongo
class FilterMixIn(object):
@staticmethod
def _filter_boolean(query, field, selector):
if selector is None:
return
if selector in [True, 'true', 'True', '1']:
selector = True
elif selector i... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap_api/models/mixins.py",
"copies": "1",
"size": "3576",
"license": "mit",
"hash": 5822427329579392000,
"line_mean": 29.8275862069,
"line_max": 105,
"alpha_frac": 0.5492170022,
"autogenerated": false,
"ratio": 4.339805825242719,
"config_test": fa... |
__author__ = 'schlitzer'
from el_aap.app import app
@app.get('/')
def slash(m_aa, m_elproxy, dummy=None):
m_aa.check_auth()
return m_elproxy.get()
@app.get('/_cluster')
@app.get('/_cluster/')
@app.get('/_cluster/<dummy:path>')
@app.get('/_cluster/<dummy:path>/')
@app.get('/_nodes')
@app.get('/_nodes/')
@ap... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap/controllers/cluster_api.py",
"copies": "1",
"size": "1549",
"license": "mit",
"hash": 8934091123392870000,
"line_mean": 24.393442623,
"line_max": 51,
"alpha_frac": 0.6158812137,
"autogenerated": false,
"ratio": 2.666092943201377,
"config_test"... |
__author__ = 'schlitzer'
from el_aap.app import app, str_index
@app.put('/_template/<dummy>')
@app.put('/_warmer')
def admin_put(m_aa, m_elproxy, dummy=None):
m_aa.require_permission(':', '')
return m_elproxy.put()
@app.put(str_index+'/_warmer')
@app.put(str_index+'/<_type>/_warmer')
@app.put(str_index)
@a... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap/controllers/index_api.py",
"copies": "1",
"size": "2849",
"license": "mit",
"hash": 8200868604602438000,
"line_mean": 26.6601941748,
"line_max": 63,
"alpha_frac": 0.634959635,
"autogenerated": false,
"ratio": 2.5970829535095716,
"config_test":... |
__author__ = 'schlitzer'
from unittest import TestCase
from unittest.mock import Mock, patch
import jsonschema.exceptions
from el_aap_api.controllers import roles
from el_aap_api.errors import InvalidBody
class TestUnitControllerRoles(TestCase):
def setUp(self):
request_patcher = patch('el_aap_api.cont... | {
"repo_name": "schlitzered/el_aap",
"path": "tests/tests_unit/tests_el_aap_api/controllers/test_controller_roles.py",
"copies": "1",
"size": "7091",
"license": "mit",
"hash": 3731845337429309000,
"line_mean": 31.0859728507,
"line_max": 100,
"alpha_frac": 0.5880693837,
"autogenerated": false,
"rat... |
__author__ = 'schlitzer'
from unittest import TestCase
import pep3143daemon.pidfile
import _io
class TestPidFileIntegration(TestCase):
def setUp(self):
self.pidfile = "integration_pidfile.pid"
def test___init__(self):
pidfile = pep3143daemon.pidfile.PidFile(self.pidfile)
self.assertI... | {
"repo_name": "schlitzered/pep3143daemon",
"path": "test/integration/test_PidFile.py",
"copies": "1",
"size": "1244",
"license": "mit",
"hash": 7070283044164193000,
"line_mean": 33.5555555556,
"line_max": 69,
"alpha_frac": 0.6905144695,
"autogenerated": false,
"ratio": 4.092105263157895,
"confi... |
__author__ = 'schlitzer'
import datetime
import logging
import random
import string
import uuid
from bottle import request
from bson.binary import Binary, STANDARD
from passlib.hash import pbkdf2_sha512
from el_aap_api.models.mixins import FilterMixIn, ProjectionMixIn
from el_aap_api.errors import *
class Session... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap_api/models/session.py",
"copies": "1",
"size": "3821",
"license": "mit",
"hash": -4767267446249592000,
"line_mean": 37.595959596,
"line_max": 118,
"alpha_frac": 0.5870191049,
"autogenerated": false,
"ratio": 3.7169260700389106,
"config_test": ... |
__author__ = 'schlitzer'
import datetime
import logging
import random
import string
from bottle import request
import pymongo.errors
from el_aap_api.models.mixins import FilterMixIn, ProjectionMixIn
from el_aap_api.errors import *
class LostPW(FilterMixIn, ProjectionMixIn):
def __init__(self, coll):
se... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap_api/models/lostpw.py",
"copies": "1",
"size": "2343",
"license": "mit",
"hash": -7176436579051648000,
"line_mean": 34.5,
"line_max": 118,
"alpha_frac": 0.6086214255,
"autogenerated": false,
"ratio": 3.822185970636215,
"config_test": false,
"... |
__author__ = 'schlitzer'
import inspect
from bottle import PluginError
from el_aap_api.errors import ValidationError
from el_aap_api.models.aa import AuthenticationAuthorization
from el_aap_api.models.lostpw import LostPW
from el_aap_api.models.permissions import Permissions
from el_aap_api.models.roles import Roles... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap_api/models/__init__.py",
"copies": "1",
"size": "1356",
"license": "mit",
"hash": 1143613974473669600,
"line_mean": 25.5882352941,
"line_max": 105,
"alpha_frac": 0.6467551622,
"autogenerated": false,
"ratio": 3.9765395894428153,
"config_test":... |
__author__ = 'schlitzer'
import json
from bottle import request
from el_aap.app import app, str_id, str_index
@app.post('/_bulk')
@app.post(str_index+'/_bulk')
@app.post(str_index+'/<_type>/_bulk')
def post_bulk(m_aa, m_elproxy, _index=None, _type=None):
if _index:
m_aa.require_permission(':index:crud:... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap/controllers/document_api.py",
"copies": "1",
"size": "2366",
"license": "mit",
"hash": -6447854023706022000,
"line_mean": 29.3333333333,
"line_max": 74,
"alpha_frac": 0.6158072697,
"autogenerated": false,
"ratio": 2.776995305164319,
"config_te... |
__author__ = 'schlitzer'
import json
from bottle import request
from el_aap.app import app, str_index, str_id
from el_aap_api.errors import *
@app.get(str_index+'/<_type>/'+str_id+'/count')
@app.get(str_index+'/<_type>/'+str_id+'/_explain')
@app.get(str_index+'/<_type>/'+str_id+'/_percolate')
@app.get(str_index+'/... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap/controllers/search_api.py",
"copies": "1",
"size": "2898",
"license": "mit",
"hash": 1623978372932081700,
"line_mean": 30.1612903226,
"line_max": 77,
"alpha_frac": 0.621463078,
"autogenerated": false,
"ratio": 2.749525616698292,
"config_test":... |
__author__ = 'schlitzer'
import logging
import re
import threading
from bottle import request, response
from cachetools import TTLCache
from el_aap_api.errors import *
class AuthenticationAuthorization(object):
def __init__(self, users, roles, permissions):
self.cache_user_password = TTLCache(maxsize=1... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap/models/aa.py",
"copies": "1",
"size": "6783",
"license": "mit",
"hash": 3285281186001948700,
"line_mean": 44.22,
"line_max": 124,
"alpha_frac": 0.5892672859,
"autogenerated": false,
"ratio": 4.416015625,
"config_test": false,
"has_no_keyword... |
__author__ = 'schlitzer'
import logging
from bottle import request
from passlib.hash import pbkdf2_sha512
import pymongo
import pymongo.errors
from el_aap_api.models.mixins import FilterMixIn, PaginationSkipMixIn, ProjectionMixIn, SortMixIn
from el_aap_api.errors import *
class Users(FilterMixIn, PaginationSkipMix... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap_api/models/users.py",
"copies": "1",
"size": "6843",
"license": "mit",
"hash": -1249231918054969000,
"line_mean": 40.981595092,
"line_max": 116,
"alpha_frac": 0.591699547,
"autogenerated": false,
"ratio": 3.855211267605634,
"config_test": fals... |
__author__ = 'schlitzer'
import logging
from bottle import request
import pymongo
import pymongo.errors
from el_aap_api.models.mixins import FilterMixIn, PaginationSkipMixIn, ProjectionMixIn, SortMixIn
from el_aap_api.errors import *
class Permissions(FilterMixIn, PaginationSkipMixIn, ProjectionMixIn, SortMixIn):
... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap_api/models/permissions.py",
"copies": "1",
"size": "7856",
"license": "mit",
"hash": 8248475735265601000,
"line_mean": 43.1348314607,
"line_max": 122,
"alpha_frac": 0.6028513238,
"autogenerated": false,
"ratio": 3.963673057517659,
"config_test... |
__author__ = 'schlitzer'
import logging
from bottle import request
from el_aap_api.errors import *
class AuthenticationAuthorization(object):
def __init__(self, users, sessions):
self.users = users
self.sessions = sessions
self.log = logging.getLogger('el_aap')
@method_wrapper
... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap_api/models/aa.py",
"copies": "1",
"size": "2468",
"license": "mit",
"hash": 7931935313480668000,
"line_mean": 34.768115942,
"line_max": 94,
"alpha_frac": 0.6138573744,
"autogenerated": false,
"ratio": 3.9174603174603173,
"config_test": false,
... |
__author__ = 'schlitzer'
import logging
from bottle import request, response
import requests
from el_aap_api.errors import method_wrapper
class ElasticSearchProxy(object):
def __init__(self, endpoint):
self.endpoint = endpoint
self.log = logging.getLogger('el_aap')
@method_wrapper
def ... | {
"repo_name": "schlitzered/el_aap",
"path": "el_aap/models/elproxy.py",
"copies": "1",
"size": "3030",
"license": "mit",
"hash": 6127789317488393000,
"line_mean": 34.6470588235,
"line_max": 111,
"alpha_frac": 0.6099009901,
"autogenerated": false,
"ratio": 4.0239043824701195,
"config_test": fals... |
__author__ = 'schlitzer'
import re
import socket
import uuid
class ValidationError(Exception):
pass
class Base(object):
def validate(self, item):
raise NotImplementedError
class BaseNumber(Base):
def __init__(self, typenum, typename, minval, maxval):
self._typenum = typenum
se... | {
"repo_name": "schlitzered/validation",
"path": "validation/__init__.py",
"copies": "1",
"size": "10410",
"license": "mit",
"hash": 4681787605986976000,
"line_mean": 25.7609254499,
"line_max": 112,
"alpha_frac": 0.5729106628,
"autogenerated": false,
"ratio": 4.467811158798283,
"config_test": fa... |
__author__ = 'schlitzer'
import validation
user_validator = validation.Dict(ignore_unknown=False)
user_validator.required['_id'] = validation.StringUUID()
user_validator.required['name'] = validation.String()
user_validator.required['gender'] = validation.Choice(choices=['male', 'female'])
hobbies = validation.List(... | {
"repo_name": "schlitzered/validation",
"path": "validation/sample.py",
"copies": "1",
"size": "1111",
"license": "mit",
"hash": -3488294637370733600,
"line_mean": 22.1458333333,
"line_max": 81,
"alpha_frac": 0.5913591359,
"autogenerated": false,
"ratio": 2.8560411311053984,
"config_test": fals... |
__author__ = 'schlitzer'
"""
Redis Client implementation for Python 3.
Copyright (c) 2015, Stephan Schultchen.
License: MIT (see LICENSE for details)
"""
from pyredis.exceptions import *
from pyredis.client import Client, ClusterClient, HashClient, PubSubClient, SentinelClient
from pyredis.pool import ClusterPool, ... | {
"repo_name": "schlitzered/pyredis",
"path": "pyredis/__init__.py",
"copies": "1",
"size": "2480",
"license": "mit",
"hash": 3773192201845361000,
"line_mean": 26.2527472527,
"line_max": 90,
"alpha_frac": 0.5544354839,
"autogenerated": false,
"ratio": 3.757575757575758,
"config_test": false,
"... |
__author__ = 'schlitzer'
# stdlib
import codecs
import copy
import json
import json.decoder
import logging
import os
import re
import threading
import time
class Worker(threading.Thread):
def __init__(
self, file, msgqueue, tags, regex, template,
syslog_facility, syslog_tag, syslog_severit... | {
"repo_name": "schlitzered/pylogchop",
"path": "pylogchop/worker.py",
"copies": "1",
"size": "9161",
"license": "mit",
"hash": -5222755424528516000,
"line_mean": 32.0722021661,
"line_max": 120,
"alpha_frac": 0.4848815631,
"autogenerated": false,
"ratio": 4.410688493018777,
"config_test": false,... |
__author__ = 'schmatz'
from configuration import Configuration
import urllib
from dependency import Dependency
class Downloader:
def __init__(self,dependency):
assert isinstance(dependency, Dependency)
self.dependency = dependency
@property
def download_directory(self):
raise NotImpl... | {
"repo_name": "5y/codecombat",
"path": "scripts/devSetup/downloader.py",
"copies": "2",
"size": "1479",
"license": "mit",
"hash": 8751956647313280000,
"line_mean": 40.0833333333,
"line_max": 119,
"alpha_frac": 0.6646382691,
"autogenerated": false,
"ratio": 4.154494382022472,
"config_test": fals... |
__author__ = 'schoksey'
from keystone import exception
from keystone import identity
from keystone.identity.backends import sql
from keystone.identity.backends import ldap
from keystone.openstack.common import log as logging
from keystone import config
from keystone.common.ldap import core
import uuid
import re
CONF ... | {
"repo_name": "rickerc/keystone_audit",
"path": "keystone/identity/backends/hybrid.py",
"copies": "1",
"size": "5656",
"license": "apache-2.0",
"hash": 3983676155968753700,
"line_mean": 38.5524475524,
"line_max": 121,
"alpha_frac": 0.6341937765,
"autogenerated": false,
"ratio": 3.7382683410442827... |
import warnings
import os.path as op
from nose.tools import assert_raises, assert_true, assert_equal
import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal, assert_allclose
from mne import io, pick_types
from mne.utils import requires_sklearn_0_15, run_tests_if_main
from ... | {
"repo_name": "jaeilepp/mne-python",
"path": "mne/decoding/tests/test_receptive_field.py",
"copies": "1",
"size": "10750",
"license": "bsd-3-clause",
"hash": 5239918685646342000,
"line_mean": 37.9492753623,
"line_max": 79,
"alpha_frac": 0.5578604651,
"autogenerated": false,
"ratio": 3.09352517985... |
import inspect
import os
from ....externals.six.moves import cPickle as pickle
from nose.tools import assert_raises
from numpy.testing import assert_array_equal
from mne.io.kit import read_mrk
from mne.io.meas_info import _write_dig_points
from mne.utils import _TempDir
FILE = inspect.getfile(inspect.currentframe(... | {
"repo_name": "alexandrebarachant/mne-python",
"path": "mne/io/kit/tests/test_coreg.py",
"copies": "9",
"size": "1251",
"license": "bsd-3-clause",
"hash": 8557017846755626000,
"line_mean": 26.8,
"line_max": 60,
"alpha_frac": 0.6778577138,
"autogenerated": false,
"ratio": 2.9504716981132075,
"co... |
import inspect
import os
from mne.externals.six.moves import cPickle as pickle
import pytest
from numpy.testing import assert_array_equal
from mne.io.kit import read_mrk
from mne.io.meas_info import _write_dig_points
from mne.utils import _TempDir
FILE = inspect.getfile(inspect.currentframe())
parent_dir = os.path... | {
"repo_name": "teonlamont/mne-python",
"path": "mne/io/kit/tests/test_coreg.py",
"copies": "2",
"size": "1229",
"license": "bsd-3-clause",
"hash": -3808375625214575600,
"line_mean": 26.3111111111,
"line_max": 60,
"alpha_frac": 0.6769731489,
"autogenerated": false,
"ratio": 2.9331742243436754,
"... |
import inspect
import os
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from mne.io.kit import read_hsp, write_hsp, read_mrk, write_mrk
from mne.coreg import get_ras_to_neuromag_trans
from mne.transforms import apply_trans, rotation, translation
from mne.utils import _Temp... | {
"repo_name": "jaeilepp/eggie",
"path": "mne/io/kit/tests/test_coreg.py",
"copies": "2",
"size": "2240",
"license": "bsd-2-clause",
"hash": 2140507000686864400,
"line_mean": 29.2702702703,
"line_max": 78,
"alpha_frac": 0.6433035714,
"autogenerated": false,
"ratio": 2.864450127877238,
"config_te... |
import os
import os.path as op
from numpy.testing import assert_array_equal
from mne.utils import requires_mayavi, run_tests_if_main, traits_test
@requires_mayavi
@traits_test
def test_mri_model(subjects_dir_tmp):
"""Test MRIHeadWithFiducialsModel Traits Model."""
from mne.gui._fiducials_gui import MRIHead... | {
"repo_name": "pravsripad/mne-python",
"path": "mne/gui/tests/test_fiducials_gui.py",
"copies": "10",
"size": "2292",
"license": "bsd-3-clause",
"hash": 7619568732188426000,
"line_mean": 31.2816901408,
"line_max": 79,
"alpha_frac": 0.6448516579,
"autogenerated": false,
"ratio": 2.9384615384615387... |
import os
import sys
from unittest import SkipTest
import numpy as np
from numpy.testing import assert_array_equal
from mne.io.kit.tests import data_dir as kit_data_dir
from mne.io.kit import read_mrk
from mne.utils import (_TempDir, requires_mayavi, run_tests_if_main,
traits_test)
mrk_pre_pa... | {
"repo_name": "adykstra/mne-python",
"path": "mne/gui/tests/test_marker_gui.py",
"copies": "3",
"size": "2559",
"license": "bsd-3-clause",
"hash": 3583815106207708700,
"line_mean": 28.0795454545,
"line_max": 76,
"alpha_frac": 0.6787807737,
"autogenerated": false,
"ratio": 2.872053872053872,
"co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.