repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
OleLL/Lacourdeshit
login.py
1
1600
def login_user(username, password): """ This method tries to login a user, if it has success, it will return a json with information about username availability and password availability and a json with all cookies, if password and username were correct, these cookies can be used to make more intera...
unlicense
-8,943,531,090,483,099,000
32.333333
88
0.600625
false
antfu/biconfigs
tests/test_biconfigs.py
1
3233
import biconfigs import time import pytest import datetime write_count = 0 def test_callbacks_sync(): global write_count write_count = 0 def before_save(config): if config.get('abort_save', False): return False config = biconfigs.Biconfigs( before_save=before_save, ...
mit
8,318,902,982,305,933,000
28.126126
72
0.635633
false
KWARC/mwetoolkit
bin/old/indexlib-hacked.py
1
10320
import sys import array import codecs import xml.sax import gc from bin.libs.xmlhandler.corpusXMLHandler import CorpusXMLHandler from xmlhandler.classes.sentence import Sentence from xmlhandler.classes.word import Word from util import verbose gc.set_debug(gc.DEBUG_LEAK) NGRAM_LIMIT=16 # TODO: Unify this with patt...
gpl-3.0
3,840,044,313,128,644,600
24.994962
107
0.674419
false
mganeva/mantid
qt/python/mantidqt/project/projectsaver.py
1
5274
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + # This file is part of the mantidqt package ...
gpl-3.0
5,488,659,066,554,057,000
43.694915
118
0.639932
false
DaveBackus/Data_Bootcamp
Code/Lab/googlefinance.py
1
3562
""" This file demonstrates how to read minute level data from the Google finance api """ import datetime as dt import numpy as np import pandas as pd import pandas_datareader as pdr import requests as r import sys from io import StriongIO def retrieve_single_timeseries(ticker, secs=60, ndays=5): """ Grabs da...
mit
-5,546,010,094,546,146,000
27.269841
102
0.603593
false
LIBOTAO/keras
keras/layers/core.py
1
23220
# -*- coding: utf-8 -*- from __future__ import absolute_import, division import theano import theano.tensor as T import numpy as np from .. import activations, initializations, regularizers, constraints from ..utils.theano_utils import shared_zeros, floatX from ..utils.generic_utils import make_tuple from ..regulariz...
mit
-9,181,297,336,291,323,000
34.668203
129
0.597244
false
ebu/PlugIt
tests/proxy_internal/test_plugit.py
1
12013
from _utils import TestBase import json import uuid class TestPlugIt(TestBase): @classmethod def setup_class(self): super(TestPlugIt, self).setup_class() from plugit_proxy.plugIt import PlugIt self.plugIt = PlugIt('http://0.0.0.0/') myself = self def _doQuery(url...
bsd-3-clause
7,729,425,318,450,457,000
33.520115
213
0.6001
false
AllanYangZhou/oppia
core/domain/user_jobs_continuous_test.py
1
41847
# coding: utf-8 # # Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
-6,153,741,406,100,507,000
41.441176
80
0.602672
false
imtapps/django-dynamic-validation
dynamic_validation/templatetags/dynamic_validation_tags.py
1
1727
from django.template import Library, Node, Variable from django.template.base import TemplateSyntaxError, VariableDoesNotExist from dynamic_validation import models register = Library() __all__ = ('violations_for', ) @register.tag def violations_for(parser, token): """ usage: {% violations_for trigge...
bsd-2-clause
3,028,262,467,481,679,400
36.543478
172
0.580197
false
dmsurti/reynolds-blender
reynolds_blender/add_block.py
1
4877
#------------------------------------------------------------------------------ # Reynolds-Blender | The Blender add-on for Reynolds, an OpenFoam toolbox. #------------------------------------------------------------------------------ # Copyright| #-----------------------------------------------------------------------...
gpl-3.0
-3,872,577,958,794,681,300
33.34507
79
0.494771
false
mensi/cydra
cydra/web/themes.py
1
3596
# -*- coding: utf-8 -*- # # Copyright 2012 Manuel Stocker <mensi@mensi.ch> # # This file is part of Cydra. # # Cydra is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
gpl-3.0
5,757,212,744,961,206,000
32.924528
101
0.657119
false
bruceSz/git_syncer
gsyncer/monitor/monitor-sample.py
1
1493
import re from wsgiref.simple_server import make_server def hello_world_app(environ,start_response): status = '200 OK' headers = [('Content-type','text/plain')] print environ start_response(status,headers) return ["hello world"] def event_analyst(environ,start_response): status = '200...
apache-2.0
8,617,340,967,461,874,000
23.080645
69
0.6142
false
r0fls/sanic
sanic/app.py
1
29389
import logging import logging.config import re import warnings from asyncio import get_event_loop, ensure_future, CancelledError from collections import deque, defaultdict from functools import partial from inspect import isawaitable, stack, getmodulename from traceback import format_exc from urllib.parse import urlenc...
mit
8,392,081,556,535,385,000
38.290107
79
0.546327
false
lmanul/awty
deletesubproject.py
1
2264
# -*- coding: utf-8 -*- # # Copyright 2011 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:#www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
-2,165,215,729,044,746,500
32.791045
97
0.686396
false
windy1/headerman.py
headerman/headerman.py
1
5997
""" Copyright (c) 2014 Walker Crouse Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, ...
mit
-1,445,536,719,804,450,300
27.287736
105
0.644155
false
kurttheviking/agileid-py
tests/test_to_hexstring.py
1
1201
from bson.objectid import ObjectId import os import sys import unittest sys.path.insert(0, os.path.abspath('..')) import agileid def to_hexstring_invalid(): return agileid.to_hexstring('rar') def to_hexstring_invalid_oid(): oid = str(ObjectId()) return agileid.to_hexstring('user!' + oid) class Test(...
isc
7,302,270,909,085,578,000
22.096154
63
0.652789
false
masami256/Anaconda-for-ore-ore-kernel
pyanaconda/textw/language_text.py
1
2653
# # language_text.py: text mode language selection dialog # # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software F...
gpl-2.0
9,038,738,883,028,284,000
36.9
106
0.667169
false
aisthesis/mfstockmkt
options/db/trackpuller.py
1
1181
""" .. Copyright (c) 2016 Marshall Farrier license http://opensource.org/licenses/MIT Get options to be tracked """ import datetime as dt from bson.codec_options import CodecOptions import config import constants from dbwrapper import job class TrackPuller(object): def __init__(self, logger): self.l...
mit
2,160,462,273,301,425,200
27.119048
82
0.651143
false
tkdchen/nitrate-xmlrpc
nitratexmlrpc/api/testcaserun.py
1
23763
# -*- coding: utf-8 -*- # # Nitrate is copyright 2010 Red Hat, Inc. # # Nitrate is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. This pr...
gpl-2.0
-8,789,173,971,970,894,000
36.719048
125
0.561503
false
gchq/gaffer-tools
python-shell/src/test/test_gaffer_functions_it.py
1
2491
# # Copyright 2016-2019 Crown Copyright # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
apache-2.0
1,326,256,501,067,498,500
40.516667
85
0.690084
false
llvmpy/llvmpy
llvm_cbuilder/executor.py
1
2016
''' This is mostly a convenience module for testing with ctypes. ''' from llvm.core import Type, Module import llvm.ee as le import ctypes as ct MAP_CTYPES = { 'void' : None, 'bool' : ct.c_bool, 'char' : ct.c_char, 'uchar' : ct.c_ubyte, 'short' : ct.c_short, 'ushort' : ct.c...
bsd-3-clause
7,196,493,361,788,993,000
29.089552
77
0.525298
false
cemarchi/biosphere
Src/BioDataManagement/DataAccess/Entities/MicroRnaExpressionLevel.py
1
1169
from typing import Dict from Src.BioDataManagement.DataAccess.Entities.BiologicalMeasureType import BiologicalMeasureType from Src.Core.Entity.EntityBase import EntityBase class MicroRnaExpressionLevel(BiologicalMeasureType, EntityBase): """description of class""" def __init__(self, **kargs): """ ...
bsd-3-clause
-2,202,818,392,489,671,400
23.375
97
0.58426
false
Adward-R/InfoVis
Wang/xlsx2json.py
1
3582
#!/usr/bin/python # -*- coding: utf-8 -*- import re import sys import xlrd import xlwt def parse_sheet(sheet, filename, root): '''Parse the sheet and tranfer it to a json file''' output = file(filename, 'w') header = [] data = [] for col in range(sheet.ncols): header.append(sheet.cell_value(0, col)) f...
apache-2.0
499,859,068,934,296,000
32.166667
91
0.537968
false
piluke/BasicEventEngineFrontend
ui/eventdialog.py
1
1539
# Copyright (c) 2017-18 Luke Montalvo <lukemontalvo@gmail.com> # # This file is part of BEEF. # BEEF is free software and comes with ABSOLUTELY NO WARANTY. # See LICENSE for more details. try: import wx except ImportError: raise ImportError("The wxPython module is required to run this program") from resources.enum ...
mit
4,554,310,907,938,871,300
27.5
99
0.716049
false
rofolel/DonjonMasterExploder-
DD/combat.py
1
1449
import random import console.Combat import DD.person class battle(object): class hit(object): def __init__(self,value,attacker,attackee): self.value = value self.attacker = attacker self.attackee = attackee def __str__(self): return "%s hit %s for %i"%...
mit
2,450,213,534,410,301,000
27.98
84
0.539683
false
andrecunha/coh-metrix-dementia
coh/tools/syllable/tonic.py
1
6223
#-*- encoding:utf-8 -*- # tonic.py - Tonic vowel finding using the algorithm described in Silva [2011]. # Copyright (C) 2014 Alessandro Bokan # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation, e...
gpl-3.0
-5,512,174,839,134,250,000
32.524324
79
0.509513
false
rabitt/motif
motif/feature_extractors/melodia.py
1
2442
"""Melodia feature extractor. """ import numpy as np from motif.core import FeatureExtractor from motif.feature_extractors import utils class MelodiaFeatures(FeatureExtractor): '''Melodia feature extractor Attributes ---------- ref_hz : float Reference frequency (Hz) for converting to cents....
mit
7,241,165,139,221,410,000
23.178218
75
0.51638
false
luci/recipes-py
recipe_modules/runtime/api.py
2
2238
# Copyright 2017 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. from recipe_engine import recipe_api from recipe_engine.internal.global_shutdown import GLOBAL_SHUTDOWN class RuntimeApi(recipe_api.RecipeApi):...
apache-2.0
6,582,194,244,523,981,000
38.964286
86
0.726095
false
g1o/trinityrnaseq
util/misc/TPM_weighted_gene_length.py
1
4564
#!/usr/bin/env python # encoding: utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) import os, sys, re import logging import argparse import collections logging.basicConfig(stream=sys.stderr, level=logging.INFO) logger = logging.getLogger(__file__) de...
bsd-3-clause
5,771,329,208,924,763,000
28.445161
126
0.55872
false
Tocknicsu/nctuoj
backend/web/user.py
1
2943
from req import WebRequestHandler from req import Service import tornado import math class WebUsersHandler(WebRequestHandler): @tornado.gen.coroutine def get(self): if self.map_power['user_manage'] not in self.account['power']: self.write_error(403) return args = ["page...
mit
-8,054,346,369,479,038,000
33.623529
84
0.554536
false
andersinno/django-analog
analog/define.py
1
2981
from django.db import models from .models import BaseLogEntry all_known_log_models = {} def define_log_model( model_class, base_class=BaseLogEntry, on_delete=models.CASCADE, allow_null_target=False, ): """ Define a log model for a given Django model class ("parent model"). The log entry...
mit
-8,445,276,690,030,580,000
32.875
74
0.591077
false
gaoxiaofeng/troubleShooting
src/troubleshooting/framework/template/Keyword.py
1
1763
from troubleshooting.framework.modules.configuration import ConfigManagerInstance from troubleshooting.framework.remote.client import client from troubleshooting.framework.libraries.bash import ExecuteCommond try: #import project config.variable from config.variable import * except: print "WARN: failed to i...
apache-2.0
-7,675,281,027,310,848,000
42
112
0.684628
false
georgemarshall/django
django/db/backends/sqlite3/operations.py
5
14006
import datetime import decimal import uuid from functools import lru_cache from itertools import chain from django.conf import settings from django.core.exceptions import FieldError from django.db import utils from django.db.backends.base.operations import BaseDatabaseOperations from django.db.models import aggregates...
bsd-3-clause
2,677,806,981,463,984,600
40.934132
114
0.616165
false
stephenlienharrell/roster-dns-management
test/dnslshost_test.py
1
21050
#!/usr/bin/python # Copyright (c) 2009, Purdue University # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list ...
bsd-3-clause
-3,555,437,133,333,407,000
44.366379
106
0.528314
false
julienvey/solum
solum/tests/api/v1/test_plan.py
1
6136
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
apache-2.0
852,616,006,396,934,300
39.104575
79
0.640319
false
gmimano/commcaretest
corehq/apps/domain/utils.py
1
1991
import json import re from couchdbkit import ResourceNotFound from django.conf import settings from dimagi.utils.couch.cache import cache_core from corehq.apps.domain.models import Domain from dimagi.utils.couch.database import get_db from django.core.cache import cache DOMAIN_MODULE_KEY = 'DOMAIN_MODULE_CONFIG' ADM_D...
bsd-3-clause
-5,318,859,171,678,882,000
32.183333
131
0.639377
false
bwasti/caffe2
caffe2/python/layers/layers.py
1
10652
## @package layers # Module caffe2.python.layers.layers from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core, schema, scope from caffe2.python.layers.tags import TagContext from collections i...
apache-2.0
6,367,662,560,957,188,000
35.858131
81
0.635843
false
hiuwo/acq4
acq4/analysis/tools/Fitting.py
1
36006
#!/usr/bin/env python """ Python class wrapper for data fitting. Includes the following external methods: getFunctions returns the list of function names (dictionary keys) FitRegion performs the fitting Note that FitRegion will plot on top of the current data using MPlots routines if the current curve and the current ...
mit
-8,059,704,429,750,501,000
40.529412
168
0.498
false
JoelEager/pyTanks.Player
clientLogic/clock.py
1
5148
""" The asyncio code that maintains a consistent frame rate and runs the on-frame logic """ import math import json from datetime import datetime import asyncio import config from aiLogic import tankAI from . import clientData from .logging import logPrint running = True # The asyncio event loop will end wh...
mit
-2,692,133,474,649,516,000
34.027211
106
0.621406
false
TreesLab/NCLscan
bin/create_reference.py
1
3080
#! /usr/bin/env python2 import argparse import re import os import sys from collections import OrderedDict def create_reference_and_index(config): ''' Create the reference and index for NCLscan. 1. Repeat_ChrM 2. AllRef.fa 3. Bwa index 4. Novoalign index ''' config...
mit
-12,435,532,001,862,848
34.402299
202
0.625325
false
nilearn/nilearn_sandbox
examples/rpbi/plot_localizer_rpbi.py
1
4435
""" Massively univariate analysis of a computation task from the Localizer dataset ============================================================================== A permuted Ordinary Least Squares algorithm is run at each voxel in order to determine which voxels are specifically active when a healthy subject performs a...
bsd-3-clause
2,009,834,140,274,154,500
38.954955
88
0.644645
false
jaredmichaelsmith/grove
api/resources/UserResource.py
1
1057
# -*- coding: utf-8 -*- """HTTP resources for the comment entities.""" # Third-Party modules from flask_restful import Resource from flask_restful import fields from flask_restful import marshal_with from flask_restful import current_app # Project specific modules from api.models import User from api.utils import ...
mit
6,355,641,250,232,871,000
23.022727
57
0.640492
false
m-movahhedinia/Strigil
v_0.0.1.py
1
5683
from urllib import request from bs4 import BeautifulSoup import re from builtins import print from selenium import webdriver from selenium.webdriver.common.keys import Keys import time """ The source for the very first version of the web scrapper app. No classes or functions. Just codes. """ # Open the fil...
agpl-3.0
8,050,710,611,808,017,000
50.137615
100
0.627134
false
cvegaj/ElectriCERT
venv3/lib/python3.6/site-packages/pycoin/services/blockchain_info.py
1
2303
import io import json import warnings from .agent import request, urlencode, urlopen from pycoin.serialize import b2h, h2b from pycoin.tx import Spendable class BlockchainInfoProvider(object): def __init__(self, netcode): if netcode != 'BTC': raise ValueError("BlockchainInfo only supports ma...
gpl-3.0
-3,939,509,989,904,877,000
32.867647
91
0.566652
false
mjcollin/2016spr
notebook/lib/pos_tags.py
1
1029
import nltk class PosTags: def tag(self, t, as_dicts=True): ''' With a list of tokens, mark their part of speech and return a list dicts (no native tuple type in dataframes it seems). ''' pos = nltk.pos_tag(t) if as_dicts: return self.to_dicts(pos) ...
mit
-8,534,267,724,993,481,000
23.5
67
0.474247
false
rohe/pysaml2-3
tests/test_05_md.py
1
52530
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2009 Umeå University. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
bsd-2-clause
-7,544,428,082,442,055,000
44.244617
111
0.698776
false
serl/hls-bba-testbed
pylibs/parallelize.py
1
2494
from multiprocessing import Process, Pipe import sys, time class AsyncFunction(object): def __init__(self, fn, args=(), kwargs={}, return_obj=None, return_attr=None): self.fn = fn self.args = args self.kwargs = kwargs self.result = None self.return_obj = return_obj self.return_attr = return_attr self._c...
mit
5,573,216,130,389,557,000
23.94
79
0.651163
false
rsalmaso/scripts
scripts/cdblank.py
1
5608
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 1999-2015, Raffaele Salmaso <raffaele@salmaso.org> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, includ...
mit
-5,525,597,202,367,596,000
29.983425
131
0.54868
false
SUNET/eduid-common
src/eduid_common/api/request.py
1
9772
# # Copyright (c) 2018 NORDUnet A/S # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of ...
bsd-3-clause
-4,013,282,089,634,035,700
34.277978
99
0.630065
false
pymedusa/Medusa
medusa/providers/generic_provider.py
1
42303
# coding=utf-8 """Provider code for Generic Provider.""" from __future__ import unicode_literals import logging import operator import re from builtins import map from builtins import object from builtins import str from datetime import datetime, timedelta from os.path import join from dateutil import parser, tz f...
gpl-3.0
8,554,855,820,396,960,000
40.55501
120
0.558306
false
tkarna/cofs
test/tracerEq/test_consistency_2d.py
1
5860
""" Tracer box in 2D ================ Solves a standing wave in a rectangular basin using wave equation. This version uses a constant tracer to check local/global conservation of tracers. Initial condition for elevation corresponds to a standing wave. Time step and export interval are chosen based on theoretical osc...
mit
-2,764,781,671,774,722,000
36.088608
105
0.619795
false
aLaix2/O-Nes-Sama
DebuggerClient/PPUDebugger.py
1
8074
import wx import Breakpoint import Debugger import DialogAddBreakpoint import GUI class PPUDebuggerFrame(GUI.MainFrame, Debugger.Debugger): #constructor def __init__(self, parent): GUI.MainFrame.__init__(self, parent) Debugger.Debugger.__init__(self) self.addBreakpointFra...
gpl-3.0
-2,266,689,006,091,241,700
34.7
120
0.589918
false
fuzeman/trakt.py
tests/oauth/test_oauth.py
1
5552
from __future__ import absolute_import, division, print_function from tests.core import mock from tests.core.helpers import assert_url from trakt import Trakt, TraktClient from httmock import HTTMock from threading import Event import calendar import datetime import pytest def test_authorize_url(): Trakt.site_u...
mit
2,987,620,067,835,968,500
33.271605
108
0.597442
false
bokeh/bokeh
bokeh/client/session.py
1
21780
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
-75,138,893,511,015,490
37.548673
165
0.597107
false
zutshi/S3CAMR
examples/spi/spi_plant.py
1
2022
# Must satisfy the signature # [t,X,D,P] = sim_function(T,X0,D0,P0,I0); import numpy as np from scipy.integrate import ode import matplotlib.pyplot as PLT PLOT = True class SIM(object): def __init__(self, plt, pvt_init_data): #print I # atol = 1e-10 rtol = 1e-5 # tt,YY,dummy_D,...
bsd-2-clause
601,560,720,203,809,500
21.719101
89
0.512859
false
pvcrossi/OnlineCS
online_CS.py
1
4043
''' Bayesian Online Compressed Sensing (2016) Paulo V. Rossi & Yoshiyuki Kabashima ''' from collections import namedtuple import matplotlib.pyplot as plt import numpy as np from numpy.linalg import norm from numpy.random import normal from utils import DlnH, DDlnH, G, H, moments def simulation(method='standard'): ...
mit
-526,666,937,701,070,700
29.398496
94
0.593371
false
mtury/scapy
scapy/layers/tls/automaton.py
1
9879
# This file is part of Scapy # Copyright (C) 2007, 2008, 2009 Arnaud Ebalard # 2015, 2016, 2017 Maxence Tury # This program is published under a GPLv2 license """ The _TLSAutomaton class provides methods common to both TLS client and server. """ import struct from scapy.automaton import Automaton from ...
gpl-2.0
5,974,627,427,539,037,000
38.834677
94
0.55208
false
open-synergy/opnsynid-hr
hr_award/__openerp__.py
1
1285
# -*- coding: utf-8 -*- # Copyright 2019 OpenSynergy Indonesia # Copyright 2020 PT. Simetri Sinergi Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # pylint: disable=locally-disabled, manifest-required-author { "name": "Employee Award", "version": "8.0.2.0.0", "category": "Human Re...
agpl-3.0
-8,612,456,534,530,429,000
32.815789
69
0.612451
false
tapple/nsize-web
nsize/payroll/migrations/0001_initial.py
1
8932
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-28 04:55 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('sl_profile', '0001_initial'), (...
agpl-3.0
840,198,952,923,954,000
52.807229
347
0.566055
false
karlp/frootloop
frootloop/froot.py
1
1487
# Blobtastical import threading import logging import serial import time class Port(object): def __init__(self, dev, baud, parity): if parity == 'e': p = serial.PARITY_EVEN if parity == 'n': p = serial.PARITY_NONE if parity == 'o': p = serial.PARITY_ODD ...
bsd-3-clause
-5,600,486,113,335,836,000
24.20339
85
0.560188
false
sixdub/Minions
scan_engine/dnmap_server.py
1
25935
#! /usr/bin/env python # # DNmap Server - Edited by Justin Warner (@sixdub). Originally written by Sebastian Garcia # Orginal Copyright and license (included below) applies. # # This is the server code to be used in conjunction with Minions, a collaborative distributed # scanning solution. # # # DNmap Version Modi...
gpl-2.0
729,311,156,974,299,600
29.985663
363
0.653596
false
pySTEPS/pysteps
examples/plot_optical_flow.py
1
5240
""" Optical flow ============ This tutorial offers a short overview of the optical flow routines available in pysteps and it will cover how to compute and plot the motion field from a sequence of radar images. """ from datetime import datetime from pprint import pprint import matplotlib.pyplot as plt im...
bsd-3-clause
-6,193,059,774,656,354,000
34.388889
86
0.614122
false
valmynd/MediaFetcher
src/plugins/youtube_dl/youtube_dl/extractor/tele5.py
1
1302
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from .nexx import NexxIE from ..compat import compat_urlparse class Tele5IE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tele5\.de/(?:mediathek|tv)/(?P<id>[^?#&]+)' _TESTS = [{ 'url': 'https://www.tele5.de/mediathek/fi...
gpl-3.0
1,673,361,542,314,545,700
28.590909
107
0.628264
false
linuxlewis/channels
channels/generic/base.py
1
2261
from __future__ import unicode_literals from ..routing import route_class from ..sessions import channel_session from ..auth import channel_session_user class BaseConsumer(object): """ Base class-based consumer class. Provides the mechanisms to be a direct routing object and a few other things. Class...
bsd-3-clause
5,622,295,942,873,659,000
31.768116
84
0.616099
false
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
1
21284
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os bwa_base_repository_name = 'bwa_base_repository_0100' bwa_base_repository_description = "BWA Base" bwa_base_repository_long_description = "BWA tool that depends on bwa 0.5.9, with a complex repository dependency pointing at package_bwa_0_5_9_0100" ...
gpl-3.0
-2,234,231,402,344,952,000
72.393103
148
0.578369
false
beagles/neutron_hacking
neutron/plugins/ml2/rpc.py
1
9582
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
-4,473,079,515,387,726,000
42.162162
78
0.549781
false
gsastry/human-rl
humanrl/pong_catastrophe.py
1
8525
import logging import os import pickle from collections import namedtuple import gym import numpy as np from catastrophe_wrapper import * from catastrophe_wrapper import CatastropheWrapper from classifier_tf import (SavedCatastropheBlockerTensorflow, SavedCatastropheClassifierTensorflow) l...
mit
8,899,969,216,970,118,000
32.695652
110
0.581584
false
conceptric/pyinvest
pyinvest/utils.py
1
1880
import numpy as np def cost_of_equity(rfr, mrp, beta=1): ''' Calculates the fractional cost of equity from collections: risk_free : collection of fractional risk free rates. market_risk: collection of fractional market risk premimums. stock_beta : collection of the market beta of the stocks. ...
mit
-3,116,411,222,393,631,000
35.153846
65
0.65266
false
Hybrid-Cloud/badam
patches_tool/aws_patch/aws_deps/libcloud/compute/drivers/nephoscale.py
1
17670
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not ...
apache-2.0
8,585,967,866,526,175,000
37.441964
79
0.533729
false
marvinpinto/charlesbot-rundeck
setup.py
1
1210
from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() requirements = [ # TODO: add any additional package requirements here 'charlesbot', ] test_requirements = [ # TODO: add any additional package test requirements here 'asynctest', 'c...
mit
7,972,108,712,810,894,000
26.5
67
0.652893
false
aweimann/traitar
traitar/heatmap.py
1
19822
#!/usr/bin/env python #adapted from Nathan Salomonis: http://code.activestate.com/recipes/578175-hierarchical-clustering-heatmap-python/ import matplotlib as mpl #pick non-x display mpl.use('Agg') import matplotlib.pyplot as pylab import scipy import scipy.cluster.hierarchy as sch import scipy.spatial.distance as dist...
gpl-3.0
-374,013,051,845,701,400
45.313084
186
0.585814
false
grvcTeam/grvc-ual
uav_abstraction_layer/scripts/track_waypoints.py
1
2926
#!/usr/bin/env python import argparse import sys import yaml import rospy import rospkg from uav_abstraction_layer.srv import TakeOff, GoToWaypoint, Land from geometry_msgs.msg import PoseStamped def track_waypoints(): # Parse arguments parser = argparse.ArgumentParser(description='Track waypoints defined in a...
mit
3,929,381,616,088,929,000
35.575
90
0.592276
false
AndreyPerelygin/partstem
partstem/__init__.py
1
12494
from nltk.stem import SnowballStemmer from nltk.stem.api import StemmerI import nltk import json class ParticleStemmer(SnowballStemmer): def __init__(self, language="english", ignore_stopwords=False, suffix_rule_list={}): super().__init__(language=language, ignore_stopwords=ignore_stopwords) if language == "engl...
apache-2.0
4,392,068,006,620,375,000
34.899425
891
0.574368
false
balazssimon/ml-playground
udemy/lazyprogrammer/reinforcement-learning-python/comparing_explore_exploit_methods.py
1
2913
import numpy as np import matplotlib.pyplot as plt from comparing_epsilons import Bandit from optimistic_initial_values import run_experiment as run_experiment_oiv from ucb1 import run_experiment as run_experiment_ucb class BayesianBandit: def __init__(self, true_mean): self.true_mean = true_mean ...
apache-2.0
5,929,950,057,335,887,000
24.778761
78
0.595606
false
akpetty/ibtopo2016
calc_multi_atm.py
1
9475
############################################################## # Date: 20/01/16 # Name: calc_multi_atm.py # Author: Alek Petty # Description: Main script to calculate sea ice topography from IB ATM data # Input requirements: ATM data, PosAV data (for geolocation) # Output: topography datasets import matplotlib matplo...
gpl-3.0
4,707,440,322,217,559,000
42.26484
249
0.671979
false
rmasters/inbox
inbox/api/filtering.py
1
10329
from datetime import datetime import bson from sqlalchemy import and_, or_, asc, desc from sqlalchemy.orm import joinedload, subqueryload from inbox.models import (Contact, Message, MessageContactAssociation, Thread, Tag, TagItem, Part) from inbox.util.encoding import base36decode class Filt...
agpl-3.0
5,378,588,556,592,926,000
41.858921
79
0.577016
false
apdjustino/DRCOG_Urbansim
src/opus_core/variables/expression_tests/aggregate_disaggregate_expression.py
1
22844
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.tests import opus_unittest from opus_core.datasets.dataset import Dataset from opus_core.datasets.dataset_pool import DatasetPool from opus...
agpl-3.0
-2,313,823,708,598,339,600
48.553145
168
0.570172
false
mzdaniel/oh-mainline
mysite/search/tests.py
1
62680
# This file is part of OpenHatch. # Copyright (C) 2010 Parker Phinney # Copyright (C) 2010 Jack Grigg # Copyright (C) 2009, 2010 OpenHatch, Inc. # Copyright (C) 2010 Jessica McKellar # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as...
agpl-3.0
-7,965,343,108,736,281,000
41.552614
170
0.619608
false
snahelou/awx
awx/sso/views.py
1
3691
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python import urllib import logging # Django from django.core.urlresolvers import reverse from django.http import HttpResponse from django.utils.timezone import now, utc from django.views.generic import View from django.views.generic.base import RedirectView...
apache-2.0
-346,393,819,182,779,650
35.91
96
0.610133
false
Donkyhotay/MoonPy
zope/app/publisher/browser/managementviewselector.py
1
1823
############################################################################## # # Copyright (c) 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
gpl-3.0
-1,589,383,941,825,829,400
38.630435
78
0.628086
false
efiop/dvc
tests/remotes/gdrive.py
1
3618
# pylint:disable=abstract-method import json import os import uuid from functools import partialmethod import pytest from funcy import cached_property, retry from dvc.fs.gdrive import GDriveFileSystem from dvc.path_info import CloudURLInfo from dvc.utils import tmp_fname from .base import Base TEST_GDRIVE_REPO_BUCK...
apache-2.0
8,986,285,501,845,859,000
27.265625
78
0.606689
false
aarose/togglwrapper
tests.py
1
26969
# -*- coding: utf-8 -*- """ tests ----- Ensures that certain actions in the togglwrapper library result in certain behaviours. Uses the responses library to mock out the requests library, and loads fixtures from ``fixtures/`` for the mock JSON response output. """ import json import os import unittest import respo...
mit
-3,781,879,621,414,097,400
34.910786
79
0.598762
false
magfest/ubersystem
tests/uber/models/test_merch.py
1
9284
import pytest from uber.config import c from uber.models import Attendee @pytest.fixture(autouse=True) def donation_tier_fixture(monkeypatch): shirt_level = 25 supporter_level = 85 monkeypatch.setattr(c, 'DONATION_TIERS', { 0: 'No thanks', shirt_level: 'RedShirt', 55: 'Cruiser', ...
agpl-3.0
-3,268,744,263,148,112,000
43.421053
115
0.608035
false
mice-software/maus
tests/py_unit/test_docstore/_test_root_document_store/test_control_message.py
1
3246
# This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus # # MAUS is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
gpl-3.0
-8,072,324,307,590,264,000
35.886364
79
0.615527
false
jdjnovak/WaffleTalk
WaffleTalk/functions.py
1
2627
#!/usr/bin/python3 import random GLOBAL_NULLS = "abcdefghijklmnopqrstuvwxyz" def encrypt(message, key): KEY = key.strip() spacelessmessage = message.replace(" ","") strippedmessage = spacelessmessage.strip() WORK_MSG = strippedmessage.lower() #Use this as workable string SORTED_KEY = sortKey(KEY...
mit
8,449,275,893,829,301,000
25.27
70
0.591549
false
asimonia/Flask-Task
views.py
1
1097
import sqlite3 from functools import wraps from flask import Flask, flash, redirect, render_template, request, session, url_for # config app = Flask(__name__) app.config.from_object('_config') # helper functions def connect_db(): return sqlite3.connect(app.config['DATABASE_PATH']) def login_required(test): ...
apache-2.0
89,991,023,488,574,850
20.529412
84
0.678213
false
matthew-brett/pymc
pymc/NormalApproximation.py
1
16647
# TODO: Test case for EM algorithm. # TODO: Derivatives from the EM algorithm can't actually be used to compute the Hessian for the normal approx. # Post-2.0-release: # TODO: Think about what to do about int-valued stochastics. # TODO: Allow constraints if fmin_l_bfgs_b is used. __docformat__='reStructuredText' __a...
mit
9,176,496,390,441,689,000
31.705305
134
0.562324
false
lynnUg/django-registration-10
registration/models.py
1
10562
import datetime import hashlib import random import re from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.db import transaction from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ try: from d...
bsd-3-clause
-7,067,296,624,832,669,000
37.97417
83
0.623367
false
aarande/nexradaws
setup.py
1
1799
import setuptools setuptools.setup( name='nexradaws', version='1.1', packages=['nexradaws','nexradaws.resources'], description= 'Query and download NEXRAD data from AWS S3 storage.', long_description= '''This module is designed to allow you to query and download Nexrad radar files from Amazon Web S...
mit
-1,327,709,155,368,937,200
32.314815
117
0.70428
false
scmallorca/primefactors-dojo
alearnaiz_joanmiralles/tests/prime_factors_test.py
1
1155
import unittest from ..src.prime_factors import PrimeFactors class PrimeFactorsTest(unittest.TestCase): def test_generate_one__should_be_empty(self): primes = PrimeFactors.generate(1) assert len(primes) == 0 def test_generate_two__should_be_two(self): number = 2 self.check_p...
mit
-6,107,728,574,355,927,000
27.875
66
0.637229
false
zenn1989/scoria-interlude
L2Jscoria-Game/data/scripts/quests/616_MagicalPowerOfFirePart2/__init__.py
1
6980
#Made by Emperorc import sys from com.l2scoria import Config from com.l2scoria.gameserver.datatables.sql import SpawnTable from com.l2scoria.gameserver.model.quest import State from com.l2scoria.gameserver.model.quest import QuestState from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest from co...
gpl-3.0
-4,146,172,437,554,269,000
35.359375
172
0.580946
false
zapier/transformer
transformer/transforms/string/phone_number_extract_test.py
1
2330
import unittest import phone_number_extract class TestStringPhoneExtractTransform(unittest.TestCase): def test_phoneextract(self): transformer = phone_number_extract.StringPhoneExtractTransform() # using the default regex - which is uni1 self.assertEqual(transformer.transform(""), "") ...
gpl-3.0
-3,492,909,269,365,346,000
45.6
136
0.593133
false
ucsb-seclab/dr_checker
helper_scripts/runner_scripts/components/entry_point_identifier.py
1
4615
from base_component import * import os class EntryPointIdentifier(Component): """ This component tries to find entry point functions from provided bitcode file and hdr file list. """ def __init__(self, value_dict): ep_finder_bin = None ep_config = None llvm_bc_out = None ...
bsd-2-clause
4,279,677,519,820,468,700
38.784483
112
0.597616
false
jwoeifjoei/bot01
src/main.py
1
6502
# -*- coding: utf-8 -*- # Copyright (c) 2016-2017 Marco Aceti <dev@marcoaceti.it> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the right...
mit
7,732,577,843,276,382,000
35.683616
155
0.598799
false
davy39/eric
Debugger/DebuggerInterfacePython.py
1
43520
# -*- coding: utf-8 -*- # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the Python debugger interface for the debug server. """ from __future__ import unicode_literals import sys import os import re from PyQt5.QtCore import QObject, QTextCodec, QProcess, QProcessEn...
gpl-3.0
8,212,610,193,828,883,000
39.259019
79
0.535018
false
psci2195/espresso-ffans
src/python/espressomd/checkpointing.py
1
9727
# # Copyright (C) 2013-2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
-748,265,956,042,886,900
31.972881
142
0.596587
false
mattgrogan/ledmatrix
ledmatrix/components/viewport.py
1
1050
class Viewport_Mixin(object): """ Mixin to help move around the image """ def update(self): """ Call update to get fresh data. """ pass def reset(self): """ Reset the viewport """ self._position = (0, 0) def set_position(self, xy): self._position = xy def move_left(self)...
mit
1,700,873,094,009,266,200
15.666667
75
0.589524
false
the-dalee/gnome-2048
gui/controllers/theme_selection_controller.py
1
3718
from gi.repository import Gtk import os from properties import Directories, Properties from model.themes import ThemeAttributes class ThemeSelectionController(object): def __init__(self): self._builder = Gtk.Builder() glade_file = os.path.join(Directories.APP_GLADES, ...
mit
2,979,809,018,699,620,400
35.45098
98
0.578268
false
0x00f/pelican
pelican/tools/pelican_themes.py
1
7117
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import shutil import sys try: import pelican except: err('Cannot import pelican.\nYou must install Pelican in order to run this script.', -1) global _THEMES_PATH _THEMES_PATH = os.path.join( os.path.dirname( os.path.abspath(...
agpl-3.0
-6,267,579,847,709,491,000
30.078603
132
0.547281
false
verloop/rasa_nlu
rasa_nlu/server.py
1
4816
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import import argparse import logging import os from functools import wraps from flask import Flask from flask import current_app from flask import jsonify from flask import req...
apache-2.0
8,913,336,688,404,441,000
39.470588
119
0.636213
false