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
userzimmermann/robotframework-tools
robotshell/extension.py
1
2404
# 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
6,982,898,271,881,108,000
30.631579
78
0.660566
false
3.797788
false
false
false
reza-arjmandi/rpi-course
session7/HCSR04_GUI.py
1
1607
###################################################################### # HCSR04_GUI.py # # This program read HCSR04 sensor data and print on a label in GUI ###################################################################### from Tkinter import * import RPi.GPIO as GPIO import time trigPin = 18 echoPin = 23 ...
mit
7,610,055,474,746,990,000
24.507937
79
0.584941
false
3.501089
false
false
false
alshedivat/tensorflow
tensorflow/python/autograph/converters/call_trees.py
1
12664
# 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 applica...
apache-2.0
-5,008,266,975,303,155,000
35.495677
80
0.655638
false
3.887047
false
false
false
pantheon-systems/etl-framework
etl_framework/transformer_mixins/FieldMappingsMixin.py
1
1633
"""parses configuration and returns useful things""" #pylint: disable=relative-import from etl_framework.utilities.DataTable import DataRow from functools import reduce class FieldMappingsMixin(object): """stuff""" def map_fields(self, row): """stuff""" mapped_row = DataRow() for tra...
mit
8,308,739,289,440,713,000
31.019608
106
0.590937
false
3.963592
true
false
false
Deltares/aqua-monitor
app/ee/data.py
1
24941
#!/usr/bin/env python """Singleton for the library's communication with the Earth Engine API.""" from __future__ import print_function # Using lowercase function naming to match the JavaScript names. # pylint: disable=g-bad-name # pylint: disable=g-bad-import-order import contextlib import json import time import...
lgpl-3.0
-5,770,114,813,001,985,000
30.254386
80
0.666172
false
3.927717
false
false
false
recognant/labyrinth
actor.py
1
9688
import pygame from const import * from vector import Vector2 as Vec2 import random class Way(list): def __init__(self, d_in = 0, d_out = 0, *args, **kwargs): super(Way, self).__init__(*args, **kwargs) super(Way, self).append(d_in) super(Way, self).append(d_out) def append(...
apache-2.0
-3,161,642,536,057,716,000
24.836565
132
0.51796
false
3.709035
false
false
false
vivek8943/clipasswordmgr
clipwdmgr.py
1
38173
#!/usr/bin/env python3 #CLI Password Manager # #The MIT License (MIT) # #Copyright (c) 2015 Sami Salkosuo # #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 withou...
mit
1,841,456,328,685,494,500
30.731505
211
0.620334
false
3.843048
true
false
false
tensorflow/datasets
tensorflow_datasets/core/download/util.py
1
1841
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets 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 appl...
apache-2.0
8,859,040,855,256,509,000
31.298246
77
0.666486
false
3.875789
false
false
false
Toto-Azero/Wikipedia
pywikibot/translation.py
1
22942
#!/usr/bin/python # -*- coding: utf-8 -*- import _errorhandler import pywikibot from pywikibot import catlib, config, pagegenerators import codecs, re, _mysql def projectsort(item): return item[1] def capitalizefirst(string): return string[0:1].capitalize()+string[1:] def checkproject(project): #pywiki...
gpl-3.0
3,085,296,272,230,131,000
43.467961
307
0.527925
false
4.179015
false
false
false
Aeolitus/Sephrasto
Einstellungen.py
1
12514
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Einstellungen.ui' # # Created by: PyQt5 UI code generator 5.12.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_SettingsWindow(object): def setupUi(self, SettingsWindow): ...
mit
4,182,285,861,560,731,000
56.091324
116
0.720307
false
3.904747
false
false
false
WuPeiqi/Tyrion
Tyrion/Framework.py
1
5201
#!/usr/bin/env python # -*- coding:utf-8 -*- class FrameworkFactory(object): __framework = None @staticmethod def set_framework(framework): FrameworkFactory.__framework = framework @staticmethod def get_framework(): return FrameworkFactory.__framework class BaseFramework(object...
mit
10,751,413,017,320,750
28.116129
98
0.590738
false
3.078445
false
false
false
JanMalte/secondhandshop_server
src/sale_lists/views.py
1
5927
""" Second-Hand-Shop Project @author: Malte Gerth @copyright: Copyright (C) 2015 Malte Gerth @license: MIT @maintainer: Malte Gerth @email: mail@malte-gerth.de """ import re from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.sites.shortcuts ...
mit
-1,117,264,560,456,724,200
32.868571
106
0.676227
false
3.616229
false
false
false
D4N/FSM_exercise_class
sheet_3/plotter.py
1
6554
#-*- coding: utf-8 -*- from __future__ import division, print_function import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from mpl_toolkits.mplot3d import Axes3D class simulation_output(object): def __init__(self, filename, update_scale_time = 0, frame_rate = 25): """ ...
gpl-3.0
-9,105,008,208,255,139,000
29.202765
223
0.665395
false
2.932438
false
false
false
open-mmlab/mmdetection
mmdet/models/roi_heads/mask_heads/fused_semantic_head.py
1
3654
import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmcv.runner import BaseModule, auto_fp16, force_fp32 from mmdet.models.builder import HEADS @HEADS.register_module() class FusedSemanticHead(BaseModule): r"""Multi-level fused semantic segmentation head. .. code-block...
apache-2.0
-7,011,683,878,066,828,000
33.471698
79
0.504926
false
3.782609
false
false
false
Olamyy/Norman
Norman/auth/auth_utils.py
1
8975
from flask import session from flask_login import UserMixin from mongoengine import DoesNotExist from Norman.models import Hospital, Service, UserModel, Notification class HospitalUtil(UserMixin): def __init__(self, email=None, password=None, active=True, name=None, hospital_id=None): self.hospital_id = ...
bsd-3-clause
6,741,381,003,260,036,000
29.423729
109
0.558663
false
4.048263
false
false
false
HouCoder/gfwlist2dnsmasq
main.py
1
7983
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import urllib2 import base64 import json import urlparse import time from datetime import datetime from argparse import ArgumentParser def prepareLog(): global logFile logFilePath = scriptPath + '/gfwlist2dnsmasq.log' # The maximum log file si...
mit
4,605,791,889,444,358,000
26.153061
113
0.577602
false
3.92285
true
false
false
shapiromatron/comp523-medcosts
myuser/migrations/0001_initial.py
1
5916
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'MyUser' db.create_table(u'myuser_myuser', ( (...
mit
3,541,253,343,062,683,000
61.946809
194
0.590602
false
3.54889
false
false
false
beerbauf/Arduino-SC-Interface
src/SerialComunication.py
1
1152
''' Project: Arduino SC Interface - A GUI for Arduino serial comunication @author: Andrea Cirillo <sabageek.blogspot.com> @copyright: 2012 Andrea Cirillo @license: GPL-3 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as p...
gpl-3.0
-1,759,320,303,434,931,000
36.16129
73
0.674479
false
3.931741
false
false
false
rcbops/opencenter
test_runner.py
1
1644
#!/usr/bin/env python # OpenCenter(TM) is Copyright 2013 by Rackspace US, Inc. ############################################################################## # # OpenCenter is licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
apache-2.0
1,708,167,434,486,365,700
44.666667
79
0.658759
false
4.592179
true
false
false
nmc-probe/emulab-nome
protogeni/tutorial/renewsliver.py
1
2822
#! /usr/bin/env python # # Copyright (c) 2008-2010 University of Utah and the Flux Group. # # {{{GENIPUBLIC-LICENSE # # GENI Public License # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without rest...
agpl-3.0
-318,512,706,140,984,800
25.87619
75
0.716867
false
3.46683
false
false
false
hughperkins/pub-prototyping
py/reinf/test_reinf_v.py
1
5046
import gym import time import torch from torch import nn, autograd, optim import torch.nn.functional as F import numpy as np num_hidden = 4 print_every = 100 max_steps_per_episode = 2000 class ValueEstimator(nn.Module): def __init__(self, num_obs_features): super().__init__() # self.num_actions ...
apache-2.0
6,365,818,098,006,529,000
33.326531
130
0.585811
false
3.274497
false
false
false
tylertian/Openstack
openstack F/glance/glance/openstack/common/notifier/rabbit_notifier.py
1
1709
# Copyright 2011 OpenStack LLC. # 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 b...
apache-2.0
525,624,503,401,135,170
36.152174
78
0.689292
false
4.20936
false
false
false
fbradyirl/home-assistant
tests/components/zha/test_binary_sensor.py
1
3632
"""Test zha binary sensor.""" from homeassistant.components.binary_sensor import DOMAIN from homeassistant.const import STATE_ON, STATE_OFF, STATE_UNAVAILABLE from .common import ( async_init_zigpy_device, make_attribute, make_entity_id, async_test_device_join, async_enable_traffic, ) async def te...
apache-2.0
3,171,818,375,154,899,500
36.061224
88
0.699064
false
3.341306
true
false
false
zentner-kyle/Wick
src/unicode_gen.py
1
7466
#!/usr/bin/env python2 from __future__ import print_function from collections import namedtuple Node = namedtuple('Node', ['color', 'left', 'right', 'low', 'high', 'key']) def mid(node): return (node.high + node.low) / 2.0 def makeRed(node): return Node('red', node.left, node.right, node.low, node.high, node...
bsd-2-clause
7,388,996,896,315,531,000
27.280303
79
0.537637
false
3.283201
false
false
false
ict-felix/stack
modules/resource/orchestrator/src/policies/Condition.py
1
7996
import os import sys import time ''' @author: msune,cbermudo,omoya @organization: i2CAT, OFELIA FP7 PolicyEngine Condition class Encapsulates logic of a simple condition ''' '''Supported operators''' _collectionOperators= ["in"] _logicalOperators = ["&&","||"] _rangeOperators = ["[]","{}"] _comparisonOp...
apache-2.0
5,398,023,581,808,564,000
32.041322
137
0.694472
false
3.465973
false
false
false
blindsightcorp/rigor
test/test_interop.py
1
6172
import os import json import constants import shutil import db from s3 import setup_module, teardown_module from datetime import datetime from urlparse import urlsplit from rigor.config import RigorDefaultConfiguration from rigor.database import Database from rigor.utils import RigorJSONEncoder from rigor.interop impor...
bsd-2-clause
3,529,499,778,289,425,400
34.883721
124
0.74757
false
2.997572
true
false
false
phil-el/phetools
ircbot/pyirclogs.py
1
7652
# -*- coding: utf-8 -*- #! /usr/bin/env python import os import sys network = 'irc.freenode.net' port = 8001 nick = 'phe-log-bot' ## Change this, of course. channels = ['#wikisource-fr'] # LOWERCASE ONLY name = 'IRC Log Bot - http://code.google.com/p/pyirclogs/' fd = open(os.path.expanduser('~/password/password-ircb...
gpl-3.0
4,828,586,746,736,997,000
33.264574
175
0.585264
false
3.5375
false
false
false
alshedivat/kgp
kgp/layers.py
1
4685
"""Gaussian Process layers for Keras.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from keras.engine import InputSpec from keras.engine import Layer # Backend for neural networks from keras import backend as K # Backend for Gauss...
mit
4,574,885,584,515,342,000
29.225806
78
0.581003
false
3.865512
false
false
false
grnet/e-science
webapp/backend/okeanos_utils.py
1
51272
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script contains useful classes and fuctions for orka package. @author: e-science Dev-team """ import logging import re import subprocess import yaml import urllib import requests from urllib2 import urlopen, Request, HTTPError from base64 import b64encode from os...
agpl-3.0
-6,684,331,800,807,416,000
46.783784
180
0.61125
false
3.840599
false
false
false
badbytes/pymeg
meg/megcontourtap.py
1
2489
# Copyright 2008 Dan Collins # # # This is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # And is distributed in the hope that it will...
gpl-3.0
4,613,817,523,649,966,000
28.630952
102
0.671756
false
3.14665
false
false
false
jhroot/elife-bot
provider/lax_provider.py
1
5276
import requests import time from . import article import base64 import json from dateutil.parser import parse import log import os identity = "process_%s" % os.getpid() logger = log.logger("lax_provider.log", 'INFO', identity) class ErrorCallingLaxException(Exception): pass def article_versions(article_id, set...
mit
7,022,034,902,476,248,000
34.173333
142
0.637036
false
3.681786
false
false
false
bbcrd/bbc-reith-lectures-sphinx-evaluation
transcriber.py
1
2554
# Copyright (c) 2011 British Broadcasting Corporation # # 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
2,010,383,633,793,847,000
38.90625
139
0.659358
false
3.755882
false
false
false
nilgradisnik/coinprice-indicator
coin/exchanges/gemini.py
1
1470
# Gemini # https://docs.gemini.com/rest-api/ # By Rick Ramstetter <rick@anteaterllc.com> from exchange import Exchange, CURRENCY class Gemini(Exchange): name = "Gemini" code = "gemini" ticker = "https://api.gemini.com/v1/pubticker/" discovery = "https://api.gemini.com/v1/symbols" default_label ...
mit
-312,363,369,501,915,970
24.344828
114
0.511565
false
3.75
false
false
false
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/misc/font_indexing.py
1
1392
""" ============= Font Indexing ============= A little example that shows how the various indexing into the font tables relate to one another. Mainly for mpl developers.... """ from __future__ import print_function import matplotlib from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, KERNING_UNFITTED, KERNING_U...
mit
-7,733,947,046,590,591,000
30.636364
91
0.679598
false
2.784
false
false
false
felipenaselva/felipe.repository
script.module.placenta/lib/resources/lib/sources/de/cinenator.py
1
5655
# -*- coding: UTF-8 -*- ####################################################################### # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # @tantrumdev wrote this file. As long as you retain this notice you # can do whatever you want wit...
gpl-2.0
-3,906,013,265,237,504,000
39.978261
175
0.50893
false
3.565574
false
false
false
IntersectTechnologies/inetbfa-data-conversion
datamanager/utils.py
1
1652
# -*- coding: utf-8 -*- """ Created on Fri Aug 15 14:37:02 2014 @author: Niel """ from os import path, listdir, remove import pandas as pd import datetime as dt import calendar as cal import sys def last_dayof_prev_month(year, month): if (month == 1): month = 12 year = year - 1 return last...
apache-2.0
2,971,275,800,519,223,300
24.828125
74
0.565981
false
3.797701
false
false
false
FR4NK-W/osourced-scion
python/lib/crypto/trc.py
1
14435
# Copyright 2014 ETH Zurich # # 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, sof...
apache-2.0
8,138,152,835,999,217,000
36.782723
96
0.59849
false
3.584058
false
false
false
alephu5/Soundbyte
environment/lib/python3.3/site-packages/matplotlib/testing/jpl_units/UnitDblConverter.py
1
5415
#=========================================================================== # # UnitDblConverter # #=========================================================================== """UnitDblConverter module containing class UnitDblConverter.""" #==========================================================================...
gpl-3.0
-2,627,695,189,698,850,000
33.490446
80
0.546076
false
4.527592
false
false
false
gramps-project/addons-source
HouseTimelineGramplet/housetimeline.py
1
9110
# Copyright (C) 2018 Andrew Vitu <a.p.vitu@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This ...
gpl-2.0
-5,601,325,753,480,000,000
43.54
120
0.511309
false
3.917419
false
false
false
sfllaw/django-litetest
setup.py
1
1171
#!/usr/bin/env python from setuptools import setup import django_litetest setup( name='django-litetest', version=django_litetest.__version__, description='A lightweight Django "test" command for quick unittest runs.', long_description=open('README.rst').read(), license='Apache Software License, ...
apache-2.0
4,952,601,101,408,334,000
29.025641
79
0.631939
false
4.227437
true
false
false
HydrelioxGitHub/home-assistant
homeassistant/components/group/__init__.py
1
19174
"""Provide the functionality to group entities.""" import asyncio import logging import voluptuous as vol from homeassistant import core as ha from homeassistant.const import ( ATTR_ENTITY_ID, CONF_ICON, CONF_NAME, STATE_CLOSED, STATE_HOME, STATE_NOT_HOME, STATE_OFF, STATE_ON, STATE_OPEN, STATE_LOCKED, ST...
apache-2.0
3,960,676,092,577,221,600
30.640264
79
0.587462
false
4.028998
true
false
false
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/network/cmd/netmap/type_Result.py
1
12090
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: type_Result.py from types import * import array import mcl.object.MclTime RESULT_TYPE_ERROR = 0 RESULT_TYPE_DATA = 1 RESULT_MAX_ADDRS = 64 RESULT_FLA...
unlicense
-9,010,897,813,781,819,000
39.847973
97
0.60794
false
3.544415
false
false
false
joetainment/mmmmtools
MmmmToolsMod/Dynamic/QuickMenus.py
1
7596
import pymel.all as pm import traceback from collections import namedtuple as NamedTuple class Duck(object): pass class MmmmQuickMenus( object ): ## __init__ runs as soon as we start the cube maker ## we almost always put a reference to self in ## def __init__(self): self.setupNamedTuple...
gpl-3.0
-1,190,832,412,831,129,900
33.684932
110
0.490521
false
3.7999
false
false
false
ggm/vm-for-transfer
src/vm/debugger.py
1
9764
#Copyright (C) 2011 Gabriel Gregori Manzano # #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License #as published by the Free Software Foundation; either version 2 #of the License, or (at your option) any later version. # #This program is distribute...
gpl-2.0
4,041,804,155,798,921,700
37.140625
80
0.563396
false
4.288098
false
false
false
Urokhtor/Naga-Automation-Suite
Naga Automation Suite/Controllers/ClientManagementFormController.py
1
2415
__author__ = 'Urokhtor' from Controllers.FormController import FormController from Tools.JSONFrontEndTool import JSONFrontEndTool as JFET from Tools.FrontEndElementTool import FrontEndElementTool as FEET from Tools.TypeMapper import TypeMapper import json class ClientManagementFormController(FormController): de...
gpl-3.0
1,957,212,803,306,506,200
33.514286
106
0.617391
false
4.135274
false
false
false
jjgomera/pychemqt
equipment/UI_dryer.py
1
7241
#!/usr/bin/python3 # -*- coding: utf-8 -*- '''Pychemqt, Chemical Engineering Process simulator Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Softwar...
gpl-3.0
-2,539,565,406,779,968,000
46.625
160
0.661555
false
3.328276
false
false
false
legoktm/pywikipedia-rewrite
scripts/i18n/thirdparty.py
1
151330
# -*- coding: utf-8 -*- msg = { # Author: DrTrigon 'en': { 'thirdparty-drtrigonbot-subster-summary-mod': u'substituting %(tags)s tag(s)', 'thirdparty-drtrigonbot-sum_disc-notify-changed': u'Discussion changed', 'thirdparty-drtrigonbot-sum_disc-notify-closed': u'Discussion closed', 'thirdparty-drtrigonbot-sum_...
mit
-8,332,957,912,028,772,000
75.948285
298
0.71548
false
2.069302
false
false
false
cs360f14/PythonTicTacToe-Group-3
main.py
1
1223
#!/usr/bin/python3 ########################################## # File Name:main.py # Author:Group 3 # Date:10/24/14 # Class:360 # Assignment:Tic-Tac-Toe # Purpose:to run the game ######################################## from game import * """ The Main Module """ def main() : """"initiliaze a new game and set the name...
gpl-2.0
1,159,024,401,130,978,000
19.383333
64
0.58381
false
3.160207
false
false
false
discolabs/django-shopify-auth
shopify_auth/decorators.py
1
2485
from functools import wraps from django.contrib.auth.decorators import user_passes_test from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.encoding import force_str from django.shortcuts import resolve_url from django.contrib.auth.decorators import login_required as...
mit
4,269,803,243,485,444,000
36.651515
120
0.688934
false
4.211864
false
false
false
perrys/WSRC
modules/wsrc/site/usermodel/migrations/0003_auto_20180331_1836.py
1
2488
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import wsrc.site.usermodel.models import uuid class Migration(migrations.Migration): dependencies = [ ('usermodel', '0002_auto_20180328_2346'), ] operations = [ migrations.AlterField...
gpl-2.0
-3,300,317,913,412,520,000
47.784314
323
0.643891
false
3.857364
false
false
false
datakortet/dk
dk/collections/pset.py
1
11934
# -*- coding: utf-8 -*- """Mapping classes. """ from __future__ import absolute_import import sys from collections import namedtuple import six try: unicode except NameError: unicode = str keyval = namedtuple('keyval', 'key val') def xmlrepr(v, toplevel=False): "Return ``v`` as xml tag-soup." if top...
lgpl-3.0
-4,299,093,135,906,139,000
27.014085
93
0.471091
false
3.963467
false
false
false
klpdotorg/dubdubdub
apps/reports/api_views/base_report.py
1
1441
from django.db.models import Count from rest_framework.exceptions import ParseError class BaseReport(): # Throws error if mandatory parameters are missing def check_mandatory_params(self, mandatoryparams): for params in mandatoryparams: if not self.request.GET.get(params): ...
mit
9,000,407,102,508,824,000
39.027778
84
0.594032
false
4.188953
false
false
false
jriehl/numba
numba/typing/context.py
1
22760
from __future__ import print_function, absolute_import from collections import defaultdict import types as pytypes import weakref import threading import contextlib import operator import numba from numba import types, errors from numba.typeconv import Conversion, rules from . import templates from .typeof import typ...
bsd-2-clause
-7,943,050,927,494,061,000
32.519882
81
0.562742
false
4.397218
false
false
false
gaufung/LMDI
PDA_Industry/config.py
1
2422
# -*- coding:utf-8 -*- # 转换系数 from __future__ import unicode_literals import sys, os pwd = sys.path[0] # 获取当前执行脚本的位置 os.path.abspath(os.path.join(pwd, os.pardir,'Data')) # -*- coding:utf-8 -*- ''' global variables ''' XLXS_FILE_PATH = os.path.abspath(os.path.join(pwd, os.pardir, 'Data', 'New_Industry.xlsx')) CO2_FI...
mit
3,982,635,180,171,503,000
17.738739
92
0.544231
false
1.566265
false
false
false
gingerpayments/python-libmt94x
libmt94x/fields.py
1
13373
from datetime import datetime from decimal import Decimal from libmt94x.currency_codes import CurrencyCodes from libmt94x.info_acct_owner_subfields import BeneficiaryParty from libmt94x.info_acct_owner_subfields import BusinessPurpose from libmt94x.info_acct_owner_subfields import Charges from libmt94x.info_acct_owner...
mit
-4,353,080,820,030,533,000
38.448378
96
0.652733
false
3.903386
false
false
false
Starkiller4011/tsat
tsat/core/dtutils.py
1
10446
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ''' ##################################### # ╔╗ ┬ ┬ ┬┌─┐ ╔╦╗┌─┐┌┬┐ # # ╠╩╗│ │ │├┤ ║║│ │ │ # # ╚═╝┴─┘└─┘└─┘ ═╩╝└─┘ ┴ # # ╔═╗┌─┐┌─┐┌┬┐┬ ┬┌─┐┬─┐┌─┐ # # ╚═╗│ │├┤ │ │││├─┤├┬┘├┤ # # ╚═╝└─┘└ ┴ └┴┘┴ ┴┴└─└─┘ # ###...
mit
1,719,196,682,543,416,000
22.031532
87
0.506748
false
3.566795
false
false
false
drnlm/sqlobject
sqlobject/converters.py
1
6450
from array import array import datetime from decimal import Decimal import time import sys from .compat import PY2, buffer_type if PY2: from types import ClassType, InstanceType, NoneType else: # Use suitable aliases for now ClassType = type NoneType = type(None) # This is may not be what we want i...
lgpl-2.1
7,660,381,981,179,258,000
24.697211
72
0.629767
false
3.846154
false
false
false
gkc1000/pyscf
pyscf/fci/direct_nosym.py
1
9431
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
3,228,738,681,889,287,000
37.182186
89
0.545647
false
3.037359
false
false
false
neherlab/pan-genome-analysis
scripts/sf_association.py
1
12701
import os import numpy as np from Bio import Phylo from collections import defaultdict from sf_coreTree_json import Metadata from sf_miscellaneous import write_pickle class PresenceAbsenceAssociation(object): """docstring for Association""" def __init__(self, tree, meta_info): super(PresenceAbsenceAsso...
gpl-3.0
-5,791,073,155,249,446,000
45.185455
182
0.563341
false
3.456995
false
false
false
dodobas/osm-export-tool2
api/pagination.py
1
1654
# -*- coding: utf-8 -*- import logging from rest_framework import status from rest_framework.pagination import PageNumberPagination from rest_framework.response import Response logger = logging.getLogger(__name__) class LinkHeaderPagination(PageNumberPagination): page_size = 10 page_size_query_param = 'pag...
bsd-3-clause
6,938,120,701,165,348,000
40.35
124
0.634825
false
3.556989
false
false
false
rzhxeo/youtube-dl
youtube_dl/downloader/common.py
1
12486
from __future__ import unicode_literals import os import re import sys import time from ..compat import compat_str from ..utils import ( encodeFilename, format_bytes, timeconvert, ) class FileDownloader(object): """File Downloader class. File downloader objects are the ones responsible of downl...
unlicense
-5,629,333,811,756,272,000
34.674286
109
0.58001
false
4.035553
false
false
false
shiyemin/shuttleNet
nets/inception_resnet_v2_rnn.py
1
14688
# 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 ...
gpl-3.0
-8,669,633,150,386,679,000
43.917431
86
0.553105
false
3.35419
false
false
false
xesscorp/skidl
tests/test_index_slicing.py
1
1179
import pytest from skidl import * from .setup_teardown import * def test_index_slicing_1(): mcu = Part("GameteSnapEDA", "STM32F767ZGT6", pin_splitters="/()") mcu.match_pin_regex = False assert len(mcu["FMC_D[0:15]"]) == 16 assert len(mcu["FMC_D[15:0]"]) == 16 mcu.match_pin_regex = True asser...
mit
4,714,295,417,357,989,000
29.230769
69
0.563189
false
2.430928
false
false
false
gobstones/PyGobstones-Lang
pygobstoneslang/__init__.py
1
5169
#!/usr/bin/python # -*- coding: utf-8 -*- import pygobstoneslang.common.utils as utils import pygobstoneslang.common.i18n as i18n from pygobstoneslang.common.tools import tools import pygobstoneslang.lang as lang from pygobstoneslang.lang.gbs_api import GobstonesRun import logging import os import traceback def setup_...
gpl-3.0
-8,808,393,923,438,249,000
30.907407
96
0.579222
false
4.041439
false
false
false
sebastinas/debian-devel-changes-bot
DebianDevelChangesBot/utils/decoding.py
1
2249
# # Debian Changes Bot # Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk> # Copyright (C) 2016 Sebastian Ramacher <sramacher@debian.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Sof...
agpl-3.0
-2,539,398,849,258,368,500
28.592105
76
0.62072
false
3.82483
false
false
false
datapythonista/pandas
pandas/tests/io/formats/style/test_matplotlib.py
2
9261
import numpy as np import pytest from pandas import ( DataFrame, IndexSlice, Series, ) pytest.importorskip("matplotlib") pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture def df(): return DataFrame([[1, 2], [2, 4]], columns=["A", "B"]) @pytest.fixture def st...
bsd-3-clause
647,738,087,284,994,700
34.895349
88
0.524781
false
3.234719
true
false
false
TRex22/Sick-Beard
sickbeard/webserve.py
1
125658
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
-8,613,270,365,925,296,000
36.078182
564
0.568694
false
4.018998
true
false
false
renard/ansible
hacking/build_library/build_ansible/command_plugins/docs_build.py
1
6545
# coding: utf-8 # Copyright: (c) 2020, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import absolute_import, division, print_function import glob import os import os.path import pathlib import shutil from tem...
gpl-3.0
3,483,167,368,328,123,000
38.908537
98
0.607945
false
4.222581
true
false
false
ReiherGroup/OrbitalPerturbation
python/orbitalperturbation/gaussian_perturber.py
1
1692
import sys import time from orbitalperturbation.perturbation_utils import create_backup, command_exists, execute_command class GaussianOrbitalPerturber: executable_name = "gaussian_perturbation" formchk_command = "formchk" unfchk_command = "unfchk" def __init__(self, checkpoint_file): self.c...
lgpl-3.0
2,364,229,849,762,358,300
40.268293
102
0.680851
false
3.654428
false
false
false
solus-project/package-management
pisi/archive.py
1
27754
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2011, TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # #...
gpl-2.0
278,981,859,197,795,650
34.810323
152
0.516052
false
4.110338
false
false
false
Davidrjx/mongoengine
mongoengine/queryset/base.py
1
70878
from __future__ import absolute_import import copy import itertools import operator import pprint import re import warnings from bson import SON, json_util from bson.code import Code import pymongo import pymongo.errors from pymongo.common import validate_read_preference import six from mongoengine import signals fr...
mit
-4,405,141,766,166,476,000
36.52144
124
0.568456
false
4.526632
false
false
false
simon816/Command-Block-Assembly
c_comp/lib/text.py
1
1961
from ..ir import IR from ..types import FunctionType text_stack = [] def head(): return text_stack[-1] def compile_text(text): import json data = json.dumps(text, separators=(',', ':')) return IR.Asm((('CMD tellraw @s ' + data, None, None),)) def begin(visitor, expr): text_stack.append({}) def ...
mit
-5,852,028,969,534,785,000
25.863014
60
0.593575
false
3.404514
false
false
false
kiberpipa/pipa-visualizations
impact-graph/generate-startup-person-graph-json.py
1
3263
#!/usr/bin/python #! -*- encoding: utf-8 -*- import json import csv import bisect import copy """ File Pipeline: Input: CSV file with startups, CSV file with person and where they work. Output: JSON file suitable for d3 consumption. """ STARTUPS_FILE = 'startups.csv' PERSONS_FILE = 'persons.csv' STARTUPS_PERSONS_J...
mit
1,846,561,690,577,533,000
26.191667
127
0.552865
false
3.504834
false
false
false
GrognardsFromHell/TemplePlus
tpdatasrc/tpgamefiles/scr/tpModifiers/sudden_maximize.py
1
2095
from templeplus.pymod import PythonModifier from toee import * import tpdp # Sudden Maximize: Complete Arcane, p. 83 print "Registering Sudden Maximize" def SuddenMaximizeRadial(attachee, args, evt_obj): #Add a checkbox to turn on and off sudden Maximize if there is a carge available, otherwise just don't show it ...
mit
-4,326,233,400,315,059,700
30.742424
114
0.77136
false
2.71022
false
false
false
saraivaufc/askMathPlus
askmath/models/historic/answeredquestionshistoric.py
1
1360
from django.db import models from django.utils import timezone from django.utils.translation import ugettext as _ class AnsweredQuestionsHistoric(models.Model): discipline = models.ForeignKey('Discipline', related_name=_('Discipline'), verbose_name=_(u"Discipline")) lesson = models.ForeignKey('Lesson', relate...
gpl-2.0
-3,386,622,786,128,655,400
35.756757
109
0.671324
false
3.756906
false
false
false
tribut/vdirsyncer
vdirsyncer/repair.py
1
1987
# -*- coding: utf-8 -*- from os.path import basename from . import log from .utils import generate_href, href_safe from .utils.vobject import Item logger = log.get(__name__) def repair_storage(storage): seen_uids = set() all_hrefs = list(storage.list()) for i, (href, _) in enumerate(all_hrefs): ...
mit
-69,967,281,373,662,910
31.048387
74
0.561651
false
4.022267
false
false
false
vyscond/pyfpdf
setup.py
1
2141
#!/usr/bin/env python from distutils.core import setup import os import sys import warnings import subprocess import fpdf package_dir = 'fpdf' # convert the README and format in restructured text (only when registering) long_desc = "" if os.path.exists("README.md"): try: cmd = ['pandoc', '--from=markdow...
lgpl-3.0
5,129,048,606,191,757,000
35.288136
87
0.586642
false
3.979554
false
false
false
mverleg/data_cleaner
view/interface_server.py
1
2518
""" REST JSON API for designing transformation files Based on: * https://mafayyaz.wordpress.com/2013/02/08/writing-simple-http-server-in-python-with-rest-and-json/ """ import threading from http.server import BaseHTTPRequestHandler, HTTPServer from re import search from socketserver import ThreadingMixIn from sys...
mit
1,775,535,109,038,694,000
24.693878
114
0.70691
false
3.052121
false
false
false
sbobovyc/JA-BiA-Tools
src/experimental/resource_editor.py
1
3403
#!/usr/bin/python # treectrl.py import wx class MyPopupMenu(wx.Menu): def __init__(self, parent): super(MyPopupMenu, self).__init__() self.parent = parent mmi = wx.MenuItem(self, wx.NewId(), 'Minimize') self.AppendItem(mmi) self.Bind(wx.EVT_MENU, self.OnMini...
gpl-3.0
8,835,337,202,834,303,000
31.721154
106
0.60094
false
3.159703
false
false
false
jirivrany/riskflow123d-prep
genui/tab/ui_mesh_settings.py
1
11853
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'meshsettings.ui' # # Created: Thu Jan 31 10:54:20 2013 # by: PyQt4 UI code generator 4.9.6 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUt...
gpl-2.0
2,353,792,031,600,109,000
63.85
131
0.690205
false
3.533989
false
false
false
DouglasOrr/Snippets
waystotrain/waystotrain/utility.py
1
1891
import glob import json import os import numpy as np import pandas as pd import torch as T def flat_items(d, prefix): """Recurses through a dict-of-dicts yielding ((key_0..key_n), value).""" if isinstance(d, dict): for k, v in d.items(): yield from flat_items(v, prefix + (k,)) else: ...
mit
4,610,515,737,336,125,400
26.405797
97
0.579588
false
3.260345
false
false
false
moas/carbooking
booking/courses/views.py
1
1417
from django.shortcuts import redirect from django.views.generic import ListView, CreateView, DeleteView, DetailView from django.core.urlresolvers import reverse from .models import Journey from .forms import CreateJourneyForm # Create your views here. class JourneyList(ListView): model = Journey template_...
mit
3,587,014,847,672,163,000
25.240741
77
0.699365
false
3.738786
false
false
false
marmyshev/bug_1117098
openlp/plugins/songs/lib/ewimport.py
1
14242
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
gpl-2.0
1,840,665,590,227,850,500
45.9967
119
0.515941
false
4.146768
false
false
false
ministryofjustice/django-pagedown
setup.py
1
1275
from os import path from setuptools import setup from subprocess import check_call from distutils.command.build import build from setuptools.command.develop import develop def get_submodules(): if path.exists('.git'): check_call(['rm', '-rf', 'pagedown/static/pagedown']) check_call(['rm', '-rf', '...
bsd-3-clause
-6,804,245,791,306,975,000
27.977273
131
0.66902
false
3.455285
false
false
false
pierotofy/WebODM
plugins/test/plugin.py
1
1570
from rest_framework import status from rest_framework.response import Response from app.plugins import PluginBase, Menu, MountPoint, get_current_plugin from app.plugins.views import TaskView from django.shortcuts import render from django import forms class TestForm(forms.Form): testField = forms.CharField(label=...
mpl-2.0
3,674,016,135,094,737,000
29.784314
109
0.618471
false
3.783133
true
false
false
grantbeattie/plugin.video.wsbk
resources/lib/index.py
1
6771
# Copyright (c) 2016 Grant Beattie <xbmc#grantbeattie.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # T...
gpl-3.0
3,053,731,532,987,183,600
32.545918
515
0.638901
false
2.865425
false
false
false
itucsdb1630/itucsdb1630
lightmdb/models/common.py
1
3700
"""Common Classes for App.""" class Database(object): def __init__(self, connection=None): self.connection = connection self.connection.set_session(autocommit=True) @property def cursor(self): return self.connection.cursor() def set(self, connection=None): self.connec...
gpl-3.0
-3,753,687,395,850,354,700
37.947368
86
0.437568
false
4.404762
false
false
false
glaunay/pyproteinsExt
src/pyproteinsExt/tmhmmContainerFactory.py
1
4013
import pyproteinsExt.proteinContainer import re import gzip def parse(inputFile=None): """ Parse tmhmm output to create Container :param inputFile: path to tmhmm output :return: tmhmmContainerFactory.Container """ mainContainer = Container() fnOpen = open t = 'r' if inputFile.ends...
gpl-3.0
-5,290,968,826,839,991,000
31.362903
100
0.590082
false
3.775165
false
false
false
yeleman/snisi
snisi_nutrition/utils.py
1
20898
#!/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 logging from collections import OrderedDict from snisi_core.indicators import Indicator from snisi_core.models.Reporting imp...
mit
8,573,899,714,420,507,000
39.111324
79
0.596516
false
3.167323
false
false
false
tb2010/pynet
Week2/exercise3.py
1
2194
#!/usr/bin/env python ''' Class-based version.... Write a script that connects to the lab pynet-rtr1, logins, and executes the 'show ip int brief' command. ''' import telnetlib import time import socket import sys import getpass TELNET_PORT = 23 TELNET_TIMEOUT = 6 class TelnetConn(object): ''' Telnet connect...
mit
-6,364,653,060,367,881,000
23.931818
90
0.600273
false
3.668896
false
false
false
vizvayu/mod-webui
module/plugins/worldmap/worldmap.py
1
5683
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Mohier Frédéric frederic.mohier@gmail.com # Karfusehr Andreas, frescha@unitedseed.de # This file is part of Shinken. # # Shinken is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
-5,677,495,023,869,295,000
35.184713
244
0.628058
false
3.568467
false
false
false
dokterbob/django-shopkit
shopkit/core/forms.py
1
1726
# Copyright (C) 2010-2011 Mathijs de Bruin <mathijs@mathijsfietst.nl> # # This file is part of django-shopkit. # # django-shopkit is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 2, or (at...
agpl-3.0
6,976,207,177,903,274,000
35.744681
77
0.734647
false
3.967816
false
false
false
cassiobotaro/curso.web2py
blog/controllers/initial.py
1
6224
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Anotações da aula 1: Toda função que apresenta parâmetros não é exposta: Ex: def soma(x, y): return x + y Existe no objeto request variáveis vars, post_vars e get_vars separadas. Utilize redirect('http://www.google.com') para redirecionar para outra págin...
gpl-3.0
4,120,082,052,053,573,000
26.352679
99
0.723845
false
2.94709
false
false
false
10clouds/edx-platform
lms/djangoapps/instructor/views/instructor_dashboard.py
1
31218
""" Instructor Dashboard Views """ import logging import datetime from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey import uuid import pytz from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from django.utils.translation imp...
agpl-3.0
4,105,992,526,861,027,000
45.455357
128
0.669806
false
3.906645
false
false
false
chromium/chromium
infra/config/scripts/tests/branch_integration_test.py
4
3341
#!/usr/bin/env vpython3 # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Integration test for branch.py""" import json import os import subprocess import tempfile import textwrap import unittest INFRA_C...
bsd-3-clause
-485,603,256,700,503,940
31.436893
80
0.590542
false
3.728795
true
false
false
codingsnippets/Gooey
gooey/python_bindings/config_generator.py
1
4680
import os import sys import warnings from gooey.python_bindings import argparse_to_json from gooey.gui.util.quoting import quote from gooey.python_bindings import constants default_layout = { 'widgets': [{ 'type': 'CommandField', 'required': True, 'data': { 'display_name': '...
mit
1,984,267,630,467,011,600
41.738318
109
0.587179
false
3.659109
false
false
false
aquavitae/mongokit-py3
mongokit/grid.py
1
7581
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2011, Nicolas Clairon # 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 abov...
bsd-3-clause
-5,633,691,554,989,407,000
42.32
110
0.611925
false
4.195351
false
false
false
ESOedX/edx-platform
common/djangoapps/track/middleware.py
1
8712
""" This is a middleware layer which keeps a log of all requests made to the server. It is responsible for removing security tokens and similar from such events, and relaying them to the event tracking framework. """ from __future__ import absolute_import import hashlib import hmac import json import logging import ...
agpl-3.0
4,229,338,149,288,374,000
38.067265
113
0.601584
false
4.366917
false
false
false
Impactstory/impactstory-tng
views.py
1
22232
from app import app from app import db from models.orcid import get_orcid_id_from_oauth from models.person import Person from models.person import PersonExistsException from models.person import make_person from models.person import refresh_orcid_info_and_save from models.person import connect_orcid from models.person...
mit
1,711,261,151,352,198,400
31.080808
121
0.634176
false
3.579456
false
false
false
Taapat/enigma2-plugin-youtube
src/YouTubeSearch.py
1
17120
from __future__ import print_function from threading import Thread from json import loads from enigma import ePoint from Screens.ChoiceBox import ChoiceBox from Screens.Screen import Screen from Screens.VirtualKeyBoard import VirtualKeyBoard from Components.config import config, ConfigText, getConfigListEntry from Co...
gpl-2.0
-1,230,178,314,522,452,200
40.756098
107
0.689428
false
3.100888
true
false
false