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
patrick-winter-knime/mol-struct-nets
molstructnets/steps/evaluation/shared/roc_curve.py
1
2908
import random import numpy from matplotlib import pyplot from util import logger, progressbar, file_util def plot(predictions_list, prediction_names, classes, roc_curve_plot_file, shuffle=True, seed=42): actives_list = [] inactives_list = [] auc_list = [] for i in range(len(predictions_list)): ...
gpl-3.0
-8,506,648,301,944,247,000
38.297297
98
0.625516
false
mpbraendli/dab-autocorrelation
correlate_with_ref.py
1
6924
#!/usr/bin/env python # # Find NULL symbols in file, then correlate with the phase reference symbol and # plot the resulting correlation result. # # This will display the Channel Impulse Reference # # Copyright (C) 2016 # Matthias P. Braendli, matthias.braendli@mpb.li # http://www.opendigitalradio.org # Licence: The MI...
mit
5,335,406,212,402,760,000
35.634921
125
0.613663
false
RIOT-OS/riot_job_manager
vcs/git.py
1
6122
"""Provides an abstraction layer to pygit2""" from os.path import join as path_join, isdir import pygit2 from . import Repository, Commit, Tree, Blob class GitRepository(Repository): """A basic Git repository""" def __init__(self, directory, url=None, default_branch='master'): try: self.dir...
gpl-2.0
8,624,118,001,476,154,000
32.453552
86
0.562725
false
kmolab/kmolab.github.io
data/Brython-3.3.4/Lib/traceback.py
1
1353
import sys from browser import console def _restore_current(exc): """Restore internal attribute current_exception, it may have been modified by the code inside functions of this module. """ __BRYTHON__.current_exception = exc def print_exc(file=sys.stderr): exc = __BRYTHON__.current_exception ...
agpl-3.0
-2,767,024,463,012,012,500
29.088889
78
0.570584
false
shree-shubham/Unitype
The Hidden Message.py
1
1670
# Didn't pass testcase 11, 15 import sys def dfs(p, s, dic, ind, path): global cost global r global ncr if r: return if len(path) > len(ncr): ncr = path[:] if ind == len(p): delete = 0 add = 0 path.pop(0) pathcopy = path[:] stack = [...
gpl-3.0
6,179,828,717,420,863,000
21.567568
70
0.410778
false
arminnh/c-to-p-compiler
src/VisitorDeclarationProcessor.py
1
3603
from antlr4 import * from AbstractSyntaxTree import * from VisitorSymbolTable import * class VisitorDeclarationProcessor(VisitorSymbolTable): def __init__(self, symbolTable, errorHandler): super(VisitorDeclarationProcessor, self).__init__(symbolTable, errorHandler) self.mainFunctionDefined = False ...
mit
-8,998,582,801,746,729,000
34.323529
110
0.642798
false
akshmakov/Dolfin-Fijee-Fork
test/unit/function/python/FunctionAssigner.py
1
6254
"""Unit tests for the FunctionAssigner class""" # Copyright (C) 2013 Johan Hake # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
gpl-3.0
-4,560,434,575,751,486,500
36.22619
90
0.543172
false
south-coast-science/scs_core
src/scs_core/osio/data/user_metadata.py
1
3498
""" Created on 30 Apr 2017 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) example: { "id": "southcoastscience-dev", "name": "South Coast Science - Dev", "month": "2016-11", "gravatar-hash": "07f512e9fe64863039df0c0f1834cc25", "topics": [ { "topic": "/orgs/south-coast-science-dev/user/d...
mit
-3,796,951,891,901,695,500
28.15
118
0.44311
false
HRODEV/Frequency
Frequency/GameLogic/GameLogic.py
1
2226
from GameLogic import BarrackFactory from GameLogic import UnitFactory from GameLogic.Player import Player class GameLogic: def __init__(self, players, _turn=0): self.Players = players self._turn = _turn from GameLogic.Map import Map self._map = Map(self) @property def Map...
mit
-8,867,589,860,559,513,000
27.538462
87
0.615903
false
BoPeng/simuPOP
docs/mutatorVSP.py
1
3347
#!/usr/bin/env python # # $File: mutatorVSP.py $ # # This file is part of simuPOP, a forward-time population genetics # simulation environment. Please visit http://simupop.sourceforge.net # for details. # # Copyright (C) 2004 - 2010 Bo Peng (bpeng@mdanderson.org) # # This program is free software: you can redistribute...
gpl-2.0
4,371,186,255,659,703,300
35.380435
97
0.647445
false
crask/redisproxy
test/test.py
1
6318
#!/usr/bin/env python import memcache as mc import redis import time import unittest2 as unittest import yaml import string import random def id_generator(size=8, chars=string.ascii_letters + string.digits): return ''.join(random.choice(chars) for x in range(size)) def load_conf(filename): return yaml.load(o...
apache-2.0
4,395,494,815,288,156,000
29.819512
86
0.581671
false
lnussel/osc
osc/core.py
1
309117
# Copyright (C) 2006 Novell Inc. All rights reserved. # This program is free software; it may be used, copied, modified # and distributed under the terms of the GNU General Public Licence, # either version 2, or version 3 (at your option). from __future__ import print_function __version__ = '0.171.git' # __store_ve...
gpl-2.0
-5,444,135,780,350,646,000
37.760752
364
0.551626
false
fhcflx/alt-pub
fabfile.py
1
2473
from fabric.api import * import fabric.contrib.project as project import os import shutil import sys import SocketServer from pelican.server import ComplexHTTPRequestHandler # Local path configuration (can be absolute or relative to fabfile) env.deploy_path = 'public' DEPLOY_PATH = env.deploy_path # Remote server co...
cc0-1.0
-720,392,187,051,187,200
25.308511
76
0.657905
false
gregpechiro/dndtools
dndtools/dnd/filters.py
1
14072
# -*- coding: utf-8 -*- from dndtools import django_filters2 from dndtools.dnd.models import ( Spell, DndEdition, SpellSchool, SpellSubSchool, SpellDescriptor, FeatCategory, CharacterClass, Rulebook, Domain, Feat, Skill, Item, Language, RaceType, ItemSlot, ItemProperty, Deity, Rule) from dndtools.dnd.filte...
mit
-1,290,737,780,061,080,600
30.342984
114
0.63438
false
sealcode/gpandoc
table_widget.py
1
1780
import PyQt5 from PyQt5 import QtWidgets from PyQt5.QtWidgets import QLabel from PyQt5.QtWidgets import QLineEdit from PyQt5.QtWidgets import QListView from PyQt5.QtWidgets import QPushButton from PyQt5.QtWidgets import QTableWidget from PyQt5.QtWidgets import QPlainTextEdit from PyQt5.QtWidgets import QTableWidgetIte...
lgpl-3.0
1,876,793,916,902,599,400
31.944444
73
0.658797
false
erigones/esdc-ce
core/urls.py
1
1161
from django.conf.urls import url, include, patterns from django.contrib import admin from django.conf import settings handler403 = 'core.views.forbidden' handler404 = 'core.views.page_not_found' handler500 = 'core.views.server_error' urlpatterns = patterns( 'core.views', # api urls - WARNING: Do NOT change t...
apache-2.0
2,942,097,458,302,777,300
33.147059
104
0.615848
false
jaumemarti/l10n-spain-txerpa
l10n_es_payment_order/wizard/csb58.py
1
15333
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2006 ACYSOS S.L. (http://acysos.com) # Pedro Tarrafeta <pedro@acysos.com> # Copyright (c) 2008 Pablo Rocandio. All Rights Res...
agpl-3.0
8,593,853,676,416,834,000
44.900901
79
0.52352
false
larrybradley/astropy
astropy/table/tests/test_table.py
1
102062
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.utils.tests.test_metadata import MetaBaseTest import gc import sys import copy from io import StringIO from collections import OrderedDict import pickle import pytest import numpy as np from numpy.testing import asser...
bsd-3-clause
-4,566,174,454,191,236,000
34.495825
98
0.528226
false
cmu-delphi/delphi-epidata
src/server/endpoints/ght.py
1
1031
from flask import Blueprint, request from .._config import AUTH from .._query import execute_query, QueryBuilder from .._validate import check_auth_token, extract_integers, extract_strings, require_all # first argument is the endpoint name bp = Blueprint("ght", __name__) alias = None @bp.route("/", methods=("GET", ...
mit
-3,238,699,512,166,556,000
26.864865
88
0.670223
false
ichuang/sympy
sympy/series/order.py
1
7958
from sympy.core import Basic, S, sympify, Expr, Rational, Symbol from sympy.core import Add, Mul from sympy.core.cache import cacheit from sympy.core.compatibility import cmp_to_key class Order(Expr): """ Represents the limiting behavior of some function The order of a function characterizes the function base...
bsd-3-clause
521,524,758,839,641,860
30.330709
106
0.54197
false
FederatedAI/FATE
python/federatedml/feature/feature_selection/model_adapter/statistic_adapter.py
1
1585
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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/lic...
apache-2.0
-1,514,203,313,510,065,000
40.710526
88
0.68959
false
mirestrepo/voxels-at-lems
registration_eval/multimodal_vishal/random_transform.py
1
1537
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: Maria Isabel Restrepo # @Date: 2014-01-08 14:34:42 # @Last Modified by: Maria Isabel Restrepo # @Last Modified time: 2014-01-15 10:20:14 # # A file to generate rigid transformations import rotations import transformations as tf import numpy as np for trial...
bsd-2-clause
-5,758,851,073,942,741,000
26.446429
97
0.607027
false
lcoandrade/DsgTools
core/DSGToolsProcessingAlgs/Algs/OtherAlgs/raiseFlagsAlgorithm.py
1
9424
# -*- coding: utf-8 -*- """ /*************************************************************************** DsgTools A QGIS plugin Brazilian Army Cartographic Production Tools ------------------- begin : 2019-01-04 git sha ...
gpl-2.0
-7,668,695,703,256,355,000
41.075893
156
0.567593
false
TinghuiWang/ActivityLearning
actlearn/models/DenoisingAutoencoder.py
1
13972
""" This tutorial introduces denoising auto-encoders (dA) using Theano. Denoising autoencoders are the building blocks for SdA. They are based on auto-encoders as the ones used in Bengio et al. 2007. An autoencoder takes an input x and first maps it to a hidden representation y = f_{\theta}(x) = s(Wx+b), paramete...
bsd-3-clause
-4,783,254,493,239,638,000
40.215339
133
0.593687
false
marcelotrevisani/vtky
setup.py
1
1633
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import codecs from setuptools import setup def read(fname): file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read() setup( name='vtky', packages=['vtky'], version='0.1.0', autho...
mit
2,189,444,242,208,070,400
31.68
76
0.611145
false
triveous/PyMovieCount
moviecount.py
1
2333
__author__ = 'sohammondal' import sys import urllib import re def sortFunc(tuple): ''' simple key comparison method for sorting :param tuple: :return: ''' return tuple[-1] def openAndCount(url): ''' opens a site and finds the following movie pattern serial number: 1. movie na...
apache-2.0
5,050,906,400,376,594,000
26.447059
87
0.559794
false
rerb/tripping-sansa-harness
tripping_sansa_harness/settings.py
1
2069
""" Django settings for tripping_sansa_harness project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BA...
gpl-2.0
6,975,749,084,224,183,000
23.927711
71
0.727405
false
tsuru/rpaas
rpaas/sslutils.py
1
4989
# Copyright 2016 rpaas authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import json import os import datetime import ipaddress import base64 from cryptography import x509 from cryptography.hazmat.backends import default_backend from cr...
bsd-3-clause
-3,365,001,182,327,682,600
36.511278
107
0.67709
false
chirpradio/chirpradio-volunteers
site-packages/migrate/versioning/pathed.py
1
2019
""" A path/directory class. """ from migrate.versioning.base import * from migrate.versioning.util import KeyedInstance from migrate.versioning import exceptions import os import shutil class Pathed(KeyedInstance): """ A class associated with a path/directory tree. Only one instance of this class may...
mit
6,190,412,673,342,063,000
27.041667
79
0.605745
false
kernevil/samba
source4/torture/drs/python/drs_base.py
1
24898
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Unix SMB/CIFS implementation. # Copyright (C) Kamen Mazdrashki <kamenim@samba.org> 2011 # Copyright (C) Andrew Bartlett <abartlet@samba.org> 2016 # Copyright (C) Catalyst IT Ltd. 2016 # # This program is free software; you can redistribute it and/or modify # it under t...
gpl-3.0
7,851,796,401,282,473,000
39.418831
109
0.57587
false
sverros/MMCP
realizations.py
1
6392
import numpy as np import copy import os import h5py from mapio.shake import ShakeGrid from openquake.hazardlib.geo.geodetic import distance from readstation import readStation from init_grid import initialize def realizations(total_real, my_reals, radius, variables, grid_arr, mu_arr, sigma_arr, list_sizes_grid, list...
unlicense
-7,121,845,106,338,485,000
39.201258
136
0.618116
false
shobhitmishra/CodingProblems
epi_judge_python/queue_with_max.py
1
1411
from test_framework import generic_test from test_framework.test_failure import TestFailure class QueueWithMax: def enqueue(self, x: int) -> None: # TODO - you fill in here. return def dequeue(self) -> int: # TODO - you fill in here. return 0 def max(self) -> int: ...
mit
-5,694,876,002,682,228,000
28.395833
78
0.474132
false
thuykn/GUI-nlu-pyflask
welcome.py
1
3906
# Copyright 2015 IBM Corp. 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
363,654,631,083,258,300
33.875
131
0.654634
false
awirbel/debadvect
2D_btest/read_inputfiles.py
1
3281
""" This function just reads all the required input files for the 2D three body rotation test Copyright 2017 Anna Wirbel 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, either ve...
gpl-3.0
5,247,983,543,264,705,000
32.824742
93
0.703444
false
Kloudless/kloudless-python
tests/integration/test_cases/test_account.py
1
4165
import utils import sdk from sdk import exceptions as kexceptions import unittest import pytz import time import random from datetime import datetime, timedelta class Account(unittest.TestCase): def test_retrieve_account(self): account = sdk.Account(id=self.account.id) account.refresh() s...
mit
-1,864,803,295,269,949,000
34
75
0.577431
false
Suwmlee/XX-Net
gae_proxy/server/lib/google/appengine/api/prospective_search/error_pb.py
1
2614
#!/usr/bin/env python # # Copyright 2007 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...
bsd-2-clause
-8,065,221,845,336,901,000
21.730435
74
0.688217
false
EdwardJKim/nbgrader
nbgrader/tests/nbextensions/test_assignment_list.py
1
13603
import pytest import os from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException, NoSuchElementException from .. import run_nbgrader from .conftest import...
bsd-3-clause
5,221,054,896,851,864,000
44.192691
138
0.699919
false
ChessCorp/docker-ascii-map
tests/raster_test.py
1
3352
import unittest from docker_ascii_map.raster import Raster, Boundary, RasterCell class RasterTests(unittest.TestCase): def test_empty_raster(self): raster = Raster() self.assertEqual('', str(raster)) self.assertEqual((0, 0), raster.size()) self.assertEqual(RasterCell(), raster.get...
mit
6,118,320,935,337,607,000
26.252033
146
0.475537
false
RamonGuiuGou/l10n-spain
l10n_es_aeat/wizard/export_to_boe.py
1
8986
# -*- coding: utf-8 -*- # Copyright 2004-2011 Luis Manuel Angueira Blanco (http://pexego.es) # Copyright 2013 Ignacio Ibeas (http://acysos.com) # Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com> # Copyright 2016 Angel Moya <odoo@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agp...
agpl-3.0
7,501,633,384,687,510,000
39
81
0.550781
false
mobarski/sandbox
covid19/old/covid19_old.py
1
7584
import numpy as np import re sentencer_cfg = {'no_matching' : re.compile( '(?i)All rights reserved'+ '|No reuse allowed'+ '|author/funder'+ '|this preprint' ) } phraser_cfg = { 'min_count' : 3, 'threshold' : 1.0, 'delimiter' : b'__', 'components' : True, 'common_terms' : [ '','to','and','of','the','a'...
mit
-5,422,408,124,254,998,000
29.336
91
0.61366
false
Ektorus/bohrium
bridge/npbackend/target/__init__.py
1
1226
""" Initialization of npbackend target. The target chosen is controlled by setting one of the following environment vars: * BHPY_BACKEND * BHPY_TARGET * NPBE_TARGET The envvars are searched in the order above, first match wins. The envvar can be one of the following: * bhc * numpy * numexp...
lgpl-3.0
9,086,665,649,205,932,000
24.541667
80
0.645188
false
asyncee/home-bookkeeping-sample
src/expenses/queries/base.py
1
1649
from collections import namedtuple from expenses.queries.cache import KeyedCache class QueryParams: """Holder for query parameters.""" @classmethod def from_dict(cls, dct): return cls._make([dct[p] for p in cls._fields]) def to_string(self): values = [getattr(self, param) for param ...
mit
-1,456,603,283,349,878,800
28.981818
102
0.60946
false
DevHugo/zds-site
zds/gallery/tests/tests_models.py
4
4566
# coding: utf-8 import os from django.test import TestCase from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from zds.gallery.factories import GalleryFactory, UserGalleryFactory, ImageFactory from zds.member.factories import ProfileFactory from zds import settings ...
gpl-3.0
-225,817,961,537,007,400
32.558824
92
0.663453
false
harrijs/gns3-server
gns3server/modules/base_manager.py
1
13988
# -*- coding: utf-8 -*- # # Copyright (C) 2015 GNS3 Technologies Inc. # # 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, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
8,760,669,757,497,220,000
31.758782
151
0.568916
false
goldshtn/linux-tracing-workshop
setuidsnoop.py
1
3030
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # setuidsnoop Trace uid changes issued by the setuid() syscall. # For Linux, uses BCC, eBPF. Embedded C. # # USAGE: setuidsnoop [-h] [-p PID] # # Copyright (c) 2016 Brendan Gregg, Sasha Goldshtein. # Licensed under the Apache License, Version ...
mit
-6,281,888,384,061,737,000
22.671875
67
0.620462
false
bitcraft/pyglet
tests/interactive/image/depth_save.py
1
1501
"""Test depth buffer save. A scene consisting of a single coloured triangle will be rendered. The depth buffer will then be saved to a stream and loaded as a texture. You will see the original scene first for up to several seconds before the depth buffer image appears (because retrieving and saving the image is a sl...
bsd-3-clause
7,078,566,195,949,363,000
25.803571
74
0.636243
false
nugget/home-assistant
homeassistant/helpers/template.py
1
21972
"""Template helper methods for rendering strings with Home Assistant data.""" from datetime import datetime import json import logging import math import random import base64 import re import jinja2 from jinja2 import contextfilter from jinja2.sandbox import ImmutableSandboxedEnvironment from jinja2.utils import Names...
apache-2.0
7,250,586,668,098,213,000
30.843478
79
0.605816
false
SophieTh/und_Sophie_2016
pySRU/tests/RadiationFactorytest.py
1
3999
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2016 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal #...
mit
4,673,161,436,286,058,000
47.180723
123
0.715429
false
stvstnfrd/edx-platform
cms/djangoapps/contentstore/views/public.py
1
2210
""" Public views """ from django.conf import settings from django.shortcuts import redirect from django.utils.http import urlquote_plus from waffle.decorators import waffle_switch from common.djangoapps.edxmako.shortcuts import render_to_response from ..config import waffle __all__ = ['register_redirect_to_lms', '...
agpl-3.0
-2,873,853,984,906,249,700
30.571429
110
0.690498
false
stianaske/pybotvac
pybotvac/account.py
1
7761
"""Account access and data handling for beehive endpoint.""" import logging import os import shutil import requests from voluptuous import ( ALLOW_EXTRA, All, Any, Extra, MultipleInvalid, Optional, Range, Required, Schema, Url, ) from .exceptions import NeatoRobotException, Ne...
mit
9,026,604,313,120,005,000
29.081395
82
0.536786
false
grahamking/goodenergy
action/models.py
1
6331
"""Business objects for Action """ # Copyright 2010,2011 Good Energy Research Inc. <graham@goodenergy.ca>, <jeremy@goodenergy.ca> # # This file is part of Good Energy. # # Good Energy is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licen...
agpl-3.0
-4,513,062,788,204,360,000
32.675532
99
0.653293
false
egbertbouman/tribler-g
Tribler/Core/ProxyService/Proxy.py
1
29071
# Written by George Milescu # see LICENSE.txt for license information import sys import time from traceback import print_exc from collections import deque from threading import Lock from Tribler.Core.BitTornado.bencode import bencode from Tribler.Core.BitTornado.BT1.MessageID import * from Tribler.Core.simpledefs imp...
lgpl-2.1
787,331,529,277,729,300
40.708752
152
0.631248
false
edeposit/edeposit.amqp.storage
src/edeposit/amqp/storage/structures/comm/archive.py
1
1705
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # # !!! DO NOT EDIT THIS FILE - THIS IS GENERATED FILE !!! # Imports ===================================================================== from collections import namedtuple # Functions and classes =====================================...
mit
6,806,873,049,090,487,000
28.912281
79
0.538416
false
lucatoscano/ErlangTW
tests/test_speedup.py
1
2330
# # This file is part of ErlangTW. ErlangTW 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without e...
gpl-2.0
1,035,627,493,117,002,000
39.877193
149
0.697854
false
spectrumone/websockets-autobahn-python
server.py
1
3254
import sys import random from twisted.web.static import File from twisted.python import log from twisted.web.server import Site from twisted.internet import reactor from autobahn.twisted.websocket import WebSocketServerFactory, \ WebSocketServerProtocol from autobahn.twisted.resource import WebSocketResource ...
mit
-2,763,003,658,071,677,000
32.214286
109
0.643208
false
syscoin/syscoin
test/functional/p2p_fingerprint.py
1
5044
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test various fingerprinting protections. If a stale block more than a month old or its header are requ...
mit
-2,530,587,060,874,433,500
36.924812
120
0.658406
false
chris-belcher/joinmarket-clientserver
scripts/obwatch/ob-watcher.py
1
18029
from __future__ import absolute_import, print_function import BaseHTTPServer import SimpleHTTPServer import base64 import io import json import threading import time import hashlib import os import sys import urllib2 from decimal import Decimal from optparse import OptionParser from twisted.internet import reactor ...
gpl-3.0
1,969,615,938,244,902,000
38.193478
146
0.569527
false
shanot/imp
modules/pmi/test/test_nuisance_mover.py
2
1205
from __future__ import print_function import IMP import IMP.core import IMP.test import IMP.algebra import IMP.atom import IMP.container import IMP.pmi.tools as tools import IMP.pmi.samplers as samplers class XTransRestraint(IMP.Restraint): def __init__(self, m): IMP.Restraint.__init__(self, m, "XTransR...
gpl-3.0
2,099,798,847,107,410,400
24.104167
69
0.613278
false
gghezzo/prettypython
PythonEveryDay2015/MyTinker.py
1
1323
# Adding Random things to a Tkinter window # From my brain # Typer: Ginny C Ghezzo # What I learned: # TODO: Need to figure out the localip return (ARG ARG) from tkinter import * import time import urllib # opening and reading URLs import urllib.request # why do I need this import re # regular exp...
mit
1,217,881,998,857,131,800
26.5625
86
0.683296
false
WilliamRy/python_ex
tollstation_problem/ex_tollstation.py
1
2556
# -*- coding: utf-8 -*- """ the classical toll station problem: given the distance between all toll stations on a long road, find the location of them. """ import random def points_generator(number, rangee): lst = range(1,rangee+1) random.shuffle(lst) f =lst[0:number-1] f.sort() result = [0] + f ...
mit
-2,947,788,969,308,378,000
23.815534
70
0.471049
false
DayGitH/Python-Challenges
DailyProgrammer/DP20160325C.py
1
2529
""" [2016-03-25] Challenge #259 [Hard] Operator number system https://www.reddit.com/r/dailyprogrammer/comments/4bwibm/20160325_challenge_259_hard_operator_number_system/ In most cases, humans use a decimal system. Scientists have suggested that this way to count things has been defined by our hands with 5 fingers ea...
mit
-7,154,210,822,800,282,000
48.54902
119
0.738821
false
dparaujo/projeto
app_administrativo/cronograma/urls.py
1
1064
# -*- coding: utf-8 -*- """ Desenvolvedor: David Pereira de Araújo Projeto: credenciamento E-mail: daraujo@tins.com.br Mês: 01 Ano: 2017 Empresa: TINS - Soluções Corporativas """ __author__ = u'daraujo' from django.conf.urls import url from app_a...
gpl-3.0
-8,930,559,119,983,043,000
43.208333
115
0.523585
false
jolyonb/edx-platform
lms/djangoapps/grades/management/commands/tests/test_recalculate_subsection_grades.py
1
3744
""" Tests for reset_grades management command. """ from __future__ import absolute_import from datetime import datetime import ddt import six from django.conf import settings from mock import MagicMock, patch from pytz import utc from lms.djangoapps.grades.constants import ScoreDatabaseTableEnum from lms.djangoapps...
agpl-3.0
6,049,054,167,248,438,000
44.108434
117
0.701656
false
samba-team/samba
source4/torture/drs/python/replica_sync.py
1
37375
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Tests various schema replication scenarios # # Copyright (C) Kamen Mazdrashki <kamenim@samba.org> 2011 # # 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 Fo...
gpl-3.0
-6,257,371,183,514,169,000
49.033467
126
0.619318
false
uwosh/uwosh.section
uwosh/section/content/__init__.py
1
1232
# -*- coding: utf-8 -*- # # File: content.py # # Copyright (c) 2008 by [] # Generator: ArchGenXML Version 2.1 # http://plone.org/products/archgenxml # # GNU General Public License (GPL) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public Lic...
gpl-2.0
-2,867,014,957,745,163,300
27.651163
67
0.731331
false
yuraic/koza4ok
skTMVA/sci_bdt_electron_BDT_structure.py
1
4530
from array import array import numpy as np import matplotlib.pyplot as plt from sklearn import datasets from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import AdaBoostClassifier from sklearn.metrics import classification_report, roc_auc_score, roc_curve from sklearn import tree import cPickle ...
mit
513,559,341,317,220,600
32.813433
124
0.648124
false
fbradyirl/home-assistant
homeassistant/components/xiaomi_miio/switch.py
1
18045
"""Support for Xiaomi Smart WiFi Socket and Smart Power Strip.""" import asyncio from functools import partial import logging import voluptuous as vol from homeassistant.components.switch import DOMAIN, PLATFORM_SCHEMA, SwitchDevice from homeassistant.const import ATTR_ENTITY_ID, CONF_HOST, CONF_NAME, CONF_TOKEN from...
apache-2.0
-6,243,953,858,440,710,000
31.631103
88
0.587365
false
irtnog/SATOSA
src/satosa/backends/orcid.py
1
4662
""" OAuth backend for Orcid """ import json import requests import logging from urllib.parse import urljoin from oic.utils.authn.authn_context import UNSPECIFIED from oic.oauth2.consumer import stateID from oic.oauth2.message import AuthorizationResponse from satosa.backends.oauth import _OAuthBackend from ..internal...
apache-2.0
1,252,418,777,160,678,700
39.894737
79
0.629344
false
openstack/networking-l2gw
networking_l2gw/db/migration/alembic_migrations/versions/queens/contract/0fb45e525aa9_add_standard_attribute_id_for_l2gw.py
1
2830
# Copyright 2017 <PUT YOUR NAME/COMPANY HERE> # # 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 applica...
apache-2.0
6,316,439,713,957,126,000
35.282051
78
0.637102
false
loopCM/chromium
build/android/pylib/chrome_test_server_spawner.py
1
16757
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A "Test Server Spawner" that handles killing/stopping per-test test servers. It's used to accept requests from the device to spawn and kill instances of ...
bsd-3-clause
4,568,571,054,452,696,600
37.789352
80
0.666289
false
panyam/libgraph
tests/test_dfs.py
1
3100
import ipdb import unittest from libgraph import graphs, dfs, algorithms class Tests(unittest.TestCase): def test_basic(self): g = graphs.Graph() g.add_edges((1,2), (1,3), (1,4), (2,3), (2,5), (5, 6)) tr = dfs.Traversal(g) dfs.dfs(1, tr) self.assertEqual(tr.node_state[1], ...
apache-2.0
3,829,257,034,962,295,300
40.891892
97
0.575806
false
GoogleCloudPlatform/sap-deployment-automation
third_party/github.com/ansible/awx/awx_collection/plugins/modules/tower_group.py
1
4756
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1...
apache-2.0
-5,066,718,106,858,290,000
29.487179
117
0.618377
false
ReactiveX/RxPY
rx/core/operators/elementatordefault.py
1
1151
from typing import Any, Callable from rx.core import Observable from rx.internal.exceptions import ArgumentOutOfRangeException def _element_at_or_default(index, has_default=False, default_value=None): if index < 0: raise ArgumentOutOfRangeException() def element_at_or_default(source: Observable) -> O...
mit
8,960,340,141,025,708,000
31.885714
89
0.537793
false
JamesLinEngineer/RKMC
addons/plugin.video.salts/scrapers/flixanity_scraper.py
1
9447
""" SALTS XBMC Addon Copyright (C) 2014 tknorris 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, either version 3 of the License, or (at your option) any later version. T...
gpl-2.0
4,361,609,295,338,535,000
43.352113
190
0.558696
false
levilucio/SyVOLT
mbeddr2C_MM/transformation_from_eclipse/Hlayer3rule2.py
1
6621
from core.himesis import Himesis import uuid class Hlayer3rule2(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule layer3rule2. """ # Flag this instance as compiled now self.is_compiled = True ...
mit
-1,918,666,612,348,753,000
42.736486
325
0.553995
false
yanbober/SmallReptileTraining
DistributedBaseSpider/SpiderWork.py
1
3406
import re from urllib.parse import urljoin import requests from bs4 import BeautifulSoup from multiprocessing.managers import BaseManager ''' [分布式爬取解析工作端,可台机器分别运行] 简单主从模式的分布式爬虫,支持多节点管理 Ubuntu OSError: [Errno 98] Address already in use $ sudo netstat -tlnp|grep 8001 tcp 0 0 0.0.0.0:8001 0.0.0.0:* LISTEN 24314/...
mit
-1,597,223,114,124,105,200
32.389474
134
0.555485
false
taikoa/wevolver-server
wevolve/users/migrations/0003_auto__chg_field_profile_city__chg_field_profile_picture_original_name_.py
1
11634
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Profile.city' db.alter_column(u'user_profile', 'city', self.gf('django.db.models.fields.C...
agpl-3.0
-5,579,581,137,125,957,000
66.254335
226
0.588362
false
ThreatResponse/margaritashotgun
margaritashotgun/remote_shell.py
1
9147
import paramiko from paramiko import AuthenticationException, SSHException, ChannelException from enum import Enum from concurrent.futures import ThreadPoolExecutor from socket import error as SocketError from margaritashotgun.auth import AuthMethods from margaritashotgun.exceptions import * import logging logger = lo...
mit
1,033,756,631,633,732,900
39.118421
88
0.538865
false
superphy/insilico-subtyping
phylotyper/test/test_new.py
1
15768
import logging import os import shutil import tempfile import unittest from Bio import SeqIO from phylotyper.config import PhylotyperOptions from phylotyper.run import build_pipeline, check_gene_names from phylotyper.subtypes_index import SubtypeConfig from phylotyper.tree.seq import SeqDict from phylotyper.tree.seqal...
apache-2.0
-952,176,039,040,711,300
31.920668
129
0.596525
false
alpine9000/amiga_examples
tools/external/amitools/amitools/fs/ADFSNode.py
1
5378
from FileName import FileName from MetaInfo import MetaInfo from ProtectFlags import ProtectFlags from TimeStamp import TimeStamp from FSError import * from FSString import FSString import amitools.util.ByteSize as ByteSize class ADFSNode: def __init__(self, volume, parent): self.volume = volume self.blkdev ...
bsd-2-clause
8,015,660,144,196,338,000
28.07027
117
0.624396
false
dbmi-pitt/DIKB-Micropublication
scripts/mp-scripts/Bio/Sequencing/Ace.py
1
20376
""" Parser for (new) ACE files output by PHRAP. version 1.3, 05/06/2004 Written by Frank Kauff (fkauff@duke.edu) and Cymon J. Cox (cymon@duke.edu) Uses the Biopython Parser interface: ParserSupport.py Usage: There are two ways of reading an ace file: The ACEParser() reads the whole file at once and the RecordParser...
apache-2.0
6,913,604,128,323,306,000
33.477157
115
0.554623
false
NotSoSuper/NotSoBot
mods/Verification.py
1
20486
import discord import asyncio import random import steam from steam.steamid import SteamId from steam.steamprofile import SteamProfile from steam.steamaccountuniverse import SteamAccountUniverse from steam.steamaccounttype import SteamAccountType from discord.ext import commands from utils import checks from mods.cog i...
mit
-4,955,574,702,958,139,000
44.125551
380
0.690716
false
ivanyu/kaggle-digit-recognizer
classify_base.py
1
2335
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import re import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import MaxAbsScaler from sklearn.decomposition import PCA import meta from meta imp...
mit
-5,361,899,739,560,428,000
33.850746
75
0.623555
false
schnapptack/gskompetenzen
features/gsaudit/migrations/0025_auto__add_field_skill_author.py
1
15198
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Skill.author' db.add_column(u'gsaudit_skill', 'author', self.gf('djang...
agpl-3.0
-2,912,736,705,076,302,300
75.762626
215
0.544085
false
Bitergia/allura
ForgeHg/forgehg/hg_main.py
1
2713
#-*- python -*- import logging # Non-stdlib imports from pylons import c from ming.utils import LazyProperty from ming.orm.ormsession import ThreadLocalORMSession # Pyforge-specific imports import allura.tasks from allura.lib import helpers as h from allura import model as M from allura.controllers.repository import...
apache-2.0
8,782,871,054,509,972,000
36.680556
95
0.667158
false
rmed/textventures
src/textventures/parser/saves.py
1
4802
# -*- coding: utf-8 -*- # This file is part of TextVentures - https://github.com/RMed/textventures # # Copyright (C) 2013 Rafael Medina García <rafamedgar@gmail.com> # # 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...
gpl-2.0
4,892,097,107,536,839,000
30.379085
74
0.619871
false
gajim/gajim
gajim/common/const.py
1
28447
from enum import IntEnum, Enum, unique from collections import namedtuple from gi.repository import Gio from nbxmpp.namespaces import Namespace from gajim.common.i18n import _ from gajim.common.i18n import Q_ EncryptionData = namedtuple('EncryptionData', 'additional_data') EncryptionData.__new__.__defaults__ = (Non...
gpl-3.0
-1,480,373,902,542,022,700
24.495964
112
0.561348
false
pombredanne/metamorphosys-desktop
metamorphosys/META/analysis_tools/PYTHON_RICARDO/rpl/tools/geometry/read_cad_metrics.py
1
3907
""" Read in parts from a cad metrics file. """ import numpy as np from lxml import etree import re from geom_utils import matrix_from_nx_ny_ro conv_dict = {"inch" : 0.0254, "millimeter" : 0.001, "mm" : 0.001, "m" : 1.0} def get_parts(cad_metric_xml_file): """ Return a list of part information. ...
mit
-7,735,941,924,765,311,000
30.831933
93
0.499616
false
Radagast-red/golem
golem/model.py
1
6698
import datetime import jsonpickle as json import logging from enum import Enum from os import path from peewee import (SqliteDatabase, Model, CharField, IntegerField, FloatField, DateTimeField, TextField, CompositeKey, BooleanField) log = logging.getLogger('golem.db') NEUTRAL_TRUST = 0.0 # Indi...
gpl-3.0
7,036,831,455,788,716,000
27.623932
105
0.641236
false
gviejo/ThalamusPhysio
python/figure_article_v2/main_article_fig_supp_6.py
1
6938
import numpy as np import pandas as pd # from matplotlib.pyplot import plot,show,draw import scipy.io import sys sys.path.append("../") from functions import * from pylab import * from sklearn.decomposition import PCA import _pickle as cPickle import matplotlib.cm as cm import os #####################################...
gpl-3.0
-2,075,857,534,753,483,000
34.040404
115
0.573796
false
RandomKori/Forex
ForexNNClass/ForexNNClass/ForexNNClassB.py
1
3694
from __future__ import print_function import numpy as np import cntk from cntk.ops.functions import load_model def LoadData(fn,is_training): n=".\\Data\\"+fn datainp=cntk.io.StreamDef("features",30) dataout=cntk.io.StreamDef("labels",4) dataall=cntk.io.StreamDefs(features=datainp,labels=dataout) st...
gpl-3.0
-3,863,880,155,538,661,400
36.5
131
0.685442
false
albireox/marvin
python/marvin/tools/rss.py
1
19904
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: Brian Cherinka, José Sánchez-Gallego, and Brett Andrews # @Date: 2016-04-11 # @Filename: rss.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) # # @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu) # @Last modified time: 2018-...
bsd-3-clause
2,139,113,228,908,923,600
35.988848
99
0.592462
false
jakubbrindza/gtg
GTG/gtk/browser/browser.py
1
61395
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
gpl-3.0
19,767,875,418,420,108
40.094378
79
0.572685
false
rcpedersen/stl-to-voxel
perimeter.py
1
1874
import math from collections import defaultdict import numpy as np def linesToVoxels(lineList, pixels): for x in range(len(pixels)): isBlack = False lines = list(filter(lambda line: isRelevantLines(line, x, pixels), lineList)) targetYs = list(map(lambda line:int(generateY(line, x)),lines)) ...
mit
3,278,711,420,019,987,000
31.310345
126
0.527215
false
papallas/baxter_cashier
scripts/baxter_cashier_manipulation/src/baxter_pose.py
1
3209
#!/usr/bin/env python """ Copyright (C) 2016/2017 The University of Leeds and Rafael Papallas. 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, either version 3 of the License, or (at your option...
gpl-3.0
-3,485,173,546,208,582,700
35.05618
73
0.571829
false
ghclara/ProgScripts
tekton-master/backend/appengine/routes/lingAngulars/admin/edit.py
1
1105
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from config.template_middleware import TemplateResponse from gaebusiness.business import CommandExecutionException from tekton import router from gaecookie.decorator import no_csrf from lingAngular_app import facade from routes.lingAngular...
mit
4,886,881,965,354,895,000
37.103448
125
0.729412
false
mruwek/topydo
topydo/lib/PrettyPrinterFilter.py
1
3423
# Topydo - A todo.txt client written in Python. # Copyright (C) 2014 - 2015 Bram Schoenmakers <me@bramschoenmakers.nl> # # 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, either version 3 of the L...
gpl-3.0
-3,183,096,127,573,630,000
31.913462
76
0.623138
false
Juicechuan/AMR_graph
camr_conversion/on/common/log.py
1
23072
# COPYRIGHT 2007 BY BBN TECHNOLOGIES CORP. # BY USING THIS SOFTWARE THE USER EXPRESSLY AGREES: (1) TO BE BOUND BY # THE TERMS OF THIS AGREEMENT; (2) THAT YOU ARE AUTHORIZED TO AGREE TO # THESE TERMS ON BEHALF OF YOURSELF AND YOUR ORGANIZATION; (3) IF YOU OR # YOUR ORGANIZATION DO NOT AGREE WITH THE TERMS OF THIS AGR...
mit
-937,953,334,212,389,200
44.328094
169
0.550191
false
kylef/maintain
tests/release/test_bump_version.py
1
1133
import unittest from semantic_version import Version from maintain.release.version_file import VersionFileReleaser from ..utils import temp_directory, touch class BumpVersionTestCase(unittest.TestCase): # Detection def test_detects_version_file(self): with temp_directory(): touch('VERSI...
bsd-2-clause
6,859,724,554,218,829,000
26.634146
61
0.632833
false
mwcraig/vpython-jupyter
vpython/shapespaths.py
1
46092
from math import sqrt, sin, cos, tan, asin, acos, atan, floor, pi from ._vector_import_helper import vec, vector, mag, norm # List of names that are imported from this module with import * __all__ = ['RackOutline', 'ToothOutline', 'addpos', 'convert', 'path_object', 'paths', 'rotatecp', 'roundc', 'scalecp'...
mit
-8,041,384,325,000,247,000
41.441989
128
0.505229
false