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
smclt30p/PCS
plugins/HelloWorld_plugin/PluginImpl.py
1
7410
from core.plugins.Plugin import Plugin, PluginException, Playable, DataStream, SubtitleStream """ This is a skeleton for a PCS plugin. Read the comments CAREFULLY. This plugin works fine inside PCS, try it. Rules: 0) The ID must be a UNIQUE int. And 0xCAFEBABE is NOT unique. 1) The plugin file must only contain one...
bsd-2-clause
-7,603,469,113,579,809,000
30.943966
125
0.663968
false
4.351145
false
false
false
erasmospunk/electrumx
lib/server_base.py
1
4398
# Copyright (c) 2017, Neil Booth # # All rights reserved. # # See the file "LICENCE" for information about the copyright # and warranty status of this software. import asyncio import logging import os import signal import sys import time from functools import partial class ServerBase(object): '''Base class serve...
mit
8,250,410,485,864,790,000
33.904762
79
0.622556
false
4.58125
false
false
false
ppoile/athletica-adapter
athletica/settings.py
1
2550
""" Django settings for athletica project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) ...
gpl-2.0
-3,373,215,367,070,398,000
24.757576
71
0.712157
false
3.175592
false
false
false
gencer/sentry
src/sentry/web/forms/accounts.py
1
27701
""" sentry.web.forms.accounts ~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from datetime import datetime import pytz from django import forms from django.conf import settin...
bsd-3-clause
-5,475,219,136,794,670,000
32.617718
160
0.590953
false
4.385845
false
false
false
kickoffai/footparse
tests/test_eloratings.py
1
2228
from datetime import date from footparse import eloratings from testutils import data_path def test_homepage_date(): path = data_path('eloratings_home.html') page = eloratings.HomePage.from_file(path) assert page.date == date(2016, 9, 18) def test_homepage_ratings(): truth = { 'rank': 234, ...
mit
-2,608,629,401,545,905,700
27.202532
64
0.557451
false
3.215007
true
false
false
ctogle/dilapidator
test/geometry/tools_tests.py
1
2305
from dilap.geometry.vec3 import vec3 from dilap.geometry.quat import quat import dilap.geometry.tools as gtl #import dilap.mesh.tools as dtl import dilap.core.plotting as dtl import matplotlib.pyplot as plt import unittest,numpy #python3 -m unittest discover -v ./ "*tests.py" class test_tools(unittest.TestCase): ...
mit
4,543,843,215,374,603,300
30.575342
76
0.609111
false
2.481163
true
false
false
jck/uhdl
uhdl/structures.py
1
1480
""" uhdl.structures ~~~~~~~~~~~~~~~ Data structures(unrelated to hardware description) used internally by uhdl. """ import collections def _dictrepr(instance, store): name = instance.__class__.__name__ return '{name}({store})'.format(name=name, store=store) class DictRef(object): def __init__(self, st...
bsd-3-clause
2,211,368,123,443,428,000
22.125
75
0.579054
false
3.874346
false
false
false
bhgv/bCNC
GCode_parser/Parser_engine/py/tools/pycoco/Coco.py
1
4536
#! /usr/bin/env python #/*------------------------------------------------------------------------- #Coco.py -- the Compiler Driver #Compiler Generator Coco/R, #Copyright (c) 1990, 2004 Hanspeter Moessenboeck, University of Linz #extended by M. Loeberbauer & A. Woess, Univ. of Linz #ported from Java to Python by Ronald...
gpl-2.0
-8,563,648,682,257,317,000
34.162791
154
0.624339
false
3.971979
false
false
false
SchoolIdolTomodachi/frgl
web/model_choices.py
1
4850
from django.utils.translation import ugettext_lazy as _, string_concat ATTRIBUTES = ( ('crazy', _('Crazy')), ('cool', _('Cool')), ('hot', _('Hot')), ('deep', _('Deep')), ('fun', _('Fun')), ('classic', _('Classic')), ) def attributeToString(attribute): return dict(ATTRIBUTES)[attribute] CARD_TY...
apache-2.0
-2,418,742,477,124,150,000
30.493506
103
0.579588
false
3.205552
false
false
false
desihub/desispec
py/desispec/quicklook/quicksky.py
1
7598
""" desispec.quicklook.quicksky Here will be the sky computing and sky subtraction routines for QL """ import sys import numpy as np from desispec.sky import SkyModel from desispec import util from desispec import frame as fr import scipy from desispec.resolution import Resolution from desispec.linalg import cholesky_...
bsd-3-clause
-4,931,846,746,553,340,000
35.180952
116
0.602132
false
3.434901
false
false
false
hkv-consultants/bowa
bowa/migrations/0003_auto__add_field_bowascenario_err_matrix.py
1
2992
# encoding: 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 'BowaScenario.err_matrix' db.add_column('bowa_bowascenario', 'err_matrix', self.gf('django....
gpl-3.0
93,615,369,468,199,250
62.659574
165
0.564505
false
3.411631
false
false
false
ESOedX/edx-platform
cms/envs/common.py
1
67182
# -*- coding: utf-8 -*- """ This is the common settings file, intended to set sane defaults. If you have a piece of configuration that's dependent on a set of feature flags being set, then create a function that returns the calculated value based on the value of FEATURES[...]. Modules that extend this one can change th...
agpl-3.0
4,526,987,276,493,263,000
32.143069
120
0.654188
false
3.644407
true
false
false
rgayon/plaso
plaso/output/xlsx.py
1
6669
# -*- coding: utf-8 -*- """Output module for the Excel Spreadsheet (XLSX) output format.""" from __future__ import unicode_literals import datetime import os import re import xlsxwriter from plaso.output import dynamic from plaso.output import interface from plaso.output import manager import pytz # pylint: disab...
apache-2.0
1,788,286,064,851,698,700
30.757143
90
0.659619
false
3.802166
false
false
false
google/trax
trax/layers/initializers_test.py
1
3087
# coding=utf-8 # Copyright 2021 The Trax 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 applicable law or a...
apache-2.0
510,633,557,966,824,800
31.15625
80
0.697441
false
3.252898
true
false
false
agiliq/django-answrs
example/example/settings.py
1
5382
# Django settings for example project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'exampl...
bsd-3-clause
-7,912,812,040,645,450,000
33.280255
127
0.687105
false
3.7375
false
false
false
sleibman/python-colossus
colossus/test/api/test_image.py
1
4117
__author__ = 'sleibman' import nose import colossus import numpy import tempfile import os from PIL import Image import shutil def create_image(img): """ Example numpy/PIL image creation code from http://jehiah.cz/a/creating-images-with-numpy """ (h, w) = img.shape pilImage = Image.frombuffer('RG...
mit
-7,971,470,962,260,027,000
31.164063
94
0.613311
false
3.016117
true
false
false
djfroofy/bafload
bafload/interfaces.py
1
4401
# Copryright 2012 Drew Smathers, See LICENSE from zope.interface import Interface, Attribute, directlyProvides from twisted.python import log class ILog(Interface): """ API for logging components that follow Twisted's log interface: msg() and err(). """ def msg(*message, **kw): """ ...
mit
3,536,874,334,767,085,600
25.196429
78
0.608953
false
4.293659
false
false
false
jpgneves/hojehatransportes
hojehatransportes/social_auth_extra/sapo.py
1
1989
""" SAPO OAuth support. This adds support for SAPO OAuth service. An application must be registered first on twitter and the settings SAPO_CONSUMER_KEY and SAPO_CONSUMER_SECRET must be defined with they corresponding values. User screen name is used to generate username. By default account id is stored in extra_data...
mit
-7,084,666,715,995,082,000
31.606557
77
0.677728
false
3.42931
false
false
false
badbytes/pymeg
mri/slice.py
1
1379
import numpy from numpy import shape from pylab import figure, show, connect ##import sys ##for arg in sys.argv: ## ## print arg ## data=arg class IndexTracker: def __init__(self, ax, X): self.ax = ax ax.set_title('use scroll wheen to navigate images') self.X = X rows,c...
gpl-3.0
-8,667,554,073,536,231,000
21.606557
63
0.57868
false
3.162844
false
false
false
fedebell/Laboratorio3
FranckHertz/plotEnergyLevel.py
1
8826
import uncertainties from uncertainties import ufloat import math import numpy import numpy import pylab from scipy.optimize import curve_fit import math import scipy.stats import uncertainties from uncertainties import unumpy import numpy as np from scipy.signal import argrelextrema def linear(x, b): return b #Pre...
gpl-3.0
3,119,960,291,514,811,400
32.816092
93
0.692613
false
2.510953
false
false
false
yfried/ansible
lib/ansible/modules/cloud/ovirt/ovirt_vm.py
1
103038
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCU...
gpl-3.0
9,066,787,659,124,472,000
43.85764
158
0.576768
false
4.208037
false
false
false
orlenko/sfpirg
sfpirgapp/migrations/0017_auto__add_field_profile_on_mailing_list__del_field_contact_on_mailing_.py
1
23037
# -*- 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 'Profile.on_mailing_list' db.add_column(u'sfpirgapp_profile', 'on_mailing_list', ...
bsd-2-clause
9,042,704,025,571,618,000
79.271777
187
0.554586
false
3.581066
false
false
false
university-gender-evolution/py-university-gender-dynamics-pkg
pyugend/BuilderGenericOverallMFPlot.py
1
4970
#!/usr/bin/python """ Builder Class generic Male-Female comparison plot """ ## MIT License ## ## Copyright (c) 2017, krishna bhogaonker ## 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 w...
mit
3,049,770,752,454,083,000
43.375
463
0.578471
false
4.131338
false
false
false
wenwei202/terngrad
terngrad/inception/vgg_preprocessing.py
1
13103
# Copyright 2016 The TensorFlow 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
48,941,857,099,553,250
34.318059
80
0.679234
false
3.703505
false
false
false
vbisserie/sudoku_sover
routes/index.py
1
1159
# -*- coding: utf-8 -*- from flask import Blueprint, jsonify, request blueprint = Blueprint('index', __name__, url_prefix='/api/v1/') @blueprint.route("ping") def health_check(): return jsonify({'ping': 'pong'}) @blueprint.route("solve", methods=['POST']) def solve(): solve_request = request.get_json() ...
gpl-3.0
-7,583,931,265,893,311,000
32.114286
82
0.570319
false
3.73871
false
false
false
halbbob/dff
modules/viewer/hexedit/utils.py
1
3205
# DFF -- An Open Source Digital Forensics Framework # Copyright (C) 2009 ArxSys # # This program is free software, distributed under the terms of # the GNU General Public License Version 2. See the LICENSE file # at the top of the source tree. # # See http://www.digital-forensic.org for more information about this # ...
gpl-2.0
4,540,371,042,403,220,500
27.873874
114
0.585335
false
4.031447
false
false
false
talbrecht/pism_pik07
test/test_shelf/exactV.py
1
5301
#!/usr/bin/env python from pylab import figure, plot, xlabel, ylabel, title, show, axis, linspace, hold, subplot, grid, step import numpy as np import subprocess import shlex import sys from netCDF4 import Dataset as NC # Setup secpera = 3.15569259747e7 # seconds per year rho_sw = 1028.0 ...
gpl-3.0
-1,207,723,150,797,295,400
31.127273
102
0.609319
false
2.879413
false
false
false
anaran/olympia
apps/addons/widgets.py
1
3069
from django import forms from django.conf import settings from django.utils.encoding import force_unicode from django.utils.html import conditional_escape from django.utils.safestring import mark_safe from tower import ugettext as _ from addons.models import Category class IconWidgetRenderer(forms.RadioSelect.rende...
bsd-3-clause
5,625,723,379,684,508,000
34.686047
79
0.527859
false
4.070292
false
false
false
juselius/gimic
src/pygimic/magnet.py
1
2166
import numpy as np from grid import Grid class Magnet: def __init__(self, b, grid = None, ortho = False): self.grid = grid self.isortho = ortho if isinstance(b, str): if not self.grid: raise ValueError('Grid object not defined.') self.mag = self._get_...
gpl-2.0
-4,722,963,626,824,571,000
25.740741
75
0.467682
false
3.301829
false
false
false
ryanraaum/oldowan.phylip
setup.py
1
1202
from setuptools import setup, find_packages import os PACKAGE = 'phylip' VERSION = open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'oldowan', PACKAGE, 'VERSION')).read().strip() desc_lines = open('README', 'r').readlines() setup(name='oldowan.%s' % PACKAGE, version=VERSION, ...
mit
8,591,942,250,159,784,000
34.352941
78
0.606489
false
3.598802
false
true
false
gmferrigno/pyafipws
pyrece.py
1
46200
#!usr/bin/python # -*- coding: utf-8-*- # 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, or (at your option) any later # version. # # This program is distributed in the hope tha...
gpl-3.0
-4,385,594,502,368,245,000
41.411765
134
0.486195
false
3.477317
true
false
false
richardliaw/ray
python/ray/util/placement_group.py
1
8753
import time from typing import (List, Dict, Optional) import ray from ray._raylet import PlacementGroupID, ObjectRef bundle_reservation_check = None # We need to import this method to use for ready API. # But ray.remote is only available in runtime, and # if we define this method inside ready method, this function...
apache-2.0
-8,640,362,162,984,740,000
34.15261
78
0.609962
false
4.286484
false
false
false
amitjamadagni/sympy
sympy/logic/boolalg.py
1
27969
"""Boolean algebra module for SymPy""" from collections import defaultdict from sympy.core.basic import Basic from sympy.core.decorators import deprecated from sympy.core.operations import LatticeOp from sympy.core.function import Application, sympify from sympy.core.compatibility import ordered, product class Boole...
bsd-3-clause
-8,591,651,325,745,727,000
25.997104
78
0.550717
false
3.647972
false
false
false
mtlchun/edx
lms/djangoapps/bulk_email/tests/test_err_handling.py
1
17414
# -*- coding: utf-8 -*- """ Unit tests for handling email sending errors """ from itertools import cycle from celery.states import SUCCESS, RETRY from django.test.utils import override_settings from django.conf import settings from django.core.management import call_command from django.core.urlresolvers import reverse...
agpl-3.0
-6,110,051,164,432,440,000
51.15015
124
0.663826
false
3.767028
true
false
false
lamflam/wunderclient
tests/test_client.py
1
3088
from mock import Mock from unittest import TestCase from nose.tools import assert_equals, assert_raises from wunderclient.utils import assert_is_instance from wunderclient.client import WunderClient, User, List, ValidationError TEST_NAME = 'Testy McTesterton' TEST_EMAIL = 'testy@mctesterton.com' mock_requests = Mock(...
mit
8,081,280,158,970,820,000
32.204301
84
0.639573
false
3.561707
true
false
false
rackerlabs/python-atomhopper
atomhopper/atom_options.py
1
2079
import urllib class AtomOptions(object): """Container for all options that can be sent to AtomHopper.""" def __init__( self, marker=None, direction=None, limit=None, search=None ): self.marker = marker self.direction = direction self.limit ...
apache-2.0
6,499,212,155,787,011,000
22.359551
76
0.543531
false
4.589404
false
false
false
arturosolutions/dta_test
src/log.py
1
1045
import logging from src.configuration import settings from src.configuration.settings import LOG_DIR def init(): level_mode = logging.DEBUG if settings.DEBUG else logging.INFO logging.basicConfig(level=level_mode) logger = logging.getLogger() logger_matching_engine = logging.getLogger('DATA...
mit
-5,444,045,761,750,066,000
30.65625
66
0.684211
false
4.034749
false
false
false
terrycojones/txdpce
txdpce/dpce.py
1
3768
# Copyright 2011 Fluidinfo 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 or agreed to in writing, ...
apache-2.0
-7,792,924,058,794,060,000
38.25
79
0.67224
false
4.745592
false
false
false
jtakayama/makahiki-draft
install/python273_altinstall.py
1
2827
#!/usr/bin/python2.6 import sys import os import datetime import datestring_functions import redhat.pythonsetup import redhat.altinstall # NOTE: # This script is meant to be run under Python 2.6.6 (the default version on # RHEL 6 x64) in order to make and install Python 2.7.3 as an altinstall. def logfile_open(scri...
mit
5,204,517,092,379,592,000
32.654762
101
0.644853
false
3.959384
false
false
false
hansomesong/TracesAnalyzer
log2csv.py
1
1436
# -*- coding: utf-8 -*- #Attention! RoundInstanceFactory is in fact a python script where defines uniquely a python class #If we want to instantiate this class, use its method #Using syntax like "from RoundInstanceFactory import *" instead of "import RoundInstanceFactory" # Inspired from this post : http://pymotw.com...
gpl-2.0
-7,227,987,622,366,940,000
42.272727
141
0.72619
false
3.933884
false
false
false
brendan-ward/rasterio
rasterio/rio/clip.py
1
4381
"""File translation command""" import click from cligj import format_opt from .helpers import resolve_inout from . import options import rasterio from rasterio.coords import disjoint_bounds from rasterio.windows import Window # Geographic (default), projected, or Mercator switch. projection_geographic_opt = click.o...
bsd-3-clause
3,472,034,031,189,016,600
34.330645
80
0.577494
false
4.474974
false
false
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.3/Lib/plat-mac/cfmfile.py
1
5719
"""codefragments.py -- wrapper to modify code fragments.""" # (c) 1998, Just van Rossum, Letterror __version__ = "0.8b3" __author__ = "jvr" import Carbon.File import struct from Carbon import Res import os import sys DEBUG = 0 error = "cfm.error" BUFSIZE = 0x80000 def mergecfmfiles(srclist, dst, architecture = '...
mit
7,691,182,586,545,726,000
30.081522
82
0.530687
false
3.893125
false
false
false
DjHaski/coldybot-py
cmds.py
1
2365
import exceptions as exp import random cmd_list = [] cmd_class_list = [] h_page = 'Страница с командами:\n' prefix = '!' # Базовый класс команды. От него наследуются все остальные команды. # Обязательно ставьте декоратор регистрации команды (@registercmd)! Иначе не будет команды! class Command(): def __init__(se...
apache-2.0
4,392,360,403,080,818,000
31.066667
91
0.595634
false
2.214039
false
false
false
lakiw/cripts
cripts/config/forms.py
1
10206
from django import forms from django.conf import settings class ConfigGeneralForm(forms.Form): """ Django form for updating the CRIPTs Configuration. """ required_css_class = 'required' debug = forms.BooleanField( help_text='*Requires a web server restart.', initial=False, ...
mit
5,682,702,473,660,081,000
37.224719
91
0.609837
false
4.293647
true
false
false
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/PyKDE4/kdeui/KShortcut.py
1
2248
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python2.7/dist-packages/PyKDE4/kdeui.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg class KShortcut(): # skipped ...
gpl-2.0
-3,511,771,182,158,395,000
26.753086
101
0.574733
false
3.691297
false
false
false
asconz/SystematicPrioritization
application/models/DB.py
1
15831
#! /usr/bin/python ################ # models\DB.py # ################ import logging from PyQt5.QtCore import Qt from PyQt5.QtGui import QColor from PyQt5.QtSql import QSqlRelationalTableModel, QSqlRelation, QSqlTableModel, QSqlDatabase, QSqlQuery, QSql from Dialogs import Dialogs log = logging.getLogger('DB') (TASK, W...
mit
2,549,333,122,605,561,300
38.977273
121
0.560419
false
3.92342
false
false
false
edf-hpc/verrou
pyTools/dd_config.py
1
11373
# This file is part of Verrou, a FPU instrumentation tool. # Copyright (C) 2014-2021 EDF # F. Févotte <francois.fevotte@edf.fr> # B. Lathuilière <bruno.lathuiliere@edf.fr> # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # pub...
gpl-2.0
7,778,708,840,723,755,000
39.756272
213
0.546214
false
3.85327
true
false
false
PAIR-code/saliency
saliency/core/guided_ig.py
1
9902
# Copyright 2021 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 applicable law or ag...
apache-2.0
-3,590,675,948,737,192,400
40.087137
80
0.676126
false
3.743667
false
false
false
RexFuzzle/sfepy
script/tile_periodic_mesh.py
1
2177
#!/usr/bin/env python import sys sys.path.append('.') from sfepy.base.base import Output from sfepy.discrete.fem.mesh import Mesh from sfepy.mesh.mesh_generators import gen_tiled_mesh from optparse import OptionParser usage = """%prog [options] filename_in filename_out The program scales a periodic input mesh (a rec...
bsd-3-clause
1,274,437,576,660,156,000
34.112903
79
0.606339
false
3.646566
false
false
false
dgouldin/django-socialite
socialite/apps/base/oauth20/helper.py
1
5637
import httplib2 import urllib import sys from utils import Error try: from urlparse import parse_qs, parse_qsl, urljoin except ImportError: from urlparse import urljoin from cgi import parse_qs, parse_qsl REQUEST_TOKEN, AUTHORIZE, AUTHENTICATE, ACCESS_TOKEN = 0, 1, 2, 3 class Client(object): """Client...
mit
-5,464,984,181,442,938,000
33.796296
80
0.589321
false
4.055396
false
false
false
b1quint/samfp
samfp/old/test_peak_finding_1D.py
1
1765
#!/usr/bin/env python # -*- coding: utf8 -*- """ This script was created to test different algorithms for peak finding in different situations. by Bruno Quint """ import numpy as np import matplotlib.pyplot as plt from astropy.modeling import fitting, models from scipy import signal __author__ = 'Bruno Quint' ...
bsd-3-clause
817,412,502,059,180,000
23.513889
79
0.564306
false
2.662142
false
false
false
duganchen/wine_env
wine_env/bottle.py
1
1782
from wine_env import wine_rc import argparse import os import re import sys def main() -> None: parser = argparse.ArgumentParser() parser.add_argument('bottle', help='The name of the Wine bottle, e.g. PvZ', type=is_valid_bottle) parser.add_argument('--wine', help='The path to the Wine executable to use')...
mit
4,877,729,143,927,226,000
34.64
101
0.642536
false
3.072414
false
false
false
brandonlogan/octavia
octavia/openstack/common/systemd.py
1
3060
# Copyright 2012-2014 Red Hat, 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 or...
apache-2.0
-9,205,321,591,106,601,000
27.867925
78
0.638235
false
4.031621
false
false
false
51reboot/actual_09_homework
04/kk/listsort.py
1
2067
#encoding: utf-8 sort_list = [(1,4),(5,1),(2,3)] for j in range(len(sort_list) - 1): for i in range(len(sort_list) - 1): if max(sort_list[i]) > max(sort_list[i + 1]): #比较元素 #交换元素 temp = sort_list[i] sort_list[i] = sort_list[i + 1] sort_list[i + 1] = temp pr...
mit
3,470,843,879,758,446,600
25.267606
79
0.515818
false
2.313896
false
false
false
mpg-age-bioinformatics/AGEpy
AGEpy/go.py
1
2665
import pandas as pd #import urllib2 # python2 import urllib.request as urllib2 # import StringIO # python2 from io import StringIO import gzip import sys def getGeneAssociation(URL_or_file): """ This function collects GO annotation from http://geneontology.org/page/download-annotations. :param URL_or_fil...
mit
-1,873,630,614,812,621,300
41.301587
188
0.6394
false
3.369153
false
false
false
CroMarmot/MyOICode
ProjectEuler/p243.py
1
1085
# 见unsolved 找规律 N = 1000 FS = (15499,94744) dstRadio = FS[0]/FS[1] p = [0 for i in range(0, N+10)] def init(): p[1] = 1 for i in range(2, N+1): if p[i] == 0: j = i*i while j <= N: p[j] = i j += i def rc(val, arr, idx, der, pn): if idx == len...
gpl-3.0
6,091,762,810,910,410,000
11.821429
86
0.420613
false
2.804688
false
false
false
liamw9534/mopidy
tests/core/test_tracklist.py
1
2728
from __future__ import unicode_literals import unittest import mock from mopidy import backend, core from mopidy.models import Track class TracklistTest(unittest.TestCase): def setUp(self): self.tracks = [ Track(uri='dummy1:a', name='foo'), Track(uri='dummy1:b', name='foo'), ...
apache-2.0
680,172,512,915,077,400
35.373333
79
0.658724
false
3.414268
true
false
false
kubevirt/client-python
kubevirt/models/k8s_io_api_core_v1_pod_affinity_term.py
1
6067
# coding: utf-8 """ KubeVirt API This is KubeVirt API an add-on for Kubernetes. OpenAPI spec version: 1.0.0 Contact: kubevirt-dev@googlegroups.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class K8sIoApi...
apache-2.0
-8,777,044,438,350,808,000
32.335165
352
0.617439
false
4.236732
false
false
false
EnceladOnline/interfaX
core.py
1
5483
#!/usr/bin/env python # -*- coding: utf-8 -*- import iodata class Core: def __init__(self): # Liste des Tabs # self.tablist = [[tab], [tab], ..., [tab]] # Avec: # [tab] = ["title", [fond d'écran], # [iconsList]] # [fond d'écran] = ["color", "pathname image"] # [iconsList] = [[icon], [icon], ... [i...
gpl-2.0
1,200,075,452,523,371,800
19.626415
63
0.619945
false
2.743474
false
false
false
cmwaura/aura
aura/urls.py
1
1142
"""aura URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based ...
mit
4,881,849,648,007,302,000
38.37931
82
0.725044
false
3.591195
false
false
false
e-koch/canfar_scripts
img_pipe/casanfar_image_exp.py
1
27135
import os import numpy as np from scipy.optimize import curve_fit from matplotlib import pyplot as plt def plotmosaic(vis='', sourceid='', figfile='', coord='relative', skipsource=-1, doplot=True, help=False, sciencespws=False, vm='', debug=False, intent='OBSERVE_TARGET#ON_SOURCE'): ...
mit
-1,832,556,272,969,535,500
31.188612
126
0.550138
false
3.264557
false
false
false
Kozea/Dyko
kalamar/item.py
1
13193
# -*- coding: utf-8 -*- # This file is part of Dyko # Copyright © 2008-2010 Kozea # # This library 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 lat...
gpl-3.0
8,894,201,542,136,036,000
31.638614
80
0.60496
false
4.234425
false
false
false
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/tutorials/tensor_expr_get_started.py
1
11977
# 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 u...
apache-2.0
-441,829,121,032,817,100
37.760518
92
0.635969
false
3.835094
false
false
false
mthh/cartogram_geopandas
cartogram_geopandas.py
1
1738
# -*- coding: utf-8 -*- """ cartogram_geopandas v0.0.0c: Easy construction of continuous cartogram on a Polygon/MultiPolygon GeoDataFrame (modify the geometry in place or create a new GeoDataFrame). Code adapted to fit the geopandas.GeoDataFrame datastructure from Carson Farmer's code (https://github...
gpl-2.0
4,351,514,445,272,252,000
35.208333
77
0.697353
false
3.705757
false
false
false
coleifer/peewee
tests/hybrid.py
1
4720
from peewee import * from playhouse.hybrid import * from .base import ModelTestCase from .base import TestModel from .base import get_in_memory_db class Interval(TestModel): start = IntegerField() end = IntegerField() @hybrid_property def length(self): return self.end - self.start @hybr...
mit
3,264,753,388,633,969,700
30.258278
76
0.550424
false
3.417813
true
false
false
gfyoung/numpy
benchmarks/benchmarks/bench_overrides.py
2
1632
from __future__ import absolute_import, division, print_function from .common import Benchmark from numpy.core.overrides import array_function_dispatch import numpy as np def _broadcast_to_dispatcher(array, shape, subok=None): return (array,) @array_function_dispatch(_broadcast_to_dispatcher) def mock_broadca...
bsd-3-clause
7,977,122,286,051,749,000
25.754098
64
0.676471
false
3.464968
false
false
false
JioCloud/oslo-incubator
openstack/common/excutils.py
1
3740
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation. # Copyright 2012, Red Hat, 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:/...
apache-2.0
7,674,876,171,003,596,000
36.029703
78
0.594118
false
4.495192
false
false
false
tsudmi/json-database
json_database/recognizer/DatabaseLexer.py
1
10305
# Generated from java-escape by ANTLR 4.5 # encoding: utf-8 from __future__ import print_function from antlr4 import * from io import StringIO def serializedATN(): with StringIO() as buf: buf.write(u"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2") buf.write(u"!\u00fa\b\1\4\2\t\2\4\3\t\3\4\4...
mit
-8,571,423,908,196,419,000
53.81383
103
0.544493
false
1.634676
false
false
false
bjlittle/iris
lib/iris/analysis/_area_weighted.py
1
4319
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. from iris.analysis._interpolation import get_xy_dim_coords, snapshot_grid class AreaWeightedRegridder: """ This clas...
lgpl-3.0
2,550,326,149,243,316,000
32.223077
79
0.582542
false
4.059211
false
false
false
simon-r/PyParticles
pyparticles/forces/linear_spring_constrained.py
1
2530
# PyParticles : Particles simulation in python # Copyright (C) 2012 Simone Riva # # 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 late...
gpl-3.0
-2,235,073,604,497,134,300
29.119048
101
0.536759
false
3.598862
false
false
false
gijskant/phdthesis-experiments
scripts/connectfour.py
1
5391
#! /usr/bin/env python # :noTabs=true: # (c) Copyright (c) 2017 Gijs Kant # (c) This file is distributed under the MIT License, # (c) see the file LICENSE. """ connectfour.py Brief: Generates SMV files representing the Connect Four game. Author: Gijs Kant <gijskant@protonmail.com> """ import sys N = 7 # width of ...
mit
7,744,608,832,252,209,000
28.298913
95
0.405491
false
2.981748
false
false
false
e-koch/VLA_Lband
14B-088/HI/imaging/sd_regridding/arecibo_regrid.py
1
2063
''' Regrid the Arecibo data to match the VLA HI data. ''' from spectral_cube import SpectralCube from astropy.utils.console import ProgressBar import numpy as np import os from cube_analysis.io_utils import create_huge_fits from paths import fourteenB_HI_data_path, data_path # Load the non-pb masked cube vla_cube...
mit
-8,524,887,837,568,744,000
29.338235
87
0.697528
false
2.917963
false
false
false
yavdr/vdr-plugin-shutdown
script.shutdownvdr/default.py
1
6234
import sys import xbmcaddon import xbmcgui import xbmc import telnetlib Addon = xbmcaddon.Addon('script.shutdownvdr') # Script constants __scriptname__ = Addon.getAddonInfo('name') __id__ = Addon.getAddonInfo('id') __version__ = Addon.getAddonInfo('version') class SVDRPClient(object): def __init__(self, host, ...
gpl-2.0
5,315,258,154,963,178,000
32.159574
79
0.539461
false
3.988484
false
false
false
MDSLab/s4t-iotronic
iotronic/openstack/common/service.py
1
15677
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
8,274,637,262,323,323,000
29.148077
79
0.593417
false
4.116859
false
false
false
AlexanderMB/Group_tiny_krude_Renamer
Main.py
1
11824
#Copyright (c) 2014, Alexander M. Burns #All rights reserved. #Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: #1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follo...
bsd-3-clause
4,261,267,513,769,549,300
39.632302
756
0.731817
false
3.08479
false
false
false
bhargavasana/activitysim
scripts/stack_mode_choice.py
1
2586
import pandas as pd import string f = pd.read_excel(open("../ModeChoice.xls"), sheetname=None) coeffs = {} coeff_ind = None specs = {} ind = None for key, df in f.iteritems(): if "debug" in key or "model" in key or "data" in key: continue print key """ Really these lines just extract the rel...
agpl-3.0
241,342,969,877,945,500
28.397727
77
0.595514
false
3.349741
false
false
false
HerdOfBears/Learning_Machine_Learning
Reinforcement Learning/recursionprac.py
1
1434
from math import factorial import numpy as np import pandas as pd # take the number 3, want to get all permutations of 1,2,3. # (1,2,3), (1,3,2), (3,1,2), (3,2,1), (2,1,3), (2,3,1) # or for 4, all permutations of 1,2,3,4 # by using recursion def swapper(x,y): return y,x def permutor(x, depth): # will be list...
mit
437,091,087,558,427,650
17.397436
77
0.599721
false
2.298077
false
false
false
Spirotot/taskwiki
taskwiki/cache.py
1
6061
import vim # pylint: disable=F0401 import re import vwtask import viewport import regexp import store class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self): # Determine defaults d...
mit
-9,074,915,698,538,888,000
31.411765
88
0.594291
false
4.048764
false
false
false
Saumya-Suvarna/machine-learning
Route_prediction/data/valid_initialisation.py
1
1649
#!/usr/bin/env python2 import os import sys import h5py import numpy import data _fields = { 'trip_id': 'S19', 'call_type': numpy.int8, 'origin_call': numpy.int32, 'origin_stand': numpy.int8, 'taxi_id': numpy.int16, 'timestamp': numpy.int32, 'day_type': numpy.int8, 'missing_data': nump...
apache-2.0
-3,633,174,246,422,291,500
27.431034
92
0.573075
false
3.020147
false
false
false
staugur/SwarmOps
src/utils/web.py
1
4411
# -*- coding: utf-8 -*- """ SwarmOps.utils.web ~~~~~~~~~~~~~~ Common function for web. :copyright: (c) 2018 by staugur. :license: MIT, see LICENSE for more details. """ import json from .tool import logger from .jwt import JWTUtil, JWTException from .aes_cbc import CBC from libs.Base import Cache...
bsd-3-clause
2,158,957,588,236,556,800
25.651316
149
0.585534
false
3.085301
false
false
false
NeurodataWithoutBorders/api-python
examples/create_scripts/timeseries-e.py
1
2327
#!/usr/bin/python import sys from nwb import nwb_file from nwb import nwb_utils as utils """ Example extending the format: using MyNewTimeSeries type. This example uses an extension specified in file "examples/e-timeseries.py". The extension specified in that file defines a new type of TimeSeries (named "MyNewTimeSer...
bsd-3-clause
-8,094,498,623,612,451,000
37.783333
115
0.695746
false
3.300709
false
false
false
Wikidata/StrepHit
strephit/commons/text.py
1
6275
from __future__ import absolute_import import re import logging logger = logging.getLogger(__name__) def clean_extract(sel, path, path_type='xpath', limit_from=None, limit_to=None, sep='\n', unicode=True): if path_type == 'xpath': return clean(sep.join(x.strip() ...
gpl-3.0
-8,912,854,291,837,263,000
38.71519
98
0.56494
false
3.912095
false
false
false
NeverWalkAloner/collectiveblogs
users/models.py
1
1782
# -*- coding: utf-8 -*- from django.conf import settings from django.db import models from django.contrib.auth.models import User def upload_location(instance, filename): return 'avatars/{}/{}'.format(instance.id, filename) # Create your models here. class Profile(models.Model): user = models.OneToOneField(...
gpl-3.0
3,333,380,948,648,993,000
35.553191
108
0.622817
false
3.655319
false
false
false
flavoi/diventi
diventi/ebooks/migrations/0112_auto_20200830_1803.py
1
2825
# Generated by Django 2.2.13 on 2020-08-30 16:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ebooks', '0111_auto_20200830_1753'), ] operations = [ migrations.AlterField( model_name='book', name='icon_style', ...
apache-2.0
-804,125,010,496,696,600
52.301887
214
0.51469
false
3.562421
false
false
false
NordicSemiconductor/mbed
workspace_tools/export/coide.py
1
1969
""" mbed SDK Copyright (c) 2014 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 writing...
apache-2.0
4,988,540,302,664,577,000
29.765625
92
0.607415
false
3.953815
false
false
false
thebjorn/pydeps
pydeps/py2depgraph.py
1
11186
# Copyright 2004,2009 Toby Dickenson # Changes 2014 (c) Bjorn Pettersen # # 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 ...
bsd-2-clause
-2,672,786,267,121,711,000
32.73913
111
0.552566
false
4.091441
false
false
false
dlzhangxg/cloud-ml-sdk
cloud_ml_sdk/cloud_ml_sdk/command/command.py
1
23109
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK # Copyright 2017 Xiaomi, 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 requ...
apache-2.0
-1,757,484,943,570,068,700
34.827907
86
0.670561
false
3.632348
false
false
false
bniemczyk/bnirc
scripts/joo_utils.py
1
11770
#!/usr/bin/env python ########################################################################### # Copyright (C) 2005 by Janne Oksanen # # jaosoksa@cc.jyu.fi # # ...
gpl-2.0
-2,007,077,188,774,609,700
33.822485
123
0.627358
false
2.505321
false
false
false
CGATOxford/Optic
scripts/optic/evaluate_mali.py
1
48235
########################################################################## # # MRC FGU Computational Genomics Group # # $Id$ # # Copyright (C) 2009 Andreas Heger # # 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 ...
mit
-7,523,436,630,208,232,000
35.458806
156
0.483736
false
4.137147
false
false
false
CKPalk/MachineLearning
FinalProject/DataCleaning/training_json_to_csv.py
1
1960
import json import sys json_str = open( sys.argv[1], 'r' ).read().upper() python_recipes = json.loads( json_str ) ingr_attr = "INGREDIENTS" CSV_ATTRIBUTES = [] # Get bag of ingredient_bag ingredient_bag = [] # Take the ingredient_bag from each recipe to create a new attribute for recipe in python_recipes: for ...
mit
7,172,961,727,889,949,000
24.128205
151
0.705612
false
2.912333
false
false
false
normalnorway/normal.no
django/apps/cms/management/commands/file.py
1
2803
import os from django.core.management.base import BaseCommand, CommandError #from django.core.files import File as DjangoFile from apps.cms.models import File # TODO # - remove stale files. or just pipe to xargs rm # - rm: handle more than one arg # /home/torkel/dev/python/examples/argparse2.py class Command(BaseComm...
gpl-3.0
2,123,114,337,683,401,500
34.0375
103
0.579736
false
3.579821
false
false
false
regardscitoyens/sunshine-data
scripts/format_declaration_conventions.py
1
2602
# -*- coding: utf-8 -*- import csv import sys from sunshine import ( CONVENTION_HEADERS, build_qualification, build_address, build_rpps, clean_text, build_eta, build_name, build_origin ) from utils import str2date def build_programme(row): nature = " ".join((row["conv_manifestatio...
agpl-3.0
1,187,547,240,911,673,000
40.301587
113
0.626826
false
3.142512
false
false
false
edent/Twitter-Networks
GetFollowing.py
1
6276
import tweepy import time import os import sys import json import argparse from datetime import datetime FOLLOWING_DIR = 'following' USER_DIR = 'twitter-users' MAX_FRIENDS = 200 FRIENDS_OF_FRIENDS_LIMIT = 200 # Create the directories we need if not os.path.exists(FOLLOWING_DIR): os.makedirs(FOLLOWING_DIR) if not...
mit
-1,068,215,295,684,246,300
33.295082
100
0.538878
false
4.007663
false
false
false
Azure/azure-sdk-for-python
sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_recommended_sensitivity_labels_operations.py
1
5397
# 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
6,419,311,994,257,529,000
47.621622
222
0.666852
false
4.331461
true
false
false
InsightSoftwareConsortium/ITKExamples
src/Filtering/Smoothing/ComputesSmoothingWithGaussianKernel/Code.py
1
1266
#!/usr/bin/env python # Copyright NumFOCUS # # 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.txt # # Unless required by applicable law or ...
apache-2.0
-5,801,053,971,673,885,000
27.772727
84
0.754344
false
3.440217
false
false
false
chrisglass/django_polymorphic
polymorphic/formsets/models.py
2
15528
from collections import OrderedDict from django import forms from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ImproperlyConfigured, ValidationError from django.forms.models import ( BaseInlineFormSet, BaseModelFormSet, ModelForm, inlineformset_factory, m...
bsd-3-clause
7,811,324,412,366,280,000
33.052632
107
0.597244
false
4.325348
false
false
false
gurneyalex/stock-logistics-warehouse
stock_reserve/__openerp__.py
1
1962
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
-3,150,588,039,255,067,000
32.827586
78
0.627931
false
4.062112
false
false
false
ebroecker/canmatrix
src/canmatrix/formats/json.py
1
10407
# -*- coding: utf-8 -*- # Copyright (c) 2013, Eduard Broecker # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that # the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this lis...
bsd-2-clause
1,686,104,147,014,587,600
43.097458
112
0.552705
false
4.289777
false
false
false
d1hotpep/peewee
playhouse/dataset.py
1
10918
import csv import datetime from decimal import Decimal import json import operator try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse import sys from peewee import * from playhouse.db_url import connect from playhouse.migrate import migrate from playhouse.migrate import Sc...
mit
3,286,707,748,160,763,400
29.327778
79
0.572266
false
4.236709
false
false
false
openstack/barbican
barbican/objects/secret_acl.py
1
6272
# Copyright 2018 Fujitsu. # # 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...
apache-2.0
-1,788,251,597,684,071,700
36.112426
79
0.631537
false
4.023092
false
false
false