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
firebitsbr/termineter
framework/modules/dump_tables.py
1
3439
# framework/modules/dump_tables.py # # Copyright 2011 Spencer J. McIntyre <SMcIntyre [at] SecureState [dot] net> # # 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 2 of the Li...
gpl-3.0
2,490,079,865,939,088,000
45.472973
259
0.719104
false
skeezix/compo4all
spaghetti-server/singlescore_handler.py
1
12920
# update_hi - receive binary and i) parse it, ii) update json tally as needed, iii) store .hi file for later # get_hi -- fetch a bin for the emu # get_json_tally - dump highscore table as json (for fancy frontend to display, say) # get_html_tally - dump highscore in vaguely readable html table (for web browser quickie...
gpl-2.0
5,346,319,761,198,488,000
33.453333
223
0.516254
false
wpjesus/codematch
ietf/submit/models.py
1
3263
import re import datetime from django.db import models from ietf.doc.models import Document from ietf.person.models import Person from ietf.group.models import Group from ietf.name.models import DraftSubmissionStateName from ietf.utils.accesstoken import generate_random_key, generate_access_token def parse_email_li...
bsd-3-clause
8,802,075,955,322,732,000
35.662921
153
0.680968
false
esben/setuptools_scm
setuptools_scm/version.py
1
4137
from __future__ import print_function import datetime import re from .utils import trace from pkg_resources import iter_entry_points from distutils import log try: from pkg_resources import parse_version, SetuptoolsVersion except ImportError as e: parse_version = SetuptoolsVersion = None def _warn_if_setup...
mit
6,615,941,135,986,023,000
29.19708
77
0.639594
false
mlundblad/telepathy-gabble
tests/twisted/jingle-share/test-caps-file-transfer.py
1
6395
import dbus from twisted.words.xish import xpath from servicetest import (assertEquals, EventPattern) from gabbletest import exec_test, make_result_iq, sync_stream, make_presence import constants as cs from caps_helper import compute_caps_hash, \ text_fixed_properties, text_allowed_properties, \ stream_tube_...
lgpl-2.1
-8,873,281,189,688,629,000
41.350993
78
0.6
false
OpenNetworking/gcoin-community
qa/rpc-tests/proxy_test.py
1
6147
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import socket import traceback, sys from binascii import hexlify import time, os from test_framework.socks5 im...
apache-2.0
-8,708,953,383,756,219,000
41.10274
146
0.644217
false
Daruzon/twitter-profile-mgmt
htdocs/index.py
1
2566
#!/usr/bin/env python3 # coding: utf-8 # enable debugging if __name__ == "__main__": import cgi, cgitb, sys, os, locale, codecs, io, importlib from datetime import datetime from time import time #cgitb.enable() os.environ['CONFPATH'] = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+"/app/includ...
mit
5,593,159,257,900,130,000
25.905263
108
0.652582
false
firtek/flap.py
flap.py
1
4358
#!/usr/bin/env python3 from copy import copy import pyglet from pyglet import gl import settings from sprites import Bird, Background, Floor, Pipe from utils import get_sprite, check_collision def main(callback=None): #global score set to -1 because on first pipe score is increased global score score = ...
bsd-2-clause
8,000,193,271,814,344,000
24.786982
124
0.539468
false
mauriceling/dose
dose/copads/statisticsdistribution.py
1
134396
""" Classes for Various Statistical Distributions. References: - Regress+ A compendium of common probability distributions (version 2.3) by Michael P. McLaughlin (mpmcl@mitre.org) http://www.causascientia.org/math_stat/Dists/Compendium.pdf - Hand-book on statistical distributions for experimenta...
gpl-3.0
288,445,279,155,761,150
35.911425
83
0.581699
false
janusnic/21v-pyqt
unit_02/con3.py
1
1328
##!/usr/bin/python # -*- coding: utf-8 -*- """ Code PyQt4 In this example, we create a simple window in PyQt4. """ from PyQt4 import QtCore, QtGui class MyWindow(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.button1 = QtGui.QPushButton(u"Кнопка 1. Нажм...
mit
-807,823,098,126,535,000
31.315789
105
0.629177
false
appsembler/configuration
playbooks/roles/backups/files/backup.py
1
17068
#!/usr/bin/python import argparse import datetime import logging import math import os import requests import shutil import socket import subprocess import sys import time import raven def make_file_prefix(base_name): hostname = socket.gethostname() return '{0}_{1}'.format(hostname, base_name) def make_fi...
agpl-3.0
4,505,051,146,387,217,400
34.558333
111
0.629189
false
jtacoma/geometriki
geometriki/tests/functional/test_pages.py
1
2036
# This file is part of geometriki. # # geometriki is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # geometriki is distributed ...
agpl-3.0
943,609,453,979,199,700
34.103448
82
0.667485
false
maliceio/malice-pdf
pdfparser/pdf_parser.py
1
58940
""" Modified by CSE to fit ASSEMBLYLINE service """ __description__ = 'pdf-parser, use it to parse a PDF document' __author__ = 'Didier Stevens' __version__ = '0.6.8' __date__ = '2017/10/29' __minimum_python_version__ = (2, 5, 1) __maximum_python_version__ = (3, 6, 3) """ Source code put in public domain by Didier Ste...
mit
7,926,709,286,726,347,000
36.976804
164
0.507397
false
EmanueleCannizzaro/scons
test/MSVS/vs-9.0Exp-exec.py
1
3292
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
mit
5,027,620,518,771,086,000
29.201835
101
0.699271
false
gstarnberger/paasta
paasta_tools/contrib/delete_old_marathon_deployments.py
1
3106
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
apache-2.0
3,240,582,496,428,836,000
32.76087
117
0.667418
false
dorneanu/appvulnms
src/core/parser/AppVulnXMLParser.py
1
14417
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: victor # @Date: 2014-02-09 # @Last Modified by: victor # @Last Modified time: 2014-06-06 # @Copyright: # # This file is part of the AppVulnMS project. # # # Copyright (c) 2014 Victor Dorneanu <info AAET dornea DOT nu> # # Permission is hereby granted...
mit
-7,039,225,817,628,492,000
39.383754
119
0.553791
false
tricoder42/python-ariadne
docs/conf.py
1
8846
# coding: utf-8 from __future__ import unicode_literals import os import sys import sphinx_rtd_theme import ariadne # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath t...
mit
815,831,060,555,983,000
31.028986
79
0.704864
false
GennadiyZakharov/locotrack
src/ltgui/preprocessorwidget.py
1
5007
''' Created on 29 jan. 2015 @author: Gena ''' from PyQt4 import QtCore, QtGui class PreprocessorWidget(QtGui.QWidget): ''' classdocs ''' def __init__(self, preprocessor, parent=None): ''' Constructor ''' super(PreprocessorWidget, self).__init__(parent) self.p...
lgpl-3.0
-634,777,850,189,652,000
40.38843
100
0.688236
false
kollad/turbo-ninja
utils/mathutils.py
1
5600
from bisect import insort_left from collections import MutableMapping, OrderedDict import random import struct import hashlib from threading import Lock import os from engine.utils.timeutils import milliseconds _inc_lock = Lock() _inc = 0 _pid = int(os.getpid()) % 0xffff def random_id(length=18): """Generate i...
mit
-161,171,418,633,999,780
24.339367
119
0.5425
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection.py
1
7595
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
4,056,119,647,110,844,400
48.967105
117
0.663858
false
epuzanov/ZenPacks.community.CIMMon
ZenPacks/community/CIMMon/interfaces.py
1
9776
################################################################################ # # This program is part of the CIMMon Zenpack for Zenoss. # Copyright (C) 2012 Egor Puzanov. # # This program can be used under the GNU General Public License version 2 # You can find full information here: http://www.zenoss.com/oss # ###...
gpl-2.0
-7,139,634,888,139,762,000
51.55914
80
0.54511
false
shaz13/oppia
core/controllers/cron.py
1
7669
# 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 required by applicable ...
apache-2.0
-490,610,909,016,384,450
40.231183
79
0.615726
false
luzheqi1987/nova-annotation
nova/network/linux_net.py
1
71216
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file...
apache-2.0
-7,665,344,293,116,199,000
37.979748
79
0.538292
false
ProgVal/Supybot-website
plugins/models.py
1
2683
from django.contrib.auth.models import User from django.db import models from django import forms import datetime class Plugin(models.Model): author = models.ForeignKey(User, help_text='The user who wrote the plugin.') name = models.SlugField(max_length=255, help_text='The name of the plugin.', u...
bsd-3-clause
-7,488,097,766,186,343,000
34.302632
89
0.660082
false
nikofil/invenio-search-ui
invenio_search_ui/version.py
1
1207
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio 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...
gpl-2.0
1,992,955,465,545,032,400
35.575758
76
0.743165
false
imcgreer/simqso
simqso/sqrun.py
1
27784
#!/usr/bin/env python import os import numpy as np from functools import partial from astropy.io import fits from astropy.table import Table,hstack from astropy import cosmology from . import sqbase from . import sqgrids as grids from . import hiforest from . import dustextinction from . import sqphoto from . import ...
bsd-3-clause
-7,249,735,259,691,682,000
38.634807
79
0.610711
false
openstack/python-neutronclient
neutronclient/tests/functional/core/test_readonly_neutron.py
1
5377
# 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, software # d...
apache-2.0
2,111,925,428,263,533,600
38.536765
79
0.606286
false
lrei/canonical_urls
urlhelpers.py
1
1775
""" """ import re import logging import rfc3987 import urlparse def url_encode_non_ascii(b): return re.sub('[\x80-\xFF]', lambda c: '%%%02x' % ord(c.group(0)), b) def ensure_url(iri): '''If IRI, convert to URL If fragments (#), remove http://stackoverflow.com/posts/4391299/revisions ''' # i...
mit
2,921,001,869,390,411,000
21.75641
78
0.579155
false
thruflo/pyramid_redis
src/pyramid_redis/hooks.py
1
4492
# -*- coding: utf-8 -*- """Provides a ``RedisFactory`` to get a configured redis client from a settings dictionary, e.g.:: >>> factory = RedisFactory() >>> client = factory({'redis.url': 'redis://localhost:6379'}) And ``GetRedisClient`` which wraps the factory so it can be used as a Pyramid request...
unlicense
5,676,939,344,290,679,000
34.370079
79
0.61821
false
YufeiZhang/Principles-of-Programming-Python-3
Preparing/words.py
1
1255
# words.py def main(): try: #txt = open("test_1.txt") #txt = open("test_2.txt") #txt = open("test_3.txt") txt = open("test_4.txt") #target = input("Enter characters (spaces will be ignored): ") #target = "cluuud IN DeD 23*" target = "NSCRT - oooe+*" except OSError: print("OSError: Cannot find th...
gpl-3.0
-474,582,302,238,988,500
18.936508
99
0.588048
false
NERC-CEH/jules-jasmin
majic/joj/tests/functional/test_model_run_pre_create.py
1
3962
# Majic # Copyright (C) 2014 CEH # # 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 2 of the License, or # (at your option) any later version. # # This progra...
gpl-2.0
-5,171,435,831,803,058,000
44.022727
126
0.693337
false
google/mirandum
alerts/streamjar/models.py
1
1874
# Copyright 2016 Google Inc. 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 required by applica...
apache-2.0
-5,070,340,945,048,618,000
37.244898
95
0.670224
false
summerisgone/gitrecipe
setup.py
1
1115
# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name="gitrecipe", version='0.0.2', description='Simple buildout recipe for downloading git repositories. It uses system git command and its syntax', author='Ivan Gromov', author_email='summer.is.gone@gmail.com', url='htt...
bsd-3-clause
-8,936,679,593,237,095,000
37.448276
117
0.642152
false
jnez71/demos
geometry/bezier_surface.py
1
5934
#!/usr/bin/env python3 """ Efficient implementation of a Bezier surface and its differential geometry. """ from __future__ import division import numpy as np ################################################## CORE class Bezier(object): """ Bezier manifold of dimension 2 embedded in Euclidean space of dimensi...
mit
-1,133,954,785,867,220,100
37.283871
94
0.568419
false
vedujoshi/tempest
tempest/lib/common/preprov_creds.py
1
16653
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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 re...
apache-2.0
-6,200,474,663,788,724,000
43.526738
79
0.582297
false
appleseedhq/cortex
test/IECoreScene/MeshNormalsOpTest.py
1
4405
########################################################################## # # Copyright (c) 2008-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
bsd-3-clause
-3,052,171,660,580,019,000
38.330357
116
0.69353
false
lihuanshuai/libmc
tests/shabby/reconnect_delay.py
1
1557
# coding: utf-8 import os import time import libmc import slow_memcached_server import subprocess def memcached_server_ctl(cmd, port): ctl_path = os.path.join( os.path.dirname(os.path.dirname(os.path.dirname( os.path.abspath(__file__) ))), 'misc', 'memcached_server' ) ...
bsd-3-clause
-3,118,505,879,109,745,000
24.95
70
0.62492
false
EmanueleCannizzaro/scons
test/LINK/SHLINKCOM.py
1
2607
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
mit
-4,458,785,082,767,178,000
26.442105
96
0.671653
false
eirannejad/pyRevit
extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools.stack/Links.pulldown/Create Workset For Linked Element.pushbutton/script.py
1
1095
from pyrevit import revit, DB, UI from pyrevit import script from pyrevit import forms logger = script.get_logger() selection = revit.get_selection() linkedModelName = '' if len(selection) > 0: for el in selection: if isinstance(el, DB.RevitLinkInstance): linkedModelName = el.Name.split(':...
gpl-3.0
-6,848,140,956,992,978,000
35.5
79
0.624658
false
9p0le/simiki
simiki/log.py
1
2342
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import logging from logging import getLogger, Formatter, StreamHandler from simiki import utils from simiki.compat import is_linux, is_osx class ANSIFormatter(Formatter): """Use ANSI escape sequences to colore...
mit
7,475,655,482,972,480,000
25.91954
76
0.584116
false
akegan/plasmoids
relReconVars.py
1
9293
############################################### ### ### This file is generated by wpp. ### ### Input file : /scr_verus/wernerg/vrun/relRecon/relReconRepo/relReconPre.py ### Output file : relRecon.in ### Translation: 2014 Dec 04, 14:26:11 ### ### disthistMac version $Id: disthistMac.py 104 2014-04-29 03:36:27Z wernerg ...
mit
7,488,255,541,433,285,000
27.160606
137
0.689551
false
esteluk/reinhardt
memberinfo/mailman.py
2
4938
# Copyright (C) 1998-2007 by the Free Software Foundation, Inc. # Much of this is based on /usr/lib/mailman/bin/paths.py and Fixes the path of the project in order to use mailman # BEGIN MAILMAN PATH INCLUSION --------------------------- import os import sys from warnings import filterwarnings # some scripts expect...
agpl-3.0
-8,628,226,163,998,219,000
38.190476
127
0.662009
false
liaozhida/liaozhida.github.io
_posts/pythonbak/preCaptcha.py
1
2197
# -*- coding: utf-8 -*- import requests import json from bs4 import BeautifulSoup import time class CaptchaHelper: def __init__(self): self.headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari...
apache-2.0
-7,904,162,348,769,327,000
25.654321
150
0.553497
false
SystemsBioinformatics/cbmpy
setupegg.py
1
1159
""" CBMPy: Constraint Based Modelling in Python (http://pysces.sourceforge.net/cbm) ============ Copyright (C) 2010-2018 Brett G. Olivier, VU University Amsterdam, Amsterdam, The Netherlands This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as pub...
gpl-3.0
2,300,610,091,657,087,700
35.21875
93
0.762726
false
Jelby-John/HatalogicoWeatherStation
main.py
1
5387
#!/usr/bin/python from Adafruit_PWM_Servo_Driver import PWM from Adafruit_ADS1x15 import ADS1x15 import time, os, sys import Adafruit_DHT # HOW MANY CYCLES TO BE PERFORMED BEFORE SHOWING THE HIGH AND LOW SEQUENCE # SET TO 0 FOR OFF intervalHighLow = 60 # HOW LONG TO REST BETWEEN CYCLES - ZERO IS FINE intervalSleep = ...
mit
-341,734,205,532,914,300
24.77512
100
0.699462
false
AntonovAlexander/activecore
designs/rtl/sigma/sw/benchmarks/mul_sw/hw_test_mul_sw.py
1
1185
# -*- coding:utf-8 -*- from __future__ import division import sys sys.path.append('../../../../../rtl/udm/sw') import time import udm from udm import * sys.path.append('..') import sigma from sigma import * def test_mul_sw(sigma, a, b): sigma.tile.udm.wr32(0x6000, a) sigma.tile.udm.wr32(0x6004, b) corr...
apache-2.0
-607,769,951,120,433,200
24.212766
86
0.55865
false
ifiddes/pycbio
tests/libtests/pycbio/sys/symEnumTests.py
1
4840
# Copyright 2006-2014 Mark Diekhans import unittest, sys, cPickle if __name__ == '__main__': sys.path.extend(["../../..", "../../../.."]) from pycbio.sys.symEnum import SymEnum, SymEnumValue from pycbio.sys.testCaseBase import TestCaseBase class Color(SymEnum): red = 1 green = 2 blue = 3 class GeneFea...
bsd-3-clause
1,242,285,625,566,823,200
36.51938
102
0.628926
false
gtt116/rabbitclient
rabbit.py
1
3469
#!/usr/bin/env python """ A Kombu based RabbitMQ server client """ import sys import argparse import json import pprint try: from kombu.messaging import Producer from kombu import Exchange, Queue, Connection except ImportError: print 'Please install kombu before running this script.' print 'You can run ...
apache-2.0
-6,895,754,863,888,696,000
31.726415
78
0.593255
false
aymeric-spiga/remap
py/archive/reduced.py
1
2347
#! /usr/bin/env python import netCDF4 as nc import sys import math import numpy as np def from_reduced(N,M): #"N elements from south to north and N elements around equator " if gaussian: hmax = 2*math.pi/N hmin = hmax/2 nlon = N cells_lon = [] cells_lat = [] for i in range(M/2): lat1 = 180.0...
gpl-2.0
2,083,614,771,329,507,000
26.290698
89
0.612697
false
hip-odoo/odoo
addons/hr_attendance/models/hr_employee.py
15
7281
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from random import choice from string import digits from odoo import models, fields, api, exceptions, _, SUPERUSER_ID class HrEmployee(models.Model): _inherit = "hr.employee" _description = "Employee" def...
agpl-3.0
2,383,363,399,660,738,600
48.530612
210
0.631232
false
cloud-ark/cloudark
client/fmcmds/call_server.py
1
14059
import gzip import json import os import requests import tarfile import urllib2 resources_endpoint = "http://localhost:5002/resources" resource_stacks_endpoint = "http://localhost:5002/resource_stacks" environments_endpoint = "http://localhost:5002/environments" apps_endpoint = "http://localhost:5002/apps" containers_...
apache-2.0
1,964,869,006,662,134,500
37.203804
124
0.580838
false
ibmjstart/bluemix-python-eve-sample
macreduce/run.py
1
3837
#!/usr/bin/env python """Instantiates the Python Eve REST API Server. Instantiates the Python Eve REST API Server for both local and cloud (IBM Bluemix) execution. Provides a default catch-all routing to provide API consumers with intentional responses for all routes. Provides a redis cloud caching instance for sess...
apache-2.0
7,938,279,015,738,166,000
32.955752
79
0.66823
false
sbarton272/AcousticBarcodes-Explorations
barcodes/dxfwrite/examples/mtext.py
1
3720
#!/usr/bin/env python #coding:utf-8 # Author: mozman # Purpose: examples for dxfwrite usage, see also tests for examples # Created: 09.02.2010 # Copyright (C) 2010, Manfred Moitzi # License: MIT License import sys import os try: import dxfwrite except ImportError: # if dxfwrite is not 'installed' append pare...
mit
-6,541,401,395,220,813,000
39.879121
83
0.600538
false
openstack/smaug
karbor/tests/unit/protection/test_cinder_freezer_protection_plugin.py
1
7811
# 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, software # dist...
apache-2.0
-7,735,721,643,586,370,000
36.373206
79
0.616566
false
fangohr/oommf-python
new/evolvers_test.py
1
3923
import pytest from evolvers import RungeKuttaEvolve, CGEvolve class TestRungeKuttaEvolve(object): def setup(self): # Set of valid arguments. self.args1 = [[1, 1, 1, 'rkf54'], [0.5, 1e5, 0.01, 'rk2'], [0.05, 2.21e5, 5e6, 'rk4'], [0.1...
bsd-2-clause
3,618,059,933,764,490,000
30.134921
76
0.465205
false
DutBright/scientificResearch
adminStaff/views.py
1
8772
# coding: UTF-8 ''' Created on 2014-06-07 Desc: adminStaff' view, includes home(manage), review report view ''' import time from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.views.decorators import csrf from backend.decorators import * from const import * from ba...
agpl-3.0
-821,464,746,761,467,800
30.52518
185
0.684961
false
rudhir-upretee/Sumo17_With_Netsim
tools/traci/constants.py
1
16975
""" @file constants.py This script contains TraCI constant definitions from <SUMO_HOME>/src/traci-server/TraCIConstants.h generated by "rebuildConstants.py" on 2012-12-03 12:37:11.425000. SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ Copyright (C) 2009-2013 DLR (http://www.dlr.de/) and contr...
gpl-3.0
-4,040,832,587,357,143,600
24.916031
98
0.729131
false
vensder/itmo_python
nasledovanye3.py
1
1220
import random class Transport: def __init__(self, name, speed = 0, wheel_count = 0, mass = 0, color = (0,0,0)): self.name = name self.speed = speed self.wheel_count = wheel_count self.mass = mass self.color = color self.pos = 0 def drive(self, time): self.pos += self.speed * time #return self.po...
gpl-3.0
-2,407,283,530,971,650,000
16.941176
83
0.594262
false
meisamhe/GPLshared
Programming/MPI — AMath 483 583, Spring 2013 1.0 documentation_files/scoping.py
1
1058
# @include x, y, z = 'global-x', 'global-y', 'global-z' def basic_scoping(): print(x) # global-x y = 'local-y' global z z = 'local-z' basic_scoping() print(x, y, z) # global-x global-y local-z def inner_outer_scoping(): def inner1(): print(x) # outer-x def inner2(): x = 'i...
gpl-3.0
-7,386,681,169,818,829,000
18.592593
74
0.52741
false
the-duck/launcher-next
src/duck/launcher/XlibStuff.py
1
1626
#! /usr/bin/python # -*- coding: utf-8 -*- ######### ######### #Copyright (C) 2014-2015 Mark Spurgeon <theduck.dev@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 Software Foundation, either v...
gpl-2.0
6,072,618,563,806,798,000
35.954545
138
0.636531
false
alefnula/perart
src/perart/forms.py
1
1510
__author__ = 'Viktor Kerkez <alefnula@gmail.com>' __contact__ = 'alefnula@gmail.com' __date__ = '20 April 2010' __copyright__ = 'Copyright (c) 2010 Viktor Kerkez' import logging from django import forms from django.conf import settings from google.appengine.api import mail # perart imports from perart impor...
gpl-3.0
-3,145,847,521,591,563,000
22.984127
94
0.602649
false
OCA/purchase-workflow
purchase_landed_cost/wizard/import_invoice_line.py
1
1945
# Copyright 2014-2016 Tecnativa - Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3 from odoo import api, fields, models class ImportInvoiceLine(models.TransientModel): _name = "import.invoice.line.wizard" _description = "Import supplier invoice line" supplier = fields.Many2one( ...
agpl-3.0
-5,586,129,776,587,690,000
44.232558
77
0.614396
false
vitmod/enigma2-1
skin.py
1
33730
from Tools.Profile import profile profile("LOAD:ElementTree") import xml.etree.cElementTree import os profile("LOAD:enigma_skin") from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop from Components.config import ConfigSubsection,...
gpl-2.0
6,708,689,500,288,114,000
32.2643
231
0.678476
false
adsabs/adsabs-pyingest
pyingest/parsers/hstprop.py
1
5181
#!/usr/bin/env python from past.utils import old_div import sys import math import requests class URLError(Exception): pass class RequestError(Exception): pass class DataError(Exception): pass class HSTParser(object): # HSTParser will return a list of articles taken from a HST API # (https:...
mit
8,031,092,040,686,377,000
40.448
145
0.550087
false
radical-cybertools/radical.ensemblemd
src/radical/entk/execman/mock/resource_manager.py
1
3425
__copyright__ = 'Copyright 2017-2018, http://radical.rutgers.edu' __author__ = 'Vivek Balasubramanian <vivek.balasubramaniana@rutgers.edu>' __license__ = 'MIT' # pylint: disable=unused-argument from ..base.resource_manager import Base_ResourceManager import radical.utils as ru # ------------------------------...
mit
-5,283,086,850,979,547,000
29.309735
80
0.38219
false
pratheekms/nlp-class
unit_test_5/feature_functions.py
1
8956
''' feature_functions.py Implements the feature generation mechanism Author: Anantharaman Narayana Iyer Date: 21 Nov 2014 ''' from nltk import sent_tokenize, word_tokenize import nltk import json import numpy import pickle import datetime from MyMaxEnt import MyMaxEnt phones = ["phone", "phones", "smar...
mit
-8,602,308,351,966,660,000
26.252366
142
0.423515
false
PW-Sat2/PWSat2OBC
integration_tests/emulator/rtc.py
1
1580
from datetime import timedelta, datetime import wx from wx import xrc from devices import RTCDevice from .base import ModuleBase, bind class RTCModule(ModuleBase): GridPos = (1, 0) def __init__(self, system): self._system = system self._rtc = system.rtc # type: RTCDevice self.title =...
agpl-3.0
8,938,563,817,151,320,000
27.214286
77
0.593671
false
lxml/lxml
versioninfo.py
1
2210
import io import os import re import sys __LXML_VERSION = None def version(): global __LXML_VERSION if __LXML_VERSION is None: with open(os.path.join(get_base_dir(), 'src', 'lxml', '__init__.py')) as f: __LXML_VERSION = re.search(r'__version__\s*=\s*"([^"]+)"', f.read(250)).group(1) ...
bsd-3-clause
-7,693,295,235,261,800,000
26.283951
92
0.567873
false
exic/spade2
spade/pubsub.py
1
9884
from Behaviour import MessageTemplate, OneShotBehaviour from xmpp.protocol import * from xmpp.simplexml import Node import uuid def gen_id(): return str(uuid.uuid4()) #def PubSubMessageTemplate(): # msgs = [] # for ns in (NS_PUBSUB, NS_PUBSUB_OWNER): # msg = Iq() # msg.addChild(name='pubsub',...
lgpl-2.1
4,256,735,416,115,895,300
31.620462
101
0.542493
false
amoin62/cs229
youtube_sentiment/tags.py
1
8165
from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.svm import LinearSVC from sklearn.naive_bayes import BernoulliNB from sklearn.pipeline import Pipeline from sklearn.linear_model import RidgeClassifier, LogisticRegression from tim...
gpl-3.0
-6,587,001,173,086,228,000
40.973684
135
0.644213
false
xiaocong/remote-task-http-server
devices.py
1
4107
#!/usr/bin/env python # -*- coding: utf-8 -*- from bottle import Bottle, request, static_file, abort import re import time import os import subprocess from io import BytesIO try: import PIL.Image as Image except: from PIL import Image from jobs import lock import adb app = Bottle() @app.get("/") def device...
mit
7,346,349,997,841,327,000
39.663366
197
0.528366
false
bors-ltd/django-gitstorage
gitstorage/models.py
1
6291
# Copyright Bors LTD # This file is part of django-gitstorage. # # Django-gitstorage 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
749,146,428,825,357,800
34.948571
112
0.650135
false
maas/maas
src/maasserver/models/tests/test_cleansave.py
1
13144
# Copyright 2018 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Tests for `CleanSave`.""" from unittest.mock import sentinel from django.db.models import Model from maasserver.models.cleansave import CleanSaveModelState from maasserver.m...
agpl-3.0
-2,817,001,847,400,110,600
37.887574
77
0.638771
false
MarkusHackspacher/unknown-horizons
horizons/util/python/weakmethod.py
1
2225
# ################################################### # Copyright (C) 2008-2017 The Unknown Horizons Team # team@unknown-horizons.org # This file is part of Unknown Horizons. # # Unknown Horizons is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
gpl-2.0
867,174,227,849,065,700
32.208955
90
0.671461
false
CSSIP-AIR/UMETRICS
collapse_persons/person_attribute.py
1
3929
################################################################################ # Copyright (c) 2013, AMERICAN INSTITUTES FOR RESEARCH # 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. Redistribut...
bsd-2-clause
-7,868,506,971,949,554,000
54.338028
757
0.686689
false
myquant/strategy
SkyPark/python/SkyPark.py
1
4283
# encoding: utf-8 from gmsdk.api import StrategyBase from gmsdk import md from gmsdk.enums import * import arrow import time # 每次开仓量 OPEN_VOL = 5 class SkyPark(StrategyBase): def __init__(self, *args, **kwargs): super(SkyPark, self).__init__(*args, **kwargs) # 上、下轨 self.upr = None ...
apache-2.0
4,281,629,947,472,806,000
33.366667
110
0.543051
false
pcmoritz/Strada.jl
deps/src/caffe/python/apollocaffe/layers/caffe_layers.py
1
7272
""" List of layer classes for building protobuf layer parameters from python """ from .layer_headers import Layer, LossLayer, DataLayer from .layer_helpers import assign_proto, Filler from apollocaffe.proto import caffe_pb2 class CapSequence(Layer): def __init__(self, name, sequence_lengths, **kwargs): su...
bsd-2-clause
-2,210,375,708,227,604,200
39.853933
111
0.630226
false
mbiciunas/nix
test/config/test_config_tags.py
1
3679
# Nix # Copyright (c) 2017 Mark Biciunas. # # 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. # # This program is distrib...
gpl-3.0
-418,231,377,767,631,170
34.375
109
0.638761
false
ethancaballero/neural-engineers-first-attempt
adaptive_attention.py
1
9391
import tensorflow as tf from tensorflow.python.ops import rnn, rnn_cell, seq2seq from utils import get_seq_length, _add_gradient_noise, _position_encoding, _xavier_weight_init, _last_relevant, batch_norm #from https://github.com/DeNeutoy/act-rte-inference/blob/master/AdaptiveIAAModel.py class Adaptive_Episodes_Con...
mit
8,711,310,250,242,839,000
39.658009
179
0.621127
false
TAlonglong/trollduction-test
trollduction/tests/test_xml_read.py
1
4230
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014 Martin Raspaud # Author(s): # Martin Raspaud <martin.raspaud@smhi.se> # 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, eit...
gpl-3.0
3,548,981,223,696,637,000
34.546218
106
0.623404
false
operator/sqlalchemy_bulk_lazy_loader
test/conftest.py
1
1226
#!/usr/bin/env python """ pytest plugin script. This script is an extension to py.test which installs SQLAlchemy's testing plugin into the local environment. """ import sys import os from lib.sqlalchemy_bulk_lazy_loader import BulkLazyLoader from sqlalchemy.testing import plugin BulkLazyLoader.register_loader() #...
mit
7,862,574,074,721,302,000
28.902439
74
0.67863
false
mbusb/multibootusb
scripts/config.py
1
2054
#!/usr/bin/env python3 # Name: config.py # Purpose: Module to share important variables between various modules. Mainly included so as not to call many # functions again and again # Authors: Sundar # Licence: This file is a part of multibootusb package. You can redistribute it or modify # under the ter...
gpl-2.0
-479,208,830,022,669,200
26.756757
111
0.689387
false
glogiotatidis/bedrock
bedrock/releasenotes/tests/test_base.py
1
17464
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from django.core.cache import caches from django.http import Http404 from django.test.client import RequestFactory from d...
mpl-2.0
-2,249,092,954,485,534,700
43.10101
81
0.633704
false
kirmani/lockman
MC/pio.py
1
3202
import RPi.GPIO as GPIO import requests import time import threading import os import base64 import string import random import datetime "GPIO.setmode(BOARD)" def closeLock(): p = GPIO.PWM(12,50) #sets pin 12 to PWM and sends 50 signals per second p.start(7.5) #starts by sending a pulse at 7.5% to c...
mit
1,823,985,232,699,865,300
30.087379
115
0.625859
false
beeftornado/sentry
src/sentry/shared_integrations/client.py
1
10459
from __future__ import absolute_import import logging import requests import sentry_sdk import six from collections import OrderedDict from django.core.cache import cache from bs4 import BeautifulSoup from django.utils.functional import cached_property from requests.exceptions import ConnectionError, Timeout, HTTPEr...
bsd-3-clause
5,743,440,093,390,676,000
32.522436
100
0.574816
false
ChromiumWebApps/chromium
tools/telemetry/telemetry/core/backends/chrome/extension_dict_backend.py
1
2602
# 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. import json import re from telemetry.core import extension_page from telemetry.core.backends.chrome import inspector_backend class ExtensionNotFoundExcept...
bsd-3-clause
-441,002,597,549,063,600
33.693333
76
0.701768
false
mishbahr/django-users2
users/views.py
1
6157
from django.contrib import messages from django.contrib.auth import get_user_model, login from django.urls import reverse from django.shortcuts import redirect, resolve_url from django.template.response import TemplateResponse from django.utils.translation import ugettext as _ from django.views.decorators.cache import ...
bsd-3-clause
-3,139,041,058,954,845,000
35.431953
97
0.637486
false
Arabidopsis-Information-Portal/GAG
test/sequence_tests.py
1
16369
#!/usr/bin/env python # coding=utf-8 import unittest from mock import Mock from src.sequence import Sequence, overlap class TestSequence(unittest.TestCase): def setUp(self): self.seq1 = Sequence("seq1", "GATTACA") def add_mock_gene(self, name="foo_gene"): mockgene = Mock() mockgene...
mit
5,033,641,834,612,063,000
40.231738
104
0.610789
false
JustinTulloss/harmonize.fm
masterapp/masterapp/model/user.py
1
22317
# Justin Tulloss # # Putting user in its own file since it's huge import logging from pylons import cache, request, session, c from pylons.templating import render from decorator import decorator from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Table, sql from sqlalchemy.sql impo...
mit
8,144,348,351,670,925,000
32.916413
99
0.577049
false
Osndok/zim-desktop-wiki
tests/translations.py
1
4529
import re from glob import glob from tests import TestCase class TestTranslations(TestCase): def runTest(self, verbose=False): '''Sanity check translation files''' pot_creation_date = None for file in ['translations/zim.pot'] + glob('translations/*.po'): if verbose: print 'Checking %s' % file t = ...
gpl-2.0
5,430,020,703,552,679,000
24.88
125
0.647384
false
11craft/django-cms
cms/tests/management.py
1
8977
# -*- coding: utf-8 -*- from __future__ import with_statement from cms.models import Page from django.core import management from cms.test_utils.testcases import CMSTestCase from cms.test_utils.util.context_managers import SettingsOverride from cms.api import create_page, add_plugin from cms.management.command...
bsd-3-clause
-3,773,510,374,559,143,400
37.546256
89
0.560209
false
ARM-software/trappy
tests/test_utils.py
1
2217
# Copyright 2015-2017 ARM Limited # # 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 w...
apache-2.0
-5,604,032,030,369,191,000
35.344262
83
0.666216
false
RazerM/pg_grant
tests/conftest.py
1
2475
from pathlib import Path import pytest import testing.postgresql from sqlalchemy import create_engine, text from sqlalchemy.engine.url import make_url from testcontainers.postgres import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', ...
mit
4,059,386,316,065,879,600
28.117647
86
0.657778
false
raymondnoonan/Mpropulator
MPropulator/write_tab.py
1
1656
from MPropulator import helpers import string def write_tab(sheet, table_data, xls_startcell, skiprows, skipcols): """Writes the data for a particular table to the corresponding Excel spreadsheet. sheet: openpyxl worksheet to which you're writing table_data: pandas data frame containing data to write...
mit
5,847,719,726,850,679,000
37.511628
77
0.624396
false
johnny555/2d3g
viz.py
1
5005
__author__ = 'Admin' def group_bands(depth, coal_labels, holeID): coal_label_list = ['RU', 'R', 'R1', 'R2', 'RO', 'RL', 'MU', 'MM', 'MML', 'LN', 'TR', 'TRL', 'PS', 'PSL', 'P2', 'P2U', 'P2LA', 'P2LB', 'BA', 'G1', 'G2', 'G34', 'G3', 'G4', 'G56', 'G5', 'G6', 'G7', 'G8', 'G9', 'G10', ...
bsd-2-clause
1,808,144,811,737,757,200
24.804124
121
0.507493
false
letsmeet-click/letsmeet.click
letsmeet/events/migrations/0001_initial.py
1
2446
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2015-12-28 00:55 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import django_extensions.db.fields class Migration(migrations.Migration...
mit
-1,845,259,420,887,350,000
45.150943
145
0.616926
false
teonlamont/mne-python
mne/datasets/brainstorm/bst_auditory.py
4
1920
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr> # # License: BSD (3-clause) from functools import partial from ...utils import verbose from ..utils import (has_dataset, _data_path, _get_version, _version_doc, _data_path_doc) has_brainstorm_data = partial(has_dataset, name='brainstorm') ...
bsd-3-clause
-4,784,413,848,918,143,000
33.285714
78
0.639063
false
dtudares/hello-world
yardstick/tests/unit/benchmark/scenarios/networking/test_netperf_node.py
1
3858
#!/usr/bin/env python ############################################################################## # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompan...
apache-2.0
-2,371,470,591,946,177,000
29.377953
78
0.554951
false
jamesstout/fail2ban-0.8.4-OpenSolaris
testcases/filtertestcase.py
1
5930
# This file is part of Fail2Ban. # # Fail2Ban 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. # # Fail2Ban is distributed in the hope t...
gpl-2.0
2,968,010,339,299,266,600
29.101523
184
0.698314
false
uogbuji/Library.Link
pylib/resource.py
1
2994
''' ''' import re import http import asyncio from itertools import * from versa.driver import memory from versa import I, VERSA_BASEIRI, ORIGIN, RELATIONSHIP, TARGET, ATTRIBUTES from versa.reader import rdfalite from versa.reader.rdfalite import RDF_NS, SCHEMAORG_NS from versa import util as versautil #from bibfram...
apache-2.0
7,825,348,551,972,483,000
31.193548
80
0.641283
false