text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = 'Roman Arkharov'
class Crypt:
def __init__(self, sequence):
self.sequence = sequence
def convert(self, byte, key, direction):
if direction is True:
new = byte + key
if new > 255:
new -= 255
else:
new = byte - ... | {
"repo_name": "romka/leaderboards-server",
"path": "crypt.py",
"copies": "1",
"size": "1776",
"license": "mit",
"hash": -6847536658022598000,
"line_mean": 23.7391304348,
"line_max": 93,
"alpha_frac": 0.4115990991,
"autogenerated": false,
"ratio": 3.886214442013129,
"config_test": false,
"has_... |
__author__ = 'Roman Arkharov'
from optparse import OptionParser
from serverfactory import LeaderboardsServerFactory
from twisted.application import internet, service
from twisted.python import log
# Rename example_secret.py to secret.py and fill it with your own values between 1 and 255
secret = [line.str... | {
"repo_name": "romka/leaderboards-server",
"path": "main.py",
"copies": "1",
"size": "1576",
"license": "mit",
"hash": -1230528314007454200,
"line_mean": 28.9019607843,
"line_max": 106,
"alpha_frac": 0.7652284264,
"autogenerated": false,
"ratio": 3.411255411255411,
"config_test": false,
"has_... |
__author__ = 'Roman Arkharov'
from twisted.internet.protocol import Protocol
import time
import simplejson as json
from twisted.python import log
class LeaderboardsProtocol(Protocol):
return_codes = {}
return_codes['wrong_request'] = '1'
return_codes['wrong_arguments'] = '2'
return_codes['s... | {
"repo_name": "romka/leaderboards-server",
"path": "protocol.py",
"copies": "1",
"size": "3739",
"license": "mit",
"hash": 1653272518270820600,
"line_mean": 41.9882352941,
"line_max": 126,
"alpha_frac": 0.593474191,
"autogenerated": false,
"ratio": 4.273142857142857,
"config_test": false,
"ha... |
__author__ = 'Roman Arkharov'
from twisted.internet.protocol import ServerFactory
from protocol import LeaderboardsProtocol
from leaderboards import Leaderboards
from twisted.python import log
log.msg('LeaderboardsServerFactory')
class LeaderboardsServerFactory(ServerFactory):
protocol = Leaderbo... | {
"repo_name": "romka/leaderboards-server",
"path": "serverfactory.py",
"copies": "1",
"size": "1241",
"license": "mit",
"hash": -8374238062900727000,
"line_mean": 26.2045454545,
"line_max": 121,
"alpha_frac": 0.6390008058,
"autogenerated": false,
"ratio": 4.136666666666667,
"config_test": false... |
__author__ = 'Roman Arkharov'
from twisted.web.resource import Resource
from pymongo import MongoClient
import simplejson as json
class LeaderboardsWebserver(Resource):
isLeaf = True
def __init__(self, db_name, db_host, db_port):
self.db_name = db_name
self.db_host = db_host
... | {
"repo_name": "romka/leaderboards-server",
"path": "http_responder.py",
"copies": "1",
"size": "2074",
"license": "mit",
"hash": 208615909210605980,
"line_mean": 31.4516129032,
"line_max": 104,
"alpha_frac": 0.5506268081,
"autogenerated": false,
"ratio": 3.7572463768115942,
"config_test": false... |
__author__ = 'Roman Arkharov'
import txmongo
from pymongo import MongoClient
from twisted.internet import defer
from twisted.python import log
class Db:
"""
Database communication class.
"""
def __init__(self, parent, db_name, db_host, db_port):
"""
Initialize vari... | {
"repo_name": "romka/leaderboards-server",
"path": "db.py",
"copies": "1",
"size": "5509",
"license": "mit",
"hash": 4239775583012439000,
"line_mean": 30.7916666667,
"line_max": 118,
"alpha_frac": 0.5022690143,
"autogenerated": false,
"ratio": 4.135885885885886,
"config_test": false,
"has_no_... |
import copy as cp
import numpy as np
from scipy.fftpack import fftfreq
from ..io.pick import pick_types
from ..utils import logger, verbose, warn
from ..time_frequency.multitaper import (dpss_windows, _mt_spectra,
_csd_from_mt, _psd_from_mt_adaptive)
from ..externals.six.mov... | {
"repo_name": "nicproulx/mne-python",
"path": "mne/time_frequency/csd.py",
"copies": "3",
"size": "16491",
"license": "bsd-3-clause",
"hash": 4435395503941602000,
"line_mean": 37.4405594406,
"line_max": 101,
"alpha_frac": 0.614820205,
"autogenerated": false,
"ratio": 3.770233196159122,
"config_... |
import warnings
import copy as cp
import numpy as np
from scipy.fftpack import fftfreq
from ..io.pick import pick_types
from ..utils import logger, verbose
from ..time_frequency.multitaper import (dpss_windows, _mt_spectra,
_csd_from_mt, _psd_from_mt_adaptive)
class CrossSp... | {
"repo_name": "antiface/mne-python",
"path": "mne/time_frequency/csd.py",
"copies": "9",
"size": "9864",
"license": "bsd-3-clause",
"hash": 6798592703785028000,
"line_mean": 37.53125,
"line_max": 79,
"alpha_frac": 0.5849553933,
"autogenerated": false,
"ratio": 3.8546307151230947,
"config_test":... |
__author__ = 'Roman Solovyev [IPPM]'
import os
import re
import subprocess
import shutil
import time
import copy
import sys
import networkx as nx
from cada033 import *
def test_1():
G = nx.DiGraph()
G.add_edge(1, 2)
print(G.nodes())
print(G.edges())
exit()
def print_graph_structure(G):
print... | {
"repo_name": "IDMIPPM/ICCAD_2016_Contest",
"path": "python_utils/graph_functions.py",
"copies": "1",
"size": "6321",
"license": "mit",
"hash": -2954416732895834000,
"line_mean": 32.5355191257,
"line_max": 96,
"alpha_frac": 0.5090435066,
"autogenerated": false,
"ratio": 3.10262891809909,
"confi... |
__author__ = 'Roman Solovyev [IPPM]'
import random
from collections import defaultdict
from itertools import product, chain, islice, repeat
import copy
class scheme_alt(object):
def __init__(self):
self.__inputs__ = []
self.__outputs__ = []
self.__elements__ = {}
self.processed = {... | {
"repo_name": "IDMIPPM/ICCAD_2016_Contest",
"path": "python_utils/generate_tests.py",
"copies": "1",
"size": "6423",
"license": "mit",
"hash": -2683754622264920600,
"line_mean": 30.960199005,
"line_max": 115,
"alpha_frac": 0.5262338471,
"autogenerated": false,
"ratio": 3.6206313416009017,
"conf... |
__author__ = "Romilly Cocking"
__copyright__ = "Copyright 2011 hamcrest.org"
__license__ = "BSD, see License.txt"
from hamcrest.core.base_matcher import BaseMatcher
from hamcrest.core.helpers.hasmethod import hasmethod
import six
class StringContainsInOrder(BaseMatcher):
def __init__(self, *substring... | {
"repo_name": "nitishr/PyHamcrest",
"path": "src/hamcrest/library/text/stringcontainsinorder.py",
"copies": "2",
"size": "1705",
"license": "bsd-3-clause",
"hash": -4048029218122106400,
"line_mean": 30.7884615385,
"line_max": 79,
"alpha_frac": 0.6158357771,
"autogenerated": false,
"ratio": 4.3717... |
__author__ = 'RongShun'
import argparse, sys, time, logging, subprocess, os, shutil, fileinput
from lib.common.logo import logo
from lib.core.startup import check_root, init_logging, check_modules, check_device_compatibility, check_ini_files
from lib.common.exceptions import DroidCriticalError, InitilizeError
from lib.... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "droidpot.py",
"copies": "1",
"size": "7776",
"license": "mit",
"hash": 226749245898632960,
"line_mean": 32.3733905579,
"line_max": 133,
"alpha_frac": 0.6152263374,
"autogenerated": false,
"ratio": 3.6818181818181817,
"config_test": false,
"has_no_... |
__author__ = 'RongShun'
from command import Command
from os import path, getuid
from time import sleep
import os, sys
BASE_DIR = os.path.join(os.getcwd(), "..", "..", "..")
sys.path.append(BASE_DIR)
from lib.common.exceptions import NotRootUserError
SUCCESSFUL = True
UNSUCCESSFUL = False
class Fastboot(Command):
... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "lib/common/commands/fastboot.py",
"copies": "1",
"size": "2335",
"license": "mit",
"hash": -1140431910181869600,
"line_mean": 24.1182795699,
"line_max": 69,
"alpha_frac": 0.5610278373,
"autogenerated": false,
"ratio": 4.332096474953618,
"config_test... |
__author__ = 'RongShun'
from django import forms
from django.db import models
from django.forms import ModelForm
from lib.common.commands.adb import Adb
from lib.common.constant import SCRIPTED_PROFILE_INTERACTION, RANDOM_INTERACTION
from lib.core.managers.session import get_current_device_serial
adb= Adb()
class Con... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "modules/templates/profile/view_template.py",
"copies": "1",
"size": "1251",
"license": "mit",
"hash": 1394264339377289000,
"line_mean": 45.3333333333,
"line_max": 121,
"alpha_frac": 0.6027178257,
"autogenerated": false,
"ratio": 4.848837209302325,
"... |
__author__ = 'RongShun'
from django import forms
from django.db import models
from django.forms import ModelForm
from lib.common.commands.adb import Adb
from lib.core.managers.session import get_current_device_serial
adb = Adb()
class ConfigForm(forms.Form):
"""
This class handles the creation of django form ... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "modules/monitor/critical_variable/view_critical_variable.py",
"copies": "1",
"size": "1134",
"license": "mit",
"hash": 5442320170219957000,
"line_mean": 46.2916666667,
"line_max": 121,
"alpha_frac": 0.5784832451,
"autogenerated": false,
"ratio": 4.909... |
__author__ = 'RongShun'
from os import path
from command import Command
from time import sleep
SUCCESSFUL = True
UNSUCCESSFUL = False
class Adb(Command):
"""
ADB python wrapper
"""
def __init__(self):
super(Adb, self).__init__()
self.setCommand("adb")
def push(self, source, dest... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "lib/common/commands/adb.py",
"copies": "1",
"size": "6006",
"license": "mit",
"hash": 7253849860571694000,
"line_mean": 25.3421052632,
"line_max": 92,
"alpha_frac": 0.5472860473,
"autogenerated": false,
"ratio": 4.5056264066016505,
"config_test": fa... |
__author__ = 'RongShun'
from subprocess import check_output, Popen, CalledProcessError
import subprocess
import logging
#logging.basicConfig(level=logging.DEBUG)
logs = logging.getLogger("Command")
class result(object):
def __init__(self):
self.std_output = []
self.std_error = ""
self.isS... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "lib/common/commands/command.py",
"copies": "1",
"size": "4114",
"license": "mit",
"hash": 8805222269316012000,
"line_mean": 26.4266666667,
"line_max": 116,
"alpha_frac": 0.5503159942,
"autogenerated": false,
"ratio": 4.6591166477916195,
"config_test... |
__author__ = 'RongShun'
import logging, copy, ConfigParser
from os import getuid
from lib.core.managers.plugin import MonitorsManager
from lib.common.exceptions import InitilizeError
from lib.common.commands.adb import Adb
from lib.common.device import Device
from lib.common.constant import BASE_PATH
from lib.common.... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "lib/core/startup.py",
"copies": "1",
"size": "3277",
"license": "mit",
"hash": 7830711339364423000,
"line_mean": 26.3083333333,
"line_max": 135,
"alpha_frac": 0.6344217272,
"autogenerated": false,
"ratio": 4.239327296248383,
"config_test": true,
"... |
__author__ = 'RongShun'
import logging, json,os, ast
#logging.basicConfig(level=logging.INFO)
#logs = logging.getLogger("yapsy")
from yapsy.PluginManager import PluginManager
from lib.common.constant import MONITOR_MODULE_DIR, PROFILE_MODULE_DIR, SCRIPTED_PROFILE_INTERACTION, RANDOM_INTERACTION, PROCESSING_MODULE_DIR
... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "lib/core/managers/plugin.py",
"copies": "1",
"size": "9153",
"license": "mit",
"hash": -5545963060031923000,
"line_mean": 34.0689655172,
"line_max": 143,
"alpha_frac": 0.6378236644,
"autogenerated": false,
"ratio": 4.434593023255814,
"config_test": ... |
__author__ = 'RongShun'
import os, ConfigParser
DEVICES_INI = "devices.ini"
class Device(object):
def __init__(self):
pass
def _read_ini(self,):
"""
Private function to read devices.ini file
:return: ConfigParser object
"""
DEVICE_CONFIG = "devices.ini"
... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "lib/common/device.py",
"copies": "1",
"size": "3293",
"license": "mit",
"hash": 1513261316540269600,
"line_mean": 26.4416666667,
"line_max": 119,
"alpha_frac": 0.5733373823,
"autogenerated": false,
"ratio": 4.510958904109589,
"config_test": true,
... |
__author__ = 'RongShun'
import sys, os,re, time, hashlib, logging, subprocess, glob
#logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__file__)
sys.path.append(os.getcwd())
BASE_DIR = os.getcwd()
from lib.common.commands.adb import Adb
from lib.common.commands.fastboot import Fastboot
from lib.commo... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "lib/core/partitions.py",
"copies": "1",
"size": "12952",
"license": "mit",
"hash": -4573490552958021000,
"line_mean": 39.0990712074,
"line_max": 203,
"alpha_frac": 0.5987492279,
"autogenerated": false,
"ratio": 3.908267954133977,
"config_test": fals... |
__author__ = 'RongShun'
import unittest
from lib.common.commands.adb import Adb
from time import sleep
import os
SDCARD_PATH = "/sdcard/"
TEST_FILE = "testFile.txt"
class adb_testcase(unittest.TestCase):
def setUp(self):
self.adb_c = Adb()
self.adb_c.start_server()
def tearDown(self):
... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "tests/unittest/adb_test.py",
"copies": "1",
"size": "2446",
"license": "mit",
"hash": -7092837353869795000,
"line_mean": 25.5869565217,
"line_max": 83,
"alpha_frac": 0.6026165168,
"autogenerated": false,
"ratio": 3.7004538577912256,
"config_test": t... |
__author__ = 'RongShun'
import unittest, os, sys, time
DIR_PATH = os.path.join(os.getcwd(), "..", "..")
sys.path.append(DIR_PATH)
from lib.common.commands.fastboot import Fastboot
from lib.common.commands.adb import Adb
class fastboot_testCase(unittest.TestCase):
def setUp(self):
self.fastboot = Fastb... | {
"repo_name": "WhySoGeeky/DroidPot",
"path": "tests/unittest/fastboot_test.py",
"copies": "1",
"size": "1990",
"license": "mit",
"hash": -7677197284487772000,
"line_mean": 23.5679012346,
"line_max": 82,
"alpha_frac": 0.5467336683,
"autogenerated": false,
"ratio": 3.995983935742972,
"config_test... |
__author__ = 'Ron'
from webmux.terminal import Terminal
# TODO: merge SocketIO / StandardIO objects with Terminal objects
class SocketIO(object):
def __init__(self, client):
self.client = client
def write(self, data):
terminal_id = self.client.session.conn.terminal._id
self.parent.wri... | {
"repo_name": "tonypupp/webmux",
"path": "webmux/web_terminal.py",
"copies": "3",
"size": "1515",
"license": "mit",
"hash": 9065264578335548000,
"line_mean": 27.0555555556,
"line_max": 72,
"alpha_frac": 0.6323432343,
"autogenerated": false,
"ratio": 3.904639175257732,
"config_test": false,
"h... |
__author__ = 'Ronny Eichler'
import cv2
class Tracker(object):
def __init__(self):
self.frame = None
@staticmethod
def pre_process(frame, method=None):
return frame
@staticmethod
def threshold(frame, method=None):
if method is None:
rv = False
elif m... | {
"repo_name": "wonkoderverstaendige/MausverPyler",
"path": "lib/core/Tracker.py",
"copies": "1",
"size": "1921",
"license": "mit",
"hash": -709472840903578100,
"line_mean": 26.8405797101,
"line_max": 93,
"alpha_frac": 0.5278500781,
"autogenerated": false,
"ratio": 3.857429718875502,
"config_tes... |
__author__ = 'Ronny Eichler'
# System libraries
import sys
import logging
# Aux libraries
from lib.pyqtgraph import QtGui, QtCore # ALL HAIL LUKE!
import lib.pyqtgraph as pg
import cv2
# try avoiding these annoying mscvr90d.dll errors on Windows
pg.functions.USE_WEAVE = False
pg.setConfigOption('useWeave', False)
... | {
"repo_name": "wonkoderverstaendige/MausverPyler",
"path": "mausverpyler.py",
"copies": "1",
"size": "10971",
"license": "mit",
"hash": 1401543550456301600,
"line_mean": 37.6338028169,
"line_max": 182,
"alpha_frac": 0.6014948501,
"autogenerated": false,
"ratio": 3.7265625,
"config_test": false,... |
__author__ = 'Ronny Restrepo'
import numpy as np
from matplotlib import pyplot as plt
# ==============================================================================
# TALLY_AND_PLOT
# ====================================================================... | {
"repo_name": "ronrest/convenience_py",
"path": "plot/tally_and_plot.py",
"copies": "1",
"size": "2803",
"license": "apache-2.0",
"hash": 391206780967654100,
"line_mean": 35.4025974026,
"line_max": 80,
"alpha_frac": 0.5208704959,
"autogenerated": false,
"ratio": 3.8449931412894376,
"config_test... |
__author__ = 'Ronny Restrepo'
import numpy as np
# ==============================================================================
# INDICES_OF_ALL_CLASSES
# ==============================================================================
def indices_of_all_classes... | {
"repo_name": "ronrest/convenience_py",
"path": "ml/indices_of_all_classes.py",
"copies": "1",
"size": "1309",
"license": "apache-2.0",
"hash": 220768257403922620,
"line_mean": 37.5,
"line_max": 80,
"alpha_frac": 0.4896867838,
"autogenerated": false,
"ratio": 4.407407407407407,
"config_test": f... |
__author__ = 'root'
__author__ = 'Abhinav'
import matplotlib.pyplot as pyplot
train_file = open("./train.out", "rb")
test_file = open("./test.out", "rb")
cv_file = open("cross_validation_error.dat", "rb")
train_data = train_file.readlines()
test_data = test_file.readlines()
cv_data = cv_file.readlines()
plotX_train ... | {
"repo_name": "abhimm/Face-attractiveness-classification",
"path": "plot_knn_error.py",
"copies": "1",
"size": "1283",
"license": "bsd-3-clause",
"hash": 4120346901687558000,
"line_mean": 25.1836734694,
"line_max": 66,
"alpha_frac": 0.6765393609,
"autogenerated": false,
"ratio": 2.832229580573951... |
__author__ = 'root'
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import MySQLdb
from config import *
import urllib2
import codecs
expos_url = 'http://www.muziejai.lt/Aktualijos/naujos_parodos.asp'
start_url = 'http://www.muziejai.lt'
def cities():
with codecs.open('miestai', 'r', encoding='utf-8') as f:
... | {
"repo_name": "nfqakademija/meridian",
"path": "Python_muziejai/muz.py",
"copies": "1",
"size": "1989",
"license": "mit",
"hash": -224210615256750560,
"line_mean": 28.2058823529,
"line_max": 118,
"alpha_frac": 0.6042296073,
"autogenerated": false,
"ratio": 3.0090909090909093,
"config_test": fal... |
__author__ = 'Root'
# -*- coding: utf-8 -*-
import datetime
import gflags
import httplib2
from apiclient.discovery import build
from oauth2client.file import Storage
from oauth2client.client import OAuth2WebServerFlow
from oauth2client.tools import run
FLAGS = gflags.FLAGS
FLOW = OAuth2WebServerFlow(
client_id... | {
"repo_name": "christopher-uber/laughing-octo-computing-machine",
"path": "index.py",
"copies": "1",
"size": "7367",
"license": "mit",
"hash": -2981010036881801700,
"line_mean": 33.4299065421,
"line_max": 113,
"alpha_frac": 0.5397040858,
"autogenerated": false,
"ratio": 3.6344351258016774,
"con... |
__author__ = 'root'
#copied from python3
import os
import sys
def which(cmd, mode=os.F_OK | os.X_OK, path=None):
"""Given a command, mode, and a PATH string, return the path which
conforms to the given mode on the PATH, or None if there is no such
file.
`mode` defaults to os.F_OK | os.X_OK. `path` def... | {
"repo_name": "GraysonP/codecombat-1",
"path": "scripts/devSetup/which.py",
"copies": "79",
"size": "2385",
"license": "mit",
"hash": 5395724607900488000,
"line_mean": 35.1515151515,
"line_max": 80,
"alpha_frac": 0.6100628931,
"autogenerated": false,
"ratio": 3.9226973684210527,
"config_test": ... |
__author__ = 'root'
from bokeh.models import CustomJS
def callbackTap(source):
callback_tap = CustomJS(args=dict(source=source), code="""
var data = source.get('data');
var num_clusters = 5;
var inds = cb_obj.get('selected')['1d'].indices;
data['cluster']=inds
if (inds >= 0)... | {
"repo_name": "Nik0l/UTemPro",
"path": "Visualization/GUICallbacks.py",
"copies": "1",
"size": "1748",
"license": "mit",
"hash": -6880247450066345000,
"line_mean": 28.1333333333,
"line_max": 62,
"alpha_frac": 0.4588100686,
"autogenerated": false,
"ratio": 3.6416666666666666,
"config_test": fals... |
__author__ = 'root'
from bokeh.models import HoverTool, WheelZoomTool, HoverTool, PanTool
from bokeh.models.widgets import DateFormatter, TableColumn
from bokeh.models.widgets import Slider, Dropdown, HBox, VBox, VBoxForm, DataTable
from bokeh.plotting import figure
def getHover():
hover = HoverTool(
toolt... | {
"repo_name": "Nik0l/UTemPro",
"path": "Visualization/GUIparams.py",
"copies": "1",
"size": "2943",
"license": "mit",
"hash": -8212284912839715000,
"line_mean": 39.875,
"line_max": 104,
"alpha_frac": 0.6357458376,
"autogenerated": false,
"ratio": 3.1142857142857143,
"config_test": false,
"has... |
__author__ = 'root'
from smb.SMBConnection import SMBConnection
import os;
def smbwalk(self,top):
yield from self._smbwalk(top);
def _smbwalk(self,top):
shareds = self.listpath_ex(top)
dirs = [];
files = [];
for share in shareds:
filename = share.filename;
isdirectory = share.isDire... | {
"repo_name": "lytofb/freemarker_doc_crawler",
"path": "smblist.py",
"copies": "1",
"size": "1498",
"license": "mit",
"hash": 1321712660195374300,
"line_mean": 34.6904761905,
"line_max": 154,
"alpha_frac": 0.6441922563,
"autogenerated": false,
"ratio": 3.1536842105263156,
"config_test": false,
... |
__author__ = 'root'
from subprocess import Popen, PIPE
import os
import datetime
import time
from execute import execute
import threading
class Wireless_IDS():
def __init__(self, iface):
'''
@brief Set the path of the file to store the result in a variable.
@param iface :
... | {
"repo_name": "borisoop/AtEar",
"path": "module/wids.py",
"copies": "1",
"size": "59801",
"license": "apache-2.0",
"hash": 6639352162991462000,
"line_mean": 55.4169811321,
"line_max": 173,
"alpha_frac": 0.3429541312,
"autogenerated": false,
"ratio": 4.168188471457448,
"config_test": false,
"h... |
__author__ = 'root'
import network
from aircrack import Attack
import brute_force
from airodump import Reader
from execute import execute
from multiprocessing import Process, Queue
import os, signal
import commands
import time
class auto_pentest():
def __init__(self, iface, option):
self.iface = iface
... | {
"repo_name": "NORMA-Inc/AtEar",
"path": "module/pentest_open.py",
"copies": "3",
"size": "5325",
"license": "apache-2.0",
"hash": 1934059237283739600,
"line_mean": 35.9791666667,
"line_max": 429,
"alpha_frac": 0.5492957746,
"autogenerated": false,
"ratio": 3.5358565737051793,
"config_test": tr... |
__author__ = 'root'
import network
from aircrack import Attack
import brute_force
from airodump import Reader
from execute import execute
import commands
class auto_pentest(object):
def __init__(self, iface, json_object):
self.object = json_object
self.time = int(json_object['timeout']) * 60
... | {
"repo_name": "borisoop/AtEar",
"path": "module/pentest_open.py",
"copies": "1",
"size": "4612",
"license": "apache-2.0",
"hash": 1322701716838444300,
"line_mean": 43.786407767,
"line_max": 161,
"alpha_frac": 0.5108412836,
"autogenerated": false,
"ratio": 3.9117896522476676,
"config_test": fals... |
__author__ = 'root'
import network
from libnmap.process import NmapProcess
from libnmap.parser import NmapParser, NmapParserException
from ftplib import FTP
import pxssh
import telnetlib
from smtplib import SMTP_SSL as SMTP
from email import MIMEText
from imaplib import IMAP4, IMAP4_SSL
class network_pentest(object):... | {
"repo_name": "NORMA-Inc/AtEar",
"path": "module/pentest.py",
"copies": "4",
"size": "9864",
"license": "apache-2.0",
"hash": -1800148423693354800,
"line_mean": 39.9336099585,
"line_max": 114,
"alpha_frac": 0.4530616383,
"autogenerated": false,
"ratio": 3.958266452648475,
"config_test": false,
... |
__author__ = 'root'
import numpy as np
import matplotlib.pyplot as plt, mpld3
from bokeh.plotting import figure
from bokeh.models import (
GMapOptions, GMapPlot, ColumnDataSource, PanTool, WheelZoomTool, Circle, Range1d)
from bokeh.io import output_file, show
def plotGraph(aapl, aapl_dates):
window_size = 10... | {
"repo_name": "Nik0l/UTemPro",
"path": "Visualization/PlotAdvanced.py",
"copies": "1",
"size": "2532",
"license": "mit",
"hash": -6825088254989002000,
"line_mean": 32.76,
"line_max": 103,
"alpha_frac": 0.6394154818,
"autogenerated": false,
"ratio": 3.0802919708029197,
"config_test": false,
"h... |
__author__ = 'root'
import os;
import smblist;
from db_mysql_module import SQLiteWraper;
from optparse import OptionParser;
def getappendfix(f):
appendfix = '';
fsplit = f.split(".")
if len(fsplit)>1:
appendfix = fsplit[-1]
return appendfix;
def getsmbwalklist(host,remote_server,user,password,p... | {
"repo_name": "lytofb/freemarker_doc_crawler",
"path": "listfiles.py",
"copies": "1",
"size": "2106",
"license": "mit",
"hash": 477942953850569200,
"line_mean": 44.8043478261,
"line_max": 161,
"alpha_frac": 0.6082621083,
"autogenerated": false,
"ratio": 3.391304347826087,
"config_test": false,
... |
__author__ = 'root'
import random, socket, time, select
import struct, string, re
import types, errno
class NetBIOS():
def __init__(self, broadcast=True, listen_port=0):
self.broadcast = broadcast
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.HEADER_STRUCT_FORMAT = '>HH... | {
"repo_name": "NORMA-Company/AtEar",
"path": "module/NetBIOS.py",
"copies": "4",
"size": "3922",
"license": "apache-2.0",
"hash": -3669305931107470000,
"line_mean": 33.4122807018,
"line_max": 160,
"alpha_frac": 0.5186129526,
"autogenerated": false,
"ratio": 3.682629107981221,
"config_test": fal... |
__author__ = 'root'
import request_class;
import json;
import time;
import re;
from db_mysql_module import SQLiteWraper;
from flask import Flask,jsonify
from datetime import datetime;
def _loadzmdajax(sorttime,harfile,zdmajaxtpl="http://faxian.smzdm.com/json_more?filter=h1s183t0f0c0&type=new×ort=",depth = 2):
... | {
"repo_name": "lytofb/freemarker_doc_crawler",
"path": "smzdmcrwal.py",
"copies": "1",
"size": "5221",
"license": "mit",
"hash": -736236562025196200,
"line_mean": 40.776,
"line_max": 285,
"alpha_frac": 0.656196131,
"autogenerated": false,
"ratio": 2.976624857468643,
"config_test": false,
"has... |
__author__ = 'root'
import request_class;
lianjia_detail_url = "http://dl.lianjia.com/ershoufang/"
def get_header():
headers = {"Accept":'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Encoding':'gzip, deflate, sdch',
'Accept-Language':'zh-CN,zh;q... | {
"repo_name": "lytofb/freemarker_doc_crawler",
"path": "lianjia.py",
"copies": "1",
"size": "1618",
"license": "mit",
"hash": -5426195036105471000,
"line_mean": 41.6052631579,
"line_max": 141,
"alpha_frac": 0.6384425216,
"autogenerated": false,
"ratio": 2.8090277777777777,
"config_test": false,... |
__author__ = 'root'
import requests
import io
def dict_to_object(d):
if '__class__' in d:
class_name = d.pop('__class__')
module_name = d.pop('__module__')
module = __import__(module_name)
class_ = getattr(module, class_name)
args = dict((key.encode('ascii'), value) for key... | {
"repo_name": "borisoop/AtEar",
"path": "download_count.py",
"copies": "1",
"size": "1174",
"license": "apache-2.0",
"hash": -6382733274577454000,
"line_mean": 24,
"line_max": 83,
"alpha_frac": 0.5221465077,
"autogenerated": false,
"ratio": 3.483679525222552,
"config_test": false,
"has_no_key... |
__author__ = 'root'
import requests;
import os;
from bs4 import BeautifulSoup;
import download_file;
import re;
import config;
import json;
def loadheaders_from_har(harfile):
headers={}
with open(harfile,encoding="utf-8") as data_file:
data = json.load(data_file)
entries = data['log']['entries']
... | {
"repo_name": "lytofb/freemarker_doc_crawler",
"path": "request_class.py",
"copies": "1",
"size": "6099",
"license": "mit",
"hash": 3908710772197230600,
"line_mean": 45.5572519084,
"line_max": 145,
"alpha_frac": 0.6532218396,
"autogenerated": false,
"ratio": 3.314673913043478,
"config_test": tr... |
__author__ = 'root'
class UtilHelper(object):
_metric_type = {
'CPULoad': 'xs:double',
'NrUSERS': 'xs:decimal',
'SWAPfree': 'xs:double',
'RAMUsed': 'xs:double',
'NrProcs': 'xs:decimal',
'DiskUsed': 'xs:decimal',
'NrZOMBIEprocs': 'xs:decimal'
}
_metric_location = {
'CPULoad': 'orion/CPULoad',
'N... | {
"repo_name": "Atos-FiwareOps/sla-dashboard",
"path": "slagui/util_helper.py",
"copies": "2",
"size": "1357",
"license": "apache-2.0",
"hash": 3016299041176375300,
"line_mean": 19.2686567164,
"line_max": 50,
"alpha_frac": 0.5843773029,
"autogenerated": false,
"ratio": 1.9955882352941177,
"confi... |
__author__ = 'root'
# -*- coding:utf8 -*-
# encoding = utf-8
from functions import get_remote, get_config, post_to_remote
import urllib2
from log import log
import json
from flask import redirect, url_for
hackathon_api_url = get_config("hackathon-api.endpoint")
hackathon_name = get_config("javascript.hackathon.name")... | {
"repo_name": "mshubian/BAK_open-hackathon",
"path": "open-hackathon-tempUI/src/hackathon/login.py",
"copies": "1",
"size": "3840",
"license": "apache-2.0",
"hash": 2663253357753106400,
"line_mean": 33.6036036036,
"line_max": 125,
"alpha_frac": 0.6052083333,
"autogenerated": false,
"ratio": 3.410... |
__author__ = 'root'
from bokeh.models import (
TapTool, CustomJS)
from bokeh.io import output_file, show
from bokeh.io import curdoc, vform, gridplot, output_server
import ClusteringSourceData as csd
import GUIparams as gui
import GUICallbacks as cb
output_server("clusteringGUI")
def plotClusters(source, p):
... | {
"repo_name": "Nik0l/UTemPro",
"path": "Visualization/ClusteringGUI.py",
"copies": "1",
"size": "1475",
"license": "mit",
"hash": -100709937600772270,
"line_mean": 29.1020408163,
"line_max": 98,
"alpha_frac": 0.7003389831,
"autogenerated": false,
"ratio": 3.0729166666666665,
"config_test": fals... |
__author__ = 'root'
from django.http import HttpResponse
from django.utils.http import urlquote
import xlwt, HTMLParser, StringIO, uuid
blue_stype = xlwt.easyxf('alignment: horz left, vert top; pattern: pattern solid, fore_colour light_blue; font: bold on;')
red_stype = xlwt.easyxf('alignment: horz left, vert top; pa... | {
"repo_name": "tongshangsoft/django_table2excel",
"path": "html_table_to_excel.py",
"copies": "1",
"size": "6254",
"license": "mit",
"hash": -791269683131732400,
"line_mean": 33.1803278689,
"line_max": 132,
"alpha_frac": 0.5257435241,
"autogenerated": false,
"ratio": 3.7359617682198327,
"config... |
__author__ = 'root'
from nova.openstack.common import log as logging
from oslo.config import cfg
from nova import exception
import socket
import os
import json
import threading
import time
LOG = logging.getLogger(__name__)
ovirtguestagent_opts = [
cfg.BoolOpt('enable_set_admin_password',
default... | {
"repo_name": "silenceli/nova",
"path": "nova/virt/libvirt/ovirtguestagent.py",
"copies": "1",
"size": "8305",
"license": "apache-2.0",
"hash": -4054976534654390000,
"line_mean": 40.525,
"line_max": 141,
"alpha_frac": 0.576038531,
"autogenerated": false,
"ratio": 4.1880988401412,
"config_test":... |
__author__ = 'root'
from pip import main
from pkg_resources import load_entry_point
from pagrant.basecommand import Command
from pagrant.vendors.myoptparser.optparse import Option
from pagrant.exceptions import CommandError, VmProviderError
class InstallCommand(Command):
name = "install"
usage = """%prog """... | {
"repo_name": "markshao/pagrant",
"path": "pagrant/commands/vmp/install.py",
"copies": "1",
"size": "2256",
"license": "mit",
"hash": 5315000753762957000,
"line_mean": 36,
"line_max": 99,
"alpha_frac": 0.6272163121,
"autogenerated": false,
"ratio": 3.791596638655462,
"config_test": false,
"ha... |
__author__ = 'root'
from pymongo import MongoClient
import pymongo
from post import Post
from settings import Settings
from user import User
from flask import Flask, render_template, abort, url_for, request, flash, session, redirect
from helper_functions import random_string
app = Flask('FlaskBlog')
app.config.from_o... | {
"repo_name": "zhangkaka/BLOG",
"path": "test.py",
"copies": "1",
"size": "2236",
"license": "mit",
"hash": -8853421736229768000,
"line_mean": 24.7011494253,
"line_max": 129,
"alpha_frac": 0.6641323792,
"autogenerated": false,
"ratio": 2.8411689961880557,
"config_test": false,
"has_no_keyword... |
__author__ = 'root'
import base64
import subprocess
import time
import os
from pagrant.exceptions import PagrantError
CONNECTIONS = 10
TIMEOUT = 5 * 60
def get_axel_path():
return os.path.join(os.path.abspath(os.path.dirname(__file__)), 'downloader', 'axel')
def get_wget_path():
return "wget"
class CI... | {
"repo_name": "markshao/pagrant",
"path": "pagrant/ci/__init__.py",
"copies": "1",
"size": "1859",
"license": "mit",
"hash": -4297727497440241700,
"line_mean": 28.0625,
"line_max": 100,
"alpha_frac": 0.5863367402,
"autogenerated": false,
"ratio": 3.980728051391863,
"config_test": false,
"has_... |
__author__ = 'root'
import happybase
import json
import time
from oslo_log import log
from oslo_utils import netutils
from six.moves.urllib import parse as urlparse
def make_query(metaquery=None, trait_query=None, **kwargs):
"""Return a filter query string based on the selected parameters.
:param metaquery: ... | {
"repo_name": "Aaron-DH/report",
"path": "impl_hbase.py",
"copies": "1",
"size": "5444",
"license": "apache-2.0",
"hash": -678241999871808400,
"line_mean": 36.0340136054,
"line_max": 130,
"alpha_frac": 0.5619030125,
"autogenerated": false,
"ratio": 3.9592727272727273,
"config_test": false,
"h... |
__author__ = 'root'
import hglib
import os
import StringIO
from .vcs_adapter import VcsAdapter
from .vcs_adapter import NoVCSError
# A deliberate copy of GitAdapter's error message:
ERR_MSG = "fatal: Not a hg repository (or any of the parent directories): .hg"
def get_hlib_client_and_path():
try:
clie... | {
"repo_name": "tarmstrong/nbdiff",
"path": "nbdiff/adapter/hg_adapter.py",
"copies": "1",
"size": "3454",
"license": "mit",
"hash": 6493970407546613000,
"line_mean": 36.5434782609,
"line_max": 79,
"alpha_frac": 0.5521134916,
"autogenerated": false,
"ratio": 4.2173382173382175,
"config_test": fa... |
__author__ = 'root'
import json
import socket
import urllib2
import sys
from django.conf import settings
class MarketplaceAdapter(object):
__instance = None
__timeout_value = 4
org_node_list = {
'TRENTO':'Trento',
'LannionNode': 'Lannion2'
}
def __new__(cls):
if cls.__instance is None:
print("NEW ... | {
"repo_name": "Atos-FiwareOps/sla-dashboard",
"path": "slagui/marketplace_adapter.py",
"copies": "2",
"size": "1823",
"license": "apache-2.0",
"hash": 2483849886286364000,
"line_mean": 26.2089552239,
"line_max": 108,
"alpha_frac": 0.6933625891,
"autogenerated": false,
"ratio": 3.3205828779599273,... |
__author__ = 'root'
import json
import socket
import urllib2
#import time
from django.conf import settings
import sys
import base64
class FMAdapter(object):
DCA = "DCA"
FM = "FM"
TOKEN_DCA = "TOKEN_DCA"
TOKEN_FM = "TOKEN_FM"
__instance = None
__token_dca = None
__token_fm = None
__timeout_value = 4
#cr... | {
"repo_name": "Atos-FiwareOps/sla-dashboard",
"path": "slagui/fm_adapter.py",
"copies": "2",
"size": "4967",
"license": "apache-2.0",
"hash": 3724275704284127000,
"line_mean": 32.5608108108,
"line_max": 108,
"alpha_frac": 0.6704248037,
"autogenerated": false,
"ratio": 3.155654383735705,
"config... |
__author__ = 'root'
import matplotlib.pyplot as plt
import numpy as np
def PlotData(data, algorithm, sample_size, exp):
h = 0.02
val = setValues(data)
#print type(data)
#print data
xx, yy = np.meshgrid(np.arange(val['x_min'], val['x_max'], h), np.arange(val['y_min'], val['y_max'], h))
#print_m... | {
"repo_name": "Nik0l/UTemPro",
"path": "Visualization/ClusteringPlot.py",
"copies": "1",
"size": "3765",
"license": "mit",
"hash": -7656361718864547000,
"line_mean": 37.8144329897,
"line_max": 108,
"alpha_frac": 0.5928286853,
"autogenerated": false,
"ratio": 3.0047885075818037,
"config_test": f... |
__author__ = 'root'
import os
from pagrant.exceptions import PagrantError
from pagrant.provisioners import BaseProvisioner
class PuppetProvisioner(BaseProvisioner):
def __init__(self, machine, logger, provision_info, provider_info):
super(PuppetProvisioner, self).__init__(machine, logger, provision_info,... | {
"repo_name": "markshao/pagrant",
"path": "pagrant/provisioners/puppet/__init__.py",
"copies": "1",
"size": "2928",
"license": "mit",
"hash": 4700283486903026000,
"line_mean": 44.75,
"line_max": 118,
"alpha_frac": 0.650273224,
"autogenerated": false,
"ratio": 3.837483617300131,
"config_test": f... |
__author__ = 'root'
import re
class VcsAdapter(object):
def get_modified_notebooks(self):
raise NotImplementedError("Subclass must implement abstract method")
def filter_modified_notebooks(self, file_hooks):
modified_notebooks = []
for item in file_hooks:
if re.search('.... | {
"repo_name": "tarmstrong/nbdiff",
"path": "nbdiff/adapter/vcs_adapter.py",
"copies": "1",
"size": "1055",
"license": "mit",
"hash": 7196195487980734000,
"line_mean": 26.0512820513,
"line_max": 76,
"alpha_frac": 0.6379146919,
"autogenerated": false,
"ratio": 4.203187250996016,
"config_test": fa... |
__author__ = 'root'
import scipy.io
from calculate_distance import calc_cosine_distance
from operator import itemgetter
def classify_knn(train_data, train_labels, test_data, K):
# calculate cosine distance for every test instance wrt training instances
distance = dict()
for j in range(len(test_data)):
... | {
"repo_name": "abhimm/Face-attractiveness-classification",
"path": "knn_classifier.py",
"copies": "1",
"size": "1544",
"license": "bsd-3-clause",
"hash": 1031927398798029000,
"line_mean": 27.6111111111,
"line_max": 86,
"alpha_frac": 0.6178756477,
"autogenerated": false,
"ratio": 3.738498789346247... |
__author__ = 'root'
import sys
import os
from pagrant.basecommand import Command
from pagrant.vmproviders import providers
from pagrant.commands.vmp import get_installed_vmproviders
DEFAULT_BLANK = 30
class ListCommand(Command):
name = "list"
usage = """%prog """
summary = "list all the installed vmpro... | {
"repo_name": "markshao/pagrant",
"path": "pagrant/commands/vmp/list.py",
"copies": "1",
"size": "1311",
"license": "mit",
"hash": -3308571530045905000,
"line_mean": 25.22,
"line_max": 58,
"alpha_frac": 0.5881006865,
"autogenerated": false,
"ratio": 3.5625,
"config_test": false,
"has_no_keywo... |
__author__ = 'root'
import sys
import os.path
import xmlrpclib
from datetime import datetime
from dateutil import parser as dateparser
# on purpose: duplicate code with geni_am_api_two_client.py
class SafeTransportWithCert(xmlrpclib.SafeTransport):
"""Helper class to foist the right certificate for the transpor... | {
"repo_name": "fp7-alien/OCF-TBPlugin",
"path": "alien_plugin/controller/geni_api_three_client.py",
"copies": "1",
"size": "7319",
"license": "bsd-3-clause",
"hash": -4881699046063201000,
"line_mean": 46.2193548387,
"line_max": 147,
"alpha_frac": 0.6689438448,
"autogenerated": false,
"ratio": 4.0... |
__author__ = 'root'
import sys
import socket
import json
from requests.auth import HTTPBasicAuth
import requests
def getRepos():
print "getRepo"
stack_name = sys.argv[1]
stack_version = sys.argv[2]
print stack_name + stack_version
# look through repo files and then submit via REST
host... | {
"repo_name": "tzolov/vagrant-pivotalhd",
"path": "provision/SetRepos.py",
"copies": "1",
"size": "1263",
"license": "apache-2.0",
"hash": 5910629964163263000,
"line_mean": 33.1351351351,
"line_max": 144,
"alpha_frac": 0.5898653998,
"autogenerated": false,
"ratio": 3.4889502762430937,
"config_t... |
__author__ = 'root'
import sys
import subprocess
import os
from .vcs_adapter import VcsAdapter
from .vcs_adapter import NoVCSError
class GitAdapter(VcsAdapter):
def __init__(self):
is_git_repo = False
try:
is_git_repo = subprocess.check_output(
"git rev-parse --is-in... | {
"repo_name": "tarmstrong/nbdiff",
"path": "nbdiff/adapter/git_adapter.py",
"copies": "1",
"size": "4012",
"license": "mit",
"hash": -774979267949187800,
"line_mean": 31.6178861789,
"line_max": 77,
"alpha_frac": 0.5438683948,
"autogenerated": false,
"ratio": 4.114871794871795,
"config_test": fa... |
__author__ = 'root'
'''
Created on 30/06/2014
@author: s270094
'''
from django.conf import settings
from django.contrib.auth.models import User
import requests
import urlparse
import json
class IdmBackEnd(object):
"""
Authenticate against the settings ADMIN_LOGIN and ADMIN_PASSWORD.
Use the login name, and a has... | {
"repo_name": "Atos-FiwareOps/sla-dashboard",
"path": "slagui/IdmBackEnd.py",
"copies": "2",
"size": "2493",
"license": "apache-2.0",
"hash": 7042513773114840000,
"line_mean": 24.96875,
"line_max": 81,
"alpha_frac": 0.6666666667,
"autogenerated": false,
"ratio": 3.204370179948586,
"config_test"... |
__author__ = 'root'
"""
The vmprovider will support the following commands
vmprovider list
-- list all the provider [native support + third party installed]
vmprovider install [vmprovider name]
-- install the new vmprovider from pypi
"""
import sys
from pagrant.basecommand import Comman... | {
"repo_name": "markshao/pagrant",
"path": "pagrant/commands/vmp/__init__.py",
"copies": "1",
"size": "3444",
"license": "mit",
"hash": -1318588907227907300,
"line_mean": 26.125984252,
"line_max": 109,
"alpha_frac": 0.6655052265,
"autogenerated": false,
"ratio": 3.5142857142857142,
"config_test"... |
__author__ = 'root'
# program name: attackter.py
# description: this program define method to create
# a covert channel between attacker and victim based
# on DNS packet
# Athor: He Tian
# date: June 12, 2015
import os
from scapy.layers.dns import DNSQR, DNS, DNSRR
from scapy.layers.inet import IP, UDP
from scapy.al... | {
"repo_name": "xspriggan/backdoor_python_demo",
"path": "attacker.py",
"copies": "1",
"size": "2268",
"license": "unlicense",
"hash": -5454678668907341000,
"line_mean": 22.1428571429,
"line_max": 65,
"alpha_frac": 0.6362433862,
"autogenerated": false,
"ratio": 3.272727272727273,
"config_test": ... |
__author__ = 'rorymiller'
import os
import re
# duplicate folder
# Traverse folders
# add YAML infromation to each .md file
# add index to each folder
# add index to first page
# make web friendly file names
# YAML for individual pages
## need to remove all non digit from yaml
## can perhaps try to add back in li... | {
"repo_name": "rorymiller/rorymiller.github.io",
"path": "rename.py",
"copies": "1",
"size": "2628",
"license": "unlicense",
"hash": 1355170858804434200,
"line_mean": 25.28,
"line_max": 140,
"alpha_frac": 0.4988584475,
"autogenerated": false,
"ratio": 3.7329545454545454,
"config_test": false,
... |
__author__ = 'roscoe'
import os
from datetime import datetime
import qgis.utils
import qgis.utils
from src.geogigpy import Repository
from src.geogigpy import geogig
from src.geogigpy.geogigexception import GeoGigException
from qgis.core import QgsVectorLayer, QgsMapLayerRegistry
class GeoRepo(object):
def __in... | {
"repo_name": "roscoeZA/GeoGigSync",
"path": "geo_repo.py",
"copies": "1",
"size": "4025",
"license": "cc0-1.0",
"hash": -8196056339910275000,
"line_mean": 37.3428571429,
"line_max": 114,
"alpha_frac": 0.5590062112,
"autogenerated": false,
"ratio": 3.9616141732283463,
"config_test": false,
"h... |
__author__ = 'rose'
from language_model import LanguageModel
class SmoothedLanguageModel(object):
"""
class to represent calculating term weighting
"""
def __init__(self, docLM, colLM, alpha=1.0, beta=1.0, lam=0.5):
"""
:param docLM: a LanguageModel object representing the document
... | {
"repo_name": "leifos/ifind",
"path": "ifind/common/smoothed_language_model.py",
"copies": "1",
"size": "2310",
"license": "mit",
"hash": 4746236992322361000,
"line_mean": 28.2405063291,
"line_max": 108,
"alpha_frac": 0.574025974,
"autogenerated": false,
"ratio": 3.725806451612903,
"config_test... |
__author__ = 'rose'
import unittest
import logging
import sys
from position_content_extractor import PositionContentExtractor
from pagecapture import PageCapture
class TestPositionExtractor(unittest.TestCase):
def setUp(self):
self.logger = logging.getLogger("TestStructuredExtractor")
html = ' <h... | {
"repo_name": "leifos/ifind",
"path": "ifind/common/test_content_extractor.py",
"copies": "1",
"size": "3886",
"license": "mit",
"hash": 6365226572149044000,
"line_mean": 34.6513761468,
"line_max": 103,
"alpha_frac": 0.6428203809,
"autogenerated": false,
"ratio": 3.8705179282868527,
"config_tes... |
__author__ = 'rose'
class LanguageModel(object):
"""
manages reading in a file and splitting into a term, occurrence dictionary
or takes a term, occurrence dictionary
calculates the probability of a term occurring given the occurrence dict
"""
def __init__(self, file=None , term_dict=None):
... | {
"repo_name": "leifos/ifind",
"path": "ifind/common/language_model.py",
"copies": "1",
"size": "2116",
"license": "mit",
"hash": -7918619856997446000,
"line_mean": 28.3888888889,
"line_max": 79,
"alpha_frac": 0.5737240076,
"autogenerated": false,
"ratio": 4.292089249492901,
"config_test": false... |
__author__ = 'rose'
"""
To deal with cleaning the terms, this file contains a TermPipeline class
as well as TermProcessors, a TermPipeline is made of processors and
runs a term provided through each of the processors in the list to see
if a cleaned term is returned at the end
"""
import re
class TermPipeline():
... | {
"repo_name": "leifos/ifind",
"path": "ifind/common/pipeline.py",
"copies": "1",
"size": "4512",
"license": "mit",
"hash": -4032934793675624400,
"line_mean": 26.1807228916,
"line_max": 79,
"alpha_frac": 0.5622783688,
"autogenerated": false,
"ratio": 4.355212355212355,
"config_test": false,
"h... |
__author__ = 'ross'
import unittest
from pychron.core.helpers.formatting import floatfmt
DEBUG = True
class FloatfmtTestCase(unittest.TestCase):
def test_rounding(self):
x=0.007
fx = floatfmt(x, n=2)
self.assertEqual('0.01', fx)
def test_rounding2(self):
x=0.007
fx =... | {
"repo_name": "USGSDenverPychron/pychron",
"path": "pychron/core/helpers/tests/floatfmt.py",
"copies": "1",
"size": "1713",
"license": "apache-2.0",
"hash": -8236802344298982000,
"line_mean": 25.3538461538,
"line_max": 55,
"alpha_frac": 0.5843549329,
"autogenerated": false,
"ratio": 3.13162705667... |
__author__ = 'ross'
import unittest
from pychron.stage.calibration.add_holes_view import parse_holestr
class HolesTestCase(unittest.TestCase):
def test_s1(self):
s1 = '1-5'
list1 = [1, 2, 3, 4, 5]
list2 = parse_holestr(s1)
self.assertListEqual(list1, list2)
def test_s2(self... | {
"repo_name": "USGSDenverPychron/pychron",
"path": "pychron/stage/calibration/tests/holes.py",
"copies": "1",
"size": "1128",
"license": "apache-2.0",
"hash": -6565037667053274000,
"line_mean": 21.1176470588,
"line_max": 66,
"alpha_frac": 0.5496453901,
"autogenerated": false,
"ratio": 2.907216494... |
__author__ = 'roycehaynes'
from scrapy.dupefilter import BaseDupeFilter
import time
import connection
from scrapy.dupefilter import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
class RFPDupeFilter(BaseDupeFilter):
"""RabbitMQ-based request duplication filter"""
def __init__(self, se... | {
"repo_name": "roycehaynes/scrapy-rabbitmq",
"path": "scrapy_rabbitmq/dupefilter.py",
"copies": "1",
"size": "1531",
"license": "mit",
"hash": -1218382731996900600,
"line_mean": 25.3965517241,
"line_max": 74,
"alpha_frac": 0.6257348138,
"autogenerated": false,
"ratio": 4.264623955431754,
"confi... |
__author__ = 'roycehaynes'
from scrapy.spider import Spider
from scrapy import signals
from scrapy.exceptions import DontCloseSpider
import connection
class RabbitMQMixin(object):
""" A RabbitMQ Mixin used to read URLs from a RabbitMQ queue.
"""
rabbitmq_key = None
def __init__(self):
self... | {
"repo_name": "openslack/openslack-crawler",
"path": "crawler/schedulers/rabbitmq/spiders.py",
"copies": "1",
"size": "2029",
"license": "apache-2.0",
"hash": -5451943652417002000,
"line_mean": 24.6835443038,
"line_max": 88,
"alpha_frac": 0.6150813208,
"autogenerated": false,
"ratio": 3.886973180... |
__author__ = 'roycehaynes'
from scrapy.utils.misc import load_object
import connection
from scrapy_rabbitmq.dupefilter import RFPDupeFilter
# default values
SCHEDULER_PERSIST = False
QUEUE_KEY = '%(spider)s:requests'
QUEUE_CLASS = 'scrapy_rabbitmq.queue.SpiderQueue'
DUPEFILTER_KEY = '%(spider)s:dupefilter'
IDLE_BEFO... | {
"repo_name": "openslack/openslack-crawler",
"path": "crawler/schedulers/rabbitmq/scheduler.py",
"copies": "1",
"size": "2450",
"license": "apache-2.0",
"hash": -6047561748882525000,
"line_mean": 33.0277777778,
"line_max": 114,
"alpha_frac": 0.6514285714,
"autogenerated": false,
"ratio": 3.540462... |
__author__ = 'roycehaynes'
import connection
from scrapy.spider import Spider
from scrapy import signals
from scrapy.exceptions import DontCloseSpider
class RabbitMQMixin(object):
""" A RabbitMQ Mixin used to read URLs from a RabbitMQ queue.
"""
rabbitmq_key = None
def __init__(self):
self... | {
"repo_name": "roycehaynes/scrapy-rabbitmq",
"path": "scrapy_rabbitmq/spiders.py",
"copies": "1",
"size": "2029",
"license": "mit",
"hash": 5107319969651483000,
"line_mean": 24.6835443038,
"line_max": 88,
"alpha_frac": 0.6150813208,
"autogenerated": false,
"ratio": 3.8869731800766285,
"config_t... |
__author__ = 'roycehaynes'
import connection
from scrapy.utils.misc import load_object
from scrapy_rabbitmq.dupefilter import RFPDupeFilter
# default values
SCHEDULER_PERSIST = False
QUEUE_KEY = '%(spider)s:requests'
QUEUE_CLASS = 'scrapy_rabbitmq.queue.SpiderQueue'
DUPEFILTER_KEY = '%(spider)s:dupefilter'
IDLE_BEFO... | {
"repo_name": "roycehaynes/scrapy-rabbitmq",
"path": "scrapy_rabbitmq/scheduler.py",
"copies": "1",
"size": "2715",
"license": "mit",
"hash": -2886110817188479000,
"line_mean": 33.3670886076,
"line_max": 114,
"alpha_frac": 0.650092081,
"autogenerated": false,
"ratio": 3.5770750988142295,
"confi... |
__author__ = 'roycehaynes'
import time
from scrapy.dupefilter import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
import connection
class RFPDupeFilter(BaseDupeFilter):
"""RabbitMQ-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication... | {
"repo_name": "openslack/openslack-crawler",
"path": "crawler/schedulers/rabbitmq/dupefilter.py",
"copies": "1",
"size": "1485",
"license": "apache-2.0",
"hash": -5050802419062783000,
"line_mean": 25.5178571429,
"line_max": 74,
"alpha_frac": 0.6181818182,
"autogenerated": false,
"ratio": 4.279538... |
__author__ = 'roy'
import os
import glob
import shutil
import unittest
from nose import run
from nose_logpertest.logpertest import LogPerTest
from config import A_DIR_PATH, B_DIR_PATH, EXPECTED_A, EXPECTED_B, LINES
class TestLogPerTest(unittest.TestCase):
def setUp(self):
remove_unneeded_log_dirs()
... | {
"repo_name": "taykey/nose-logpertest",
"path": "tests/unittest_runner.py",
"copies": "1",
"size": "2030",
"license": "apache-2.0",
"hash": -2195281631321406700,
"line_mean": 29.3134328358,
"line_max": 72,
"alpha_frac": 0.59408867,
"autogenerated": false,
"ratio": 3.677536231884058,
"config_tes... |
__author__ = 'royrusso'
import argparse
import logging
import json
import requests
logging.basicConfig(level=logging.DEBUG)
logging.captureWarnings(True)
logging.info("Starting Predikto Upload...")
parser = argparse.ArgumentParser()
parser.add_argument("--url", help="URL of REST API: https://api.predikto.io", narg... | {
"repo_name": "predikto/CLI-upload",
"path": "python2/upload.py",
"copies": "1",
"size": "1958",
"license": "apache-2.0",
"hash": -685393595590392200,
"line_mean": 32.186440678,
"line_max": 117,
"alpha_frac": 0.6634320735,
"autogenerated": false,
"ratio": 3.4777975133214922,
"config_test": fals... |
__author__ = 'royrusso'
import sys
import argparse
import logging
from predikto import configure
import predikto
logger = logging.getLogger('upload')
if sys.version_info < (3, 4, 0):
sys.stderr.write("You need python 3.4 or later to run this script\n")
logger.error("You need python 3.4 or later to run this ... | {
"repo_name": "predikto/CLI-upload",
"path": "python3/upload.py",
"copies": "1",
"size": "1529",
"license": "apache-2.0",
"hash": -901572813121651600,
"line_mean": 29.58,
"line_max": 88,
"alpha_frac": 0.6978417266,
"autogenerated": false,
"ratio": 3.218947368421053,
"config_test": false,
"has... |
__author__ = 'rrusk'
import datetime
import pymongo
class MongoDatabase(object):
DEFAULT_DB_NAME = "query_composer_development"
ENDPOINTS_COLLECTION = "endpoints"
QUERIES_COLLECTION = "queries"
RESULTS_COLLECTION = "results"
def __init__(self, db_name=DEFAULT_DB_NAME, host="localhost", port=270... | {
"repo_name": "scoophealth/query-composer",
"path": "util/STOPP_report_tool.py",
"copies": "1",
"size": "3924",
"license": "apache-2.0",
"hash": -4495110335539378000,
"line_mean": 33.4210526316,
"line_max": 116,
"alpha_frac": 0.5277777778,
"autogenerated": false,
"ratio": 4.283842794759825,
"co... |
__author__ = 'rsanchezavalos & ojdo'
__all__ = ["read_shp", "write_shp", "match_vertices_and_edges"]
import itertools
import numpy as np
import pandas as pd
import shapefile
import warnings
from urllib import urlretrieve
from shapely.geometry import LineString, Point, Polygon
from zipfile import ZipFile
from tempfile... | {
"repo_name": "rsanchezavalos/Research_tools",
"path": "python_tools/shptools.py",
"copies": "1",
"size": "6623",
"license": "mit",
"hash": -9001953910026572000,
"line_mean": 34.9945652174,
"line_max": 94,
"alpha_frac": 0.6130152499,
"autogenerated": false,
"ratio": 3.5493033226152195,
"config_... |
__author__ = 'rtownsend'
from lstm import build_model
from modelio import *
from nn_params import *
from nn_optimizers import *
from nn_serialization import load_params
import string
from flask import Flask, request, jsonify
app = Flask(__name__)
from collections import defaultdict, Counter
model = None
max_word_co... | {
"repo_name": "Sentimentron/Dracula",
"path": "server.py",
"copies": "1",
"size": "5898",
"license": "bsd-3-clause",
"hash": 8173264151818614000,
"line_mean": 32.7028571429,
"line_max": 154,
"alpha_frac": 0.6156324178,
"autogenerated": false,
"ratio": 3.4734982332155475,
"config_test": false,
... |
__author__ = 'rtownsend'
from nn_serialization import load_params
import types
def list_to_js(l):
if type(l) != types.ListType:
raise ValueError()
if type(l[0]) == types.ListType:
ret = []
for i in l:
# ret.append(list_to_js(i))
inner = list_to_js(i)
... | {
"repo_name": "Sentimentron/Dracula",
"path": "export.py",
"copies": "1",
"size": "1737",
"license": "bsd-3-clause",
"hash": -4319080222435608000,
"line_mean": 25.3181818182,
"line_max": 57,
"alpha_frac": 0.4542314335,
"autogenerated": false,
"ratio": 3.289772727272727,
"config_test": false,
... |
__author__ = 'rtownsend'
import numpy
import logging
def char_diff(a, b):
if a == b:
return 2
if a.lower() == b.lower():
return 1 # It's a match
return -1
class SimilarityMatcher(object):
def __init__(self):
self.words = set([])
pass
@classmethod
def _similar... | {
"repo_name": "Sentimentron/Dracula",
"path": "matcher.py",
"copies": "1",
"size": "2417",
"license": "bsd-3-clause",
"hash": 983655720271436700,
"line_mean": 24.9892473118,
"line_max": 70,
"alpha_frac": 0.4944145635,
"autogenerated": false,
"ratio": 3.428368794326241,
"config_test": false,
"... |
__author__ = 'rtownsend'
import numpy
import theano
import theano.tensor as T
# start-snippet-1
class HiddenLayer(object):
def __init__(self, rng, input, n_in, n_out, W=None, b=None,
activation=T.tanh):
"""
Typical hidden layer of a MLP: units are fully-connected and have
... | {
"repo_name": "Sentimentron/Dracula",
"path": "hidden.py",
"copies": "1",
"size": "2807",
"license": "bsd-3-clause",
"hash": -2939431807586784000,
"line_mean": 34.5443037975,
"line_max": 79,
"alpha_frac": 0.5632347702,
"autogenerated": false,
"ratio": 3.9759206798866855,
"config_test": false,
... |
__author__ = 'rudolphmutter'
# Orignal version taken from http://www.djangosnippets.org/snippets/186/
# Original author: udfalkso
# Modified by: Shwagroo Team and Gun.io
import sys
import os
import re
import hotshot
import hotshot.stats
import tempfile
import StringIO
from django.conf import settings
words_re = re... | {
"repo_name": "yeti/manticore-django",
"path": "manticore_django/middleware.py",
"copies": "1",
"size": "3674",
"license": "mit",
"hash": -2990165516625106000,
"line_mean": 30.1440677966,
"line_max": 98,
"alpha_frac": 0.5658682635,
"autogenerated": false,
"ratio": 3.835073068893528,
"config_tes... |
__author__ = 'rudy'
DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.postgresql_psycopg2",
# DB name or path to database file if using sqlite3.
"NAME": "%(proj_name)s",
# Not used with sqlite3.
... | {
"repo_name": "yeti/manticore-django",
"path": "manticore_django/fabfile/vagrant_settings.py",
"copies": "1",
"size": "1466",
"license": "mit",
"hash": 708026928218361700,
"line_mean": 27.7647058824,
"line_max": 87,
"alpha_frac": 0.6412005457,
"autogenerated": false,
"ratio": 3.1869565217391305,
... |
__author__ = "Ruslan Zaporojets <ruzzzua[]gmail.com>"
__date__ = "2016-04-07"
__version__ = "1.0"
__credits__ = "MIT"
import time
import urllib.parse
import posixpath
import os.path
import mimetypes
import sys
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse
from urllib... | {
"repo_name": "Ruzzz/OneFileTools",
"path": "script/downloader_tester.py",
"copies": "1",
"size": "10938",
"license": "mit",
"hash": 3320520239504004600,
"line_mean": 34.4012944984,
"line_max": 124,
"alpha_frac": 0.5504662644,
"autogenerated": false,
"ratio": 3.6890387858347387,
"config_test": ... |
__author__ = 'russomi'
import endpoints
import ferris3 as f3
from ferris3 import Service, hvild, auto_service, auto_method
from models import JobPost
JobPostMessage = f3.model_message(JobPost)
""" /_ah/api/jobsite/v1/jobposts/{id}
"""
@auto_service(endpoint='jobsite', resource_name='jobposts')
class JobPosts(Serv... | {
"repo_name": "russomi/ferris3-tutorial",
"path": "app/jobposts/jobposts_service.py",
"copies": "1",
"size": "1718",
"license": "apache-2.0",
"hash": -4999029728670500000,
"line_mean": 32.0384615385,
"line_max": 83,
"alpha_frac": 0.6385331781,
"autogenerated": false,
"ratio": 3.35546875,
"confi... |
__author__ = 'russomi'
import endpoints
import ferris3 as f3
from ferris3 import Service, hvild, auto_service
from models import Employer
EmployerMessage = f3.model_message(Employer)
""" /_ah/api/jobsite/v1/employers/<method name>
"""
@auto_service(endpoint='jobsite', resource_name='employers', path='employers')
... | {
"repo_name": "russomi/ferris3-tutorial",
"path": "app/Employers/employers_service.py",
"copies": "1",
"size": "1571",
"license": "apache-2.0",
"hash": -4652296369611439000,
"line_mean": 31.7291666667,
"line_max": 83,
"alpha_frac": 0.632718014,
"autogenerated": false,
"ratio": 3.186612576064909,
... |
__author__ = 'russomi'
import ferris3 as f3
from ferris3 import Service, auto_service, hvild
from ..ext import hvild_restful
from models import Post
PostMessage = f3.model_message(Post)
@auto_service(endpoint='ferris')
class PostsService(Service):
""" Posts service
See here: https://github.com/Tagtoo/en... | {
"repo_name": "russomi/ferris3-tutorial",
"path": "app/posts/posts_service.py",
"copies": "1",
"size": "1625",
"license": "apache-2.0",
"hash": -5459022107476969000,
"line_mean": 35.1111111111,
"line_max": 129,
"alpha_frac": 0.6233846154,
"autogenerated": false,
"ratio": 3.5951327433628317,
"co... |
__author__ = 'russomi'
import protopigeon
import ferris3 as f3
from ferris3 import Service, hvild, auto_service
from models import JobSeeker
JobSeekerMessage = protopigeon.model_message(JobSeeker)
@auto_service(endpoint='jobsite', resource_name='jobseekers')
class JobSeeker(Service):
""" JobSeeker service
... | {
"repo_name": "russomi/ferris3-tutorial",
"path": "app/jobseekers/jobseekers_service.py",
"copies": "1",
"size": "1208",
"license": "apache-2.0",
"hash": 3960102375156096000,
"line_mean": 33.5142857143,
"line_max": 85,
"alpha_frac": 0.667218543,
"autogenerated": false,
"ratio": 3.264864864864865,... |
__author__ = 'russomi'
""" The goal of this module is to provide a restful scaffold for ferris3 """
import inflect
import ferris3
from ferris3.hvild \
import \
list_impl, \
paginated_list_impl, \
insert_impl, \
update_impl, \
get_impl, \
searchable_list_impl, \
delete_impl
def list(... | {
"repo_name": "russomi/ferris3-tutorial",
"path": "app/ext/hvild_restful.py",
"copies": "1",
"size": "4334",
"license": "apache-2.0",
"hash": 8698364710369731000,
"line_mean": 27.8933333333,
"line_max": 103,
"alpha_frac": 0.6575911398,
"autogenerated": false,
"ratio": 3.6947996589940324,
"confi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.