text stringlengths 0 1.05M | meta dict |
|---|---|
"""Model configuration for VID dataset"""
import numpy as np
from config import base_model_config
def vid_yolo_config():
"""Specify the parameters to tune below."""
mc = base_model_config('VID')
mc.DEBUG_MODE = False
# Data Augmentation
mc.LOSS_TYPE = 'YOLO'
mc.DATA_... | {
"repo_name": "goan15910/ConvDet",
"path": "src/config/vid_yolo_config.py",
"copies": "1",
"size": "2067",
"license": "bsd-2-clause",
"hash": -5466017603992881000,
"line_mean": 23.0348837209,
"line_max": 77,
"alpha_frac": 0.4794388002,
"autogenerated": false,
"ratio": 2.8353909465020575,
"confi... |
__author__ = ''
class ToolMetric(object):
def __init__(self, list_of_files, test_case, tool):
self.list_of_files = list_of_files
self.test_case = test_case
self.tool = tool
self.metrics = []
self.parser_objects = []
def gather_metrics(self):
for parser_object i... | {
"repo_name": "tazmanrising/ppa",
"path": "genCSV/Metrics/ToolMetric.py",
"copies": "1",
"size": "5691",
"license": "mit",
"hash": 8121470662310176000,
"line_mean": 47.2372881356,
"line_max": 115,
"alpha_frac": 0.6411878404,
"autogenerated": false,
"ratio": 3.884641638225256,
"config_test": fal... |
__author__ = '\n ~\n . .\n /V\\\n // \\\\\n /(___)\\\n ^ ~ ^\nd i b i t s'
# -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
from django.template import Context, Template
from cabot.cabotapp.alert import AlertPlugin, AlertPluginUserData
from os import environ as env... | {
"repo_name": "dibits/cabot-alert-opsgenie",
"path": "cabot_alert_opsgenie/models.py",
"copies": "1",
"size": "2832",
"license": "mit",
"hash": -5200372026997761000,
"line_mean": 33.5487804878,
"line_max": 250,
"alpha_frac": 0.5674435028,
"autogenerated": false,
"ratio": 3.927877947295423,
"con... |
__author__ = 'Noah Peeters'
import copy
import mathexpressions.lib as lib
print_indent = 0
class Kind():
K_OPERATOR = 0
K_FUNCTION = 1
K_CONST = 2
K_VAR = 3
K_BRACKET = 4
K_LATEX = 5
class Part:
def __init__(self, kind, name, value, parts):
self.name = name
self.kind ... | {
"repo_name": "NoahPeeters/pymathexpressions",
"path": "mathexpressions/__init__.py",
"copies": "1",
"size": "10417",
"license": "mit",
"hash": -4621204866235647000,
"line_mean": 34.5563139932,
"line_max": 109,
"alpha_frac": 0.4396659307,
"autogenerated": false,
"ratio": 4.146894904458598,
"con... |
__author__ = 'Noah Peeters'
import time
import mathexpressions
# first create a parser object
parser = mathexpressions.Parser()
# add all variables; the value will not be used while parsing and improving
# variable names can be as long as you want
# variable names are case sensitive
# variable names can not start ... | {
"repo_name": "NoahPeeters/pymathexpressions",
"path": "example.py",
"copies": "1",
"size": "2130",
"license": "mit",
"hash": 1295896626073919700,
"line_mean": 27.7972972973,
"line_max": 114,
"alpha_frac": 0.6798122066,
"autogenerated": false,
"ratio": 3.0559540889526544,
"config_test": false,
... |
__author__ = 'noam'
import cv2
import numpy as np
from numpy import linalg
import math
from operator import itemgetter
from scipy.optimize import minimize_scalar
from matplotlib import pyplot as plt
class FindHand:
def __init__(self, image_path, hand_type):
self.image = cv2.imread(image_path)
self... | {
"repo_name": "noamkatzir/palm-hand-reading",
"path": "FindHand.py",
"copies": "1",
"size": "12535",
"license": "bsd-3-clause",
"hash": -4691154949672414000,
"line_mean": 41.0637583893,
"line_max": 118,
"alpha_frac": 0.6082169924,
"autogenerated": false,
"ratio": 3.547976224172092,
"config_test... |
__author__ = 'noam'
import FindHand as fh
import cv2
import numpy as np
from matplotlib import pyplot as plt
from scipy import ndimage
first_hand = fh.FindHand('./images/preprocessed/noam_left_hand_6.12.08_02062015.png', 'left')
# first_hand = fh.FindHand('./images/preprocessed/noam_right_hand_19.08.08_02062015.png', ... | {
"repo_name": "noamkatzir/palm-hand-reading",
"path": "main.py",
"copies": "1",
"size": "4822",
"license": "bsd-3-clause",
"hash": 6916383225395187000,
"line_mean": 44.9333333333,
"line_max": 184,
"alpha_frac": 0.7386976358,
"autogenerated": false,
"ratio": 2.7382169222032937,
"config_test": fa... |
__author__ = 'noam'
__author__ = 'noam'
import os
import cv2
import numpy as np
from matplotlib import pyplot as plt
imagesPath = '../images/preprocessed/'
lefthand = cv2.imread(imagesPath+'noam_left_hand_30.5.15_02062015_0001.png', 0)
small = cv2.resize(lefthand, (0, 0), fx=0.5**6, fy=0.5**6)
# lefthand = cv2.imre... | {
"repo_name": "noamkatzir/palm-hand-reading",
"path": "tests/test3.py",
"copies": "1",
"size": "2312",
"license": "bsd-3-clause",
"hash": 4079377126862563000,
"line_mean": 24.6888888889,
"line_max": 95,
"alpha_frac": 0.669550173,
"autogenerated": false,
"ratio": 2.3166332665330662,
"config_test... |
__author__ = 'noam'
import os
import cv2
import numpy as np
from matplotlib import pyplot as plt
from numpy import linalg
from operator import itemgetter, attrgetter, methodcaller
# return list of center sorted descending to the contour area
# and the min rect cordinates
def mapPalmAndFingers(contours, image):
ha... | {
"repo_name": "noamkatzir/palm-hand-reading",
"path": "tests/test7.py",
"copies": "1",
"size": "3731",
"license": "bsd-3-clause",
"hash": 2907199535038094300,
"line_mean": 36.31,
"line_max": 105,
"alpha_frac": 0.6869471991,
"autogenerated": false,
"ratio": 2.9587628865979383,
"config_test": fal... |
__author__ = 'noam'
import os
import cv2
import numpy as np
from matplotlib import pyplot as plt
def sortObjects(contours):
areas = []
for i in xrange(len(contours)):
M = cv2.moments(contours[i])
centroid_x = int(M['m10']/M['m00'])
centroid_y = int(M['m01']/M['m00'])
# cv2.circ... | {
"repo_name": "noamkatzir/palm-hand-reading",
"path": "tests/test5.py",
"copies": "1",
"size": "2235",
"license": "bsd-3-clause",
"hash": -4747830348190614000,
"line_mean": 33.921875,
"line_max": 119,
"alpha_frac": 0.6729306488,
"autogenerated": false,
"ratio": 2.577854671280277,
"config_test":... |
__author__ = 'noam'
import os
import cv2
import numpy as np
from matplotlib import pyplot as plt
lefthand = cv2.imread('noam_left_hand_30.5.15_02062015_0001.png')
lefthand_imgray = cv2.cvtColor(lefthand,cv2.COLOR_BGR2GRAY)
small = cv2.resize(lefthand_imgray, (0, 0), fx=0.5**6, fy=0.5**6)
small = cv2.resize(small, ... | {
"repo_name": "noamkatzir/palm-hand-reading",
"path": "tests/test4.py",
"copies": "1",
"size": "1096",
"license": "bsd-3-clause",
"hash": 5046073582507500000,
"line_mean": 29.4444444444,
"line_max": 102,
"alpha_frac": 0.727189781,
"autogenerated": false,
"ratio": 2.4140969162995596,
"config_tes... |
__author__ = 'nobit'
import wx
import socket
import threading
import time
myEVT_COUNT = wx.NewEventType()
EVT_COUNT = wx.PyEventBinder(myEVT_COUNT, 1)
#
myEVT_RECV = wx.NewEventType()
EVT_RECV = wx.PyEventBinder(myEVT_RECV, 1)
class CountEvent(wx.PyCommandEvent):
"""Evetn to singal that a count value is ready
... | {
"repo_name": "VtsBlack/wxPythonServer",
"path": "app.py",
"copies": "1",
"size": "2315",
"license": "mit",
"hash": 4496119115361157600,
"line_mean": 28.6794871795,
"line_max": 94,
"alpha_frac": 0.5149028078,
"autogenerated": false,
"ratio": 4.06140350877193,
"config_test": false,
"has_no_key... |
__author__ = 'noe'
from os.path import abspath, join
from os import pardir
import numpy as np
import pyemma.util.discrete_trajectories as dt
from pyemma.msm import markov_model
class DoubleWell_Discrete_Data(object):
""" MCMC process in a symmetric double well potential, spatially discretized to 100 bins
""... | {
"repo_name": "arokem/PyEMMA",
"path": "pyemma/datasets/double_well_discrete.py",
"copies": "1",
"size": "2734",
"license": "bsd-2-clause",
"hash": -2431344216403901000,
"line_mean": 36.9722222222,
"line_max": 105,
"alpha_frac": 0.6463057791,
"autogenerated": false,
"ratio": 3.346389228886169,
... |
__author__ = 'noe'
from pyemma._base.model import SampledModel
from pyemma.msm.models.msm import MSM
from pyemma.util.types import is_iterable
class SampledMSM(MSM, SampledModel):
def __init__(self, samples, ref=None, conf=0.95):
r""" Constructs a sampled MSM
Parameters
----------
... | {
"repo_name": "arokem/PyEMMA",
"path": "pyemma/msm/models/msm_sampled.py",
"copies": "1",
"size": "15380",
"license": "bsd-2-clause",
"hash": -4047789100072291300,
"line_mean": 34.0341685649,
"line_max": 122,
"alpha_frac": 0.5630039012,
"autogenerated": false,
"ratio": 3.381706244503078,
"confi... |
__author__ = 'noe'
from pyemma._ext.sklearn.base import BaseEstimator as _BaseEstimator
from pyemma._ext.sklearn.parameter_search import ParameterGrid
from pyemma.util.log import getLogger
from pyemma.util import types as _types
import inspect
import joblib
# imports for external usage
from pyemma._ext.sklearn.base... | {
"repo_name": "arokem/PyEMMA",
"path": "pyemma/_base/estimator.py",
"copies": "1",
"size": "10404",
"license": "bsd-2-clause",
"hash": -3020611093214770000,
"line_mean": 34.7525773196,
"line_max": 133,
"alpha_frac": 0.6178392926,
"autogenerated": false,
"ratio": 4.349498327759197,
"config_test"... |
__author__ = 'noe'
from pyemma.msm.models.msm import MSM as _MSM
from pyemma.msm.estimators.maximum_likelihood_msm import MaximumLikelihoodMSM as _MLMSM
from pyemma.msm.models.msm_sampled import SampledMSM as _SampledMSM
from pyemma.util.types import ensure_dtraj_list
class BayesianMSM(_MLMSM, _SampledMSM):
""" ... | {
"repo_name": "arokem/PyEMMA",
"path": "pyemma/msm/estimators/bayesian_msm.py",
"copies": "1",
"size": "6046",
"license": "bsd-2-clause",
"hash": -2656615320233131000,
"line_mean": 42.8115942029,
"line_max": 116,
"alpha_frac": 0.6424082038,
"autogenerated": false,
"ratio": 4.065904505716207,
"c... |
__author__ = 'noe'
import copy
import numpy as np
from pyemma.msm.models.msm import MSM
from pyemma.util.annotators import shortcut
from pyemma.util.units import TimeUnit
class EstimatedMSM(MSM):
r"""Estimates a Markov model from discrete trajectories.
Parameters
----------
dtrajs : list containin... | {
"repo_name": "arokem/PyEMMA",
"path": "pyemma/msm/estimators/estimated_msm.py",
"copies": "2",
"size": "20650",
"license": "bsd-2-clause",
"hash": 5934185590476015000,
"line_mean": 42.2008368201,
"line_max": 120,
"alpha_frac": 0.6241646489,
"autogenerated": false,
"ratio": 4.320987654320987,
"... |
__author__ = 'noe'
import math
import numpy as np
import matplotlib.pylab as plt
def _add_ck_subplot(cktest, ax, i, j, ipos=None, jpos=None, y01=True, units='steps', dt=1.):
# plot estimates
lest = ax.plot(dt*cktest.lagtimes, cktest.estimates[:, i, j], color='black')
# plot error of estimates if available... | {
"repo_name": "arokem/PyEMMA",
"path": "pyemma/plots/markovtests.py",
"copies": "2",
"size": "4213",
"license": "bsd-2-clause",
"hash": -5172451713230745000,
"line_mean": 36.625,
"line_max": 117,
"alpha_frac": 0.6040826015,
"autogenerated": false,
"ratio": 3.1940864291129643,
"config_test": tru... |
__author__ = 'noe'
import numpy as np
from pyemma.msm.estimators.estimated_hmsm import EstimatedHMSM as _EstimatedHMSM
from pyemma.msm.estimators.estimated_msm import EstimatedMSM as _EstimatedMSM
from pyemma.msm.estimators.maximum_likelihood_msm import MaximumLikelihoodMSM as _MSMEstimator
from pyemma._base.estimato... | {
"repo_name": "arokem/PyEMMA",
"path": "pyemma/msm/estimators/maximum_likelihood_hmsm.py",
"copies": "1",
"size": "13718",
"license": "bsd-2-clause",
"hash": 7075092706194745000,
"line_mean": 46.6319444444,
"line_max": 120,
"alpha_frac": 0.6226855227,
"autogenerated": false,
"ratio": 3.9510368663... |
__author__ = 'noe'
import numpy as np
from pyemma.msm import estimation as msmest
from pyemma.util.annotators import shortcut
from pyemma.util.linalg import submatrix
from pyemma.util.discrete_trajectories import visited_set
class DiscreteTrajectoryStats(object):
r""" Statistics, count matrices and connectivity... | {
"repo_name": "arokem/PyEMMA",
"path": "pyemma/msm/estimators/_dtraj_stats.py",
"copies": "1",
"size": "8384",
"license": "bsd-2-clause",
"hash": 7962230091021343000,
"line_mean": 32.4023904382,
"line_max": 123,
"alpha_frac": 0.5927958015,
"autogenerated": false,
"ratio": 4.11990171990172,
"con... |
__author__ = 'noe'
import numpy as _np
from pyemma.util.types import ensure_dtraj_list
from pyemma.msm.estimators.maximum_likelihood_hmsm import MaximumLikelihoodHMSM as _MaximumLikelihoodHMSM
from pyemma.msm.models.hmsm import HMSM as _HMSM
from pyemma.msm.estimators.estimated_hmsm import EstimatedHMSM as _Estimated... | {
"repo_name": "arokem/PyEMMA",
"path": "pyemma/msm/estimators/bayesian_hmsm.py",
"copies": "1",
"size": "5583",
"license": "bsd-2-clause",
"hash": 7049083556412002000,
"line_mean": 45.5333333333,
"line_max": 119,
"alpha_frac": 0.6369335483,
"autogenerated": false,
"ratio": 3.553787396562699,
"c... |
__author__ = 'Nolan Nichols <http://orcid.org/0000-0003-1099-3328>'
import os
import StringIO
import rdflib
import pandas as pd
# Access namespace objects as attributes
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self... | {
"repo_name": "nicholsn/niquery",
"path": "niquery/utils.py",
"copies": "1",
"size": "1399",
"license": "apache-2.0",
"hash": 235348082532471840,
"line_mean": 28.7872340426,
"line_max": 73,
"alpha_frac": 0.6125804146,
"autogenerated": false,
"ratio": 3.261072261072261,
"config_test": false,
"... |
__author__ = '@nolram'
import os
import django
from Crawler.models import Sites, Categorias, LinksRSS
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
django.setup()
class PrimeiraAdicao:
def __init__(self):
arq_sites = open(os.path.join(BASE_DIR, "Crawler", "arquivos_iniciais")+"/links_sites",... | {
"repo_name": "nolram/NewsReader-Django",
"path": "Crawler/add_some_sites.py",
"copies": "1",
"size": "1901",
"license": "mit",
"hash": -7664620803611715000,
"line_mean": 34.8679245283,
"line_max": 101,
"alpha_frac": 0.5549710679,
"autogenerated": false,
"ratio": 3.1473509933774833,
"config_tes... |
__author__ = 'nolram'
import re
import json
import html
import nltk
import string
class RSSModel:
def __init__(self, dados, link, link_real, fk_rss):
self.titulo = dados["title"]
self.link = link
self.link_real = link_real
self.fk_rss = fk_rss
self.texto = ""
self.i... | {
"repo_name": "nolram/NewsReader-Django",
"path": "scripts/rssmodel_w_nltk.py",
"copies": "1",
"size": "2794",
"license": "mit",
"hash": -1995794837040544800,
"line_mean": 32.2619047619,
"line_max": 85,
"alpha_frac": 0.5078740157,
"autogenerated": false,
"ratio": 3.780784844384303,
"config_test... |
__author__ = 'nolram'
import sys
import django
import requests
import feedparser as fp
from Crawler.models import LinksRSS, Postagens, TagsPostagens, Tags
from Crawler.rssmodel import RSSModel
from requests.exceptions import ConnectionError, TooManyRedirects
from django.db.utils import IntegrityError
from django.db... | {
"repo_name": "nolram/NewsReader-Django",
"path": "scripts/crawler_rss_thread.py",
"copies": "1",
"size": "4772",
"license": "mit",
"hash": -4457639733601347000,
"line_mean": 39,
"line_max": 112,
"alpha_frac": 0.4466386555,
"autogenerated": false,
"ratio": 4.407407407407407,
"config_test": fals... |
__author__ = 'nolram'
import time
import requests
import feedparser as fp
from Crawler.models import LinksRSS, Postagens, TagsPostagens
from requests.exceptions import ConnectionError
from Crawler.rssmodel import RSSModel
def do_crawler():
tempo1 = time.time()
import django
django.setup()
print("Co... | {
"repo_name": "nolram/NewsReader-Django",
"path": "scripts/teste_tasks_coleta.py",
"copies": "1",
"size": "2543",
"license": "mit",
"hash": 4127034996612607500,
"line_mean": 42.0847457627,
"line_max": 117,
"alpha_frac": 0.4893784422,
"autogenerated": false,
"ratio": 3.9472049689440993,
"config_... |
__author__ = 'NoNotCar'
from Img import img2, img32, imgstrip, imgstrip2
from random import choice, randint, shuffle
import pygame, math
pi=math.pi
tau=2*pi
right=pi/2
def iround(fl):
return int(round(fl))
class Path(object):
def __init__(self, path):
self.path = path
def get_score(self, end):
... | {
"repo_name": "NoNotCar/BombAdventures",
"path": "Entities.py",
"copies": "1",
"size": "19742",
"license": "mit",
"hash": 2756107491495048000,
"line_mean": 28.2041420118,
"line_max": 116,
"alpha_frac": 0.4793334009,
"autogenerated": false,
"ratio": 3.20487012987013,
"config_test": false,
"has... |
__author__ = 'NoNotCar'
import Img, Entities
class Tile(object):
img = None
solid = True
slippery = False
def update(self, world, x, y):
pass
class Grass(Tile):
img = Img.img2("Grass")
class Goal(Tile):
img = Img.imgsz("Goal", (32, 40))
class BonusGoal(Tile):
img = Img.imgsz... | {
"repo_name": "NoNotCar/BombAdventures",
"path": "Tiles.py",
"copies": "1",
"size": "3426",
"license": "mit",
"hash": 9151228907080109000,
"line_mean": 29.5892857143,
"line_max": 117,
"alpha_frac": 0.5610040864,
"autogenerated": false,
"ratio": 2.57593984962406,
"config_test": false,
"has_no_... |
__author__ = 'NoNotCar'
import Img, Entities, Tiles, Object, FX, pygame, Bosses
from random import randint
powerup = Img.sndget("powerup")
exp = Img.sndget("explode")
class World(object):
rumbling=0
rtime=0
boss=None
def __init__(self, edit, level=None):
self.edit = edit
self.playerde... | {
"repo_name": "NoNotCar/BombAdventures",
"path": "World.py",
"copies": "1",
"size": "9744",
"license": "mit",
"hash": 5949393849781648000,
"line_mean": 33.5531914894,
"line_max": 105,
"alpha_frac": 0.42477422,
"autogenerated": false,
"ratio": 3.3692946058091287,
"config_test": false,
"has_no_... |
__author__ = 'NoNotCar'
import Img, Entities, Tiles, Object, FX, pygame
from random import randint
import BattlePlayers
powerup = Img.sndget("powerup")
exp = Img.sndget("explode")
class World(object):
pconv=[BattlePlayers.Player,BattlePlayers.FatPlayer,BattlePlayers.SmallPlayer,BattlePlayers.ThinPlayer,BattlePla... | {
"repo_name": "NoNotCar/BombAdventures",
"path": "BattleWorld.py",
"copies": "1",
"size": "7185",
"license": "mit",
"hash": 3340935390485007000,
"line_mean": 32.1105990783,
"line_max": 133,
"alpha_frac": 0.4411969381,
"autogenerated": false,
"ratio": 3.3843617522374,
"config_test": false,
"ha... |
__author__ = 'NoNotCar'
import Object, Img, GameRegistry, GUI, Img, pygame, sys
class CrGUI(GUI.GUI):
def __init__(self, crafter):
self.cr = crafter
def run(self, screen, player):
recrects = []
while True:
for e in pygame.event.get():
if e.type==pygame.QUIT... | {
"repo_name": "NoNotCar/monolith",
"path": "Monolith/Crafting.py",
"copies": "1",
"size": "2144",
"license": "mit",
"hash": -7524348795234018000,
"line_mean": 36.6140350877,
"line_max": 92,
"alpha_frac": 0.5368470149,
"autogenerated": false,
"ratio": 3.5792988313856426,
"config_test": false,
... |
__author__ = 'NoNotCar'
import pygame
import os
np = os.path.normpath
loc = os.getcwd() + "/Assets/"
pygame.mixer.init()
def img(fil):
return pygame.image.load(np(loc + fil + ".png"))
def img2(fil):
return pygame.transform.scale2x(pygame.image.load(np(loc + fil + ".png"))).convert_alpha()
def img32(fil):
... | {
"repo_name": "NoNotCar/BombAdventures",
"path": "Img.py",
"copies": "1",
"size": "1824",
"license": "mit",
"hash": 7648511956551101000,
"line_mean": 28.9016393443,
"line_max": 116,
"alpha_frac": 0.6430921053,
"autogenerated": false,
"ratio": 2.895238095238095,
"config_test": false,
"has_no_k... |
__author__ = 'NoNotCar'
import pygame, sys
pygame.init()
screen = pygame.display.set_mode((640, 704))
import World
import Tiles
import Img
clock = pygame.time.Clock()
selmenu=0
selobjs=[0 for _ in Tiles.tilemenus+Tiles.objmenus]
w=World.World(True)
expimg=Img.img2("Exp")
pexpimg=Img.img2("ExpPen")
bombimg=Img.img2("Bo... | {
"repo_name": "NoNotCar/BombAdventures",
"path": "editor.py",
"copies": "1",
"size": "3398",
"license": "mit",
"hash": -4177709374834294000,
"line_mean": 42.0253164557,
"line_max": 145,
"alpha_frac": 0.5503237198,
"autogenerated": false,
"ratio": 3.1117216117216118,
"config_test": false,
"has... |
__author__ = 'NoNotCar'
import pygame, sys, os
pygame.init()
pygame.font.init()
screen = pygame.display.set_mode((640, 704))
import BattleWorld, Img
from random import choice
import Controllers
pdf = pygame.font.get_default_font()
tfont=pygame.font.Font(pdf,60)
sfont=pygame.font.Font(pdf,20)
clock = pygame.time.Clock(... | {
"repo_name": "NoNotCar/BombAdventures",
"path": "battle.py",
"copies": "1",
"size": "3377",
"license": "mit",
"hash": -1778547287202426400,
"line_mean": 33.4693877551,
"line_max": 139,
"alpha_frac": 0.5910571513,
"autogenerated": false,
"ratio": 2.9162348877374784,
"config_test": false,
"has... |
__author__ = 'Nonthakon Jitchiranant'
def jaccard_compare(text1, text2):
text1 = remove_stopwords(text1)
text2 = remove_stopwords(text2)
same_word = []
for i in text1:
for j in text2:
if i == j:
same_word.append(text1)
return len(same_word) / ((len(text1) + len(t... | {
"repo_name": "nonkung51/IntentParser",
"path": "intentparser/utils.py",
"copies": "1",
"size": "2221",
"license": "apache-2.0",
"hash": 5512680543319679000,
"line_mean": 48.3555555556,
"line_max": 90,
"alpha_frac": 0.4565511031,
"autogenerated": false,
"ratio": 2.8732212160413972,
"config_test... |
__author__ = 'norbit'
#!/usr/bin/env python
import wx
import wx.animate
import app
import threading
from app import EVT_COUNT, EVT_RECV, Countingthread
class MyFrame(wx.Frame):
""" We simply derive a new class of Frame. """
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=tit... | {
"repo_name": "VtsBlack/wxPythonServer",
"path": "wxServer.py",
"copies": "1",
"size": "2318",
"license": "mit",
"hash": 5346652478330627000,
"line_mean": 25.9534883721,
"line_max": 87,
"alpha_frac": 0.6078515962,
"autogenerated": false,
"ratio": 3.210526315789474,
"config_test": false,
"has_... |
__author__ = 'NovikovII'
from model.group import Group
from model.contact import Contact
import mysql.connector
class DbFixture:
def __init__(self, host, database, user, password):
self.host = host
self.database = database
self.user = user
self.password = password
self.con... | {
"repo_name": "assassinen/python_training",
"path": "fixture/db.py",
"copies": "1",
"size": "2054",
"license": "apache-2.0",
"hash": -3150704163787379000,
"line_mean": 36.8333333333,
"line_max": 109,
"alpha_frac": 0.5220372184,
"autogenerated": false,
"ratio": 4.3354564755838645,
"config_test":... |
__author__ = 'NovikovII'
from pony.orm import *
from datetime import datetime
from model.group import Group
from model.contact import Contact
from pymysql.converters import decoders
from pymysql.converters import encoders, decoders, convert_mysql_timestamp
conv = encoders
conv.update(decoders)
conv[datetime] = convert_... | {
"repo_name": "assassinen/python_training",
"path": "fixture/orm.py",
"copies": "1",
"size": "2807",
"license": "apache-2.0",
"hash": -6127679934059824000,
"line_mean": 37.9444444444,
"line_max": 141,
"alpha_frac": 0.6729671897,
"autogenerated": false,
"ratio": 3.6321243523316062,
"config_test"... |
__author__ = 'NovikovII'
from model.contact import Contact
from model.group import Group
import random
def test_del_contact_from_group(app, orm, data_contacts, data_groups):
all_groups = orm.get_group_list()
all_contacts = orm.get_contact_list()
# получаем список групп в которых есть контакты
groups ... | {
"repo_name": "assassinen/python_training",
"path": "test/test_del_contact_from_group.py",
"copies": "1",
"size": "1528",
"license": "apache-2.0",
"hash": 9047720531787929000,
"line_mean": 41.2941176471,
"line_max": 101,
"alpha_frac": 0.6668984701,
"autogenerated": false,
"ratio": 2.8645418326693... |
__author__ = 'NovikovII'
from model.contact import Contact
import random
import string
import jsonpickle
import os.path
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
# print help information and exit:
getopt.... | {
"repo_name": "assassinen/python_training",
"path": "genereator/contact.py",
"copies": "1",
"size": "1359",
"license": "apache-2.0",
"hash": -4186864341405856000,
"line_mean": 26.7551020408,
"line_max": 94,
"alpha_frac": 0.5938189845,
"autogenerated": false,
"ratio": 3.52987012987013,
"config_t... |
__author__ = 'NovikovII'
from model.contact import Contact
import random
import string
def random_string(prefix, maxlen):
#symbols = string.ascii_letters + string.digits + string.punctuation + " "*10
symbols = string.ascii_letters + string.digits #+ " "*10
return prefix + "".join([random.choice(symbols) ... | {
"repo_name": "assassinen/python_training",
"path": "data/contacts.py",
"copies": "1",
"size": "1669",
"license": "apache-2.0",
"hash": 6680294898995002000,
"line_mean": 34.1956521739,
"line_max": 94,
"alpha_frac": 0.5015441631,
"autogenerated": false,
"ratio": 3.621923937360179,
"config_test":... |
__author__ = 'NovikovII'
from model.contact import Contact
import random
def test_add_contact_to_group(app, orm, data_contacts, data_groups):
# создаем группу если список групп пуст
if app.group.count() == 0:
app.group.create(data_groups)
all_groups = orm.get_group_list()
group = random.choic... | {
"repo_name": "assassinen/python_training",
"path": "test/test_add_contact_to_group.py",
"copies": "1",
"size": "1093",
"license": "apache-2.0",
"hash": -7276931866169971000,
"line_mean": 39.75,
"line_max": 105,
"alpha_frac": 0.7011258956,
"autogenerated": false,
"ratio": 2.5710526315789473,
"c... |
__author__ = 'NovikovII'
from model.contact import Contact
import re
import time
class ContactHelper:
def __init__(self, app):
self.app = app
def add_contact(self, entry):
wd = self.app.wd
wd.find_element_by_link_text("add new").click()
for key, item in entry.paramentr.items(... | {
"repo_name": "assassinen/python_training",
"path": "fixture/contact.py",
"copies": "1",
"size": "6491",
"license": "apache-2.0",
"hash": 4595454494145188000,
"line_mean": 37.1823529412,
"line_max": 189,
"alpha_frac": 0.5706362656,
"autogenerated": false,
"ratio": 3.3701973001038423,
"config_te... |
__author__ = 'NovikovII'
from model.group import Group
import random
import string
import jsonpickle
import os.path
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
# print help information and exit:
getopt.usag... | {
"repo_name": "assassinen/python_training",
"path": "genereator/group.py",
"copies": "1",
"size": "1398",
"license": "apache-2.0",
"hash": 37733410442269810,
"line_mean": 26.431372549,
"line_max": 115,
"alpha_frac": 0.6359084406,
"autogenerated": false,
"ratio": 3.19908466819222,
"config_test":... |
__author__ = 'NovikovII'
from model.group import Group
import random
import string
constant = [
Group(name="name1", header="header1", footer="footer1"),
]
def random_string(prefix, maxlen):
symbols = string.ascii_letters + string.digits #+ string.punctuation + " "*10
return prefix + "".join([random.cho... | {
"repo_name": "assassinen/python_training",
"path": "data/groups.py",
"copies": "1",
"size": "1171",
"license": "apache-2.0",
"hash": -8330089396380744000,
"line_mean": 33.4411764706,
"line_max": 115,
"alpha_frac": 0.6396242528,
"autogenerated": false,
"ratio": 3.1226666666666665,
"config_test"... |
__author__ = 'NovikovII'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_l... | {
"repo_name": "assassinen/python_training",
"path": "fixture/group.py",
"copies": "1",
"size": "4435",
"license": "apache-2.0",
"hash": 8712394181751420000,
"line_mean": 34.7661290323,
"line_max": 100,
"alpha_frac": 0.5948139797,
"autogenerated": false,
"ratio": 3.319610778443114,
"config_test"... |
__author__ = 'NovikovII'
#from selenium.webdriver.firefox.webdriver import WebDriver
from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self, browser, base_url):
if brows... | {
"repo_name": "assassinen/python_training",
"path": "fixture/application.py",
"copies": "1",
"size": "1138",
"license": "apache-2.0",
"hash": -4064057712465100300,
"line_mean": 25.488372093,
"line_max": 65,
"alpha_frac": 0.6028119508,
"autogenerated": false,
"ratio": 4.035460992907802,
"config_... |
__author__ = 'NovikovII'
from sys import maxsize
class Contact:
def __init__(self, lastname=None, middlename=None, firstname=None, id=None, address=None, home=None, mobile=None, work=None, fax=None, email=None, email2=None, email3=None):
self.lastname = lastname
self.firstname = firstname
... | {
"repo_name": "assassinen/python_training",
"path": "model/contact_with_static_attributes.py",
"copies": "1",
"size": "1035",
"license": "apache-2.0",
"hash": -1470728847357919500,
"line_mean": 30.3939393939,
"line_max": 177,
"alpha_frac": 0.5690821256,
"autogenerated": false,
"ratio": 3.69642857... |
__author__ = 'NovikovII'
import re
import random
from model.contact import Contact
def random_contact(app):
count = app.contact.count()
return random.randint(0, count-1)
def test_contact_on_home_page(app, data_contacts):
if app.contact.count() == 0:
app.contact.add_contact(data_contacts)
#пол... | {
"repo_name": "assassinen/python_training",
"path": "test/test_contact.py",
"copies": "1",
"size": "3428",
"license": "apache-2.0",
"hash": -1392827993770946600,
"line_mean": 50.2615384615,
"line_max": 155,
"alpha_frac": 0.6719687875,
"autogenerated": false,
"ratio": 3.031847133757962,
"config_... |
__author__ = 'NovikovII'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_elemen... | {
"repo_name": "assassinen/python_training",
"path": "fixture/session.py",
"copies": "1",
"size": "1457",
"license": "apache-2.0",
"hash": 5254124923458704000,
"line_mean": 29.3541666667,
"line_max": 76,
"alpha_frac": 0.5717227179,
"autogenerated": false,
"ratio": 3.42018779342723,
"config_test"... |
__author__ = 'NovikovII'
from point import Point
import string
import random
# #random_contact()
# print(random_contact())
#
#
# testdata = [
# (str(n1)+str(n2)+str(n3)+str(n4))
# for n1 in range (10)
# for n2 in range (10)
# for n3 in range (10)
# for n4 in range (10)
# ]
#
# for i in testdat... | {
"repo_name": "assassinen/python_training",
"path": "_test/test_1.py",
"copies": "1",
"size": "1315",
"license": "apache-2.0",
"hash": 22715702390826624,
"line_mean": 14.962962963,
"line_max": 107,
"alpha_frac": 0.5522041763,
"autogenerated": false,
"ratio": 2.0266457680250785,
"config_test": f... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import re
import copy
sys.path.append(os.path.join(sys.path[0], '../lib'))
from fastMessageReaderOriginal import MessageReader
def print_missing_sequence(start_seq_num, end_seq_num):
for i in range(start_seq_num+1, end_... | {
"repo_name": "assassinen/python_training",
"path": "dump/book_from_snapshot.py",
"copies": "1",
"size": "4100",
"license": "apache-2.0",
"hash": 3303956252085446000,
"line_mean": 29.1544117647,
"line_max": 107,
"alpha_frac": 0.583902439,
"autogenerated": false,
"ratio": 3.4569983136593594,
"co... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import re
sys.path.append(os.path.join(sys.path[0], '../lib'))
from fastMessageReaderOriginal import MessageReader
def print_missing_sequence(start_seq_num, end_seq_num):
for i in range(start_seq_num+1, end_seq_num):
... | {
"repo_name": "assassinen/python_training",
"path": "dump/book_from_incremental.py",
"copies": "1",
"size": "4554",
"license": "apache-2.0",
"hash": 1630202924653160200,
"line_mean": 32.7407407407,
"line_max": 127,
"alpha_frac": 0.6108915239,
"autogenerated": false,
"ratio": 3.2093023255813953,
... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from python_example.fixture.fixture import driver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
from python_exam... | {
"repo_name": "assassinen/sel-3",
"path": "python_example/test_l14.py",
"copies": "1",
"size": "1539",
"license": "apache-2.0",
"hash": -5778614898327563000,
"line_mean": 34,
"line_max": 78,
"alpha_frac": 0.6796621183,
"autogenerated": false,
"ratio": 3.5056947608200457,
"config_test": false,
... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from python_example.fixture.fixture import driver
from selenium.webdriver.support.wait import WebDriverWait
def add_to_cart(driver, count = 1):
for i in range(count):
driver.find_element_by_css_selector("#box-most-popular a").click()... | {
"repo_name": "assassinen/sel-3",
"path": "python_example/test_l13.py",
"copies": "1",
"size": "1257",
"license": "apache-2.0",
"hash": -1198025235524138500,
"line_mean": 35.9705882353,
"line_max": 123,
"alpha_frac": 0.6801909308,
"autogenerated": false,
"ratio": 3.2734375,
"config_test": false... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
from python_example.fixture.fixture import driver
def test_l07(driver):
dr... | {
"repo_name": "assassinen/sel-3",
"path": "python_example/test_l07.py",
"copies": "1",
"size": "1326",
"license": "apache-2.0",
"hash": -5331407694552531000,
"line_mean": 38,
"line_max": 85,
"alpha_frac": 0.6681749623,
"autogenerated": false,
"ratio": 3.38265306122449,
"config_test": false,
"... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from selenium.webdriver.support.ui import Select
from python_example.fixture.fixture import driver
from python_example.fixture.random_string import random_string
def test_l11(driver):
account_info = dict(
firstname = random_string(""... | {
"repo_name": "assassinen/sel-3",
"path": "python_example/test_l11.py",
"copies": "1",
"size": "1476",
"license": "apache-2.0",
"hash": -4527698086762738000,
"line_mean": 35.9,
"line_max": 97,
"alpha_frac": 0.6558265583,
"autogenerated": false,
"ratio": 3.432558139534884,
"config_test": false,
... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from selenium.webdriver.support.wait import WebDriverWait
from python_example.fixture.fixture import driver
def is_correct_name(driver):
name_from_main_page = driver.find_element_by_css_selector("#box-campaigns .name").text
driver.find_e... | {
"repo_name": "assassinen/sel-3",
"path": "python_example/test_l10.py",
"copies": "1",
"size": "2516",
"license": "apache-2.0",
"hash": 2524014978107363000,
"line_mean": 36.552238806,
"line_max": 113,
"alpha_frac": 0.6494435612,
"autogenerated": false,
"ratio": 3.133250311332503,
"config_test":... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from python_example.fixture.fixture import driver
def test_l09_1(driver):
... | {
"repo_name": "assassinen/sel-3",
"path": "python_example/test_l09.py",
"copies": "1",
"size": "2162",
"license": "apache-2.0",
"hash": -4867482650856591000,
"line_mean": 43.1224489796,
"line_max": 169,
"alpha_frac": 0.683626272,
"autogenerated": false,
"ratio": 3.2907153729071537,
"config_test... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import os
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.wait import WebDriverWait
from python_example.fixture.fixture import driver
from python_e... | {
"repo_name": "assassinen/sel-3",
"path": "python_example/test_l12.py",
"copies": "1",
"size": "3220",
"license": "apache-2.0",
"hash": -6823650029292330000,
"line_mean": 42.5135135135,
"line_max": 111,
"alpha_frac": 0.7031055901,
"autogenerated": false,
"ratio": 3.191278493557978,
"config_test... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
import pytest
from selenium import webdriver
import string
import random
@pytest.fixture
def driver(request):
wd = webdriver.Chrome()
request.addfinalizer(wd.quit)
return wd
def test_mobile(driver):
list_pwd = []
... | {
"repo_name": "assassinen/sel-3",
"path": "python_example/test_mobile_5.py",
"copies": "1",
"size": "1157",
"license": "apache-2.0",
"hash": 2518868532061752000,
"line_mean": 26.5476190476,
"line_max": 81,
"alpha_frac": 0.6551426102,
"autogenerated": false,
"ratio": 3.324712643678161,
"config_t... |
__author__ = 'NovikovII'
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#апдейт
import os
import sys
sys.path.append(os.path.join(sys.path[0], '../lib'))
from fastMessageReaderOriginal import MessageReader
def is_order_book_message(message):
messageType = message['MessageType']
return (messageType == 'X' o... | {
"repo_name": "assassinen/python_training",
"path": "dump/incremental_vs_snapshot.py",
"copies": "1",
"size": "2298",
"license": "apache-2.0",
"hash": -1786878816634020600,
"line_mean": 24.7640449438,
"line_max": 71,
"alpha_frac": 0.6082024433,
"autogenerated": false,
"ratio": 3.5700934579439254,... |
__author__ = 'novokonst'
from general.keywords import PYTHON_KEYWORDS
from general.dummylex import *
class PythonKeyLexer(DummyLexer):
MY_KEYWORDS = PYTHON_KEYWORDS
def __init__(self):
self.t_LINE_COMMENT.__func__.__doc__ = r'\#.*'
self.t_STRING.__func__.__doc__ = r'\'.*\'|".*"'
self... | {
"repo_name": "sayon/ignoreme",
"path": "tokenizers/pythonlex/pythonkeylex.py",
"copies": "1",
"size": "1042",
"license": "mit",
"hash": -2899546665129213000,
"line_mean": 25.075,
"line_max": 65,
"alpha_frac": 0.5777351248,
"autogenerated": false,
"ratio": 3.1865443425076454,
"config_test": tru... |
__author__ = 'novokonst'
import os
import csv
def save_results(token_dict, out_dir):
for ttype, tlist in token_dict.items():
filename = out_dir + '\\' + ttype + '.txt'
out_file = open(filename, 'w')
out_file.write(str(len(tlist)) + '\n')
out_file.write('\n'.join([tok.value for tok... | {
"repo_name": "sayon/ignoreme",
"path": "tokenizers/general/utils.py",
"copies": "1",
"size": "1096",
"license": "mit",
"hash": 1347093766260586000,
"line_mean": 27.8684210526,
"line_max": 109,
"alpha_frac": 0.6177007299,
"autogenerated": false,
"ratio": 3.052924791086351,
"config_test": false,... |
__author__ = 'novokonst'
import ply.lex as lex
C_KEYWORDS = [
'auto'
, 'break'
, 'case'
, 'char'
, 'const'
, 'continue'
, 'default'
, 'do'
, 'double'
, 'else'
, 'enum'
, 'extern'
, 'float'
, 'for'
, 'goto'
, 'if'
, 'int'
, 'long'
, 'register... | {
"repo_name": "sayon/ignoreme",
"path": "tokenizers/clex/csmartlex.py",
"copies": "1",
"size": "2878",
"license": "mit",
"hash": -6954410591664633000,
"line_mean": 21.6692913386,
"line_max": 81,
"alpha_frac": 0.4909659486,
"autogenerated": false,
"ratio": 3.2704545454545455,
"config_test": fals... |
__author__ = 'novokonst'
import ply.lex as lex
JAVA_KEYWORDS = [
'abstract'
, 'assert'
, 'boolean'
, 'break'
, 'byte'
, 'case'
, 'catch'
, 'char'
, 'class'
, 'const'
, 'continue'
, 'default'
, 'do'
, 'double'
, 'else'
, 'enum'
, 'extends'
, 'fin... | {
"repo_name": "sayon/ignoreme",
"path": "tokenizers/javalex/javasmartlex.py",
"copies": "1",
"size": "3336",
"license": "mit",
"hash": -7421219724735927000,
"line_mean": 21.0993377483,
"line_max": 81,
"alpha_frac": 0.4883093525,
"autogenerated": false,
"ratio": 3.2263056092843327,
"config_test"... |
__author__ = 'novokonst'
import sys
import getopt
from utils import *
from java import *
from c import *
from python import *
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
RESULTS_DIR = os.path.join(CURRENT_DIR, 'results')
SOURCES_DIR = 'sources\\java'
JAVA_FILE_NAME = 'AbstractBiMap.java'
COMMENT_FILE_NA... | {
"repo_name": "sayon/ignoreme",
"path": "tokenizers/tokenizer.py",
"copies": "1",
"size": "3236",
"license": "mit",
"hash": 2770642948001630000,
"line_mean": 29.5377358491,
"line_max": 98,
"alpha_frac": 0.6035228677,
"autogenerated": false,
"ratio": 3.438894792773645,
"config_test": false,
"h... |
__author__ = 'nrg@purefusion.com'
# -*- coding: utf-8 -*-
"""
David J. Mark - October 2016
"""
from flask import Flask, render_template, flash, request, redirect, send_from_directory
from wtforms import Form, TextField, TextAreaField, validators, StringField, SubmitField, PasswordField
# App config.
DEBUG = True
f... | {
"repo_name": "nrg3k/pfdi-test1",
"path": "crestapp/views.py",
"copies": "1",
"size": "2581",
"license": "bsd-3-clause",
"hash": -1356190176772703500,
"line_mean": 31.2625,
"line_max": 103,
"alpha_frac": 0.5645098799,
"autogenerated": false,
"ratio": 3.5259562841530054,
"config_test": false,
... |
import os
import sys
np = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if np not in sys.path:
sys.path.append(np)
import util.log
LOG = True
class OFDPA20():
__shared_state = {}
def __init__(self, config):
self.__dict__ = self.__shared_state # makes this a singleton
... | {
"repo_name": "huxh10/iSDX",
"path": "flanc/ofdpa20.py",
"copies": "2",
"size": "8033",
"license": "apache-2.0",
"hash": 2777097448088304600,
"line_mean": 43.1373626374,
"line_max": 142,
"alpha_frac": 0.5829702477,
"autogenerated": false,
"ratio": 3.5974025974025974,
"config_test": true,
"has... |
import json
import sys
from lsassy import Lsassy, Logger, Dumper, Parser, Writer
class CMEModule:
name = 'lsassy'
description = "Dump lsass and parse the result remotely with lsassy"
supported_protocols = ['smb']
opsec_safe = True
multiple_hosts = True
def options(self, context, module_opti... | {
"repo_name": "jorik041/CrackMapExec",
"path": "cme/modules/lsassy.py",
"copies": "1",
"size": "10430",
"license": "bsd-2-clause",
"hash": -9218790468015445000,
"line_mean": 40.062992126,
"line_max": 118,
"alpha_frac": 0.5845637584,
"autogenerated": false,
"ratio": 3.881652400446595,
"config_te... |
import json
import sys
class CMEModule:
name = 'bh_owned'
description = "Set pwned computer as owned in Bloodhound"
supported_protocols = ['smb']
opsec_safe = True
multiple_hosts = True
def options(self, context, module_options):
"""
URI URI for Neo4j database ... | {
"repo_name": "jorik041/CrackMapExec",
"path": "cme/modules/bh_owned.py",
"copies": "1",
"size": "3046",
"license": "bsd-2-clause",
"hash": 8496770725908164000,
"line_mean": 37.0875,
"line_max": 123,
"alpha_frac": 0.5817465529,
"autogenerated": false,
"ratio": 3.609004739336493,
"config_test": ... |
from cme.helpers.logger import highlight
class User:
def __init__(self, username):
# current username
self.username = username
# user(s) we can impersonate
self.grantors = []
self.parent = None
self.is_sysadmin = False
self.dbowner = None
def __str__(s... | {
"repo_name": "byt3bl33d3r/CrackMapExec",
"path": "cme/modules/mssql_priv.py",
"copies": "1",
"size": "11256",
"license": "bsd-2-clause",
"hash": 6086072822641110000,
"line_mean": 34.175,
"line_max": 78,
"alpha_frac": 0.5505508173,
"autogenerated": false,
"ratio": 3.9453207150368033,
"config_te... |
import random
import sys
import traceback
import os
import math
import argparse
import time
import random_connected_graph
# Parses Arguments
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
description='Simulates a P2P network with random dynamic c... | {
"repo_name": "rsbrisci/Math455RandomWalkProject",
"path": "Python Solution v1.0/SimulateP2PNetwork.py",
"copies": "1",
"size": "9332",
"license": "mit",
"hash": 9037659034321969000,
"line_mean": 38.8803418803,
"line_max": 146,
"alpha_frac": 0.6496999571,
"autogenerated": false,
"ratio": 3.793495... |
from ryu.ofproto import ether
from ryu.ofproto import inet
class FlowMod(object):
def __init__(self, config, origin, flow_mod):
self.mod_types = ["insert", "remove"]
self.rule_types = ["inbound", "outbound", "main", "main-in", "main-out"]
self.config = config
self.parser =... | {
"repo_name": "huxh10/iSDX",
"path": "flanc/ofp10.py",
"copies": "3",
"size": "7367",
"license": "apache-2.0",
"hash": -8084507407682168000,
"line_mean": 43.3795180723,
"line_max": 124,
"alpha_frac": 0.5049545269,
"autogenerated": false,
"ratio": 4.320821114369502,
"config_test": true,
"has_n... |
import abc
import json
import logging
import copy
from Queue import Queue
import os
import sys
np = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if np not in sys.path:
sys.path.append(np)
import util.log
from ofdpa20 import OFDPA20
IP_ETH_TYPE = 0x0800
ARP_ETH_TYPE = 0x0806
TCP_IP_PROTO = 6
#... | {
"repo_name": "h2020-endeavour/iSDX",
"path": "flanc/lib.py",
"copies": "1",
"size": "19142",
"license": "apache-2.0",
"hash": 8260123388252212000,
"line_mean": 42.0157303371,
"line_max": 133,
"alpha_frac": 0.5450841082,
"autogenerated": false,
"ratio": 4.18038873116401,
"config_test": true,
... |
import httplib
import json
from webob import Response
from ryu.app.wsgi import ControllerBase, route
url = '/refmon/flowmod'
anomaly_url = '/refmon/anomaly'
class FlowModReceiver(ControllerBase):
def __init__(self, req, link, data, **config):
super(FlowModReceiver, self).__init__(req, link, data, **co... | {
"repo_name": "h2020-endeavour/iSDX",
"path": "flanc/rest.py",
"copies": "1",
"size": "1245",
"license": "apache-2.0",
"hash": 7640115223062315000,
"line_mean": 27.2954545455,
"line_max": 81,
"alpha_frac": 0.637751004,
"autogenerated": false,
"ratio": 3.716417910447761,
"config_test": false,
... |
import json
import logging
from Queue import Queue
import os
import sys
np = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if np not in sys.path:
sys.path.append(np)
import util.log
from ofdpa20 import OFDPA20
# COOKIES
NO_COOKIE = 0
class Config(object):
MULTISWITCH = 0
MULTITABLE =... | {
"repo_name": "huxh10/iSDX",
"path": "flanc/lib.py",
"copies": "2",
"size": "16349",
"license": "apache-2.0",
"hash": -8060168316779558000,
"line_mean": 39.4678217822,
"line_max": 133,
"alpha_frac": 0.5583216099,
"autogenerated": false,
"ratio": 4.004163605192261,
"config_test": true,
"has_no... |
from ss_lib import vmac_next_hop_mask, vmac_participant_match, vmac_participant_mask, vmac_next_hop_match, vmac_part_port_match
# PRIORITIES (Values can be in [0,65535], 0 is miss)
FLOW_MISS_PRIORITY = 0
# outbound switch priorities
OUTBOUND_HIT_PRIORITY = 2
# inbound switch priorities
INBOUND_HIT_PRIORITY = 4
IN... | {
"repo_name": "huxh10/iSDX",
"path": "pctrl-sgdx/ss_rule_scheme.py",
"copies": "3",
"size": "8460",
"license": "apache-2.0",
"hash": 4054715585770731000,
"line_mean": 30.8045112782,
"line_max": 127,
"alpha_frac": 0.5956264775,
"autogenerated": false,
"ratio": 3.8524590163934427,
"config_test": ... |
import json
from multiprocessing import Queue
import os
from Queue import Empty
from time import time
from ryu import cfg
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER, DEAD_DISPATCHER, set_ev_cls
from ryu.ofproto import ofproto_v1_0, ofproto... | {
"repo_name": "h2020-endeavour/iSDX",
"path": "flanc/refmon.py",
"copies": "1",
"size": "6608",
"license": "apache-2.0",
"hash": -4162159598113851400,
"line_mean": 36.3333333333,
"line_max": 140,
"alpha_frac": 0.5924636804,
"autogenerated": false,
"ratio": 3.806451612903226,
"config_test": true... |
import numpy
from statistics.AUC import CalculateAUCandCI
def DetermineAUCandCI(featureExtractor, nf, classifierFactory, (dsTraining, dsTesting), ERlabels = None):
if featureExtractor.name in ["SCPunsupervisedFeatureExtractor", "SCPFeatureExtractor", "PatsialouGeneSignature", "VantVeerGeneSignature", "ErasmusMC... | {
"repo_name": "chStaiger/ACES-Training",
"path": "code/statistics/PerformanceCurve.py",
"copies": "1",
"size": "3524",
"license": "mit",
"hash": -5847318551580507000,
"line_mean": 47.2739726027,
"line_max": 195,
"alpha_frac": 0.7531214529,
"autogenerated": false,
"ratio": 3.986425339366516,
"co... |
from sklearn.metrics import roc_curve, auc
import numpy
# See http://en.wikipedia.org/wiki/Receiver_operating_characteristic for a good discussion of the ROC and AUC.
import itertools
def CalculateAUCandCI(scores, outcomes):
auc = CalculateAUC(scores, outcomes)
ci = CalculateCI(scores, outcomes)
return ... | {
"repo_name": "chStaiger/ACES-Training",
"path": "code/statistics/AUC.py",
"copies": "1",
"size": "4982",
"license": "mit",
"hash": 2759891319063742000,
"line_mean": 32.4362416107,
"line_max": 114,
"alpha_frac": 0.6222400642,
"autogenerated": false,
"ratio": 3.515878616796048,
"config_test": fa... |
import numpy, random, json
class ExpressionDataset(object):
def __init__(self, name, expressionData, geneLabels, patientClassLabels, patientLabels, checkNormalization, checkClassLabels = True):
self.name = name
self.expressionData = expressionData
self.geneLabels ... | {
"repo_name": "chStaiger/ACES-Training",
"path": "code/datatypes/ExpressionDataset.py",
"copies": "1",
"size": "9115",
"license": "mit",
"hash": 7005927151110851000,
"line_mean": 40.4318181818,
"line_max": 148,
"alpha_frac": 0.6704333516,
"autogenerated": false,
"ratio": 4.069196428571429,
"con... |
import random
class GeneSetCollection:
def __init__(self, name, geneSets, geneSetsNames, release):
self.name = name
self.geneSets = geneSets
self.geneSetsNames = geneSetsNames
self.release = release
def getNodes(self):
return frozenset.union(*[frozenset(s) for s... | {
"repo_name": "chStaiger/ACES-Training",
"path": "code/datatypes/GeneSetCollection.py",
"copies": "1",
"size": "3058",
"license": "mit",
"hash": 1700128091083168000,
"line_mean": 29.2772277228,
"line_max": 126,
"alpha_frac": 0.5945062132,
"autogenerated": false,
"ratio": 3.8272841051314144,
"co... |
from __future__ import print_function
from math import exp, log
import numpy as np
import statsmodels.api as sm
from scipy.stats import ncx2
from Model import Model
from compare_estimators import compare_estimators
class CIR(Model):
def __init__(self):
Model.__init__(self)
#super(Mod... | {
"repo_name": "khrapovs/finmetrix-code",
"path": "CIR.py",
"copies": "1",
"size": "2989",
"license": "mit",
"hash": 4000613330137736700,
"line_mean": 28.0291262136,
"line_max": 77,
"alpha_frac": 0.5078621613,
"autogenerated": false,
"ratio": 2.947731755424063,
"config_test": false,
"has_no_ke... |
from __future__ import print_function
import numpy as np
from numpy.linalg import inv
import matplotlib.pylab as plt
from scipy.optimize import minimize
from scipy.stats.kde import gaussian_kde
from scipy.stats import norm
from functools import reduce
class Model(object):
def __init__(self):
self.pat... | {
"repo_name": "khrapovs/finmetrix-code",
"path": "Model.py",
"copies": "1",
"size": "4465",
"license": "mit",
"hash": -5128434802076428000,
"line_mean": 33.0916030534,
"line_max": 75,
"alpha_frac": 0.5039193729,
"autogenerated": false,
"ratio": 3.263888888888889,
"config_test": false,
"has_no... |
from __future__ import print_function
import pandas as ps
ps.set_option('float_format', '{:8.3f}'.format)
def compare_estimators(model, x, theta_true):
theta_ols_euler = model.estimate_ols_euler(x)
theta_ols_exact = model.estimate_ols_exact(x)
theta_qmle_euler = model.estimate_qmle(x, theta_ols_exact, 'e... | {
"repo_name": "khrapovs/finmetrix-code",
"path": "compare_estimators.py",
"copies": "1",
"size": "1163",
"license": "mit",
"hash": 2134495216844532000,
"line_mean": 39.1379310345,
"line_max": 77,
"alpha_frac": 0.6483233018,
"autogenerated": false,
"ratio": 2.795673076923077,
"config_test": fals... |
import numpy as np
from math import exp, log
from Model import Model
from compare_estimators import compare_estimators
class Vasicek(Model):
def __init__(self):
#super(Model, self).__init__()
Model.__init__(self)
self.names = ['kappa','mu','sigma']
def drift(self, x, the... | {
"repo_name": "khrapovs/finmetrix-code",
"path": "Vasicek.py",
"copies": "1",
"size": "2390",
"license": "mit",
"hash": -3317936259156086000,
"line_mean": 26.8023255814,
"line_max": 70,
"alpha_frac": 0.539748954,
"autogenerated": false,
"ratio": 3.032994923857868,
"config_test": false,
"has_n... |
import numpy as np
from numpy.random import multivariate_normal
import matplotlib.pylab as plt
class Heston(object):
def __init__(self):
self.eps = None
self.names = ['mu_r','kappa','mu_v','eta','rho']
def drift_S(self, x, theta):
"""Price drift."""
mu_r, kappa, mu_v,... | {
"repo_name": "khrapovs/finmetrix-code",
"path": "Heston.py",
"copies": "1",
"size": "4585",
"license": "mit",
"hash": -5060805503368829000,
"line_mean": 30.6275862069,
"line_max": 75,
"alpha_frac": 0.5212649945,
"autogenerated": false,
"ratio": 3.2656695156695155,
"config_test": false,
"has_... |
import numpy as np
import pandas as ps
import matplotlib as mpl
import matplotlib.pylab as plt
from GBM import GBM
from Vasicek import Vasicek
from CIR import CIR
from compare_estimators import compare_estimators
# Printing options for nicer output.
mpl.rcParams.update({'font.size': 10})
np.set_printoptions(precisio... | {
"repo_name": "khrapovs/finmetrix-code",
"path": "main.py",
"copies": "1",
"size": "1845",
"license": "mit",
"hash": -2956411693214326300,
"line_mean": 29.262295082,
"line_max": 77,
"alpha_frac": 0.691598916,
"autogenerated": false,
"ratio": 2.5985915492957745,
"config_test": false,
"has_no_k... |
import numpy as np
import pandas as ps
import statsmodels.api as sm
from Model import Model
from compare_estimators import compare_estimators
class GBM(Model):
def __init__(self):
#super(Model, self).__init__()
Model.__init__(self)
self.names = ['mu','sigma']
def drift(self, x, ... | {
"repo_name": "khrapovs/finmetrix-code",
"path": "GBM.py",
"copies": "1",
"size": "1902",
"license": "mit",
"hash": 7428777042656139000,
"line_mean": 24.7162162162,
"line_max": 73,
"alpha_frac": 0.5778128286,
"autogenerated": false,
"ratio": 3.185929648241206,
"config_test": false,
"has_no_ke... |
import unittest
import sys
import os
import argparse
import subprocess
import filecmp
from yamboparser import YamboFile, YamboFolder
folder = os.path.dirname(os.path.realpath(__file__))+'/testdata/t1_errors_warnings'
fold = YamboFolder(folder)
fold.yambofiles
fl = YamboFile('o-GW_run.10.720.qp',folder)
print
prin... | {
"repo_name": "alexmoratalla/yambo-py",
"path": "tests/parser/test_verbose.py",
"copies": "4",
"size": "1209",
"license": "bsd-3-clause",
"hash": 7705187949915671000,
"line_mean": 18.8196721311,
"line_max": 83,
"alpha_frac": 0.7245657568,
"autogenerated": false,
"ratio": 2.4424242424242424,
"co... |
__author__ = 'ntrepid8'
from collections import namedtuple, Mapping
import os
import calendar
import time
import traceback
import json
import requests
DUMP_PATH = '/tmp/agilebot_dumps'
def dump_resp(resp):
if not os.path.exists(DUMP_PATH):
os.makedirs(DUMP_PATH)
dp_kwargs = dict(
dump_path=DU... | {
"repo_name": "ntrepid8/agilebot",
"path": "agilebot/util.py",
"copies": "1",
"size": "3629",
"license": "mit",
"hash": 2522798085920080400,
"line_mean": 30.8333333333,
"line_max": 109,
"alpha_frac": 0.6040231469,
"autogenerated": false,
"ratio": 3.547409579667644,
"config_test": false,
"has_... |
__author__ = 'ntrepid8'
from functools import wraps, partial
from collections import deque
from time import time, sleep
from pprint import pformat as lib_pformat
import requests
import json
import re
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format="%(message)s")
logging.get... | {
"repo_name": "MaaSiveNet/maasive-py",
"path": "maasivepy/maasivepy.py",
"copies": "1",
"size": "10442",
"license": "mit",
"hash": -225239443650785920,
"line_mean": 29.5321637427,
"line_max": 92,
"alpha_frac": 0.5361999617,
"autogenerated": false,
"ratio": 3.734620886981402,
"config_test": fals... |
__author__ = 'ntrepid8'
from requests_oauthlib import OAuth1
import requests
from agilebot import util
import logging
from logging import NullHandler
from fnmatch import fnmatch
import json
logger = logging.getLogger('agilebot.lib.trello')
logger.addHandler(NullHandler())
TRELLO_API_BASE_URL = 'https://api.trello.com/1... | {
"repo_name": "ntrepid8/agilebot",
"path": "agilebot/trello/bot.py",
"copies": "1",
"size": "9627",
"license": "mit",
"hash": -479493461436796300,
"line_mean": 36.7529411765,
"line_max": 112,
"alpha_frac": 0.5670510024,
"autogenerated": false,
"ratio": 3.907061688311688,
"config_test": true,
... |
__author__ = 'ntrepid8'
from tornado.web import RequestHandler
from premailer import Premailer
import markdown
import os
from utils import cors_support
bootstrap_path = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'..', 'css', 'bootstrap-simple.css'
)
)
index_path = os.path.abspat... | {
"repo_name": "ntrepid8/email-css-inliner",
"path": "email_css_inliner/email_css_inliner.py",
"copies": "1",
"size": "1233",
"license": "mit",
"hash": -772513720294779500,
"line_mean": 21.0178571429,
"line_max": 52,
"alpha_frac": 0.5823195458,
"autogenerated": false,
"ratio": 3.425,
"config_tes... |
__author__ = 'ntrepid8'
import agilebot.cmd_util
import logging
from logging import NullHandler
import json
import sys
import argparse
from agilebot import util
from functools import partial
import os
logger = logging.getLogger('agilebot.slack')
logger.addHandler(NullHandler())
def create_bot(args, conf):
# updat... | {
"repo_name": "ntrepid8/agilebot",
"path": "agilebot/cmd_slack.py",
"copies": "1",
"size": "2977",
"license": "mit",
"hash": 2029056364095782400,
"line_mean": 31.0107526882,
"line_max": 111,
"alpha_frac": 0.6540141082,
"autogenerated": false,
"ratio": 3.561004784688995,
"config_test": false,
... |
__author__ = 'ntrepid8'
import agilebot.cmd_util
import logging
from logging import NullHandler
import sys
import json
import argparse
from agilebot import util
logger = logging.getLogger('agilebot.sprint')
logger.addHandler(NullHandler())
ACTIVE_PATTERN = '*(active)'
def find_sprints(args, conf):
search_args = [... | {
"repo_name": "ntrepid8/agilebot",
"path": "agilebot/cmd_sprint.py",
"copies": "1",
"size": "5924",
"license": "mit",
"hash": -1364224584411148300,
"line_mean": 33.0459770115,
"line_max": 105,
"alpha_frac": 0.6428089129,
"autogenerated": false,
"ratio": 3.412442396313364,
"config_test": false,
... |
__author__ = 'ntrepid8'
import agilebot.cmd_util
import logging
from logging import NullHandler
import sys
import json
import argparse
import os
from agilebot import util
logger = logging.getLogger('agilebot.trello')
logger.addHandler(NullHandler())
def create_bot(args, conf):
# update trello arguments
conf =... | {
"repo_name": "ntrepid8/agilebot",
"path": "agilebot/cmd_trello.py",
"copies": "1",
"size": "6312",
"license": "mit",
"hash": -2114308583077503200,
"line_mean": 35.9122807018,
"line_max": 110,
"alpha_frac": 0.6642902408,
"autogenerated": false,
"ratio": 3.3808248527048743,
"config_test": false,... |
__author__ = 'ntrepid8'
import requests
from agilebot import util
import json
class SlackBot(object):
def __init__(self, conf=None):
self.conf = util.gen_namedtuple('Slack', self.default_conf(), conf or {})
@classmethod
def default_conf(cls):
return {
'webhook_url': None,
... | {
"repo_name": "ntrepid8/agilebot",
"path": "agilebot/slack/bot.py",
"copies": "1",
"size": "1444",
"license": "mit",
"hash": 6276522329561721000,
"line_mean": 31.0888888889,
"line_max": 93,
"alpha_frac": 0.5297783934,
"autogenerated": false,
"ratio": 4.0790960451977405,
"config_test": false,
... |
__author__ = 'ntrepid8'
import requests
import logging
from logging import NullHandler
import json
from fnmatch import fnmatch
from datetime import date
from agilebot import util
from agilebot.trello.bot import TrelloBot
from agilebot.slack.bot import SlackBot
import os
logger = logging.getLogger('agilebot.lib')
logger... | {
"repo_name": "ntrepid8/agilebot",
"path": "agilebot/agilebot.py",
"copies": "1",
"size": "9379",
"license": "mit",
"hash": -5895139108888164000,
"line_mean": 38.4075630252,
"line_max": 120,
"alpha_frac": 0.552084444,
"autogenerated": false,
"ratio": 3.6968860859282615,
"config_test": false,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.