repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
Fiware/context.Cygnus
cygnus-ngsi/test/acceptance/tools/cygnus_instance_config.py
3
4828
# -*- coding: utf-8 -*- # # Copyright 2015-2017 Telefonica Investigación y Desarrollo, S.A.U # # This file is part of fiware-cygnus (FIWARE project). # # fiware-cygnus 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 ...
agpl-3.0
8,554,742,955,063,492,000
44.102804
178
0.647047
false
3.511645
true
false
false
product-definition-center/product-definition-center
pdc/apps/unreleasedvariant/serializers.py
2
1065
# # Copyright (c) 2018 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # from rest_framework import serializers from pdc.apps.module.models import Module from pdc.apps.module.serializers import ModuleSerializerBase class UnreleasedVariantSerializer(ModuleSerializerBase): varia...
mit
-1,100,995,509,558,590,500
38.444444
91
0.703286
false
4.003759
false
false
false
lifemapper/core
LmWebServer/services/api/v2/taxonomy.py
1
1203
"""This module contains service code for performing searches on taxonomy.""" import cherrypy from LmServer.common.solr import query_taxonomy_index from LmWebServer.services.api.v2.base import LmService from LmWebServer.services.cp_tools.lm_format import lm_formatter # ...................................................
gpl-3.0
6,696,971,144,940,404,000
41.964286
79
0.619285
false
3.794953
false
false
false
peterfpeterson/mantid
qt/python/mantidqt/widgets/workspacedisplay/table/error_column.py
3
1560
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # ...
gpl-3.0
414,164,303,483,615,550
41.162162
97
0.663462
false
3.553531
false
false
false
Chipe1/aima-python
mdp.py
2
16758
""" Markov Decision Processes (Chapter 17) First we define an MDP, and the special case of a GridMDP, in which states are laid out in a 2-dimensional grid. We also represent a policy as a dictionary of {state: action} pairs, and a Utility function as a dictionary of {state: number} pairs. We then define the value_iter...
mit
8,823,250,765,052,430,000
33.060976
120
0.530911
false
3.639878
false
false
false
dkronst/mexbtcapi
mexbtcapi/api/btce/high_level.py
1
7757
#!/usr/bin/env python """ Implements the High-level API for btc-e so that it can be used with the mexbtcapi package """ from datetime import datetime, timedelta from decimal import Decimal import logging from mexbtcapi import concepts from mexbtcapi.concepts.currencies import * from mexbtcapi.concepts.currency impo...
cc0-1.0
-1,053,488,198,316,205,700
33.02193
124
0.61003
false
3.776534
false
false
false
myinxd/cavdet
utils/getSamples.py
1
2039
# Copyright (C) 2016 Zhixian MA <zxma_sjtu@qq.com> """ Fetch observations from chandra Reference -------- [1] http://cxc.cfa.harvard.edu/ciao/ahelp/download_chandra_obsid.html [2] http://cxc.cfa.harvard.edu/ciao/ahelp/find_chandra_obsid.html """ import os import pandas as pd import mailsender def main(): ...
mit
-5,130,998,912,953,178,000
27.71831
78
0.564492
false
2.946532
false
false
false
Titulacion-Sistemas/PythonTitulacion-EV
Lib/site-packages/setuptools/sandbox.py
76
9449
import os, sys, tempfile, operator, pkg_resources if os.name == "java": import org.python.modules.posix.PosixModule as _os else: _os = sys.modules[os.name] try: _file = file except NameError: _file = None _open = open from distutils.errors import DistutilsError from pkg_resources import working_set fro...
mit
7,768,376,964,153,455,000
28.16358
92
0.578791
false
3.810081
false
false
false
mishudark/openhealt
questions/views.py
1
1879
import json from django.http import HttpResponse from questions.models import Question from pacients.models import Pacient from mongoengine.django.auth import * def list(request): try: POST = json.loads(request.body) except Exception, e: response = []; return HttpResponse(json.dumps(res...
gpl-3.0
-1,022,815,300,675,342,500
29.306452
99
0.627461
false
3.803644
false
false
false
ff0000/red-social-auth
social_auth/models.py
1
2885
import datetime from django.conf import settings from django.db import models PROVIDERS = getattr(settings, 'SOCIAL_AUTH_PROVIDERS', ('facebook', 'twitter', 'google')) PROVIDER_CHOICES = [(x,x) for x in PROVIDERS] class IdentityProvider(models.Model): user = models.ForeignKey('social_auth.SocialUser') ...
mit
-1,186,520,093,348,489,200
32.941176
91
0.657539
false
3.390129
false
false
false
jeremiahyan/odoo
addons/sms/models/sms_template.py
1
3287
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ class SMSTemplate(models.Model): "Templates for sending SMS" _name = "sms.template" _inherit = ['mail.render.mixin'] _description = 'SMS Templates' @api.mode...
gpl-3.0
-4,261,729,565,215,185,000
42.25
167
0.566474
false
4.063041
false
false
false
zhaochao/fuel-web
fuelmenu/fuelmenu/common/network.py
1
2321
# Copyright 2013 Mirantis, 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, s...
apache-2.0
1,253,869,665,782,966,800
28.75641
75
0.660491
false
3.689984
false
false
false
dpr10/whooshle-insight
ui/configui/ui_appsconfigurationtab.py
1
2940
from PyQt4 import QtGui class Ui_AppsConfigurationTab: def __init__(self, parent): # componets # pdf box self.pdf_label = QtGui.QLabel('PDF') self.pdf_label.setMinimumWidth(30) self.pdf_app_route = QtGui.QLineEdit() self.pdf_app_route.setReadOnly(True)...
gpl-2.0
5,139,345,874,186,547,000
32.588235
67
0.598299
false
3.454759
false
false
false
maodijim/NodeJS-Server
fileCheck.py
1
1423
''' Author: Andy Mao Chekc ID in database if incorrect update database and send ip address to server ''' import os import json from getID import getId import datetime import urllib import subprocess import MySQLdb import sys os.chmod('/home/pi/Public/NodeJS-Server/codesend',0711); os.chmod('/home/pi/Public/NodeJS-Ser...
gpl-3.0
-2,848,334,389,688,528,400
28.040816
126
0.64371
false
2.863179
false
false
false
lvbeck/niubi
blog/models.py
1
7117
# -*- coding: utf-8 -*- from datetime import datetime from google.appengine.ext import db from google.appengine.ext import search from django.contrib.sitemaps import ping_google class SitemapModel(db.Model): def put(self): result = super(SitemapModel, self).put() try: ping_google() ...
apache-2.0
1,977,296,849,455,947,300
36.326316
163
0.570582
false
3.830902
false
false
false
JeremiahZhang/pybeginner
_src/om2py0w/0wex0/main.py
1
1965
# -*- coding: utf-8 -*- import sys, os, glob from time import localtime, strftime reload(sys) # 必须 reload sys.setdefaultencoding('utf-8') yes_list = ['yes', 'yep', 'ye', 'y', 'YES','YEP', 'YE', 'Y'] no_list = ['no', 'n', 'NO', 'N'] def main(): keywords = sys.argv[1:] # 调用外部数据 for words ...
mit
4,448,585,378,204,309,500
23.816901
75
0.554231
false
2.61276
false
false
false
IQSS/miniverse
dv_apps/datasets/admin.py
1
1648
from django.contrib import admin from .models import Dataset, DatasetVersion, DatasetLinkingDataverse class DatasetAdmin(admin.ModelAdmin ): save_on_top = True list_display = ('dvobject', 'identifier_string', 'protocol', 'authority', 'identifier', ) readonly_fields = ('thumbnailfile', 'doiseparator', 'id...
mit
6,486,353,336,180,281,000
32.632653
94
0.617718
false
4.02934
false
false
false
RRCKI/panda-server
pandaserver/test/missing.py
2
1267
import re import commands stMap = [] tmpMap = {} nLog = 30 for i in range(0,nLog): if i == 0: out = commands.getoutput('cat /data/sm/prod/httpd/logs/panda-Adder.log') else: out = commands.getoutput('zcat /data/sm/prod/httpd/logs/panda-Adder.log.%s.gz' % (nLog-i)) for line in out.spl...
apache-2.0
6,193,352,429,334,602,000
28.465116
106
0.486188
false
3.579096
false
false
false
cernops/nova
nova/virt/hyperv/eventhandler.py
2
4431
# Copyright 2015 Cloudbase Solutions Srl # 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 r...
apache-2.0
-1,882,628,779,922,259,200
37.530435
79
0.642067
false
4.057692
false
false
false
yeleman/snisi
snisi_web/views/mapping.py
1
5219
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import copy import json from django.http import HttpResponse from django.views.decorators.http import require_POST from django.view...
mit
5,844,988,702,571,793,000
35.243056
78
0.603564
false
3.912294
false
false
false
FedoraScientific/salome-kernel
bin/nameserver.py
1
5729
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- # Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or # modify it under the ...
lgpl-2.1
5,927,154,211,558,154,000
42.732824
176
0.623145
false
3.447052
false
false
false
josenavas/qiime
tests/test_truncate_reverse_primer.py
15
15531
#!/usr/bin/env python # File created February 29, 2012 from __future__ import division __author__ = "William Walters" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["William Walters"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "William Walters" __email__ = "William.A.Walters@col...
gpl-2.0
-6,090,754,650,739,553,000
45.086053
184
0.671496
false
3.064522
true
false
false
drvinceknight/Axelrod
axelrod/strategies/grudger.py
1
1841
from axelrod import Player class Grudger(Player): """A player starts by cooperating however will defect if at any point the opponent has defected.""" name = 'Grudger' def strategy(self, opponent): """Begins by playing C, then plays D for the remaining rounds if the opponent ever plays D.""" ...
mit
-3,561,650,652,535,968,300
29.683333
142
0.603476
false
3.795876
false
false
false
stczhc/neupy
examples/rbfn/grnn_params_selection.py
1
1372
from operator import itemgetter import numpy as np from sklearn import datasets, grid_search from sklearn.cross_validation import train_test_split from neupy import algorithms, estimators, environment environment.reproducible() def scorer(network, X, y): result = network.predict(X) return estimators.rmsle(...
mit
7,451,615,070,796,361,000
28.191489
69
0.688047
false
3.146789
true
false
false
fingeronthebutton/RIDE
src/robotide/utils/eventhandler.py
2
4026
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
-900,930,226,894,902,500
42.76087
124
0.61699
false
3.823362
false
false
false
pyvim/metacrawler
metacrawler/base.py
1
1279
# coding=utf-8 import re class Element(object): """Base element.""" def __init__(self): self._get_attributes() def __getattr__(self, name): try: attributes = {} attributes.update(self.__dict__) attributes.update(self.__class__.__dict__) v...
mit
-5,829,590,448,740,901,000
25.102041
73
0.496482
false
4.772388
false
false
false
DiamondLightSource/diffcalc
diffcalc/gdasupport/minigda/scannable.py
1
25322
### # Copyright 2008-2011 Diamond Light Source Ltd. # This file is part of Diffcalc. # # Diffcalc 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
9,057,172,920,438,214,000
35.382184
142
0.591975
false
4.460454
false
false
false
RomelTorres/alpha_vantage
alpha_vantage/sectorperformance.py
1
1796
#!/usr/bin/env python from .alphavantage import AlphaVantage as av class SectorPerformances(av): """This class implements all the sector performance api calls """ def __init__(self, *args, **kwargs): """ Inherit AlphaVantage base class with its default arguments """ super(...
mit
6,302,322,032,173,619,000
36.416667
106
0.556793
false
4.467662
false
false
false
userzimmermann/robotframework-tools
robottools/utils/normdict.py
1
5533
# robotframework-tools # # Python Tools for Robot Framework and Test Libraries. # # Copyright (C) 2013-2016 Stefan Zimmermann <zimmermann.code@gmail.com> # # robotframework-tools 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 Sof...
gpl-3.0
-8,126,405,278,371,685,000
32.131737
78
0.664377
false
4.147676
false
false
false
levilucio/SyVOLT
UMLRT2Kiltera_MM/cardinality_resolution/Himesis/HForwardCardinalitiesToApplyModelLHS.py
2
10534
from core.himesis import Himesis, HimesisPreConditionPatternLHS import cPickle as pickle from uuid import UUID class HForwardCardinalitiesToApplyModelLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HForwardCardinalitiesToApplyMode...
mit
2,336,855,293,171,119,000
41.475806
179
0.534745
false
4.556228
false
false
false
google/upvote
upvote/monitoring/metrics.py
1
3792
# Copyright 2017 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 a...
apache-2.0
3,591,197,022,218,347,000
28.858268
74
0.662975
false
3.614871
false
false
false
StingraySoftware/stingray
stingray/modeling/posterior.py
1
28172
import abc import warnings import numpy as np import six np.seterr('warn') from scipy.special import gamma as scipy_gamma from scipy.special import gammaln as scipy_gammaln from astropy.modeling.fitting import _fitter_to_model_params from astropy.modeling import models from stingray import Lightcurve, Powerspectr...
mit
8,578,012,381,201,747,000
30.689539
96
0.602549
false
4.285367
false
false
false
irvined1982/gridengine-accounting
setup.py
1
1262
# Copyright 2013 David Irvine # # This file is part of gridengine-accounting # # gridengine-accounting 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...
gpl-3.0
5,671,137,690,741,371,000
36.117647
80
0.749604
false
3.6793
false
false
false
eahneahn/free
free/settings.py
1
1966
""" Django settings for free project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impor...
agpl-3.0
1,690,708,933,102,921,700
22.97561
71
0.719227
false
3.217676
false
false
false
BenLubar/valis
valis/web/__init__.py
1
3004
# valis: valis, a lojbanic information system # Copyright (C) 2015, Riley Martinez-Lynch # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option)...
gpl-3.0
2,558,820,320,675,143,700
36.08642
82
0.708389
false
4.092643
false
false
false
initNirvana/Easyphotos
env/lib/python3.4/site-packages/IPython/parallel/apps/baseapp.py
4
8745
# encoding: utf-8 """ The Base Application class for IPython.parallel apps """ import os import logging import re import sys from IPython.config.application import catch_config_error, LevelFormatter from IPython.core import release from IPython.core.crashhandler import CrashHandler from IPython.core.application impo...
mit
-6,484,021,871,755,494,000
35.136364
91
0.565695
false
4.146515
true
false
false
opensim-org/opensim-gui
Gui/opensim/Scripts/editProperties.py
1
3797
# --------------------------------------------------------------------------- # # OpenSim: editProperties.py # # --------------------------------------------------------------------------- # # OpenSim is a toolkit for musculoskeletal modeling and simulation, # ...
apache-2.0
-8,289,673,987,378,460,000
44.746988
93
0.624704
false
4.074034
false
false
false
zielmicha/hera
hera/apimiddleware.py
1
1131
from bottle import default_app from django.core.exceptions import PermissionDenied, ObjectDoesNotExist import hera.models import json def make(): app = default_app.pop() app.catchall = False def error_catcher(environ, start_response): try: return app.wsgi(environ, start_response) ...
agpl-3.0
-8,715,342,119,017,690,000
35.483871
91
0.640141
false
4.284091
false
false
false
brennie/reviewboard
reviewboard/scmtools/tests/test_perforce.py
1
23729
# coding=utf-8 from __future__ import unicode_literals import os import shutil from hashlib import md5 import nose from django.conf import settings from django.utils import six from django.utils.six.moves import zip_longest from djblets.testing.decorators import add_fixtures from djblets.util.filesystem import is_exe...
mit
-8,431,564,436,329,460,000
39.275042
79
0.575837
false
3.836649
true
false
false
stefan-jonasson/home-assistant
homeassistant/components/switch/modbus.py
6
2305
""" Support for Modbus switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.modbus/ """ import logging import voluptuous as vol import homeassistant.components.modbus as modbus from homeassistant.const import CONF_NAME, CONF_SLAVE from homeas...
mit
2,573,840,223,078,656,000
28.177215
74
0.6282
false
3.69391
false
false
false
gregpuzzles1/Sandbox
Example Programs/Ch_18_Student_Files/testbinarytree.py
1
1414
""" File: testbinarytree.py Builds a full binary tree with 7 nodes. """ from binarytree import BinaryTree # Create initial leaf nodes a = BinaryTree("A") b = BinaryTree("B") c = BinaryTree("C") d = BinaryTree("D") e = BinaryTree("E") f = BinaryTree("F") g = BinaryTree("G") # Build the tree from the bottom up, where...
gpl-3.0
7,768,980,357,910,377,000
16.036145
67
0.655587
false
2.868154
false
false
false
stuartarchibald/numba
numba/cuda/mathimpl.py
5
9657
import math import operator from llvmlite import ir from numba.core import types, typing, utils, cgutils from numba.core.imputils import Registry from numba.types import float32, float64, int64, uint64 from numba.cuda import libdevice registry = Registry() lower = registry.lower booleans = [] booleans += [('isnand',...
bsd-2-clause
-6,581,125,392,542,019,000
32.53125
115
0.638501
false
3.051185
false
false
false
acutesoftware/AIKIF
aikif/toolbox/file_tools.py
1
2304
#!/usr/bin/python3 # coding: utf-8 # file_tools.py import os import sys import glob import shutil root_folder = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + os.sep + ".." ) pth = root_folder + os.sep + 'lib' sys.path.append(pth) import cls_filelist as mod_fl exclude_folders = [ os.sep + 'venv', ...
gpl-3.0
-4,002,506,027,516,355,600
22.272727
94
0.640625
false
2.630137
false
false
false
hbkfabio/horario
horario/migrations/0002_auto_20170704_1335.py
2
3497
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-07-04 17:35 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('parametros', '0002_auto_20170704_1335'), ('horario'...
gpl-3.0
-7,676,421,406,327,690,000
32.951456
129
0.555905
false
4.128689
false
false
false
sieben/pycolo
tests/core/TestURLParsing.py
1
1626
# coding=utf-8 import unittest from urllib.parse import urlparse from pycolo import DEFAULT_PORT class TestURLParsing(unittest.TestCase): def test_URI(self): uri = urlparse("coap://[2001:db8::2:1]/") self.assertEqual(uri.port, DEFAULT_PORT) self.assertEqual(uri.address, "[2001:db8::2:1]")...
isc
4,673,972,240,984,310,000
35.954545
96
0.619926
false
3.132948
true
false
false
willmcgugan/rich
rich/control.py
1
5298
from typing import Any, Callable, Dict, Iterable, List, TYPE_CHECKING, Union from .segment import ControlCode, ControlType, Segment if TYPE_CHECKING: from .console import Console, ConsoleOptions, RenderResult STRIP_CONTROL_CODES = [ 8, # Backspace 11, # Vertical tab 12, # Form feed 13, # Carr...
mit
-8,446,675,749,749,136,000
29.274286
100
0.573235
false
3.778887
false
false
false
SOCRedu/MedicareRDF
developer/city and states/zipcodewriteFile.py
2
1161
def write_zipcode(zipcodeF,cityURI): zipcodeF = zipcodeF.strip() zipcodeF = str(zipcodeF) zipcodeF = (5-len(zipcodeF))* '0'+ zipcodeF zipcodeID = '947'+ zipcodeF cityURI = str(cityURI) updateFile = open('mebdo_city_county_import.owl','a') updateFile.write(' <!-- http://purl.obolibrary.or...
lgpl-3.0
-3,487,280,055,171,880,000
67.352941
257
0.640827
false
2.744681
false
false
false
lmjohns3/cube-experiment
vizard/suit.py
1
1349
'''Constants related to phasespace markers.''' # labels for markers reported by the phasespace setup. abbreviations: # mc = metacarpal # mt = metatarsal # tN = thoracic vertebra #N # psis = posterior superior iliac spine # asis = anterior superior iliac spine MARKER_LABELS = [ 'r-head-back', # 00 'r-head-fro...
mit
7,312,769,700,403,300,000
18.838235
69
0.500371
false
2.512104
false
false
false
jerinisready/Blog
user/forms.py
1
2707
from django import forms from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.contrib.auth.models import User class SignUpForm(UserCreationForm): first_name = forms.CharField(max_length=30, required=True, help_text='Required.') last_name = forms.CharField(max_length=30, requi...
gpl-3.0
2,989,344,665,328,461,000
39.402985
113
0.68526
false
3.980882
false
false
false
rlrs/deep-rl
dqn/ParallelAgent.py
2
2448
""" Experimental agent implementation running separate threads for emulation and GPU training. This is slightly (estimate ~20%) faster than the sequential implementation, but results might be different. Copyright 2016 Rasmus Larsen This software may be modified and distributed under the terms of the MIT license. See ...
mit
7,276,112,704,304,762,000
29.6
108
0.591912
false
4
true
false
false
klmitch/freshen
setup.py
1
1457
#!/usr/bin/env python import os from setuptools import setup def readreq(filename): result = [] with open(filename) as f: for req in f: req = req.lstrip() if req.startswith('-e ') or req.startswith('http:'): idx = req.find('#egg=') if idx >= 0:...
apache-2.0
-3,278,866,729,766,834,000
25.490909
65
0.540837
false
4.069832
false
false
false
zutshi/S3CAMR
src/graphs/graph_generic.py
1
1654
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import graphGT import graphNX #grid_eps = [0.50, 0.04] #delta_t = 0.4 #num_samples = 2 #time python -O ./scamr.py -f ../examples/vdp/vanDerPol.tst -cn --refine model_dft -g g --seed 1 >nx_log 2>gt_log cla...
bsd-2-clause
3,212,938,206,665,371,600
24.84375
113
0.555623
false
3.361789
false
false
false
khchine5/atelier
atelier/sphinxconf/insert_input.py
1
9050
# -*- coding: utf-8 -*- # Copyright 2011-2018 Rumma & Ko Ltd # License: BSD, see LICENSE for more details. """Defines the :class:`InsertInputDirective` class and some subclasses, installing the :rst:dir:`py2rst` directive. To use it, you must run:: $ pip install atelier and then add this module to your :xfile:`co...
bsd-2-clause
-3,659,660,992,312,706,000
30.533101
85
0.594365
false
4.016866
false
false
false
zhyq0826/test-lab
tornado-lab/main2.py
1
2530
# -*- encoding: utf-8 -*- #ioloop.py 主要的是将底层的epoll或者说是其他的IO多路复用封装作异步事件来处理。 # 可以看到在注释前都是使用了传统的创建服务器的方式,不用多介绍,注意就是把套接口设置为非阻塞方式。 # 创建ioloop实例,这里是使用了ioloop.IOLoop中的 instance()静态方法,以 @classmethod 方式包装。 # 在后面的add_handler中,程序为我们的监听套接口注册了一个回调函数和一个事件类型。 # 在注册了相应的事件类型和回调函数以后,程序开始启动,如果在相应的套接口上有事件发生(注册的事件类型)那么调用相应的回调函数。 # 当监听套接口有可...
mit
-5,076,156,917,843,103,000
25.098592
116
0.669006
false
1.917184
false
false
false
skomendera/PyMyTools
providers/terminal.py
1
2039
import os def get_terminal_columns(): terminal_rows, terminal_columns = os.popen('stty size', 'r').read().split() return int(terminal_columns) def get_terminal_rows(): terminal_rows, terminal_columns = os.popen('stty size', 'r').read().split() return int(terminal_rows) def get_header_l1(lines_li...
mit
-1,228,049,063,494,354,400
18.056075
79
0.565964
false
3.467687
false
false
false
yarny/gbdt
scripts/compute_metrics.py
1
2695
#!/usr/bin/python import collections import math import re import sys import operator from optparse import make_option from optparse import OptionParser option_list = [ make_option('--group_file', action='store', type='string', dest='group_file', help='[REQUIRED] The group flatfile.'), make_op...
apache-2.0
597,467,555,095,998,300
29.625
91
0.626345
false
3.727524
false
false
false
talon-one/talon_one.py
talon_one/models/coupon_rejection_reason.py
1
6412
# coding: utf-8 """ Talon.One API The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #...
mit
-5,998,877,809,588,793,000
34.425414
647
0.609638
false
4.002497
true
false
false
nonbeing/simplemonitor
Monitors/monitor.py
1
11250
"""A collection of monitors for the SimpleMonitor application. The Monitor class contains the monitor-independent logic for handling results etc. Subclasses should provide an __init__(), and override at least run_test() to actually perform the test. A successful test should call self.record_success() and a failed on...
bsd-3-clause
4,744,861,871,320,500,000
28.527559
124
0.586756
false
4.285714
true
false
false
hugovk/terroroftinytown
terroroftinytown/services/adjix.py
2
1849
from terroroftinytown.services.base import BaseService, html_unescape import re from terroroftinytown.services.status import URLStatus from terroroftinytown.client.errors import UnexpectedNoResult class AdjixService(BaseService): def process_redirect(self, response): if '<title>Spammer</title>' in respons...
mit
-6,395,072,152,649,612,000
38.340426
83
0.572742
false
4.002165
false
false
false
hpRNA/hpRNA
hpRNA_constrain.py
1
15100
#!/usr/bin/env python ################################################################################ ## ## ## hpRNA_constrain.py SCRIPT ## ## ---------------------------------------------------...
gpl-3.0
-1,821,869,481,709,471,500
40.259563
405
0.579536
false
3.921059
false
false
false
pombreda/swarming
appengine/components/components/auth/ipaddr.py
3
4613
# Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. """Utilities for working with IPv4 and IPv6 addresses.""" import collections # Part of public API of 'auth' component, exposed by this module. __all__...
apache-2.0
-677,477,710,353,046,500
28.954545
80
0.646651
false
3.328283
false
false
false
dipapaspyros/bdo_platform
query_designer/views.py
1
14688
# -*- coding: utf-8 -*- from __future__ import unicode_literals from decimal import Decimal from query_designer.api import * from query_designer.lists import AGGREGATES from query_designer.query import * import json from django.db import transaction from django.http import HttpResponse, JsonResponse from django.shortcu...
mit
-5,101,116,414,472,928,000
31.85906
138
0.618464
false
3.970803
false
false
false
nju520/youtube-dl
youtube_dl/extractor/vevo.py
104
8366
from __future__ import unicode_literals import re import xml.etree.ElementTree from .common import InfoExtractor from ..compat import ( compat_urllib_request, ) from ..utils import ( ExtractorError, int_or_none, ) class VevoIE(InfoExtractor): """ Accepts urls from vevo.com or in the format 'vevo...
unlicense
-4,187,987,432,773,295,000
35.532751
110
0.50514
false
3.635811
false
false
false
wacax/NationalDataSciBowl
NNModules.py
1
5144
#define sigmoid function, lazy numpy doesn't have one def sigmoid(X): import numpy as np g = 1.0 / (1.0 + np.exp(-X)) return g #define sigmoid gradient def sigmoidGradient(z): g = sigmoid(z) * (1.0 - sigmoid(z)) return g #define Cost Function def nnCostFunction(Thetas, input_layer_size, hidden1_la...
gpl-2.0
-511,681,474,525,608,400
49.441176
157
0.624222
false
2.846707
false
false
false
halletienne/keepasssync
keepasssync.py
1
8226
#!/usr/bin/env python3 from kppy.database import KPDBv1 from kppy.exceptions import KPError import sys, os, time def openDatabase(db_path,db_pass): ''' Check if databases file exist and open it as read only Return the database ''' if len(db_pass)==0: db_pass=input('Enter password for ...
unlicense
-3,834,370,016,152,834,600
29.808989
232
0.615123
false
3.472351
false
false
false
dmaccarthy/sc8pr
sc8pr/gui/button.py
1
5205
# Copyright 2015-2020 D.G. MacCarthy <https://dmaccarthy.github.io/sc8pr> # # This file is part of "sc8pr". # # "sc8pr" 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...
gpl-3.0
-6,103,357,413,689,015,000
31.12963
84
0.601345
false
3.63224
false
false
false
google/sample-sql-translator
sql_parser/types.py
1
4525
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
-8,111,827,420,861,777,000
23.459459
78
0.554475
false
3.983275
false
false
false
charleszheng44/root_diff
sample_root_files/gen_sample_ROOT.py
1
1670
#! /usr/bin/env python import sys import argparse import numpy as np import ROOT def create(file, dir, label, shift, scale, mode): file.cd(dir) x = np.zeros(1, dtype=float) hist = ROOT.TH1F('hist_{}'.format(label), 'histogram of {}'.format(label), 100, -1.5, 1.5) tree = ROOT.TTree('tree_{}'.format(la...
gpl-3.0
6,567,517,082,526,121,000
29.363636
104
0.57006
false
3.211538
false
false
false
unioslo/cerebrum
Cerebrum/modules/LDIFutils.py
1
14011
# -*- coding: utf-8 -*- # Copyright 2004-2012 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (...
gpl-2.0
3,460,341,395,105,458,000
36.063492
79
0.631834
false
3.613619
false
false
false
dahlia/libsass-python
build_manylinux_wheels.py
1
1563
#!/usr/bin/env python3.5 """Script for building 'manylinux' wheels for libsass. Run me after putting the source distribution on pypi. See: https://www.python.org/dev/peps/pep-0513/ """ import os import pipes import subprocess import tempfile from twine.commands import upload def check_call(*cmd): print( ...
mit
-6,958,300,883,167,984,000
29.647059
78
0.536788
false
3.51236
false
false
false
IBMDecisionOptimization/docplex-examples
examples/cp/basic/plant_location_with_starting_point.py
1
5030
# -------------------------------------------------------------------------- # Source file provided under Apache License, Version 2.0, January 2004, # http://www.apache.org/licenses/ # (c) Copyright IBM Corp. 2015, 2016 # -------------------------------------------------------------------------- """ A ship-building co...
apache-2.0
346,185,155,350,376,300
39.24
95
0.623062
false
3.810606
false
false
false
fabio-otsuka/invesalius3
invesalius/gui/data_notebook.py
1
47515
#!/usr/bin/env python # -*- coding: UTF-8 -*- #-------------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: ...
gpl-2.0
-4,529,350,853,687,096,000
35.048558
90
0.556933
false
3.866222
false
false
false
jiomaster/skydown-telegram-bot
utils/names.py
1
14255
import re import random def antimat(name): name = re.sub(r'Хуяр', "Фигар", name) name = re.sub(r'хуяр', "фигар", name) name = re.sub(r'(По(\s|)ху(й|я|ям|ю)($|.|\s|,|\?|!)|До пизды)', random.choice(["Неважно", "Индифферентно", "Безразлично", "Всё равно"]), name) name = re.sub(r'(по(\s|)ху(й|я|ям|ю)($|.|\s|,|\?|!)|д...
gpl-3.0
-4,068,053,675,537,392,600
72.452703
170
0.598565
false
1.573227
false
false
false
mscuthbert/abjad
abjad/tools/documentationtools/GraphvizNode.py
1
3704
# -*- encoding: utf-8 -*- from abjad.tools.datastructuretools import TreeContainer from abjad.tools.documentationtools.GraphvizMixin import GraphvizMixin class GraphvizNode(GraphvizMixin, TreeContainer): r'''A Graphviz node. ''' ### CLASS VARIABLES ### __documentation_section__ = 'Graphviz' __s...
gpl-3.0
-3,746,444,903,456,188,000
26.043796
75
0.562635
false
4.578492
false
false
false
hevalberknevruz/oclapi
django-nonrel/ocl/mappings/views.py
4
15934
from django.core.exceptions import ValidationError from django.db.models import Q from django.http import HttpResponse from rest_framework import mixins, status from rest_framework.generics import RetrieveAPIView, ListAPIView, CreateAPIView, UpdateAPIView, DestroyAPIView from rest_framework.response import Response fro...
mpl-2.0
3,712,721,112,762,154,000
49.264984
203
0.659282
false
4.053422
false
false
false
pipermerriam/populus
populus/contracts/contract.py
1
1428
from __future__ import absolute_import from eth_utils import ( to_dict, ) from web3.contract import ( Contract, ) from populus.utils.contracts import ( is_project_contract, is_test_contract, ) from populus.utils.functional import ( to_object, ) class PopulusContract(Contract): populus_meta ...
mit
-4,957,234,052,237,950,000
20
80
0.636555
false
3.383886
false
false
false
NightscoutFoundation/dataxfer
oh_data_source/tasks.py
1
6446
""" A template for an asynchronous task that updates data in Open Humans. This example task: 1. deletes any current files in OH if they match the planned upload filename 2. adds a data file """ from __future__ import absolute_import import json import logging import os import shutil import tempfile import textwra...
gpl-3.0
-7,986,075,750,912,579,000
35.011173
79
0.661961
false
3.428723
false
false
false
caperren/Archives
OSU Coursework/ROB 421 - Applied Robotics/software/ros_packages/denso_ground_station/src/Framework/ArmControlSystems/ArmControlSender.py
1
3253
##################################### # Imports ##################################### # Python native imports from PyQt5 import QtCore, QtWidgets from time import time import rospy from std_msgs.msg import Float32MultiArray ##################################### # Global Variables #####################################...
gpl-3.0
5,810,593,009,784,105,000
30.582524
112
0.519828
false
3.924005
false
false
false
cpn18/track-chart
desktop/01_csv_to_json.py
1
3107
#!/usr/bin/env python3 """ Convert CSV file to JSON """ import json import sys import datetime import math AA = 0.03 # Complementary filter constant M_PI = 3.14159265358979323846 def parse_time(time_string): """ Parse Time Field """ return datetime.datetime.strptime(time_string, "%Y-%m-%dT%H:%M:%S.%fZ") if l...
gpl-3.0
2,630,024,181,377,057,300
27.245455
104
0.575797
false
2.78405
false
false
false
luisza/dfva_client
src/client_fva/monitor_pyscard.py
1
6590
import logging import time from PyQt5.QtCore import QMutex, QObject, QRunnable, pyqtSignal, pyqtSlot from client_fva import signals from client_fva.pkcs11client import PKCS11Client, SlotNotFound from client_fva.session_storage import SessionStorage from client_fva.user_settings import UserSettings from smartcard.Card...
gpl-3.0
-8,096,838,508,920,525,000
36.414773
118
0.618071
false
3.993329
false
false
false
vinicius-ronconi/bitcoin-trading-system
trading_system/api/bitfinex/tests/accounts_test.py
1
1790
import mock from unittest import TestCase from trading_system import consts from trading_system.api.bitfinex.accounts import BitfinexAccountApi from trading_system.api.beans import Balance from trading_system.api.bitfinex.clients import BitfinexClient class BitfinexAccountApiTestCase(TestCase): accounts = None ...
gpl-3.0
-2,839,952,228,025,857,000
30.964286
107
0.543017
false
3.698347
false
false
false
linkitspa/l10n-italy
l10n_it_ddt/models/partner.py
1
1799
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Apulia Software s.r.l. (http://www.apuliasoftware.it) # @author Francesco Apruzzese <f.apruzzese@apuliasoftware.it> # # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)...
agpl-3.0
-8,189,077,216,961,346,000
39.886364
78
0.601445
false
3.91939
false
false
false
schleichdi2/OPENNFR-6.1-CORE
opennfr-openembedded-core/scripts/lib/wic/plugins/source/rawcopy.py
1
2360
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope t...
gpl-2.0
1,333,563,116,050,342
33.202899
86
0.641949
false
3.746032
false
false
false
uditagarwal/tastypie
tests/related_resource/tests.py
1
23682
import django from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase from django.utils import simplejson as json from django.core.urlresolvers import reverse from core.models import Note, MediaBit from core.tests.resources import HttpRequest from core.tests.mocks i...
bsd-3-clause
-5,347,889,038,460,374,000
36.235849
291
0.59484
false
3.806172
true
false
false
katajakasa/audiostash
audiostash/webui/sockethandler.py
1
10576
# -*- coding: utf-8 -*- import json import logging from passlib.hash import pbkdf2_sha256 from audiostash.common.tables import \ session_get, Artist, Album, Playlist, PlaylistItem, Track, Setting, Session, User from audiostash.common.utils import generate_session, to_isodate, from_isodate, utc_now, utc_minus_delt...
gpl-3.0
4,458,052,905,825,119,000
32.468354
110
0.524395
false
4.137715
false
false
false
softctrl/udacity-nano-degree
deep-learning/week01/linear_regression_live/demo.py
1
1467
from numpy import * def step_gradient(b_current, m_current, points, learningRate): b_gradient = 0 m_gradient = 0 N = float(len(points)) for i in range(0, len(points)): x = points[i, 0] y = points[i, 1] b_gradient += -(2/N) * (y - ((m_current* x) + b_current)) m_gradient...
lgpl-3.0
-5,755,734,775,824,870,000
22.285714
97
0.579414
false
3.075472
false
false
false
ESS-LLP/erpnext-healthcare
erpnext/manufacturing/report/production_analytics/production_analytics.py
12
4568
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _, scrub from frappe.utils import getdate from erpnext.stock.report.stock_analytics.stock_analytics import (get_period_date_ran...
gpl-3.0
-3,396,043,446,235,539,500
29.251656
126
0.677539
false
3.101154
false
false
false
mmariani/dream
dream/simulation/Examples/DecompositionOfBatches.py
1
2085
from dream.simulation.imports import Machine, BatchSource, Exit, Batch, BatchDecomposition, Queue, G from dream.simulation.imports import simulate, activate, initialize # define the objects of the model S=BatchSource('S','Source',interarrivalTime={'distributionType':'Fixed','mean':0.5}, entity='Dream.Batch', batchNum...
gpl-3.0
4,076,489,248,911,386,600
41.55102
128
0.701199
false
3.498322
false
false
false
Chris7/cutadapt
cutadapt/scripts/cutadapt.py
1
32305
#!/usr/bin/env python # -*- coding: utf-8 -*- # kate: word-wrap off; remove-trailing-spaces all; # # Copyright (c) 2010-2015 Marcel Martin <marcel.martin@scilifelab.se> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software")...
mit
8,060,625,208,683,926,000
44.245098
138
0.722984
false
3.371777
false
false
false
ashutoshvt/psi4
psi4/driver/qcdb/basislistother.py
1
31800
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2021 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
-1,946,457,507,460,898,300
43.228095
80
0.683145
false
2.251009
false
false
false
oculusstorystudio/kraken
Python/kraken/ui/HAppkit_Editors/editor_widgets/filepath_editor.py
1
3592
import os.path from kraken.ui.Qt import QtWidgets, QtGui, QtCore from ..fe import FE from ..widget_factory import EditorFactory from ..base_editor import BaseValueEditor class FilepathEditor(BaseValueEditor): def __init__(self, valueController, parent=None): super(FilepathEditor, self).__init__(valueCo...
bsd-3-clause
-784,943,267,346,541,300
32.259259
160
0.599388
false
4.418204
false
false
false
TakeshiTseng/SDN-Work
MultiControl/ms/SlaveApp.py
1
3354
''' Slave App, testing for slave controller ''' # -*- encoding: utf-8 -*- # file: MasterApp.py from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import MAIN_DISPATCHER from ryu.controller.handler import HANDSHAKE_DISPATCHER from ryu.controller.handler import CONFIG_DISPA...
mit
1,961,674,834,291,787,500
30.641509
78
0.608527
false
3.508368
false
false
false
kg-bot/SupyBot
plugins/Gateway/gwpickle.py
1
1027
from gwssh import * from twisted.python import components import cPickle as Pickle from twisted.conch.ssh import session class PickleProtocol(SBProtocol): def write_prompt(self): pass class PickleTunnelSession(SshTunnelSession): WRAPPROTOCOL = PickleProtocol class PickleSession(ShellSession): ISESSION...
gpl-3.0
2,650,832,833,163,725,000
23.452381
60
0.692308
false
3.803704
false
false
false
fluidinfo/Tickery
tickery/consumer.py
1
1311
# Copyright 2010 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
-4,578,498,623,851,251,000
35.416667
69
0.694127
false
3.662011
false
false
false
demonchild2112/travis-test
grr/core/grr_response_core/lib/parsers/chrome_history.py
1
4569
#!/usr/bin/env python """Parser for Google chrome/chromium History files.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import itertools from future.moves.urllib import parse as urlparse from past.builtins import...
apache-2.0
-1,982,207,169,507,504,600
37.075
79
0.654629
false
4.116216
false
false
false
aquamatt/RedFlash
apps/squawk/gateway/__init__.py
1
1397
# Copyright (c) 2010 the RedFlash project contributors # All Rights Reserved # See LICENSE for details """ SMS gateway implementations """ from squawk.gateway.tweet import TwitterGateway from squawk.gateway.email import EmailGateway from squawk.gateway.webhook import WebhookGateway # needed for settings.SMS_GATEWAY to ...
bsd-3-clause
-2,395,362,914,888,395,000
33.073171
61
0.728704
false
3.869806
false
false
false
synergeticsedx/deployment-wipro
common/djangoapps/student/admin.py
9
6562
""" Django admin pages for student app """ from django import forms from django.contrib.auth import get_user_model from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.utils.translation import ugettext_lazy as _ from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey f...
agpl-3.0
-6,168,975,046,910,989,000
33.177083
115
0.64843
false
4.26658
true
false
false
Obijuan/simplez-fpga
toolchain-simplez/sboot.py
1
7418
#!/usr/bin/python3 # coding=utf-8 # ------------------------------------------------------------------------------ # - Cargador de programas en SIMPLEZ # -- (C) BQ Enero 2016. Written by Juan Gonzalez (obijuan) # -- Python 3 # ------------------------------------------------------------------------------ # - La FPGA...
gpl-2.0
1,609,310,918,916,763,000
27.178707
81
0.568749
false
3.557849
true
false
false
rochacbruno/python-pagseguro
pagseguro/config.py
1
2719
# -*- coding: utf-8 -*- class Config(dict): def __init__(self, **kwargs): sandbox = kwargs.pop('sandbox', False) base_url = 'https://ws.pagseguro.uol.com.br' payment_host = 'https://pagseguro.uol.com.br' if sandbox: base_url = 'https://ws.sandbox.pagseguro.uol.com.br' ...
mit
-3,666,528,465,403,952,000
42.854839
79
0.559029
false
3.895415
false
false
false
hsr-ba-fs15-dat/opendatahub
src/main/python/hub/formats/geopackage.py
1
1605
# -*- coding: utf-8 -*- from __future__ import unicode_literals import geopandas as gp import os from hub.formats.core import Format, Parser from hub.formats.geobase import GeoFormatterBase from hub.utils import ogr2ogr if 'GPKG' in ogr2ogr.SUPPORTED_DRIVERS: class GeoPackage(Format): label = 'GeoPackage...
mit
7,274,332,460,250,548,000
34.644444
115
0.634663
false
4
false
false
false