repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
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
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
Guzi219/Python
com/github/utils/IniFileUtil.py
1
1845
# -*- coding:utf-8 -*_ import ConfigParser import os class INIFILE: """ a class which can process *.ini file with read and write function. """ def __init__(self, fileName): self.fileName = fileName self.initflag = False self.cfg = None self.readhandle = None ...
mit
6,201,506,048,901,360,000
27.384615
102
0.573984
false
3.867925
false
false
false
trabucayre/gnuradio
gr-filter/python/filter/qa_filter_delay_fc.py
1
3902
#!/usr/bin/env python # # Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr, gr_unittest, filter, blocks import math def sin_source_f(samp_rate, freq, amp, N): t = [float(x) / samp_rate f...
gpl-3.0
-2,342,077,721,687,046,000
26.097222
81
0.57714
false
2.949358
true
false
false
Pulgama/supriya
supriya/ugens/LinLin.py
1
1205
import abc from supriya.ugens.PseudoUGen import PseudoUGen class LinLin(PseudoUGen): ### CLASS VARIABLES ### __documentation_section__ = "Line Utility UGens" ### INITIALIZER ### @abc.abstractmethod def __init__(self): raise NotImplementedError ### PUBLIC METHODS ### @staticm...
mit
2,338,045,730,599,095,300
24.104167
87
0.609129
false
3.618619
false
false
false
ericmjl/bokeh
bokeh/colors/util.py
1
3940
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
-2,405,973,552,636,025,300
31.03252
95
0.385533
false
5.620542
false
false
false
alphatwirl/alphatwirl
alphatwirl/roottree/BranchAddressManagerForVector.py
1
1619
# Tai Sakuma <tai.sakuma@gmail.com> import ROOT import re ##__________________________________________________________________|| class BranchAddressManagerForVector: """The branch address manager for ROOT TTree This class manages ROOT.vector objects used for branch addresses of ROOT TTree. The main purpos...
bsd-3-clause
-2,334,217,209,679,618,000
31.38
70
0.583694
false
4.260526
false
false
false
idaholab/raven
tests/framework/unit_tests/TSA/testPolynomialRegression.py
1
10152
# Copyright 2017 Battelle Energy Alliance, LLC # # 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 t...
apache-2.0
633,392,834,700,745,900
31.126582
111
0.646966
false
3.606394
true
false
false
tensorflow/mesh
mesh_tensorflow/transformer/adaptive_softmax.py
1
18201
# coding=utf-8 # Copyright 2021 The Mesh TensorFlow Authors. # # 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 applicab...
apache-2.0
-1,187,358,357,249,531,600
42.028369
80
0.683424
false
3.984457
false
false
false
kdunn926/eunomia-django
People/models.py
1
2149
from __future__ import unicode_literals from django.db import models #from CongressionalRecord import db from neo4j import contextmanager from neo4j import connection from re import escape from django.conf import settings connection.http.REQUEST_TIMEOUT = 9999 manager = contextmanager.Neo4jDBConnectionManager(settin...
apache-2.0
6,801,981,152,957,756,000
32.578125
104
0.590507
false
3.879061
false
false
false
wimoverwater/Sick-Beard
lib/tvnamer/roman.py
1
2827
## {{{ http://code.activestate.com/recipes/81611/ (r2) def int_to_roman(input): """ Convert an integer to Roman numerals. Examples: >>> int_to_roman(0) Traceback (most recent call last): ValueError: Argument must be between 1 and 3999 >>> int_to_roman(-1) Traceback (most recent call last): ValueE...
gpl-3.0
4,928,052,177,722,792,000
22.37069
72
0.600283
false
2.734043
false
false
false
sunlightlabs/tcamp
tcamp/twit/migrations/0001_initial.py
1
10740
# -*- 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 model 'SessionBlockTweet' db.create_table(u'twit_sessionblocktweet', ( (u'id', self.gf(...
bsd-3-clause
383,170,107,251,586,300
74.640845
194
0.563128
false
3.605237
false
false
false
sgravel/tracts
example/fancyplotting.py
1
6336
#!/usr/bin/env python """ fancyplotting.py -- make nice plots of tracts output. It mimics for the most part the output of fancyplotting.nb, but additionally provides a command-line interface and is generally more reusable that the originally-bundled Mathematica code. fancyplotting.py optionally uses seaborn or brewe...
gpl-2.0
-4,603,262,905,557,491,000
33.248649
85
0.561395
false
4.012666
false
false
false
fc-thrisp-hurrata-dlm-graveyard/flack
flask_flack/views.py
1
1618
from flask import (current_app, redirect, request, render_template, jsonify, after_this_request, Blueprint) from werkzeug import LocalProxy from .utils import (get_post_feedback_redirect, get_message, do_flash) _feedback = LocalProxy(lambda: current_app.extensions['feedback']) _datastore = LocalPr...
mit
-4,552,643,240,028,351,500
27.385965
76
0.627318
false
3.995062
false
false
false
gkc1000/pyscf
pyscf/fci/direct_spin1.py
1
38081
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
apache-2.0
-3,266,150,161,214,682,600
40.527808
95
0.584255
false
2.920322
false
false
false
Aloomaio/googleads-python-lib
examples/ad_manager/v201811/activity_service/create_activities.py
1
2230
#!/usr/bin/env python # # Copyright 2015 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 requir...
apache-2.0
-4,271,302,710,969,008,000
31.794118
77
0.718834
false
3.864818
false
false
false
hexinatgithub/CLRS
Chapter4/maximum-subarray.py
1
1207
import sys def find_max_crossing_subarray(A, low, mid, high): left_sum = -sys.maxint sum = 0 i = mid max_left = mid while i >= low: sum += A[i] if sum > left_sum: max_left = i left_sum = sum i -= 1 right_sum = -sys.maxint sum = 0 i = mid + 1 max_right = mid + 1 while i <= high: sum += A[i] i...
mit
224,464,295,923,469,250
23.14
84
0.609776
false
2.390099
false
false
false
gyoto/Gyoto
python/example-patterndisk.py
1
2991
#!/usr/bin/env python3 # # In this example script, we create a Gyoto Scnenery with a # PatternDisk, save it, read it and check that the re-read scenery is # identical to the saved one. # This is the same example as yorick/check-patterndisk.i import gyoto.core, gyoto.std import numpy import os import matplotlib.pyplot ...
gpl-3.0
5,693,086,111,596,858,000
28.613861
103
0.750919
false
2.845861
false
false
false
thorsummoner/crowbar
crowbar/linkedpanes.py
1
2370
from gi.repository import Gtk class LinkedPanes(Gtk.Bin): def __init__(self, tl, tr, bl, br): super(LinkedPanes, self).__init__() if 'linked-pane': link1 = LinkedPane( Gtk.Orientation.HORIZONTAL, tl, tr, (160, 90) ) ...
unlicense
-8,135,434,122,472,808,000
28.625
84
0.553586
false
3.720565
false
false
false
BobBuildTool/bob
pym/bob/cmds/jenkins.py
1
98147
# Bob build tool # Copyright (C) 2016 TechniSat Digital GmbH # # SPDX-License-Identifier: GPL-3.0-or-later from .. import BOB_VERSION from ..archive import getArchiver from ..errors import ParseError, BuildError from ..input import RecipeSet from ..languages import StepSpec from ..state import BobState from ..stringp...
gpl-3.0
8,702,361,835,393,258,000
42.698575
222
0.567577
false
4.182876
true
false
false
koss822/misc
Linux/MySettings/myvim/vim/bundle/jedi-vim/pythonx/jedi/test/completion/comprehensions.py
1
3188
# ----------------- # list comprehensions # ----------------- # basics: a = ['' for a in [1]] #? str() a[0] #? ['insert'] a.insert a = [a for a in [1]] #? int() a[0] y = 1.0 # Should not leak. [y for y in [3]] #? float() y a = [a for a in (1, 2)] #? int() a[0] a = [a for a,b in [(1,'')]] #? int() a[0] arr = [1,'...
gpl-3.0
-8,414,466,140,589,009,000
13.168889
91
0.452008
false
2.400602
false
false
false
Koheron/zynq-sdk
examples/red-pitaya/adc-dac-bram/adc_dac_bram.py
2
1467
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import math import numpy as np from koheron import command class AdcDacBram(object): def __init__(self, client): self.client = client self.dac_size = self.get_dac_size() self.dac = np.zeros((2, self.dac_size)) self.adc_size...
mit
-1,183,001,327,098,025,000
27.230769
87
0.582822
false
3.196078
false
false
false
tinyalpha/CaptchaPredictor
Database/crop.py
1
3127
import os import numpy as np import os.path as op from PIL import Image,ImageDraw from sklearn.cluster import KMeans def bin_or(_mat, _thr): # 二值化并取反 for i in range(_mat.shape[0]): for j in range(_mat.shape[1]): _mat[i,j] = 0 if _mat[i,j] > _thr else 1 return _mat def antinoise...
gpl-3.0
5,422,969,923,806,787,000
22.417323
74
0.51295
false
2.642667
false
false
false
unt-libraries/catalog-api
django/sierra/utils/helpers.py
1
11435
''' Contains various utility functions and classes for Sierra API project code. ''' from __future__ import unicode_literals import operator import re from django.db.models import Q def reduce_filter_kwargs(filters): ''' Given a list of filter_kwargs, where each list should be 'ORed' with each other, thi...
bsd-3-clause
-2,409,805,396,795,840,500
37.501684
78
0.567993
false
3.871022
false
false
false
40223148/2015cd_midterm
wsgi.py
1
20092
#@+leo-ver=5-thin #@+node:2014fall.20141212095015.1775: * @file wsgi.py # coding=utf-8 # 上面的程式內容編碼必須在程式的第一或者第二行才會有作用 ################# (1) 模組導入區 # 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝 #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:2014fall.20141212095015.1776: ** <<declar...
gpl-3.0
4,986,122,798,459,517
28.573712
137
0.564925
false
2.03396
false
false
false
johnmee/Flask-FlatPages
flask_flatpages/utils.py
1
2018
""" ===================== flask_flatpages.utils ===================== Utility functions to render Markdown text to HTML. """ import markdown from . import compat from .imports import PygmentsHtmlFormatter def force_unicode(value, encoding='utf-8', errors='strict'): """Convert bytes or any other Python instanc...
bsd-3-clause
-6,164,980,766,246,221,000
27.828571
77
0.655104
false
4.10998
false
false
false
Forage/Gramps
gramps/plugins/sidebar/expandersidebar.py
1
8117
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2005-2007 Donald N. Allingham # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2009 Benny Malengier # Copyright (C) 2010 Nick Hall # Copyright (C) 2011 Tim G L Lyons # # This program is free software; you can redistribute...
gpl-2.0
3,791,798,576,737,270,000
33.83691
87
0.56203
false
3.980873
false
false
false
brucelok/ucs
cimc/get_cimc_hardware.py
1
8669
#! /usr/bin/python ''' require install of ImcSdk (0.7.1)the script is to login CIMC server, and get the details of common & enabled hardware components, & health brief [ CIMC hostname, Firmware, CPU, MEM, Server Model, Serial number, NIC card, storage controller and physical disks or onbroad SATA disks] syntax: python ...
apache-2.0
5,395,877,867,665,101,000
42.782828
250
0.661668
false
3.453785
false
false
false
trichter/sito
util/main.py
1
10876
# by TR from helper import add_doc from obspy.core.util import gps2DistAzimuth from scipy.signal import get_window import logging import numpy as np import warnings from scipy.signal import iirfilter, freqz log = logging.getLogger(__name__) r_earth = 6371 def sind(x): return np.sin(x / 180. * np.pi) def cosd(x): re...
mit
-7,689,614,701,378,093,000
30.433526
110
0.583854
false
3.156123
false
false
false
paramite/kanzo
tests/plugins/sql.py
1
6136
# -*- coding: utf-8 -*- """ Example plugin for tests. This plugin should be able to install SQL database server. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import uuid from kanzo.core.puppet import update_manifest_inline from kanzo.utils.shell im...
lgpl-3.0
-8,357,320,543,788,225,000
37.835443
80
0.689048
false
4.264072
true
false
false
whatisjasongoldstein/django-draftin
draftin/models.py
1
8482
from __future__ import absolute_import, unicode_literals import re import os import lxml.html import uuid import datetime import requests import markdown import hashlib try: import urlparse except ImportError: from urllib import parse as urlparse from PIL import Image from django.db import models from django...
mit
-2,017,509,488,085,836,000
34.195021
106
0.631573
false
3.956157
false
false
false
mclarke-icr/scripts
opex/opex_series_old.py
1
8130
#!/usr/bin/env python2.7 """ Last updated: 30/09/2015 """ import os import argparse from collections import OrderedDict import pysam # delim object class Delim(object): def __init__(self,path,hea,dlm): self.path = path file_matrix = [] file_lines = [] header = "NA" with ope...
gpl-3.0
-2,422,047,881,065,171,000
32.187755
172
0.533948
false
3.291498
false
false
false
sthenc/nc_packer
tools/run_score_batch2.py
1
5055
#!/usr/bin/python import os run_root="/mnt/data/Fer/diplomski/training_currennt/speech_autoencoding_chime/mreze-2015-05-28/" index = 1100 # 178 # 142 # 73 nets =""" run10/autosave_run10_epoch181.autosave run10/autosave_run10_epoch182.autosave run10/autosave_run10_epoch183.autosave run10/autosave_run10_epoch184.aut...
mit
9,014,712,173,010,497,000
33.155405
96
0.84095
false
2.506197
false
false
false
dufferzafar/critiquebrainz
critiquebrainz/frontend/mapping/views.py
1
6564
from flask import Blueprint, render_template, request, url_for, redirect, flash from flask_login import login_required, current_user from flask_babel import gettext from werkzeug.exceptions import NotFound import critiquebrainz.frontend.apis.spotify as spotify_api from critiquebrainz.frontend.apis import musicbrainz, m...
gpl-2.0
1,506,756,935,405,627,100
42.76
174
0.688909
false
3.491489
false
false
false
osigaud/ArmModelPython
MotorControlModel/Regression/RunRegressionNN.py
1
3752
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Author: Olivier Sigaud Module: RunRegressionNN Description: Functions to run a neural net to create a controller ''' import os import numpy as np import random as rd from Utils.ReadSetupFile import ReadSetupFile from Utils.FileReading import getStateAndCommandData, ...
gpl-2.0
-2,273,377,246,047,174,700
32.5
130
0.675373
false
3.429616
true
false
false
COEXCZ/django-translation-manager
translation_manager/models.py
1
4991
import polib import os from django.db import models from django.template.defaultfilters import capfirst as cf from django.utils.translation import ugettext_lazy as _ from .settings import get_settings class TranslationEntry(models.Model): created = models.DateTimeField(auto_now_add=True, verbose_name=_(u"admin-...
mpl-2.0
-5,552,993,586,791,371,000
46.533333
199
0.676017
false
3.755455
false
false
false
arkatebi/DynamicalSystems
toggleSwitch/tSwitch-burst-pSet-1.py
1
11816
#/usr/bin/env python ''' Mutually Inhibitory Toggle Switch with protein burst. X ---| Y; Y ---| X DEs for the toggle switch system: The equivalent chemical system: R1: R2: R3: R4: System variables: X, Y, Px, and Py Dummy variable: phi System parameters: gX, gY, ...
gpl-3.0
8,824,304,135,415,339,000
30.425532
80
0.52302
false
3.304251
false
false
false
HeisenCore/heisen
heisen/rpc/run.py
1
1890
import sys import os import io import signal import traceback import socket from twisted.internet import reactor from twisted.web import server from twisted.logger import Logger, textFileLogObserver from txjsonrpc.auth import wrapResource from heisen.config import settings from heisen.core.log import logger from heis...
mit
-2,584,779,763,184,559,600
23.545455
76
0.705291
false
3.76494
false
false
false
rzr/synapse
synapse/handlers/register.py
1
11895
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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
7,104,856,400,417,512,000
35.712963
88
0.576545
false
4.338074
false
false
false
arunkgupta/gramps
gramps/plugins/tool/mediamanager.py
1
25419
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # Copyright (C) 2008 B. Malengier # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # Copyright (C) 2012 Nick Hall # # This program is free software; you can redistribute it ...
gpl-2.0
625,880,641,516,139,300
35.364807
86
0.542311
false
4.2365
false
false
false
Hydrosys4/Master
hardwaremod.py
1
60328
# -*- coding: utf-8 -*- """ selected plan utility """ from __future__ import print_function from __future__ import division from builtins import str from builtins import range from past.utils import old_div import shutil import logging import re import os import os.path import sys import string import random...
gpl-3.0
4,244,937,412,445,981,700
28.876663
244
0.687044
false
3.050258
false
false
false
ReddyLab/1000Genomes
mine-dbsnp.py
1
1777
#!/usr/bin/env python #========================================================================= # This is OPEN SOURCE SOFTWARE governed by the Gnu General Public # License (GPL) version 3, as described at www.opensource.org. # Copyright (C)2017 William H. Majoros (martiandna@gmail.com). #==============================...
gpl-2.0
6,726,144,192,897,049,000
39.386364
74
0.564434
false
3.922737
false
false
false
zielmicha/satori
satori.tools/satori/tools/problems/__init__.py
1
5093
# vim:ts=4:sts=4:sw=4:et import logging from satori.client.common import want_import want_import(globals(), '*') from satori.tools import catch_exceptions, options, setup from satori.tools.params import parser_from_xml from satori.tools.problems.common import copy_file from satori.tools.problems.download_problem imp...
mit
-3,485,869,449,155,792,000
41.798319
95
0.673081
false
3.887786
false
false
false
zhester/hzpy
examples/plot.py
1
4869
#******************************************************************************* # plot.py # # Zac Hester <zac.hester@gmail.com> # 2012-07-27 # # Minimal plotting reference using numpy + matplotlib # #******************************************************************************* import matplotlib import matplotlib...
bsd-2-clause
4,124,870,981,822,003,700
25.461957
80
0.486342
false
3.836879
false
false
false
cinepost/Copperfield_FX
copper/renderers/workbench/renderer.py
1
10265
import logging import math import time import moderngl from OpenGL.GL import * from OpenGL.arrays.vbo import VBO import moderngl import ghalton from PIL import Image from time import sleep from enum import IntEnum from ctypes import c_float import numpy as np from pyrr import Matrix44 from PyQt5 import QtCore from ...
unlicense
3,690,176,061,576,465,400
32.993377
129
0.626206
false
3.747718
false
false
false
Passw/gn_GFW
base/android/jni_generator/jni_generator_tests.py
1
43224
#!/usr/bin/env python # Copyright (c) 2012 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. """Tests for jni_generator.py. This test suite contains various tests for the JNI generator. It exercises the low-level parser all...
gpl-3.0
755,478,131,235,091,000
36.326425
80
0.574981
false
4.278757
true
false
false
mintar/ros-infrastructure-rosdistro
src/rosdistro/external/appdirs.py
1
21065
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2005-2010 ActiveState Software Inc. # Copyright (c) 2013 Eddy Petrișor # This is the MIT license # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal...
bsd-3-clause
-8,490,286,334,981,794,000
41.297189
122
0.635539
false
3.915242
true
false
false
LedgerHQ/electrum
plugins/trezor/plugin.py
1
16383
import base64 import re import threading from binascii import hexlify, unhexlify from functools import partial from electrum.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey, public_key_to_p2pkh, EncodeBase58Check, TYPE_ADDRESS, TYPE_SCRIPT, ...
gpl-3.0
3,718,949,269,591,163,400
41.664063
119
0.552341
false
4.118401
false
false
false
abhikeshav/ydk-py
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_infra_syslog_oper.py
1
34742
""" Cisco_IOS_XR_infra_syslog_oper This module contains a collection of YANG definitions for Cisco IOS\-XR infra\-syslog package operational data. This module contains definitions for the following management objects\: logging\: Logging History data syslog\: syslog Copyright (c) 2013\-2015 by Cisco Systems, Inc...
apache-2.0
-6,760,132,726,564,650,000
28.975841
216
0.511312
false
4.540251
true
false
false
deniclab/pyto_seg_slurm
segmentation/mito_and_pex_seg_nooverlap.py
1
3769
import os import sys sys.path.append('/n/denic_lab/Users/nweir/python_packages/') import argparse from pyto_segmenter import PexSegment, MitoSegment import scipy.ndimage as ndimage parser = argparse.ArgumentParser(description = 'Segment peroxisomes from \ images and return pickled obj...
mit
-471,122,717,096,715,200
44.409639
111
0.578668
false
3.320705
false
false
false
FAForever/client
src/fa/game_process.py
1
5558
import os import sys from PyQt5 import QtCore, QtWidgets import config import re import util import logging logger = logging.getLogger(__name__) from model.game import GameState __author__ = 'Thygrrr' class GameArguments: pass class GameProcess(QtCore.QProcess): def __init__(self, *args, **kwargs): ...
gpl-3.0
-6,775,463,792,830,862,000
35.090909
120
0.548759
false
4.44996
false
false
false
statik/grr
gui/api_plugins/flow_test.py
1
8992
#!/usr/bin/env python """This module contains tests for flows-related API renderers.""" from grr.gui import api_test_lib from grr.gui.api_plugins import flow as flow_plugin from grr.lib import aff4 from grr.lib import flags from grr.lib import flow from grr.lib import flow_runner from grr.lib import output_plugin ...
apache-2.0
-8,247,247,425,292,666,000
33.852713
79
0.637789
false
3.93007
true
false
false
5610110083/Safety-in-residential-project
cgi-bin/loginHistory2.py
1
3953
#!/usr/bin/python # -*- coding: utf-8 -*-f #Import modules for CGI handling import cgi, cgitb import Cookie, os, time cookie = Cookie.SimpleCookie() cookie_string = os.environ.get('HTTP_COOKIE') def getCookies(): if not cookie_string: return False else: # load() parses the cookie string ...
apache-2.0
8,487,867,148,396,669,000
29.415385
130
0.606628
false
3.102826
false
false
false
lgarren/spack
var/spack/repos/builtin/packages/minife/package.py
1
2517
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-8,250,987,460,366,578,000
37.723077
78
0.632896
false
3.884259
false
false
false
seryl/Python-Cotendo
cotendo/records.py
1
7276
from lxml import etree # DNS Results class DNSResult(object): """Abstract skeleton for every DNS result""" def __init__(self, ttl=1800): self._etree = etree.Element("result") self.ttl = ttl self._result_type = 'dns' def _get_ttl(self): return self._etree.get("ttl") def...
mit
-4,737,799,907,991,581,000
29.316667
82
0.57724
false
3.636182
false
false
false
JamesLinEngineer/RKMC
addons/plugin.video.salts/scrapers/2ddl_scraper.py
1
8509
""" 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
8,156,028,738,849,760,000
47.622857
191
0.533553
false
3.917587
false
false
false
alephobjects/Cura
Cura/gui/util/openglGui.py
1
30446
from __future__ import division __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License" import wx import traceback import sys import os import time from wx import glcanvas import OpenGL OpenGL.ERROR_CHECKING = False from OpenGL.GL import * from Cura.util import version from Cura...
agpl-3.0
-5,186,768,599,160,233,000
25.660245
140
0.665703
false
2.701508
false
false
false
SKIRT/PTS
magic/region/region.py
1
12293
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
agpl-3.0
2,789,864,496,829,080,600
21.430657
147
0.376342
false
4.714998
false
false
false
thomasem/nova
nova/api/openstack/compute/contrib/aggregates.py
1
10784
# Copyright (c) 2012 Citrix Systems, 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 ...
apache-2.0
-650,431,616,769,187,000
37.791367
79
0.601354
false
4.482128
false
false
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_links_operations.py
1
8708
# 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 may ...
mit
780,192,618,398,003,700
47.921348
198
0.65147
false
4.393542
true
false
false
leapcode/bitmask-dev
tests/functional/features/steps/common.py
1
4631
import time from selenium.common.exceptions import ( StaleElementReferenceException, TimeoutException) from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait TIMEOUT_IN_S = 30 DEFAULT_IMPLICIT_WAIT_...
gpl-3.0
-1,025,550,972,335,121,000
32.80292
79
0.682142
false
3.532418
false
false
false
boosh/iceit
tests/unit/test_backends.py
1
7822
import unittest from mock import patch, Mock from StringIO import StringIO from collections import namedtuple from iceit.backends import S3Backend, S3ResponseError, GlacierBackend class TestS3Backend(unittest.TestCase): """ Tests for the S3 backend """ def test_init_valid(self): """ Te...
mit
-5,919,878,963,531,965,000
35.551402
134
0.596139
false
3.810034
true
false
false
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/customer_client_service/transports/base.py
1
3740
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
apache-2.0
-5,946,781,270,819,104,000
35.666667
79
0.651872
false
4.338747
false
false
false
ThaiSmartDev/NineVerLay
line/client.py
1
18048
# -*- coding: utf-8 -*- """ line.client ~~~~~~~~~~~ LineClient for sending and receiving message from LINE server. :copyright: (c) 2014 by Taehoon Kim. :license: BSD, see LICENSE for more details. """ import re import requests import sys from api import LineAPI from models import LineGroup, LineC...
bsd-3-clause
6,073,829,113,201,298,000
29.332773
98
0.515348
false
4.598217
false
false
false
jabez007/Training_Helpyr
GUI/TabbedUI.py
1
2482
################################################### # Tabbed interface script # www.sunjay-varma.com ################################################### __doc__ = info = ''' This script was written by Sunjay Varma - www.sunjay-varma.com This script has two main classes: Tab - Basic tab used by TabBar for main functio...
mit
7,803,525,082,368,462,000
30.025
94
0.64585
false
3.1378
false
false
false
emidln/django_roa
examples/django_roa_client/models.py
1
5846
# -*- coding: utf-8 -*- from django.db import models from django.template.defaultfilters import slugify from django_roa import Model class RemotePage(Model): title = models.CharField(max_length=50, blank=True, null=True) def __unicode__(self): return u'%s (%s)' % (self.title, self.pk) @staticmet...
bsd-3-clause
-6,328,251,171,543,402,000
35.5375
136
0.697742
false
3.477692
false
false
false
xapi-project/sm
tests/test_trim_util.py
1
14069
import unittest import trim_util import testlib import mock EMPTY_VG_SPACE = 4 * 1024 * 1024 class AlwaysBusyLock(object): def acquireNoblock(self): return False class AlwaysFreeLock(object): def __init__(self): self.acquired = False def acquireNoblock(self): self.acquired = T...
lgpl-2.1
-5,629,110,894,098,218,000
40.017493
82
0.506575
false
4.02777
true
false
false
fbradyirl/home-assistant
homeassistant/helpers/restore_state.py
1
9556
"""Support for restoring entity states on startup.""" import asyncio import logging from datetime import timedelta, datetime from typing import Any, Dict, List, Set, Optional # noqa pylint_disable=unused-import from homeassistant.core import ( HomeAssistant, callback, State, CoreState, valid_enti...
apache-2.0
1,522,874,793,953,023,200
35.753846
87
0.616471
false
4.20044
false
false
false
tst-ppenev/earthenterprise
earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/geecheck.py
1
7085
#!/usr/bin/env python # # Copyright 2017 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 ...
apache-2.0
-5,259,165,739,392,241,000
28.894515
80
0.644601
false
3.585526
true
false
false
mjschultz/django-tastefulpy
tests/validation/api/resources.py
1
1619
from django.contrib.auth.models import User from tastefulpy import fields from tastefulpy.constants import ALL from tastefulpy.resources import ModelResource from tastefulpy.authorization import Authorization from basic.models import Note, AnnotatedNote, UserForm from django import forms from tastefulpy.validation impo...
bsd-3-clause
-7,156,013,431,193,531,000
29.54717
112
0.702285
false
4.260526
false
false
false
rs/webassets
tests/test_bundle.py
1
14299
from nose.tools import assert_raises, assert_equals from nose import SkipTest from webassets import Bundle from webassets.bundle import BuildError from webassets.filter import Filter from helpers import BuildTestHelper class TestFilterAssign(BuildTestHelper): """Test the different ways we can assign filters to ...
bsd-2-clause
5,808,265,669,087,123,000
35.760925
102
0.590811
false
3.9337
true
false
false
dsanno/chainer-neural-style
src/lbfgs.py
1
3159
import numpy from chainer import cuda from chainer import optimizer _default_hyperparam = optimizer.Hyperparameter() _default_hyperparam.lr = 0.01 _default_hyperparam.stack_size = 100 _default_hyperparam.min_ro = 1e-5 class LBFGSRule(optimizer.UpdateRule): """Update rule of L-BFGS. """ ...
mit
-5,455,089,982,834,222,000
31.252632
81
0.497626
false
3.486755
false
false
false
alex-bauer/kelvin-power-challenge
src/features/features_ltdata.py
1
1261
"""Concatenate and resample LTDATA""" import sys sys.path.append("../") from utils.utils import * import os folder=config.features_folder if not os.path.exists(folder): os.makedirs(folder) # Function to read the csv file and converting time def parse_ltdata(filename, dropna=True): df = pd.read_csv(config....
mit
-6,947,092,471,976,165,000
29.780488
104
0.720856
false
2.789823
false
false
false
kyle8998/Practice-Coding-Questions
leetcode/14-Easy-Longest-Common-Prefix/answer.py
1
1874
#!/usr/bin/python #------------------------------------------------------------------------------ class Solution(object): def longestCommonPrefix(self, strs): """ :type strs: List[str] :rtype: str """ length = len(strs) result = "" charsleft = True i...
unlicense
5,477,318,189,514,164,000
30.762712
79
0.454109
false
4.89295
false
false
false
rossica/sukiyaki
settings.py
1
3336
# Copyright (C) 2009,2010,2011 Anthony Rossi # For License information regarding this software, see LICENSE # If no LICENSE file was included, see http://www.opensource.org/licenses/mit-license.php # Django settings for sukiyaki project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG PROJECT_ROOT = os.path....
mit
-9,168,518,712,145,051,000
35.066667
108
0.691247
false
3.414534
false
false
false
aerval/de.rki.proteomic_virus_detection
plugin_source/CountPeptides.py
1
2066
import xml.etree.ElementTree as ET from ntpath import basename # determine name of a file from optparse import OptionParser def filename(file): ''' Return just the name of a file without the path and file format ''' file = basename(file) return file.split('.')[0] def countPept...
gpl-2.0
-236,991,010,081,272,220
29.30303
121
0.590997
false
3.568221
false
false
false
clreinki/GalaxyHarvester
getResources.py
1
13528
#!/usr/bin/python """ Copyright 2013 Paul Willworth <ioscode@gmail.com> This file is part of Galaxy Harvester. Galaxy Harvester 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 th...
agpl-3.0
-1,941,997,723,988,198,000
39.870091
663
0.691898
false
2.901137
false
false
false
mopidy/pyspotify
spotify/__init__.py
1
3504
from __future__ import unicode_literals import threading import pkg_resources __version__ = pkg_resources.get_distribution('pyspotify').version # Global reentrant lock to be held whenever libspotify functions are called or # libspotify owned data is worked on. This is the heart of pyspotify's thread # safety. _lo...
apache-2.0
-3,343,069,679,174,215,700
28.694915
80
0.684646
false
3.972789
false
false
false
mbauskar/helpdesk-erpnext
erpnext/accounts/doctype/account/account.py
1
9130
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, cint from frappe import throw, _ from frappe.model.document import Document class RootNotEditable(frappe.V...
agpl-3.0
304,425,701,387,602,200
37.523207
123
0.698467
false
3.297219
false
false
false
sjl767/woo
py/pre/depot.py
1
10501
# encoding: utf-8 from woo.dem import * from woo.fem import * import woo.core, woo.dem, woo.pyderived, woo.models, woo.config import math from minieigen import * class CylDepot(woo.core.Preprocessor,woo.pyderived.PyWooObject): ''''Deposition of particles inside cylindrical tube. This preprocessor was created for ...
gpl-2.0
-3,403,541,505,778,690,600
67.188312
389
0.664508
false
3.107724
false
false
false
adolgert/discretenext
pdfedit.py
1
1081
import logging import os import tempfile import shutil from PyPDF2 import PdfFileWriter, PdfFileReader logger=logging.getLogger("pdfedit") def AddPdfKeys(pdf_file, keydict): """ Add a dictionary of key-value pairs to a pdf file. Adds metadata to PDF files so you know what generated them. """ multi...
mit
-3,994,835,290,101,173,000
30.794118
70
0.688252
false
3.50974
false
false
false
orionzhou/robin
formats/phylip.py
1
1609
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import os.path as op import sys import logging import re from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from pyfaidx import Fasta from Bio import AlignIO from maize.apps.base import eprint, sh, mkdir from maize.formats.base im...
gpl-2.0
-5,607,621,547,531,732,000
26.741379
78
0.646986
false
3.136452
false
false
false
jason-weirather/Au-public
iron/pythonlib/PairwiseAlignmentBasics.py
1
10159
import sys, re from SequenceBasics import rc class PairwiseAlignment: def __init__(self): self.s1 = None self.s2 = None self.a1 = None self.a2 = None self.score = None def load_sequences(self,s1,s2): self.s1 = s1 self.s2 = s2 def do_needleman_wunsch(self): [a1,a2,score] = needlema...
apache-2.0
4,975,802,781,112,445,000
29.599398
125
0.548873
false
2.85285
false
false
false
uhliarik/rebase-helper
rebasehelper/output_tool.py
1
6781
# -*- coding: utf-8 -*- # # This tool helps you to rebase package to the latest version # Copyright (C) 2013-2014 Red Hat, 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 # he Free Software Foundation; either version 2 ...
gpl-2.0
6,008,069,341,724,772,000
32.403941
116
0.606253
false
4.132236
false
false
false
jbasko/configmanager
tests/test_extending_library.py
1
3973
import pytest from configmanager import Item, ItemAttribute, Config from configmanager.utils import not_set def test_custom_item_class_as_item_factory(): class CustomItem(Item): is_custom = ItemAttribute(name='is_custom', default=True) config = Config({ 'a': { 'b': 1, ...
mit
-7,507,046,238,957,712,000
26.978873
85
0.620941
false
3.702703
true
false
false
romanz/electrum
lib/paymentrequest.py
1
17702
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 Thomas Voegtlin # # 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...
mit
6,574,225,516,501,351,000
32.782443
145
0.604451
false
3.780863
true
false
false
moonso/genmod
tests/vcf_tools/test_sorting.py
1
1691
from tempfile import NamedTemporaryFile from genmod.vcf_tools import sort_variants def setup_csv_file(): """ Print some variants to a vcf file and return the filename """ variant_lines = [ '1\t1\t11900\t.\tA\tT\t100\tPASS\tMQ=1\tGT:GQ\t0/1:60\t0/1:60\t1/1:60\n', '3\t3\t947378\t.\tA\tT\...
mit
5,778,479,325,251,003,000
30.314815
83
0.575991
false
2.408832
false
false
false
danielfrg/jupyterhub-kubernetes_spawner
kubernetes_spawner/swagger_client/models/v1_component_status.py
1
6278
# coding: utf-8 """ Copyright 2015 SmartBear Software 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
-7,607,108,213,036,513,000
32.216931
272
0.614845
false
4.458807
false
false
false
fuspu/RHP-POS
table_setup_sql3.py
1
34576
!/bin/python #-*- coding: utf-8 -*- # # # import wxversion wxversion.select('2.8') import sqlite3 import HandyUtilities as HU def CreateTable(sql_file, table_name, column_info): con = None exists = None con = sqlite3.connect(sql_file) print('----------------------------------------') with con: ...
mit
2,537,789,638,118,385,700
35.167364
86
0.550873
false
3.954254
false
false
false
reflexsc/reflex
src/rfxengine/db/mxsql.py
1
8859
#$#HEADER-START # vim:set expandtab ts=4 sw=4 ai ft=python: # # Reflex Configuration Event Engine # # Copyright (C) 2016 Brandon Gillespie # # This program 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...
agpl-3.0
1,644,280,727,408,292,600
35.012195
93
0.488656
false
4.979764
false
false
false
vesellov/bitdust.devel
transport/proxy/proxy_router.py
1
30556
#!/usr/bin/env python # proxy_router.py # # Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io # # This file (proxy_router.py) is part of BitDust Software. # # BitDust 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 ...
agpl-3.0
-8,812,896,494,155,383,000
40.743169
133
0.553836
false
4.171468
false
false
false
slyfocks/pigs
shortcodes.py
1
1664
from itertools import product, islice from joblib import Parallel, delayed import json import requests from requests.exceptions import ConnectionError, Timeout from simplejson import JSONDecodeError import string CLIENT_ID = 'a48b4d0f6e0745e2ba68902a1f68f8d5' URL = 'https://api.instagram.com/oembed/media/?url=http://i...
apache-2.0
7,701,331,847,887,923,000
27.689655
109
0.641827
false
3.681416
false
false
false
mvernacc/proptools
docs/source/examples/convection/plots/film_cooling.py
1
1203
"""Film cooting example""" import numpy as np from matplotlib import pyplot as plt from proptools import convection T_aw = 3200 # Adiabatic wall temperature of core flow [units: kelvin]. T_f = 1600 # Film temperature [units: kelvin]. T_w = 700 # Wall temperature [units: kelvin]. x = np.linspace(0, 1) # Dis...
mit
2,538,100,434,209,827,300
34.382353
92
0.636741
false
2.55414
false
false
false
slogan621/tscharts
queue/models.py
1
2133
#(C) Copyright Syd Logan 2017-2019 #(C) Copyright Thousand Smiles Foundation 2017-2019 # #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 req...
apache-2.0
-6,096,697,637,723,108,000
36.421053
149
0.766995
false
3.729021
false
false
false
chenshuo/recipes
puzzle/poker/poker2.py
1
1170
#!/usr/bin/python import sys def get_ranks(hand): ranks = ['--23456789TJQKA'.index(r) for r, s in hand] ranks.sort(reverse = True) if ranks == [14, 5, 4, 3, 2]: ranks = [5, 4, 3, 2, 1] return ranks def expand(counts, ranks): cards = [] for i in range(len(counts)): cards.extend((ranks[i], ) * counts[i]) re...
bsd-3-clause
-294,364,423,834,941,060
24.434783
60
0.610256
false
2.537961
false
false
false
apache/qpid-dispatch
python/qpid_dispatch_internal/router/path.py
2
7682
# # 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
692,112,777,913,241,200
33.760181
98
0.530461
false
4.29162
false
false
false
KirillTim/crashsimilarity
crashsimilarity/utils.py
1
2622
import errno import json import os from datetime import datetime from smart_open import smart_open from crashsimilarity.downloader import SocorroDownloader def utc_today(): return datetime.utcnow().date() def read_files(file_names, open_file_function=smart_open): for name in file_names: with open_...
mpl-2.0
5,456,225,717,346,863,000
29.488372
95
0.617849
false
3.913433
false
false
false
TravelModellingGroup/TMGToolbox
TMGToolbox/src/common/pandas_utils.py
1
17046
from inro.emme.matrix import MatrixData import inro.modeller as m import warnings as warn mm = m.Modeller() class Face(m.Tool()): def page(self): desc = 'Collection of tools working with <a href="http://pandas.pydata.org/">pandas</a>' pb = m.ToolPageBuilder(self, runnable=False, title='Utilities'...
gpl-3.0
4,921,002,489,457,924,000
42.15443
120
0.622844
false
3.998593
false
false
false
cmc333333/regulations-parser
regparser/history/delays.py
1
2700
from collections import namedtuple from datetime import date from itertools import dropwhile, takewhile from regparser.grammar.delays import tokenizer as delay_tokenizer from regparser.grammar.delays import Delayed, EffectiveDate, Notice class FRDelay(namedtuple('FRDelay', ['volume', 'page', 'delayed_until'])): ...
cc0-1.0
9,026,328,234,331,880,000
38.705882
77
0.637778
false
4.023845
false
false
false
us-ignite/us_ignite
us_ignite/profiles/views.py
1
6238
import uuid from django.contrib import messages from django.contrib.auth import logout from django.contrib.auth.decorators import login_required from django.contrib.sites.models import Site, RequestSite from django.shortcuts import redirect from django.template.response import TemplateResponse from django.views.gener...
bsd-3-clause
-5,172,439,593,668,941,000
38.232704
82
0.690927
false
4.380618
false
false
false
hulu/monaco
src/lifeRaft/servers/server.py
1
7199
#!/usr/bin/python from ..states.leader import Leader from ..messages.client import ClientMessage import zmq import threading import pickle import Queue import time import math class Server(threading.Thread): def __init__(self, name, state, log, messageBoard, neighbors): super(Server, self).__init__() ...
mit
-248,483,130,087,962,400
32.640187
99
0.547437
false
4.336747
false
false
false
googleapis/python-monitoring
google/cloud/monitoring_v3/_dataframe.py
1
5568
# Copyright 2016 Google LLC # # 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, s...
apache-2.0
-7,858,185,117,793,109,000
35.392157
88
0.675287
false
4.145942
false
false
false