text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Irwan Fathurrahman <irwan@kartoza.com>'
__date__ = '16/05/17'
import json
import os
import threading
import requests
from utilities import absolute_path
import tempfile
import time
import yaml
from shapely import geometry as shapely_geometry
from shapely.ops import cascaded_union
from shapely.geometry.ge... | {
"repo_name": "meomancer/field-campaigner",
"path": "flask_project/campaign_manager/utilities.py",
"copies": "1",
"size": "8436",
"license": "bsd-3-clause",
"hash": 702980581731908100,
"line_mean": 26.4788273616,
"line_max": 77,
"alpha_frac": 0.6004030346,
"autogenerated": false,
"ratio": 3.90917... |
__author__ = 'Irwan Fathurrahman <irwan@kartoza.com>'
__date__ = '17/05/17'
import json
from campaign_manager.insights_functions._abstract_overpass_insight_function \
import AbstractOverpassInsightFunction
class FeatureAttributeCompleteness(AbstractOverpassInsightFunction):
function_name = "Feature completene... | {
"repo_name": "meomancer/field-campaigner",
"path": "flask_project/campaign_manager/insights_functions/feature_attribute_completeness.py",
"copies": "1",
"size": "5735",
"license": "bsd-3-clause",
"hash": -202850214237184000,
"line_mean": 30.8611111111,
"line_max": 78,
"alpha_frac": 0.5445510026,
"... |
__author__ = 'Irwan Fathurrahman <irwan@kartoza.com>'
__date__ = '17/05/17'
from abc import ABCMeta
from flask import render_template
from jinja2.exceptions import TemplateNotFound
class AbstractInsightsFunction(object):
"""
Abstract class insights function.
"""
__metaclass__ = ABCMeta
_function... | {
"repo_name": "meomancer/field-campaigner",
"path": "flask_project/campaign_manager/insights_functions/_abstract_insights_function.py",
"copies": "1",
"size": "5288",
"license": "bsd-3-clause",
"hash": -853152516158939900,
"line_mean": 27.8961748634,
"line_max": 73,
"alpha_frac": 0.5603252648,
"aut... |
__author__ = 'Irwan Fathurrahman <irwan@kartoza.com>'
__date__ = '17/05/17'
from app_config import Config
from datetime import datetime
from campaign_manager.insights_functions._abstract_insights_function import (
AbstractInsightsFunction
)
from campaign_manager.data_providers.osmcha_changesets_provider import (
... | {
"repo_name": "meomancer/field-campaigner",
"path": "flask_project/campaign_manager/insights_functions/osmcha_changesets.py",
"copies": "1",
"size": "4136",
"license": "bsd-3-clause",
"hash": -7443483531458829000,
"line_mean": 32.9016393443,
"line_max": 78,
"alpha_frac": 0.5053191489,
"autogenerate... |
__author__ = 'Irwan Fathurrahman <irwan@kartoza.com>'
__date__ = '17/05/17'
from campaign_manager.insights_functions._abstract_overpass_insight_function \
import AbstractOverpassInsightFunction
class CountFeature(AbstractOverpassInsightFunction):
function_name = "Number of feature in group"
# attribute ... | {
"repo_name": "meomancer/field-campaigner",
"path": "flask_project/campaign_manager/insights_functions/count_feature.py",
"copies": "1",
"size": "2663",
"license": "bsd-3-clause",
"hash": 2723900606389436000,
"line_mean": 28.2637362637,
"line_max": 78,
"alpha_frac": 0.5561396921,
"autogenerated": f... |
__author__ = 'Irwan Fathurrahman <irwan@kartoza.com>'
__date__ = '17/05/17'
import json
from abc import ABCMeta
from campaign_manager.insights_functions._abstract_insights_function import (
AbstractInsightsFunction
)
from campaign_manager.data_providers.overpass_provider import OverpassProvider
class AbstractOv... | {
"repo_name": "meomancer/field-campaigner",
"path": "flask_project/campaign_manager/insights_functions/_abstract_overpass_insight_function.py",
"copies": "1",
"size": "2354",
"license": "bsd-3-clause",
"hash": 8609747436415853000,
"line_mean": 30.3866666667,
"line_max": 78,
"alpha_frac": 0.59855565,
... |
__author__ = 'Irwan Fathurrahman <irwan@kartoza.com>'
__date__ = '17/05/17'
import json
import os
import shutil
from campaign_manager.insights_functions._abstract_insights_function import (
AbstractInsightsFunction
)
from campaign_manager.data_providers.shapefile_provider import (
ShapefileProvider
)
class U... | {
"repo_name": "meomancer/field-campaigner",
"path": "flask_project/campaign_manager/insights_functions/upload_coverage.py",
"copies": "1",
"size": "3162",
"license": "bsd-3-clause",
"hash": -4493585500458910700,
"line_mean": 27.4864864865,
"line_max": 77,
"alpha_frac": 0.5841239722,
"autogenerated"... |
__author__ = 'Irwan Fathurrahman <irwan@kartoza.com>'
__date__ = '29/05/17'
import shapefile
import struct
from campaign_manager.data_providers._abstract_data_provider import (
AbstractDataProvider
)
class ShapefileProvider(AbstractDataProvider):
"""Provider from overpass"""
@staticmethod
class Mult... | {
"repo_name": "meomancer/field-campaigner",
"path": "flask_project/campaign_manager/data_providers/shapefile_provider.py",
"copies": "1",
"size": "1712",
"license": "bsd-3-clause",
"hash": 1909930919813383400,
"line_mean": 30.7037037037,
"line_max": 74,
"alpha_frac": 0.5169392523,
"autogenerated": ... |
__author__ = 'isaacdontjelindell'
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.parsers.rst import Directive
def setup(app):
app.add_directive('reveal', RevealDirective)
app.add_node(RevealNode, html=(visit_reveal_node, depart_reveal_node))
BEGIN = """
<button... | {
"repo_name": "42cs/book",
"path": "modules/luther/sphinx/reveal/reveal.py",
"copies": "1",
"size": "1991",
"license": "mit",
"hash": 5183495767332545000,
"line_mean": 30.109375,
"line_max": 259,
"alpha_frac": 0.6398794576,
"autogenerated": false,
"ratio": 3.3518518518518516,
"config_test": fal... |
__author__ = 'Isaac Levanon'
import yql
def getHotelData(country, city):
#Define the URL to query in the Numbeo web page (by country and city)
URL = "http://www.numbeo.com/hotel-prices/city_result.jsp?country=" + country + "&city=" + city + "&displayCurrency=ILS"
#Fix the + problem
URL = URL.replace('... | {
"repo_name": "NnNHackTeam/israkotz",
"path": "IsraKotzApp/HotelSearcher.py",
"copies": "1",
"size": "1362",
"license": "mit",
"hash": 8796645793513980000,
"line_mean": 44.4333333333,
"line_max": 136,
"alpha_frac": 0.6358296623,
"autogenerated": false,
"ratio": 3.081447963800905,
"config_test":... |
__author__ = 'isaac'
import os
from examples.plankton import plankton
from pydnn import neuralnet as nn
from pydnn import preprocess as pp
from pydnn import tools
class Experiment(object):
"""
comments: like 63 except:
(1) using overlapping pools
(2) adam
(3) LearningRateDecay
results:
... | {
"repo_name": "zackriegman/pydnn",
"path": "examples/plankton/experiment.py",
"copies": "1",
"size": "268828",
"license": "mit",
"hash": -4769603127458818000,
"line_mean": 34.8869309838,
"line_max": 161,
"alpha_frac": 0.5426220483,
"autogenerated": false,
"ratio": 3.2022775732885442,
"config_te... |
__author__ = 'isaac'
import smtplib
import sys
from email.mime.text import MIMEText
import os
import numpy
from StringIO import StringIO
import datetime
import time
import yaml
def load_config(environ_variable, module_file, default_config):
default_config = os.path.join(os.path.dirname(module_file), default_conf... | {
"repo_name": "zackriegman/pydnn",
"path": "pydnn/tools.py",
"copies": "1",
"size": "10091",
"license": "mit",
"hash": 9154875982909606000,
"line_mean": 29.0357142857,
"line_max": 79,
"alpha_frac": 0.5266078684,
"autogenerated": false,
"ratio": 3.645592485549133,
"config_test": true,
"has_no_... |
import random, os, sys, time;
from boxm2_scene_adaptor import *;
from bbas_adaptor import *;
from boxm2_filtering_adaptor import *;
from glob import glob
from optparse import OptionParser
#######################################################
# handle inputs #
#############... | {
"repo_name": "mirestrepo/voxels-at-lems",
"path": "bmvc12/boxm2/compute_normals_export_objects.py",
"copies": "1",
"size": "4729",
"license": "bsd-2-clause",
"hash": 416450033705932200,
"line_mean": 42.787037037,
"line_max": 183,
"alpha_frac": 0.6043561007,
"autogenerated": false,
"ratio": 3.484... |
import random, os, sys, time, argparse;
from boxm2_scene_adaptor import *;
from boxm2_filtering_adaptor import *;
from glob import glob
#######################################################
# handle inputs #
#######################################################
parser = arg... | {
"repo_name": "mirestrepo/voxels-at-lems",
"path": "boxm2/boxm2_compute_taylor_coefficients.py",
"copies": "1",
"size": "3466",
"license": "bsd-2-clause",
"hash": -4919499796823987000,
"line_mean": 30.5090909091,
"line_max": 198,
"alpha_frac": 0.5758799769,
"autogenerated": false,
"ratio": 3.5658... |
import random, os, sys, time;
from boxm2_scene_adaptor import *;
from boxm2_filtering_adaptor import *;
from glob import glob
from optparse import OptionParser
#######################################################
# handle inputs #
#############################################... | {
"repo_name": "mirestrepo/voxels-at-lems",
"path": "boxm2/boxm2_compute_gauss_gradients.py",
"copies": "1",
"size": "4340",
"license": "bsd-2-clause",
"hash": -7641387093671413000,
"line_mean": 41.5490196078,
"line_max": 183,
"alpha_frac": 0.5997695853,
"autogenerated": false,
"ratio": 3.52558895... |
import random, os, sys, time;
from boxm2_scene_adaptor import *;
from boxm2_filtering_adaptor import *;
from glob import glob
from optparse import OptionParser
#######################################################
# handle inputs #
#########################################... | {
"repo_name": "mirestrepo/voxels-at-lems",
"path": "bmvc12/boxm2/export_scene_to_PLY.py",
"copies": "1",
"size": "2898",
"license": "bsd-2-clause",
"hash": -4627189131629988000,
"line_mean": 35.6835443038,
"line_max": 183,
"alpha_frac": 0.5769496204,
"autogenerated": false,
"ratio": 3.63613550815... |
import pymongo
import time
mongo_location = ... # ip address
mongo_db = ... # mongo db name
mongo_collection = ... # mongo collection name
query_items_to_remove = {...} # query of all items to be removed
query_next_batch = {.....} # query to find next batch of items (subset of query_items_to_remove to use batch)
next... | {
"repo_name": "itallam/mongo-remove",
"path": "mongoRemoveEmpty.py",
"copies": "1",
"size": "1246",
"license": "mit",
"hash": -1283146709346617600,
"line_mean": 30.15,
"line_max": 109,
"alpha_frac": 0.6998394864,
"autogenerated": false,
"ratio": 3.56,
"config_test": false,
"has_no_keywords": ... |
import tornado.ioloop
import tornado.web
import tornado.httpserver
import hashlib
import base64
import json
import mysql.connector as sql
dbuser = 'csse'
# Register a new user
class UserHandler(tornado.web.RequestHandler):
def set_default_headers(self):
self.set_header("Access-Control-Allow-Origin", "*")
s... | {
"repo_name": "RHIT-CSSE/SecurityClub",
"path": "csse290-server/mainserver.py",
"copies": "1",
"size": "6945",
"license": "mit",
"hash": -5060158551517450000,
"line_mean": 33.725,
"line_max": 531,
"alpha_frac": 0.6243340533,
"autogenerated": false,
"ratio": 3.4144542772861355,
"config_test": fa... |
__author__ = 'isha'
import json
import dateutil.parser
import datetime
import pytz
import re
import os
import pandas as pd
from sklearn.feature_extraction.text import TfidfTransformer
class EnronEmailParser:
'''
Parser for the emails included in the Enron E mail Dataset available at
http://bailando.sim... | {
"repo_name": "ishakaur/sandbox",
"path": "enron_email_analysis/enrondatahandling.py",
"copies": "1",
"size": "10155",
"license": "mit",
"hash": -6736091771979634000,
"line_mean": 38.3604651163,
"line_max": 159,
"alpha_frac": 0.5687838503,
"autogenerated": false,
"ratio": 4.119675456389452,
"co... |
__author__ = 'ishan'
from gi.repository import Gtk, GtkSource, Gio, GLib
from . import footer, terminal
from .file import FileChooser
from core.compile import Compile
import core
import os
class Tabs(footer.Footer, Gtk.Grid, core.Language):
"""
handles the addition and deletion of tabs in the notebook
... | {
"repo_name": "ishankhare07/multi-language-ide",
"path": "gui/bind/tabs.py",
"copies": "1",
"size": "5496",
"license": "mit",
"hash": -996927094980938000,
"line_mean": 31.1461988304,
"line_max": 105,
"alpha_frac": 0.5993449782,
"autogenerated": false,
"ratio": 3.829965156794425,
"config_test": ... |
__author__ = 'ishwartz'
import endpoints
from protorpc import messages
from protorpc import message_types
ID_RESOURCE_SETTING = endpoints.ResourceContainer(
message_types.VoidMessage,
id=messages.StringField(1),
play_list_size=messages.IntegerField(2),
enable=messages.BooleanField(3),
loc=messages... | {
"repo_name": "itielshwartz/BackendApi",
"path": "backend_types/request_types.py",
"copies": "1",
"size": "1033",
"license": "apache-2.0",
"hash": -8480286951197684000,
"line_mean": 26.9189189189,
"line_max": 50,
"alpha_frac": 0.7473378509,
"autogenerated": false,
"ratio": 3.611888111888112,
"c... |
__author__ = 'ismailsunni'
__project_name = 'TweetJaran'
__filename = 'unfollow_bot2'
__date__ = '1/16/14'
__copyright__ = 'imajimatika@gmail.com'
__doc__ = ''
#! /usr/bin/env python
# how to unfollow everyone who isn't following you
# By Jamieson Becker (Public Domain/no copyright, do what you will)
# Easy instruct... | {
"repo_name": "ismailsunni/TweetJaran",
"path": "unfollow_bot2.py",
"copies": "1",
"size": "2561",
"license": "mit",
"hash": -4865466266005338000,
"line_mean": 33.6216216216,
"line_max": 88,
"alpha_frac": 0.7165169856,
"autogenerated": false,
"ratio": 3.4146666666666667,
"config_test": false,
... |
"""
All modules in this file are implemented from the book
"Numerical Methods for Unconstrained Optimization and Nonlinear Equations" by
J.E. Dennis and Robert B. Schnabel (Only a few minor modifications are done).
First they were implemented and tested in MATLAB and then were converted to Python.
EXAMPLE CALL... | {
"repo_name": "scattering/ipeek",
"path": "server/quasinewton.py",
"copies": "1",
"size": "24266",
"license": "unlicense",
"hash": 5408931124517476000,
"line_mean": 33.6852941176,
"line_max": 126,
"alpha_frac": 0.5203577021,
"autogenerated": false,
"ratio": 3.4057543859649124,
"config_test": fa... |
__author__ = "isparks"
from lxml import etree
MEDI_NS = "{http://www.mdsol.com/ns/odm/metadata}"
ODM_NS = "{http://www.cdisc.org/ns/odm/v1.3}"
XLINK_NS = "{http://www.w3.org/1999/xlink}"
def getEnvironmentFromNameAndProtocol(studyname, protocolname):
"""
Extract environment name using studyname and protocol... | {
"repo_name": "mdsol/rwslib",
"path": "rwslib/rwsobjects.py",
"copies": "1",
"size": "21146",
"license": "mit",
"hash": -3867192176840583700,
"line_mean": 32.144200627,
"line_max": 253,
"alpha_frac": 0.5818121631,
"autogenerated": false,
"ratio": 3.7828264758497316,
"config_test": false,
"has... |
__author__ = 'isparks'
# -----------------------------------------------------------------------------------------------------------------------
# Overview
#
# local_cv is a small framework utilizing rwslib that pulls clinical view data from Rave and into a local
# (to your own machine) database where it can be querie... | {
"repo_name": "mdsol/rwslib",
"path": "rwslib/extras/local_cv.py",
"copies": "2",
"size": "8886",
"license": "mit",
"hash": 8422012186047627000,
"line_mean": 36.8127659574,
"line_max": 121,
"alpha_frac": 0.6264911096,
"autogenerated": false,
"ratio": 4.225392296718973,
"config_test": false,
"... |
__author__ = "Israel Fruchter <israel.fruchter@gmail.com>"
import sys, os
if not sys.platform == 'win32':
raise Exception("Windows-only demo")
try:
from _winclipboard_cffi import ffi, lib
except ImportError:
print 'run winclipboard_build first, then make sure the shared object is on sys.path'
sys.exi... | {
"repo_name": "lumig242/Hue-Integration-with-CDAP",
"path": "desktop/core/ext-py/cffi-1.5.2/demo/winclipboard.py",
"copies": "8",
"size": "1210",
"license": "apache-2.0",
"hash": -9157065666643052000,
"line_mean": 29.25,
"line_max": 89,
"alpha_frac": 0.6570247934,
"autogenerated": false,
"ratio":... |
__author__ = "Israel Fruchter <israel.fruchter@gmail.com>"
import sys, os
if not sys.platform == 'win32':
raise Exception("Windows-only demo")
try:
from _winclipboard_cffi import ffi, lib
except ImportError:
print 'run winclipboard_build first, then make sure the shared object is on sys.path'
... | {
"repo_name": "hipnusleo/laserjet",
"path": "resource/pypi/cffi-1.9.1/demo/winclipboard.py",
"copies": "1",
"size": "1250",
"license": "apache-2.0",
"hash": 3320687031732708000,
"line_mean": 29.25,
"line_max": 89,
"alpha_frac": 0.636,
"autogenerated": false,
"ratio": 3.6443148688046647,
"config... |
"""
Code to break subtitle dialogue
into 60 equal-length chunks per episode.
"""
from __future__ import division
import pandas as pd
from datetime import datetime
import re, os
def convert_time(time_):
new_time = datetime.strptime(time_, '%H:%M:%S,%f')
new_time = new_time.hour * 60 + new_time.minute + new_time... | {
"repo_name": "fredhohman/a-viz-of-ice-and-fire",
"path": "scripts/chunk_dialogue.py",
"copies": "1",
"size": "2178",
"license": "mit",
"hash": 8593732869247090000,
"line_mean": 39.3333333333,
"line_max": 91,
"alpha_frac": 0.6046831956,
"autogenerated": false,
"ratio": 3.2850678733031673,
"conf... |
"""
Code to break subtitle dialogue
into 60 equal-length clean slices per episode.
"""
from __future__ import division
import pandas as pd
from datetime import datetime
import re, os
import argparse
from clean_extracted_text import clean_text
def convert_time(time_):
new_time = datetime.strptime(time_, '%H:%M:%S,%... | {
"repo_name": "fredhohman/a-viz-of-ice-and-fire",
"path": "scripts/slice_clean_dialogue_general.py",
"copies": "1",
"size": "2079",
"license": "mit",
"hash": -4898169137093377000,
"line_mean": 36.8,
"line_max": 98,
"alpha_frac": 0.6151996152,
"autogenerated": false,
"ratio": 3.193548387096774,
... |
__author__ = 'itamar'
from api import facebook
import logging
class fb_logic():
@staticmethod
def validate_fb_login(_id, access_token):
try:
graph = facebook.GraphAPI(access_token)
user = graph.get_object("me")
_id_ = user['id']
if _id == _id_:
... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/engine/facebook_logic.py",
"copies": "1",
"size": "1807",
"license": "mit",
"hash": -541787233267896450,
"line_mean": 24.8142857143,
"line_max": 70,
"alpha_frac": 0.5334809076,
"autogenerated": false,
"ratio": 4.281990521327014,... |
from __future__ import unicode_literals
import webapp2
import requests
from bs4 import BeautifulSoup
import time
import codecs
import sys
# https://docs.python.org/2/howto/urllib2.html
import urllib2
from urllib import urlopen
# http://www.w3.org/TR/css3-selectors/#selectors
from models.Attendings import Attendings
imp... | {
"repo_name": "shaipeer/ATTENDER",
"path": "server/attender-mobile/EventSearch.py",
"copies": "1",
"size": "4463",
"license": "mit",
"hash": 5931064760215176000,
"line_mean": 33.0763358779,
"line_max": 128,
"alpha_frac": 0.4736724177,
"autogenerated": false,
"ratio": 4.140074211502783,
"config_... |
__author__ = 'itamar'
from google.appengine.api import users
from google.appengine.ext.webapp.util import login_required
import logging
from google.appengine.api import oauth
import webapp2
from engine.DAL import DAL
class GoogleLoginHandler(webapp2.RequestHandler):
def get(self):
firstname = self.request... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/api/google_login.py",
"copies": "1",
"size": "1432",
"license": "mit",
"hash": -5465119651024426000,
"line_mean": 30.152173913,
"line_max": 64,
"alpha_frac": 0.6131284916,
"autogenerated": false,
"ratio": 4.15072463768116,
"co... |
__author__ = 'itamar'
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remote
package = 'Hello'
class Greeting(messages.Message):
"""Greeting that stores a message."""
message = messages.StringField(1)
class GreetingCollection(messages.Message):
"""Colle... | {
"repo_name": "shaipeer/ATTENDER",
"path": "server/attender-mobile/search_endpoint.py",
"copies": "1",
"size": "1971",
"license": "mit",
"hash": 1416191889620524800,
"line_mean": 30.7903225806,
"line_max": 67,
"alpha_frac": 0.6732623034,
"autogenerated": false,
"ratio": 3.973790322580645,
"conf... |
__author__ = 'itamar'
import sys
from engine.facebook_logic import fb_logic
import logging
import webapp2
from engine.DAL import DAL
sys.path.insert(0, 'lib') #we need this line in order to make libraries imported from lib folder work properly
import requests
FACEBOOK_APP_ID = "683953828381840"
class APILoginHandl... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/api/facebook_login.py",
"copies": "1",
"size": "2389",
"license": "mit",
"hash": 1347373329102756400,
"line_mean": 31.2972972973,
"line_max": 119,
"alpha_frac": 0.5357890331,
"autogenerated": false,
"ratio": 4.198594024604569,
... |
__author__ = 'itamar'
import sys
import logging
import webapp2
from engine.DAL import DAL
from google.appengine.api import mail
import re
#for the email validation
qtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]'
dtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]'
atom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/api/user_login.py",
"copies": "1",
"size": "3431",
"license": "mit",
"hash": 7284207369559474000,
"line_mean": 35.1263157895,
"line_max": 92,
"alpha_frac": 0.5733022442,
"autogenerated": false,
"ratio": 3.479716024340771,
"con... |
__author__ = 'itamar'
import webapp2
from engine.DAL import DAL
class APIAttendeesHandler(webapp2.RequestHandler):
mydb = DAL()
def get(self):
reply = -1
received = False
eventid = self.request.get("eventid").encode('ascii', 'ignore')
token = self.request.get("token").encode('... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/api/server_attendees.py",
"copies": "1",
"size": "2030",
"license": "mit",
"hash": -531826453904059840,
"line_mean": 26.8219178082,
"line_max": 90,
"alpha_frac": 0.5201970443,
"autogenerated": false,
"ratio": 4.168377823408624,
... |
__author__ = 'itamar'
import webapp2
from engine.DAL import DAL
class APIAttendHandler(webapp2.RequestHandler):
def get(self):
received = 0
_token = self.request.get("token").encode('ascii', 'ignore')
eventid = self.request.get("eventid").encode('ascii', 'ignore')
attend_func = se... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/api/server_attend.py",
"copies": "1",
"size": "2231",
"license": "mit",
"hash": 6994523048029940000,
"line_mean": 31.347826087,
"line_max": 85,
"alpha_frac": 0.520394442,
"autogenerated": false,
"ratio": 4.209433962264151,
"co... |
__author__ = 'itamar'
import webapp2
from engine.DAL import DAL
class APICalendarHandler(webapp2.RequestHandler):
def get(self):
token = self.request.get("token").encode('ascii', 'ignore')
if token == "":
self.post(False)
else:
mydb = DAL()
try:
... | {
"repo_name": "denbedilov/ATTENDER",
"path": "server/attender-mobile/api/server_calendar.py",
"copies": "1",
"size": "1200",
"license": "mit",
"hash": 8020172213249806000,
"line_mean": 29,
"line_max": 75,
"alpha_frac": 0.5408333333,
"autogenerated": false,
"ratio": 4.040404040404041,
"config_te... |
class dstat_plugin(dstat):
"""
The CPU usage and the physical IO of postgres process.
Displays the total CPU usage (%) and the block read and writes of the postgres process in bytes (read_bytes and write_bytes) during the monitored interval
"""
def __init__(self):
self.name = 'postgres usa... | {
"repo_name": "barzan/dbseer",
"path": "middleware_old/dstat_for_server/plugins/dstat_postgres_cpu_bio.py",
"copies": "3",
"size": "3940",
"license": "apache-2.0",
"hash": 708776562141072500,
"line_mean": 44.8139534884,
"line_max": 158,
"alpha_frac": 0.578680203,
"autogenerated": false,
"ratio": ... |
### For more information, see:
### http://eaglet.rain.com/rick/linux/schedstat/
class dstat_plugin(dstat):
"""
Name and average amount of CPU time consumed in milliseconds of the process
that has the highest average amount of cputime for the different slices for
the measured timeframe.
On a s... | {
"repo_name": "dongyoungy/dbseer_middleware",
"path": "rs-sysmon2/plugins/dstat_top_cputime_avg.py",
"copies": "1",
"size": "2581",
"license": "apache-2.0",
"hash": 7514368222702300000,
"line_mean": 33.4133333333,
"line_max": 162,
"alpha_frac": 0.5253777606,
"autogenerated": false,
"ratio": 3.525... |
### For more information, see:
### http://eaglet.rain.com/rick/linux/schedstat/
class dstat_plugin(dstat):
"""
Name and total amount of CPU time consumed in milliseconds of the process
that has the highest total amount of cputime for the measured timeframe.
On a system with one CPU and one core, ... | {
"repo_name": "dongyoungy/dbseer_middleware",
"path": "rs-sysmon2/plugins/dstat_top_cputime.py",
"copies": "1",
"size": "2340",
"license": "apache-2.0",
"hash": 635440012001549000,
"line_mean": 31.9577464789,
"line_max": 126,
"alpha_frac": 0.5273504274,
"autogenerated": false,
"ratio": 3.56707317... |
class dstat_plugin(dstat):
"""
Most expensive CPU process.
Displays the process that uses the CPU the most during the monitored
interval. The value displayed is the percentage of CPU time for the total
amount of CPU processing power. Based on per process CPU information.
"""
def __init__(s... | {
"repo_name": "barzan/dbseer",
"path": "middleware_old/rs-sysmon2/plugins/dstat_top_mem.py",
"copies": "3",
"size": "1478",
"license": "apache-2.0",
"hash": 4753548388509218000,
"line_mean": 31.8444444444,
"line_max": 135,
"alpha_frac": 0.5338294993,
"autogenerated": false,
"ratio": 3.53588516746... |
class dstat_plugin(dstat):
"""
Top process with highest total latency.
Displays name and total amount of CPU time waited in milliseconds of
the process that has the highest total amount waited for the measured
timeframe.
For more information see:
http://eaglet.rain.com/rick/linux/sch... | {
"repo_name": "SpamapS/dstat-plugins",
"path": "dstat_plugins/plugins/dstat_top_latency.py",
"copies": "4",
"size": "2299",
"license": "apache-2.0",
"hash": 7608429617049608000,
"line_mean": 30.9305555556,
"line_max": 126,
"alpha_frac": 0.5245759026,
"autogenerated": false,
"ratio": 3.60910518053... |
class dstat_plugin(dstat):
"""
Most expensive CPU process.
Displays the mysql process that uses the CPU the most during the monitored
interval. The value displayed is the percentage of CPU time for the total
amount of CPU processing power. Based on per process CPU information.
"""
def __in... | {
"repo_name": "barzan/dbseer",
"path": "middleware_old/dstat_for_server/plugins/dstat_top_mysql_cpu.py",
"copies": "3",
"size": "2167",
"license": "apache-2.0",
"hash": 2735177491472193500,
"line_mean": 32.3384615385,
"line_max": 121,
"alpha_frac": 0.5200738348,
"autogenerated": false,
"ratio": 3... |
class dstat_plugin(dstat):
"""
Most expensive CPU process.
Displays the process that uses the CPU the most during the monitored
interval. The value displayed is the percentage of CPU time for the total
amount of CPU processing power. Based on per process CPU information.
"""
def __init__(s... | {
"repo_name": "barzan/dbseer",
"path": "middleware_old/dstat_for_server/plugins/dstat_top_cpu.py",
"copies": "3",
"size": "1969",
"license": "apache-2.0",
"hash": -3448582849846896600,
"line_mean": 31.8166666667,
"line_max": 134,
"alpha_frac": 0.5200609446,
"autogenerated": false,
"ratio": 3.4363... |
""" authority views
"""
from datetime import datetime
import os, time, sys
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType
from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.core.urlresol... | {
"repo_name": "CCLab/sezam",
"path": "apps/authority/views.py",
"copies": "1",
"size": "19276",
"license": "bsd-3-clause",
"hash": 3880797597204036600,
"line_mean": 36.6484375,
"line_max": 94,
"alpha_frac": 0.5929134675,
"autogenerated": false,
"ratio": 4.3055617601072145,
"config_test": false,... |
__author__ = "Ivan -DrSlump- Montes"
__email__ = "drslump@pollinimini.net"
__license__ = "MIT"
import os
class Dumper(object):
""" Dumps a value when the equality comparison is triggered
"""
UNSET_VALUE = {}
REPORTER = lambda x: os.sys.stdout.write(x + os.linesep)
def __init__(self, value=UNSET... | {
"repo_name": "drslump/pyshould",
"path": "pyshould/dumper.py",
"copies": "1",
"size": "1125",
"license": "mit",
"hash": 6508349286712625000,
"line_mean": 25.7857142857,
"line_max": 79,
"alpha_frac": 0.5831111111,
"autogenerated": false,
"ratio": 3.594249201277955,
"config_test": false,
"has_... |
__author__ = "Ivan Infante and Felipe Zapata"
import numpy as np
import os
import pyparsing as pa
from nac.common import (hbar, h2ev, r2meV, fs_to_cm)
from scipy.optimize import curve_fit
def autocorrelate(f):
"""
Compute and returns the un-normalized and normalized autocorrelation
of given function
... | {
"repo_name": "felipeZ/nonAdiabaticCoupling",
"path": "nac/analysis/tools.py",
"copies": "1",
"size": "5222",
"license": "mit",
"hash": 8250608358141416000,
"line_mean": 32.9090909091,
"line_max": 82,
"alpha_frac": 0.6315587897,
"autogenerated": false,
"ratio": 3.155287009063444,
"config_test":... |
__author__ = 'Ivan Mahonin'
from gettext import gettext as _
from argparse import ArgumentParser
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import parse_qs
from urllib.parse import unquote
from urllib.parse import urlparse
import os.path
import json
from renderchan.core import Render... | {
"repo_name": "morevnaproject/RenderChan",
"path": "renderchan/httpserver.py",
"copies": "2",
"size": "4162",
"license": "bsd-3-clause",
"hash": -1991866624910789600,
"line_mean": 37.537037037,
"line_max": 146,
"alpha_frac": 0.5965881788,
"autogenerated": false,
"ratio": 4.04863813229572,
"conf... |
__author__ = 'Ivan Mahonin'
from gettext import gettext as _
from argparse import ArgumentParser
from renderchan.core import RenderChan
from renderchan.utils import ini_wrapper
import os
import subprocess
import math
import configparser
class Thumbnailer:
def __init__(self):
self.srcdir = os.path.abspath... | {
"repo_name": "scribblemaniac/RenderChan",
"path": "renderchan/thumbnailer.py",
"copies": "2",
"size": "21264",
"license": "bsd-3-clause",
"hash": -4905574464898055000,
"line_mean": 41.6132264529,
"line_max": 141,
"alpha_frac": 0.5489089541,
"autogenerated": false,
"ratio": 3.9619899385131356,
... |
__author__ = 'Ivan'
import abc
import os
import cv2
import numpy as np
import glob
class Dataset(object):
"""Tracking dataset class"""
__metaclass__ = abc.ABCMeta
def __init__(self, root_folder = None, image_format = 'jpg'):
"""Constructor for Dataset"""
self.root_folder = root_folder
... | {
"repo_name": "ibogun/DeepAntrack",
"path": "python/Tracker_wrapper/Dataset.py",
"copies": "1",
"size": "4425",
"license": "mit",
"hash": 7039087054947310000,
"line_mean": 31.299270073,
"line_max": 131,
"alpha_frac": 0.5746892655,
"autogenerated": false,
"ratio": 3.702928870292887,
"config_test... |
__author__ = 'Ivan'
import glob
import cPickle
import datetime
import os
import re
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
# import seaborn as sns
class AllExperiments(object):
""""""
def load(self, results_path, datasetType, trackerLabel):
... | {
"repo_name": "ibogun/DeepAntrack",
"path": "python/Evaluation/DatasetEvaluation.py",
"copies": "1",
"size": "17795",
"license": "mit",
"hash": 3967240927230921000,
"line_mean": 27.4265175719,
"line_max": 118,
"alpha_frac": 0.5467828042,
"autogenerated": false,
"ratio": 3.674375387156721,
"conf... |
__author__ = 'Ivan'
import objectness_python
import tracker_python
from Dataset import VOT2015Dataset
import numpy as np
import matplotlib.pyplot as plt
import cv2
from matplotlib import gridspec
import re
import os
import time
import math
import copy
class ObjectnessVizualizer(object):
"""Class to perform objectn... | {
"repo_name": "ibogun/DeepAntrack",
"path": "python/Tracker_wrapper/ObjectnessVisualizer.py",
"copies": "1",
"size": "22373",
"license": "mit",
"hash": 1693913847028760000,
"line_mean": 31.7105263158,
"line_max": 116,
"alpha_frac": 0.5205828454,
"autogenerated": false,
"ratio": 3.296934865900383,... |
__author__ = 'Ivan'
import sys
from DatasetEvaluation import Dataset, loadPickle, Evaluator
from generatePythonFilePickle import AllExperiments
from VisualizeExperiment import VisualizeExperiment
import cPickle
import cv2
import copy
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.patches as mpat... | {
"repo_name": "ibogun/DeepAntrack",
"path": "python/Evaluation/VisualizeAllExperiments.py",
"copies": "1",
"size": "16472",
"license": "mit",
"hash": -6554054339398856000,
"line_mean": 27.5989583333,
"line_max": 150,
"alpha_frac": 0.5520276833,
"autogenerated": false,
"ratio": 3.5129025378545533,... |
__author__ = 'Ivan'
import sys
import cv2
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.patches as mpatches
from matplotlib import gridspec
from matplotlib.widgets import Slider, Button
from DatasetEvaluation import Dataset,loadPickle,Evaluator
class VisualizeExperiment(object):
"""Visual... | {
"repo_name": "ibogun/DeepAntrack",
"path": "python/Evaluation/VisualizeExperiment.py",
"copies": "1",
"size": "15848",
"license": "mit",
"hash": 1065299707146422400,
"line_mean": 29.0170454545,
"line_max": 121,
"alpha_frac": 0.521138314,
"autogenerated": false,
"ratio": 3.4422241529105126,
"co... |
__author__ = 'Ivan'
import traceback
import sys, getopt,os
from DatasetEvaluation import Experiment,savePickle,AllExperiments
import glob
import numpy as np
def generatePickleFromCommandLine(results_path,datasetType,trackerLabel,picklePathPrefix='./Runs/'):
run= AllExperiments()
run.load(results_path,dataset... | {
"repo_name": "ibogun/DeepAntrack",
"path": "python/Evaluation/generatePythonFilePickle.py",
"copies": "1",
"size": "1267",
"license": "mit",
"hash": 2014837533529921500,
"line_mean": 27.7954545455,
"line_max": 113,
"alpha_frac": 0.681925809,
"autogenerated": false,
"ratio": 3.726470588235294,
... |
__author__ = 'Ivan'
from BeautifulSoup import BeautifulSoup
from pylatex import Document, Table
def parseRow(row):
rowHead=row.th.text;
measurements=list();
measurements.append(rowHead)
for r,idx in zip(row,range(0,len(row))):
if idx>1:
#print unicode(r.string)
s=r.... | {
"repo_name": "ibogun/DeepAntrack",
"path": "python/Evaluation/vot2014Table.py",
"copies": "1",
"size": "6961",
"license": "mit",
"hash": -4920242785288103000,
"line_mean": 21.8229508197,
"line_max": 109,
"alpha_frac": 0.547622468,
"autogenerated": false,
"ratio": 3.3084600760456273,
"config_te... |
__author__ = 'Ivan'
from DatasetEvaluation import Dataset, loadPickle, AllExperiments, Evaluator, savePickle
from DatasetEvaluationAllExperiments import Evaluated,EvaluatorAllExperiments
import glob
import matplotlib.pyplot as plt
import numpy as np
import re
class PaperPlots(object):
""""""
def __init_... | {
"repo_name": "ibogun/DeepAntrack",
"path": "python/Evaluation/paperPlots.py",
"copies": "1",
"size": "11844",
"license": "mit",
"hash": -7753382006755688000,
"line_mean": 25.7358916479,
"line_max": 127,
"alpha_frac": 0.5991219183,
"autogenerated": false,
"ratio": 3.8157216494845363,
"config_te... |
__author__ = 'Ivan'
import numpy as np
from scipy import io
import glob
import re
from DatasetEvaluation import Experiment,AllExperiments,savePickle
class MatLoader(object):
def __init__(self,datasetType,trackerName):
self.datasetType=datasetType
self.trackerName= trackerName
self.allExp... | {
"repo_name": "ibogun/DeepAntrack",
"path": "python/Evaluation/ConvertMatlabFilesToPickles.py",
"copies": "1",
"size": "3195",
"license": "mit",
"hash": -8944277435039489000,
"line_mean": 23.030075188,
"line_max": 132,
"alpha_frac": 0.5821596244,
"autogenerated": false,
"ratio": 3.944444444444444... |
__author__ = 'Ivan'
import struck_tracker
import cv2
import matplotlib.pylab as plt
import glob
import numpy as np
import copy
import os
def showImage(I):
cv2.imshow("",I)
cv2.waitKey()
def showMatrix(I):
plt.matshow(I, fignum=100, cmap=plt.cm.gray)
plt.show()
def showImageAndBox(I, box, color=(225... | {
"repo_name": "ibogun/DeepAntrack",
"path": "python/Tracker_wrapper/GenerateTracks.py",
"copies": "1",
"size": "3678",
"license": "mit",
"hash": 3788607242681812000,
"line_mean": 30.7068965517,
"line_max": 95,
"alpha_frac": 0.4747145188,
"autogenerated": false,
"ratio": 3.456766917293233,
"conf... |
__author__ = 'ivan.shynkarenka'
import base64
import datetime
import gzip
import hashlib
import hmac
import http.client
import io
import json
import ssl
import urllib.parse
import zlib
class TickTraderWebClient:
def __init__(self, web_api_address, web_api_id=None, web_api_key=None, web_api_secret=None):
... | {
"repo_name": "SoftFx/TTWebClient-Python",
"path": "TTWebClient/TickTraderWebClient.py",
"copies": "1",
"size": "26660",
"license": "mit",
"hash": 181712963241049100,
"line_mean": 42.4201954397,
"line_max": 133,
"alpha_frac": 0.6229557389,
"autogenerated": false,
"ratio": 4.130131680867544,
"co... |
__author__ = 'ivan.v.polyakov'
from datetime import date, datetime, timedelta
import argparse
import requests
import random
if __name__ != "__main__":
exit(10)
parser = argparse.ArgumentParser(description = "Tool for routine operations over ElasticSearch indices")
parser.add_argument("-i", "--index", ... | {
"repo_name": "arshvin/scripts",
"path": "elastic_search/index-operations.py",
"copies": "1",
"size": "5509",
"license": "apache-2.0",
"hash": -8837669944757982000,
"line_mean": 40.3923076923,
"line_max": 147,
"alpha_frac": 0.6146306045,
"autogenerated": false,
"ratio": 3.714767363452461,
"conf... |
__author__ = 'ivan.v.polyakov'
import re
import os, os.path
from datetime import datetime
import argparse
parser = argparse.ArgumentParser(description="Maven's repo cleaner of artifacts with git-hash")
parser.add_argument("-p", "--repo-path", metavar="PATH", dest="path", action="store", required=True, type = ... | {
"repo_name": "arshvin/scripts",
"path": "mvn_cleaner/mvn-hash-cleaner.py",
"copies": "1",
"size": "5629",
"license": "apache-2.0",
"hash": 6795627852932414000,
"line_mean": 41.3153846154,
"line_max": 171,
"alpha_frac": 0.5567596376,
"autogenerated": false,
"ratio": 3.7956844234659473,
"config_... |
__author__ = 'ivany'
from datetime import datetime
from app import db
from sqlalchemy import desc
from flask.ext.login import UserMixin
class User:
id = 0
name = ''
emai = ''
class Member(UserMixin, db.Model):
__tablename__ = 'tb_member'
tm_id = db.Column(db.BigInteger, primary_key=True)
tm_n... | {
"repo_name": "yangpeng515/blog",
"path": "app/models.py",
"copies": "1",
"size": "3523",
"license": "mit",
"hash": 6091053674799356000,
"line_mean": 31.9252336449,
"line_max": 120,
"alpha_frac": 0.6111268805,
"autogenerated": false,
"ratio": 3.159641255605381,
"config_test": false,
"has_no_k... |
__author__ = 'IVMIT KFU: Gataullin Ravil & Veselovkiy Sergei'
def windows_intersection(window1, window2):
left = max(window1[0], window2[0])
right = min(window1[0]+window1[2], window2[0]+window2[2])
up = max(window1[1], window2[1])
down = min(window1[1]+window1[3], window2[1]+window2[3])
if right >... | {
"repo_name": "SAVeselovskiy/KFU_Visual_Tracking",
"path": "Tracking/integration.py",
"copies": "1",
"size": "3378",
"license": "mit",
"hash": 5117452596321891000,
"line_mean": 47.9710144928,
"line_max": 127,
"alpha_frac": 0.5476613381,
"autogenerated": false,
"ratio": 4.528150134048257,
"confi... |
__author__ = 'IVMIT KFU: Gataullin Ravil & Veselovkiy Sergei'
import cv2
import numpy as np
def add_gaussian_noise(bounding_box, mean, sigma):
if bounding_box is not None:
return bounding_box + np.random.normal(mean, sigma, bounding_box.shape)
else:
return None
class LearningComponent:
d... | {
"repo_name": "SAVeselovskiy/KFU_Visual_Tracking",
"path": "Tracking/learning.py",
"copies": "1",
"size": "7618",
"license": "mit",
"hash": 6282877292768262000,
"line_mean": 39.5265957447,
"line_max": 176,
"alpha_frac": 0.5811236545,
"autogenerated": false,
"ratio": 3.518706697459584,
"config_t... |
__author__ = 'IVMIT KFU: Gataullin Ravil & Veselovkiy Sergei'
import cv2
class Position:
def __init__(self, buffer, x, y, width, height):
self.buffer = buffer
self.x = x
self.y = y
self.width = width
self.height = height
self.patch = None
def update(self, x=Non... | {
"repo_name": "SAVeselovskiy/KFU_Visual_Tracking",
"path": "Tracking/structure.py",
"copies": "1",
"size": "2035",
"license": "mit",
"hash": 1005152644774314500,
"line_mean": 28.9264705882,
"line_max": 184,
"alpha_frac": 0.5656019656,
"autogenerated": false,
"ratio": 3.5764499121265376,
"config... |
"""
Library for replicating the results in my Master's Thesis titled
Set Reconciliation
by Ivo Kubjas, University of Tartu
"""
import networkx as nx
import random
import pylab
import math
import matplotlib.backends.backend_pdf
# Graph related function
def random_connected_graph(n, e, d... | {
"repo_name": "ivokub/netmatching",
"path": "graphs.py",
"copies": "1",
"size": "13417",
"license": "bsd-2-clause",
"hash": -3171328292969487000,
"line_mean": 32.0467980296,
"line_max": 79,
"alpha_frac": 0.5359618395,
"autogenerated": false,
"ratio": 3.706353591160221,
"config_test": false,
"... |
__author__ = 'ivo'
import argparse
import logging
from blackswan import config
_log = logging.getLogger(__name__)
def list_modules(args):
from blackswan import modules
for name,cls in config.modules.items():
print("{} {}".format(name.ljust(20, " "), cls.description))
pass
def display_module(arg... | {
"repo_name": "3ev0/android-whitelist",
"path": "blackswan/cli.py",
"copies": "1",
"size": "1886",
"license": "apache-2.0",
"hash": -5080725254325915000,
"line_mean": 30.45,
"line_max": 113,
"alpha_frac": 0.67126193,
"autogenerated": false,
"ratio": 3.4416058394160585,
"config_test": false,
"... |
__author__ = 'ivo'
import flask_wtf
import wtforms
class AddDomainForm(flask_wtf.Form):
domain_names = wtforms.TextAreaField("Domains/IPs", validators=[wtforms.validators.DataRequired()],
description="Multiple domains/ips can be added separated by whitespace, newline or co... | {
"repo_name": "3ev0/dns-monitor",
"path": "dnsmon/webapp/forms.py",
"copies": "1",
"size": "1154",
"license": "apache-2.0",
"hash": -8106198642493684000,
"line_mean": 63.1666666667,
"line_max": 166,
"alpha_frac": 0.7305025997,
"autogenerated": false,
"ratio": 4.322097378277154,
"config_test": f... |
__author__ = 'ivo'
import logging
import os
import os.path
import sqlalchemy as sqla
from sqlalchemy.ext import declarative
from sqlalchemy import Date, Column,Integer, String, create_engine, Boolean, ForeignKey
from sqlalchemy.orm import sessionmaker, scoped_session, relationship
_log = logging.getLogger(__name__)
... | {
"repo_name": "3ev0/android-whitelist",
"path": "blackswan/core/database.py",
"copies": "1",
"size": "3570",
"license": "apache-2.0",
"hash": -1690644848747421400,
"line_mean": 32.0555555556,
"line_max": 111,
"alpha_frac": 0.6450980392,
"autogenerated": false,
"ratio": 3.5172413793103448,
"conf... |
__author__ = 'ivo'
import logging
import os.path
import datetime
import binascii
from blackswan.core import modularity,database
from blackswan.core.database import MetaFile
from blackswan import config
from blackswan.support import sanity, progressbar
import plyvel
_log = logging.getLogger(__name__)
class LdbHashF... | {
"repo_name": "3ev0/android-whitelist",
"path": "blackswan/modules/ldb_hashfilter.py",
"copies": "1",
"size": "2422",
"license": "apache-2.0",
"hash": -1768744801129558800,
"line_mean": 33.1267605634,
"line_max": 139,
"alpha_frac": 0.6333608588,
"autogenerated": false,
"ratio": 3.664145234493192,... |
__author__ = 'ivo'
import logging
import os.path
import datetime
from sqlalchemy import or_
from blackswan.core import modularity,database
from blackswan.core.database import MetaFile
from blackswan import config
from blackswan.modules import explore
from blackswan.support import sanity, progressbar
_log = logging.... | {
"repo_name": "3ev0/android-whitelist",
"path": "blackswan/modules/hashfilter.py",
"copies": "1",
"size": "3231",
"license": "apache-2.0",
"hash": -5562788674185376000,
"line_mean": 34.1304347826,
"line_max": 162,
"alpha_frac": 0.6295264624,
"autogenerated": false,
"ratio": 3.6883561643835616,
... |
__author__ = 'ivo'
import os
import struct
import subprocess
import logging
_log = logging.getLogger(__name__)
def fstype(filepath):
if is_yaffs_image(filepath):
return "yaffs"
elif is_ext4(filepath):
return "ext4"
elif is_sparseext4(filepath):
return "sparse"
else:
re... | {
"repo_name": "3ev0/toolshed",
"path": "android/filesystem.py",
"copies": "1",
"size": "5821",
"license": "apache-2.0",
"hash": -4017605522136127000,
"line_mean": 34.2848484848,
"line_max": 116,
"alpha_frac": 0.6311630304,
"autogenerated": false,
"ratio": 3.6132836747361887,
"config_test": fals... |
__author__ = 'ivo'
import os
import struct
import subprocess
import logging
_log = logging.getLogger(__name__)
def is_yaffs_image(filepath):
"""
According to yaffs2 yaffs_guts.c source code:
struct yaffs_obj_hdr {
enum yaffs_obj_type type; <-- This can be an int value between 0 and 4 (likely 3)
... | {
"repo_name": "3ev0/android-whitelist",
"path": "blackswan/support/mounting.py",
"copies": "1",
"size": "3812",
"license": "apache-2.0",
"hash": 1539358003578085000,
"line_mean": 36.3823529412,
"line_max": 116,
"alpha_frac": 0.6201469045,
"autogenerated": false,
"ratio": 3.4749316317228804,
"co... |
__author__ = 'ivo'
import sys
import os
import math
class Progressbar(object):
'''
Represents a simple progressbar.
Works only on linux systems.
'''
def __init__(self, total, description, unit="MB", outstream=sys.stdout):
'''
Constructor
'''
self.total = total
... | {
"repo_name": "3ev0/android-whitelist",
"path": "blackswan/support/progressbar.py",
"copies": "1",
"size": "1685",
"license": "apache-2.0",
"hash": 4393214599239549400,
"line_mean": 28.5789473684,
"line_max": 155,
"alpha_frac": 0.5169139466,
"autogenerated": false,
"ratio": 3.5399159663865545,
... |
__author__ = 'ivo'
"""
Copyright (C) 2010 The Android Open Source Project
Script for converting Google Android sparse ext4 image files to regular ext4 image file.
This code is copied and rewritten from Google code.
"""
import argparse
import logging
import struct
import os
_log = logging.getLogger()
class SparseH... | {
"repo_name": "3ev0/toolshed",
"path": "android/simg2img.py",
"copies": "1",
"size": "10235",
"license": "apache-2.0",
"hash": 3345003880444952000,
"line_mean": 42.1898734177,
"line_max": 121,
"alpha_frac": 0.672789448,
"autogenerated": false,
"ratio": 2.530284301606922,
"config_test": false,
... |
__author__ = 'ivo'
"""
Script to build a hash list of files in AOSP Nexus Android file system images.
The file system images are downloaded from the AOSP internet sources. Each archive file is than unpacked and
all relevant images inside (system.img, boot.img, userdata.img, recovery.img) are mounted/unpacked and trave... | {
"repo_name": "3ev0/toolshed",
"path": "android/build_aosp_hashlist.py",
"copies": "1",
"size": "9037",
"license": "apache-2.0",
"hash": -2151679067107580700,
"line_mean": 39.8959276018,
"line_max": 168,
"alpha_frac": 0.6264246985,
"autogenerated": false,
"ratio": 3.5013560635412633,
"config_te... |
__author__ = 'iwanglian'
from PIL import Image
import os, sys
if __name__ == '__main__':
####### add size here ######
shot_sizes = {"35": (640, 960), "40": (640, 1136), "47": (750, 1334), "55": (1242, 2208)}
icon_names = ["Icon.png", "Icon@2x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-60@2x.png", "Icon-... | {
"repo_name": "iwanglian/tools",
"path": "crop4appstore.py",
"copies": "1",
"size": "2747",
"license": "mit",
"hash": -7415505907218797000,
"line_mean": 39.3970588235,
"line_max": 110,
"alpha_frac": 0.428467419,
"autogenerated": false,
"ratio": 3.8365921787709496,
"config_test": false,
"has_n... |
import json
import logging
from datetime import datetime
import requests
from pyOutlook.core.contact import Contact
from pyOutlook.core.message import Message
from pyOutlook.core.folder import Folder
from pyOutlook.internal.utils import check_response
log = logging.getLogger('pyOutlook')
__all__ = ['OutlookAccount'... | {
"repo_name": "JensAstrup/pyOutlook",
"path": "pyOutlook/core/main.py",
"copies": "1",
"size": "10774",
"license": "mit",
"hash": 9071062459293570000,
"line_mean": 36.6713286713,
"line_max": 120,
"alpha_frac": 0.6314275107,
"autogenerated": false,
"ratio": 4.053423626787058,
"config_test": fals... |
"""Authorization decorators used to enforce login for the beardo dashboard.
"""
# stdlib imports
import logging
# third-party imports
import webapp2
from google.appengine.api import users as aeusers
from nacelle.conf import settings
# local imports
from app.models import users
# default routes used for redirection ... | {
"repo_name": "paddycarey/beardo-control",
"path": "app/app/utils/decorators.py",
"copies": "1",
"size": "2586",
"license": "mit",
"hash": -1542431336248458200,
"line_mean": 34.9166666667,
"line_max": 113,
"alpha_frac": 0.6844547564,
"autogenerated": false,
"ratio": 3.990740740740741,
"config_t... |
"""Authorization example."""
from flask import Flask
from flask_apscheduler import APScheduler
from flask_apscheduler.auth import HTTPBasicAuth
class Config:
"""App configuration."""
JOBS = [
{
"id": "job1",
"func": "__main__:job1",
"args": (1, 2),
"t... | {
"repo_name": "viniciuschiele/flask-apscheduler",
"path": "examples/auth.py",
"copies": "1",
"size": "1065",
"license": "apache-2.0",
"hash": -4446758021124242000,
"line_mean": 20.3,
"line_max": 74,
"alpha_frac": 0.5680751174,
"autogenerated": false,
"ratio": 3.6724137931034484,
"config_test": ... |
AUTHORIZATION_FAILED = 5 # Invalid access token
class VkError(Exception):
pass
class VkAuthError(VkError):
def __init__(self, data):
super().__init__()
self.string = data['error_description']
def __str__(self):
return self.string
class VkAPIError(VkError):
CAPTCHA_NEEDE... | {
"repo_name": "sakost/vkAPI",
"path": "vkAPI/exceptions.py",
"copies": "1",
"size": "1196",
"license": "apache-2.0",
"hash": 3815611728299057700,
"line_mean": 27.4761904762,
"line_max": 89,
"alpha_frac": 0.5819397993,
"autogenerated": false,
"ratio": 3.7027863777089784,
"config_test": false,
... |
"""Authorization for Treadmill API."""
from __future__ import absolute_import
import logging
import importlib
import decorator
_LOGGER = logging.getLogger(__name__)
class AuthorizationError(Exception):
"""Authorization error."""
def __init__(self, annotations):
self.annotations = annotations
... | {
"repo_name": "toenuff/treadmill",
"path": "lib/python/treadmill/authz.py",
"copies": "1",
"size": "2359",
"license": "apache-2.0",
"hash": -4020732461540682000,
"line_mean": 27.421686747,
"line_max": 79,
"alpha_frac": 0.6074607885,
"autogenerated": false,
"ratio": 4.304744525547445,
"config_te... |
"""Authorization for Treadmill API.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import decorator
# Disable E0611: No 'name' in module
from treadmill import restclient
_LOGGER = logging.getLog... | {
"repo_name": "captiosus/treadmill",
"path": "treadmill/authz.py",
"copies": "1",
"size": "3120",
"license": "apache-2.0",
"hash": 8543149937019637000,
"line_mean": 27.623853211,
"line_max": 79,
"alpha_frac": 0.5727564103,
"autogenerated": false,
"ratio": 4.233378561736771,
"config_test": false... |
"""Authorization for Treadmill API."""
import logging
import decorator
# Disable E0611: No 'name' in module
from treadmill import restclient
_LOGGER = logging.getLogger(__name__)
class AuthorizationError(Exception):
"""Authorization error."""
def __init__(self, annotations):
self.annotations = a... | {
"repo_name": "ThoughtWorksInc/treadmill",
"path": "treadmill/authz.py",
"copies": "3",
"size": "2970",
"license": "apache-2.0",
"hash": 87935428514286540,
"line_mean": 27.5576923077,
"line_max": 79,
"alpha_frac": 0.5632996633,
"autogenerated": false,
"ratio": 4.242857142857143,
"config_test": ... |
from pkg_resources import EntryPoint
from repoze.who._compat import STRING_TYPES
def authenticated_predicate():
def _predicate(environ):
return 'REMOTE_USER' in environ or 'repoze.who.identity' in environ
return _predicate
class PredicateRestriction:
def __init__(self, app, predicate, enabled=Tr... | {
"repo_name": "kawamon/hue",
"path": "desktop/core/ext-py/repoze.who-2.3/repoze/who/restrict.py",
"copies": "2",
"size": "1166",
"license": "apache-2.0",
"hash": 349471911464000700,
"line_mean": 34.3333333333,
"line_max": 75,
"alpha_frac": 0.6603773585,
"autogenerated": false,
"ratio": 4.33457249... |
"""Authorization objects for checking permissions
In the AuthKit model permissions are handled by ``Permission`` objects.
Authorization objects are used to check permissions and to raise
``NotAuthenticatedError`` or ``NotAuthorizedError`` if there is no user or the
user is not authorized. The execeptions are converted... | {
"repo_name": "cedadev/AuthKit",
"path": "authkit/authorize/wsgi_adaptors.py",
"copies": "2",
"size": "7629",
"license": "mit",
"hash": -5024723101772969000,
"line_mean": 34.4837209302,
"line_max": 87,
"alpha_frac": 0.6615545943,
"autogenerated": false,
"ratio": 4.789077212806026,
"config_test"... |
"""Authorization views."""
import muffin
from example import app, session, oauth
from example.models import User, Token
# Setup function to load users from sessions
@session.user_loader
def get_user(user_id):
"""Register a user's loader for sessions."""
return User.select().where(User.id == user_id).first()... | {
"repo_name": "klen/muffin-example",
"path": "example/views/auth.py",
"copies": "1",
"size": "1518",
"license": "mit",
"hash": 2038222102499989000,
"line_mean": 28.7647058824,
"line_max": 83,
"alpha_frac": 0.6567852437,
"autogenerated": false,
"ratio": 3.72972972972973,
"config_test": false,
... |
"""AuthorizeAPIs.py - Module that implements the user authorization APIs for this application """
from flask import g, jsonify, current_app, request
from flask_restful import Resource
from flask_httpauth import HTTPBasicAuth
from itsdangerous import (TimedJSONWebSignatureSerializer
as Serializ... | {
"repo_name": "Wittle-South-LLC/base",
"path": "server/src/APIs/AuthorizeAPIs.py",
"copies": "1",
"size": "3273",
"license": "mit",
"hash": -3198646891470794000,
"line_mean": 40.4303797468,
"line_max": 97,
"alpha_frac": 0.6874427131,
"autogenerated": false,
"ratio": 4.00122249388753,
"config_te... |
"""Authorize File, Block and Portable Storage to a Virtual Server"""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
@click.command()
@click.... | {
"repo_name": "allmightyspiff/softlayer-python",
"path": "SoftLayer/CLI/virt/authorize_storage.py",
"copies": "2",
"size": "1690",
"license": "mit",
"hash": -1044257826305343000,
"line_mean": 41.25,
"line_max": 88,
"alpha_frac": 0.7,
"autogenerated": false,
"ratio": 3.840909090909091,
"config_t... |
"""Authorizes a particular egress rule for this security group"""
from baseCmd import *
from baseResponse import *
class authorizeSecurityGroupEgressCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""an optional account for the security group. Must be used with domainId... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/authorizeSecurityGroupEgress.py",
"copies": "1",
"size": "4098",
"license": "apache-2.0",
"hash": -4073847651936041500,
"line_mean": 37.6603773585,
"line_max": 120,
"alpha_frac": 0.5968765251,
"autogenerated": false,
"rati... |
"""Authorizes a particular ingress rule for this security group"""
from baseCmd import *
from baseResponse import *
class authorizeSecurityGroupIngressCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""an optional account for the security group. Must be used with domain... | {
"repo_name": "MissionCriticalCloud/marvin",
"path": "marvin/cloudstackAPI/authorizeSecurityGroupIngress.py",
"copies": "1",
"size": "4103",
"license": "apache-2.0",
"hash": -2304894778924442000,
"line_mean": 37.7075471698,
"line_max": 120,
"alpha_frac": 0.5973677797,
"autogenerated": false,
"rat... |
"""Authorizes hosts on a specific block volume."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
@click.command()
@click.argument('volume_id')
@click.option('--hardware-id', '-h', multiple=True,
he... | {
"repo_name": "nanjj/softlayer-python",
"path": "SoftLayer/CLI/block/access/authorize.py",
"copies": "2",
"size": "1970",
"license": "mit",
"hash": 295140484636221060,
"line_mean": 42.7777777778,
"line_max": 78,
"alpha_frac": 0.6182741117,
"autogenerated": false,
"ratio": 4.147368421052631,
"co... |
"""Authorizes hosts on a specific file volume."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
@click.command()
@click.argument('volume_id')
@click.option('--hardware-id', '-h', multiple=True,
hel... | {
"repo_name": "skraghu/softlayer-python",
"path": "SoftLayer/CLI/file/access/authorize.py",
"copies": "2",
"size": "2159",
"license": "mit",
"hash": -4838053137357766000,
"line_mean": 43.0612244898,
"line_max": 78,
"alpha_frac": 0.6062992126,
"autogenerated": false,
"ratio": 4.167953667953668,
... |
import numpy as np
from os import path
import datetime
import calendar
from ...utils import logger, fill_doc
from ..utils import _read_segments_file, _find_channels, _create_chs
from ..base import BaseRaw, _check_update_montage
from ..meas_info import _empty_info
from ..constants import FIFF
@fill_doc
def read_raw_... | {
"repo_name": "adykstra/mne-python",
"path": "mne/io/nicolet/nicolet.py",
"copies": "2",
"size": "7398",
"license": "bsd-3-clause",
"hash": 7067851439889858000,
"line_mean": 39.6483516484,
"line_max": 78,
"alpha_frac": 0.6153014328,
"autogenerated": false,
"ratio": 3.776416539050536,
"config_te... |
import numpy as np
from os import path
import datetime
import calendar
from ...utils import logger
from ..base import _BaseRaw, _check_update_montage
from ..meas_info import _empty_info
from ..constants import FIFF
def read_raw_nicolet(input_fname, montage=None, eog=None, misc=None, ecg=None,
e... | {
"repo_name": "yousrabk/mne-python",
"path": "mne/io/nicolet/nicolet.py",
"copies": "1",
"size": "8887",
"license": "bsd-3-clause",
"hash": 4847841273458083000,
"line_mean": 41.7259615385,
"line_max": 79,
"alpha_frac": 0.6051535951,
"autogenerated": false,
"ratio": 3.760897164621244,
"config_te... |
import numpy as np
from os import path
import datetime
import calendar
from ...utils import logger
from ..utils import _read_segments_file, _find_channels, _create_chs
from ..base import BaseRaw, _check_update_montage
from ..meas_info import _empty_info
from ..constants import FIFF
def read_raw_nicolet(input_fname,... | {
"repo_name": "jaeilepp/mne-python",
"path": "mne/io/nicolet/nicolet.py",
"copies": "5",
"size": "7772",
"license": "bsd-3-clause",
"hash": 2537438606726558000,
"line_mean": 40.7849462366,
"line_max": 78,
"alpha_frac": 0.6168296449,
"autogenerated": false,
"ratio": 3.802348336594912,
"config_te... |
import numpy as np
from os import path
import datetime
import calendar
from ...utils import logger
from ..utils import _read_segments_file, _find_channels, _create_chs
from ..base import _BaseRaw, _check_update_montage
from ..meas_info import _empty_info
from ..constants import FIFF
def read_raw_nicolet(input_fname... | {
"repo_name": "wronk/mne-python",
"path": "mne/io/nicolet/nicolet.py",
"copies": "6",
"size": "7666",
"license": "bsd-3-clause",
"hash": -6916763835217212000,
"line_mean": 40.6630434783,
"line_max": 78,
"alpha_frac": 0.6157057135,
"autogenerated": false,
"ratio": 3.8177290836653386,
"config_tes... |
import numpy as np
from os import path
import datetime
import calendar
from ...utils import logger
from ..utils import _read_segments_file, _find_channels
from ..base import _BaseRaw, _check_update_montage
from ..meas_info import _empty_info
from ..constants import FIFF
def read_raw_nicolet(input_fname, ch_type, mo... | {
"repo_name": "cmoutard/mne-python",
"path": "mne/io/nicolet/nicolet.py",
"copies": "1",
"size": "8545",
"license": "bsd-3-clause",
"hash": 3499394505272420000,
"line_mean": 40.4805825243,
"line_max": 79,
"alpha_frac": 0.6031597425,
"autogenerated": false,
"ratio": 3.7543936731107204,
"config_t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.