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
dagurval/bitcoinxt
qa/rpc-tests/test_framework/blocktools.py
1
2919
#!/usr/bin/env python3 # blocktools.py - utilities for manipulating blocks and transactions # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from .mininode import * from .script import CScript, OP_TRUE, OP_CHECKSIG # Create ...
mit
916,628,233,140,671,900
32.94186
83
0.680713
false
3.446281
false
false
false
tivaliy/git-repo
gitrepo/app.py
1
2728
# -*- coding: utf-8 -*- # # Copyright 2016 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 requ...
apache-2.0
720,256,482,255,023,400
34.894737
79
0.580279
false
4.457516
false
false
false
Jianbo-Lab/QuTE
simulations/run_simulations.py
1
1335
import os from experiment import * from plot import * import argparse import numpy as np import os def main(): parser = argparse.ArgumentParser() # Number of replicates. parser.add_argument('--replicate',type = int, default = 1000) # Which experiment to run. parser.add_argument('--experiment',type = str, defau...
mit
-265,919,612,088,449,120
26.8125
67
0.654682
false
2.914847
false
false
false
klmitch/humboldt
tools/state_analyzer/tests/unit/test_dot_util.py
1
1441
import six from six.moves import builtins from state_analyzer import dot_util class TestToFile(object): def test_base(self, mocker): stream = six.StringIO() handle = mocker.MagicMock() handle.__enter__.return_value = stream mock_open = mocker.patch.object(builtins, 'open', return_...
apache-2.0
5,057,986,451,374,456,000
26.711538
78
0.419153
false
4.070621
false
false
false
wackou/pygoo
fabfile.py
1
3780
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re from fabric.api import * from fabric.tasks import Task @task def doctests(): """Run the doctests found in GuessIt classes""" local('nosetests --with-doctest -vv pygoo') class TestTask(Task): name = 'testtask' def __init__(self, testn...
gpl-3.0
3,627,254,110,348,349,400
29
88
0.62381
false
3.603432
true
false
false
orlenko/FBBot
src/FBBot/fbposter/migrations/0001_initial.py
1
5085
# -*- 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 'FacebookStatus' db.create_table(u'fbposter_facebookstatus...
apache-2.0
5,965,538,715,092,091,000
65.921053
195
0.569518
false
3.655643
false
false
false
karlnapf/kameleon-mcmc
kameleon_mcmc/kernel/AutoRegressiveKernel.py
1
4271
""" Copyright (c) 2013-2014 Heiko Strathmann, Dino Sejdinovic All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, this list of ...
bsd-2-clause
6,617,935,056,904,851,000
34.890756
99
0.619293
false
3.547342
false
false
false
yeyanchao/calibre
src/calibre/devices/smart_device_app/driver.py
1
58734
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) ''' Created on 29 Jun 2012 @author: charles ''' import socket, select, json, inspect, os, traceback, time, sys, random import posixpath i...
gpl-3.0
-2,809,088,342,599,964,000
41.40722
114
0.529795
false
4.37074
true
false
false
EnEff-BIM/EnEffBIM-Framework
MapAPI/mapapi/molibs/BuildingSystems/Fluid/Movers/FlowControlled_dp.py
1
3269
# -*- coding: utf-8 -*- """ containes the python class Pump, as well as a function to instantiate classes from the corresponding SimModel instances. """ import mapapi.MapClasses as MapHierarchy import SimTimeSeriesSchedule_Year_Default import SimTimeSeriesSchedule_Week_Daily import SimTimeSeriesSchedule_Day_Interval...
mit
-7,728,023,298,524,273,000
41.454545
118
0.540532
false
4.278796
false
false
false
joyrahman/zerocloud
__init__.py
2
3623
from hashlib import md5 from swift.common.utils import readconf def load_server_conf(conf, sections): server_conf_file = conf.get('__file__', None) if server_conf_file: server_conf = readconf(server_conf_file) for sect in sections: if server_conf.get(sect, None): co...
apache-2.0
5,537,577,837,602,895,000
26.869231
79
0.543748
false
3.670719
false
false
false
jorisroovers/gitlint
qa/shell.py
1
3597
# This code is mostly duplicated from the `gitlint.shell` module. We conciously duplicate this code as to not depend # on gitlint internals for our integration testing framework. import subprocess from qa.utils import USE_SH_LIB, DEFAULT_ENCODING if USE_SH_LIB: from sh import git, echo, gitlint # pylint: disabl...
mit
-8,157,865,290,231,877,000
40.344828
118
0.638588
false
4.096811
false
false
false
Bugheist/website
website/migrations/0046_auto_20180630_0848.py
1
2464
# Generated by Django 2.0.6 on 2018-06-30 03:18 from django.db import migrations, models import website.models class Migration(migrations.Migration): dependencies = [ ('website', '0045_auto_20180314_2032'), ] operations = [ migrations.AlterField( model_name='domain', ...
agpl-3.0
-5,813,575,829,778,991,000
34.710145
193
0.546266
false
4.162162
false
false
false
piti118/probfit
probfit/test/testtoy.py
1
1379
import matplotlib matplotlib.use('Agg', warn=False) from nose.tools import assert_equal import numpy as np from probfit.nputil import mid from probfit.pdf import crystalball, gaussian from probfit.functor import Normalized from probfit.toy import gen_toy from probfit._libstat import compute_chi2 from probfit.nputil imp...
mit
-2,253,024,111,077,738,000
26.039216
70
0.635243
false
2.866944
false
false
false
openstack/heat-translator
translator/hot/syntax/hot_parameter.py
2
1858
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the ...
apache-2.0
-8,111,710,022,009,172,000
34.730769
78
0.672228
false
4.261468
false
false
false
mantidproject/mantid
Framework/PythonInterface/test/python/mantid/plots/modest_image/test_speed.py
3
2527
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright © 2020 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 + fro...
gpl-3.0
8,944,587,024,892,670,000
24.525253
74
0.575386
false
3.143035
false
false
false
wdv4758h/Yeppp
codegen/generate-unit-test.py
1
7092
#!/usr/bin/env python import yaml import argparse import os from common.Function import Function def generate_unit_tests(path, function_list): with open(path, "w") as output: output.write( """ #include <yepPredefines.h> #include <yepPrivate.h> #include <yepLibrary.h> #include <library/functions.h> #includ...
bsd-3-clause
3,072,800,347,450,224,000
37.335135
160
0.695431
false
3.318671
true
false
false
rajanandakumar/DIRAC
Core/Utilities/TimeLeft/PBSTimeLeft.py
9
5196
######################################################################## # $Id$ ######################################################################## """ The PBS TimeLeft utility interrogates the PBS batch system for the current CPU and Wallclock consumed, as well as their limits. """ from DIRAC import gLogger...
gpl-3.0
-5,252,760,126,509,699,000
38.969231
133
0.542533
false
3.53951
false
false
false
jeff-allen-mongo/mut
mut/__init__.py
1
1098
import abc __version__ = '0.4.6.dev0' class MutInputError(Exception, metaclass=abc.ABCMeta): """Base class for reporting malformed input files.""" def __init__(self, path: str, ref: str, message: str, verbose: str='') -> None: self._path = path self._ref = ref self._message = message ...
apache-2.0
2,346,517,068,137,462,000
26.45
83
0.596539
false
4.143396
false
false
false
dgbc/django-arctic
example/articles/forms.py
1
1031
from __future__ import (absolute_import, unicode_literals) from django import forms from .models import Article from django.db.models import Q class ArticleForm(forms.ModelForm): class Meta: fields = ['title', 'description', 'category', 'updated_at', 'tags', 'published'] model ...
mit
2,278,701,275,001,640,000
29.323529
75
0.593598
false
4.350211
false
false
false
ksachs/invenio
modules/bibclassify/lib/bibclassify_text_extractor.py
24
6202
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or ...
gpl-2.0
-7,093,005,174,300,822,000
33.648045
81
0.650435
false
3.835498
false
false
false
pandeyop/rally
tests/hacking/checks.py
3
12536
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
1,542,484,200,989,563,400
33.065217
79
0.597001
false
3.668715
true
false
false
fluentpython/pythonic-api
examples/vector_v6.py
1
1864
""" A multi-dimensional ``Vector`` class, take 6 """ from array import array import math import reprlib import numbers import functools import operator class Vector: typecode = 'd' def __init__(self, components): self._components = array(self.typecode, components) def __len__(self): retu...
mit
8,561,582,717,412,880,000
24.534247
59
0.564144
false
4.067686
false
false
false
ntfwc/twitch_desktop_notification_system
lib/NotificationSystems/GtkNotificationLibWrapper.py
1
2403
## Copyright (C) 2014 ntfwc ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program ...
gpl-3.0
-948,479,297,745,604,200
32.375
107
0.686226
false
3.796209
false
false
false
iychoi/syndicate
old/RG-python/closure.py
2
25612
#!/usr/bin/env python """ Copyright 2013 The Trustees of Princeton University 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 Unle...
apache-2.0
-306,834,144,272,822,900
28.339061
198
0.614204
false
3.74828
true
false
false
exosite-garage/utility_scripts
http_https_data_interface_read_write_example.py
1
7453
#============================================================================== # http_https_data_interface_read_write.py # Python script that tests https and http socket level calls # for basic data interface API to Exosite One Platform # #============================================================================== ...
bsd-3-clause
1,075,101,053,447,829,800
31.264069
113
0.630619
false
3.719062
false
false
false
wjo1212/aliyun-log-python-sdk
tests/sample_consumer.py
1
5744
# -*- coding: utf-8 -*- import os import time from aliyun.log.consumer import * from aliyun.log import * from threading import RLock class SampleConsumer(ConsumerProcessorBase): shard_id = -1 last_check_time = 0 log_results = [] lock = RLock() def initialize(self, shard): self.shard_id ...
mit
7,969,092,373,226,613,000
30.723757
113
0.579589
false
3.993046
true
false
false
bintlabs/python-sync-db
dbsync/client/repair.py
1
3862
""" Repair client database. The repair consists in fetching the server database and inserting it locally while discarding the client database. Ideally this procedure won't ever be needed. If the synchronization models get corrupted, either by external interference or simply poor conflict resolution, further synchroni...
mit
6,050,317,100,348,482,000
37.237624
80
0.681512
false
4.319911
false
false
false
rakeshvar/theanet
theanet/layer/color.py
2
1643
import numpy as np import theano as th import theano.tensor as tt from .layer import Layer float_x = th.config.floatX class ColorLayer(Layer): def __init__(self, inpt, img_sz, num_maps=3, rand_gen=None, balance=1, gamma=1, maxva...
apache-2.0
-1,131,545,742,776,472,300
30.596154
80
0.463177
false
3.785714
false
false
false
hyperized/ansible
lib/ansible/modules/network/ios/ios_vlans.py
1
17442
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ############################################# # WARNING # ############################################# # # This file is au...
gpl-3.0
-6,540,591,658,553,535,000
37
112
0.396686
false
3.800828
true
false
false
HumanExposure/factotum
dashboard/views/tag_autocomplete.py
1
1217
from dal import autocomplete from django.db.models import Q from dashboard.models import ExtractedListPresenceTag, ExtractedHabitsAndPracticesTag class ListPresenceTagAutocomplete(autocomplete.Select2QuerySetView): def get_queryset(self): qs = ExtractedListPresenceTag.objects.all() if self.q: ...
gpl-3.0
4,994,856,578,709,005,000
35.878788
85
0.632703
false
3.803125
false
false
false
andriy47/TFG
otro/get_user_groups.py
1
4407
#Imports for xlsx File. import openpyxl import operator #Imports for GET data from Facebook and parse json. import facebook import requests import json import pprint #Requirements to connect at MongoClient. from collections import OrderedDict from pymongo import MongoClient client = MongoClient('localhost', 27017) d...
mit
48,711,651,348,205,720
35.122951
215
0.555253
false
3.252399
false
false
false
wroberts/cribbage
cribbage/expt.py
1
12409
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' expt.py (c) Will Roberts 12 January, 2017 Training an AI to play cribbage. ''' from __future__ import absolute_import, print_function import functools import itertools import random from cribbage.dqlearning import DQLearner from cribbage.game import compare_players ...
mit
7,736,041,773,997,624,000
37.657321
98
0.619067
false
3.591606
false
false
false
JoseALermaIII/python-tutorials
pythontutorials/books/CrackingCodes/Ch12/PracticeQuestions.py
1
1134
"""Chapter 12 Practice Questions Answers Chapter 12 Practice Questions via Python code. """ def main(): # 1. What does this expression evaluate to? expression = ' Hello world'.strip() print(expression) # 2. Which characters are whitespace characters? # Hint: Check page 145 print("\nAnswer...
mit
7,466,549,777,677,922,000
29.216216
81
0.635957
false
3.44
false
false
false
jsnajder/StrojnoUcenje
SU.py
1
1801
# Sveučilište u Zagrebu # Fakultet elektrotehnike i računarstva # # Strojno ucenje # http://www.fer.hr/predmet/su # # (c) 2015 Jan Snajder import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.pipeline import Pipeline class MultiColumnLabelEncoder: def __init__(self,columns = None): ...
cc0-1.0
-532,770,326,100,320,900
27.539683
79
0.628476
false
3.676892
false
false
false
TheMutley/openpilot
pyextra/gunicorn/http/wsgi.py
2
12852
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import io import logging import os import re import sys from gunicorn._compat import unquote_to_wsgi_str from gunicorn.http.message import HEADER_RE from gunicorn.http.errors import InvalidHe...
mit
-298,329,336,982,246,900
30.270073
78
0.559757
false
4.051702
false
false
false
leilihh/novaha
nova/db/sqlalchemy/utils.py
9
23587
# Copyright (c) 2013 Boris Pavlovic (boris@pavlovic.me). # 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...
apache-2.0
8,441,293,079,857,176,000
37.730706
79
0.604358
false
4.12216
false
false
false
erikdejonge/github-stars-syncer
update_stars_github.py
1
10875
#!/usr/bin/env python3 # coding=utf-8 """ update_stars_github Usage: update_stars_github.py [options] [--] <command> Options: -h --help Show this screen. Commands: new only get the new projects all pull and new """ from __future__ import division, print_function, absolute_import, unicode_literal...
gpl-2.0
1,998,938,722,215,963,000
28.713115
135
0.467586
false
4.168264
false
false
false
titasakgm/brc-stock
openerp/addons/bangkok_rubber/stock.py
1
17391
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-4,496,218,073,164,104,700
46.130081
162
0.55707
false
4.048184
false
false
false
vikingco/django-datatrans
datatrans/middleware.py
3
1339
from django.utils.cache import patch_vary_headers from django.utils import translation class MinimalLocaleMiddleware(object): """ This is a minimal version of the LocaleMiddleware from Django. It only supports setting the current language from sessions. This allows the main site to be in one language ...
bsd-3-clause
2,959,998,714,924,167,000
36.194444
69
0.707991
false
4.617241
false
false
false
arximboldi/jagsat
lib/tf/behavior/gameloop.py
1
4857
# # This file is copyright Tribeflame Oy, 2009. # import time import sys import heapq import tf from tf.behavior import timer from tf import signalslot from tf.behavior import soundfile from tf.behavior import keyboard from tf.behavior import actions class GameLoop: """ The game loop is the main application ob...
gpl-3.0
8,234,798,082,078,734,000
26.596591
79
0.582664
false
4.054257
false
false
false
gmartinvela/RoMIE
robot_control/views.py
1
10330
import sys import time import os import subprocess import webbrowser import threading import traceback from django.http import HttpResponse from django.shortcuts import render from robot_control.models import Category, Question, Response from django.core.mail import send_mail import json MAX_TIME = 180 # seconds POR...
mit
8,279,738,797,407,754,000
35.631206
157
0.615973
false
3.540096
false
false
false
JointBox/jbaccess-server
jbaccess/jba_core/service/KeyService.py
1
1262
from typing import List from jba_core.models import Key from jba_core import exceptions from jba_core.service import PersonService def get_all() -> List[Key]: try: return list(Key.objects.all()) except: raise exceptions.SomethingWrong def get(id: int) -> Key: try: return Key.obje...
gpl-3.0
9,102,842,479,600,774,000
23.269231
92
0.636292
false
3.668605
false
false
false
tody411/ImageViewerFramework
ivf/core/sfs/toon_sfs.py
1
3836
# -*- coding: utf-8 -*- ## @package ivf.core.sfs.toon_sfs # # ivf.core.sfs.toon_sfs utility package. # @author tody # @date 2016/02/16 import numpy as np import cv2 import matplotlib.pyplot as plt from ivf.core.sfs.sfs import ShapeFromShading from ivf.util.timer import timing_func from ivf.core.shader.s...
mit
-321,879,259,351,818,600
29.943548
97
0.578728
false
2.802045
false
false
false
Mdlkxzmcp/various_python
MITx/6002x/quiz_max_contig_sum.py
1
1639
def max_contig_sum(L): """ L, a list of integers, at least one positive Returns the maximum sum of a contiguous subsequence in L """ max_contiguous_sum = 0 point = 0 for subsequence in range(len(L)): current_subsequence = [] for index, number in enumerate(L[point:]): if n...
mit
-1,156,574,379,872,143,400
45.828571
163
0.541184
false
3.642222
false
false
false
dotnetom/Yatzy-Refactoring-Kata
python/yatzy.py
3
5115
class Yatzy: @staticmethod def chance(d1, d2, d3, d4, d5): total = 0 total += d1 total += d2 total += d3 total += d4 total += d5 return total @staticmethod def yatzy(dice): counts = [0]*(len(dice)+1) for die in dice: c...
mit
2,214,839,476,040,010,800
21.23913
49
0.356403
false
3.017699
false
false
false
cydcowley/Imperial-Visualizations
visuals_maths/Fourier/Mark/series_fourier_series2.py
1
17460
# -*- coding: utf-8 -*- """ Created on Thu Jul 05 11:14:00 2018 @author: kramm """ import numpy as np import matplotlib.pyplot as plt """shapes: 0 = Triangle, 1 = square, 2 = sawtooth, 3 = ?, 4 = -x/2, 5 = x^2, 6 = x, 7 = |x|, 8 = x+|x|""" Titles = ["f(x) = Triangle", "f(x) = Square", "f(x) = Sawtooth",...
mit
-926,577,980,267,475,800
30.393321
154
0.533562
false
2.726421
false
false
false
senderle/pann
pann.py
1
39546
#!/usr/bin/python # pann.py -- An implementation of a feedforward neural network in python. # Currently most useful for text modeling. # # Copyright 2014 by Jonathan Scott Enderle # import numpy import tables import scipy.optimize import sys import math import time import argparse import os import col...
mit
-4,773,434,251,849,726,000
35.31405
99
0.574976
false
3.743823
false
false
false
ssuarez6/lyra
web/methods/secant.py
1
2033
from methods import eval def method(tolerance,inferior_limit,superior_limit,iterations,function,e): function_0=float(eval(function,inferior_limit)) function_1=float(eval(function,superior_limit)) if(function_0==0): return {'status': "FAIL", 'message': "The lower limit "+str(inferior_limit)+" is a ro...
gpl-2.0
-2,742,701,571,116,628,000
45.204545
112
0.555337
false
3.463373
false
false
false
ubyssey/dispatch
dispatch/dispatchadmin/views.py
1
1505
from datetime import datetime from django.utils import timezone from django.shortcuts import render, redirect from rest_framework.generics import get_object_or_404 from django.contrib.auth.models import Group from dispatch.models import Invite from dispatch.dispatchadmin.forms import SignUpForm from django.http imp...
gpl-2.0
7,045,932,564,255,179,000
24.083333
61
0.56412
false
4.452663
false
false
false
pointhi/kicad-footprint-generator
scripts/TerminalBlock_TE-Connectivity/make_TerminalBlock_TE-Connectivity.py
2
3395
#!/usr/bin/env python from __future__ import division import sys import os import math # ensure that the kicad-footprint-generator directory is available #sys.path.append(os.environ.get('KIFOOTPRINTGENERATOR')) # enable package import from parent directory #sys.path.append("D:\hardware\KiCAD\kicad-footprint-generat...
gpl-3.0
-4,361,746,064,288,967,000
38.941176
110
0.611193
false
3.334971
false
false
false
suvayu/rplot
tselect.py
1
6136
# coding=utf-8 """Selection interface for TTrees""" from __future__ import print_function from fixes import ROOT def redirect2hist(pair): """Scan and add expression, selection pair for redirects to histogram""" import uuid if pair[0].find('>>') < 0: return ('{}>>hist_{}'.format(pair[0], uuid.uui...
gpl-2.0
3,507,482,253,508,997,600
32.900552
79
0.58605
false
3.95871
false
false
false
hapylestat/appcore
examples/progressBar_Sample.py
1
1750
# coding=utf-8 # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # Copyright (c) 2015 Reishin <hapy.lestat@gmail.com> ...
lgpl-3.0
-168,032,866,374,365,570
43.871795
161
0.769714
false
3.661088
false
false
false
lamestation/lamestation-sdk-tools
lspaint/Bitmap.py
1
1270
import wx import Color def Copy(bitmap): return wx.ImageFromBitmap(bitmap).Copy().ConvertToBitmap() def Scale(bitmap, scale): image = wx.ImageFromBitmap(bitmap) image = image.Scale(bitmap.GetWidth()*scale, bitmap.GetHeight()*scale, wx.IMAGE_QUALITY_NORMAL)...
gpl-2.0
-5,317,345,794,912,509,000
29.97561
78
0.584252
false
3.518006
false
false
false
suttond/MODOI
ase/utils/build_web_page.py
2
3520
from __future__ import print_function import glob import optparse import os import shutil import subprocess import sys def svn_update(name='ase'): os.chdir(name) output = subprocess.check_output('svn update', shell=True) os.chdir('..') lastline = output.splitlines()[-1] return not lastline.startsw...
lgpl-3.0
2,628,305,893,615,620,000
29.344828
75
0.548864
false
3.772776
false
false
false
BakanovKirill/Medicine
src/medicine/migrations/0002_auto__add_doctor__add_patient__add_hospital.py
1
4209
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Doctor' db.create_table(u'medicine_doctor', ( (u'id', self.gf('django.db.models....
mit
-6,229,616,708,722,703,000
45.777778
186
0.588263
false
3.372596
false
false
false
Ledoux/ShareYourSystem
Pythonlogy/build/lib/ShareYourSystem/Specials/Oldpredicters/Predirater/__init__.py
2
19324
# -*- coding: utf-8 -*- """ <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> """ #<DefineAugmentation> import ShareYourSystem as SYS import types BaseModuleStr="ShareYourSystem.Specials.Oldpredicters.Predisenser" DecorationModuleStr="ShareYourSystem.Standards.Classors....
mit
7,701,734,693,203,803,000
24.426316
203
0.628441
false
3.033595
false
false
false
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/cffi/cffi_opcode.py
19
5459
from .error import VerificationError class CffiOp(object): def __init__(self, op, arg): self.op = op self.arg = arg def as_c_expr(self): if self.op is None: assert isinstance(self.arg, str) return '(_cffi_opcode_t)(%s)' % (self.arg,) classname = CLASS_NA...
gpl-3.0
7,471,493,738,282,493,000
29.497207
78
0.510167
false
2.754289
false
false
false
hamogu/ARCUS
arcus/instrument/boom.py
1
5025
import numpy as np from transforms3d.euler import euler2mat from transforms3d.affines import compose from marxs.optics import OpticalElement from marxs.simulator import Parallel from marxs.math.geometry import Cylinder class Rod(OpticalElement): '''X-axis of the rod is the cylinder axis (x-zoom gives half-length...
gpl-3.0
-7,649,948,677,379,631,000
32.724832
80
0.571343
false
3.092308
false
false
false
shash/IconDB
django_extensions/management/commands/runserver_plus.py
1
10608
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django_extensions.management.utils import setup_logger, RedirectHandler from optparse import make_option import os import re import socket import sys import time try: if 'django.contrib.staticfiles' in settings....
agpl-3.0
3,263,625,052,887,110,700
44.140426
161
0.551848
false
4.425532
false
false
false
Jgarcia-IAS/SAT
openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/l10n_pe_ple03/sunat_3_19.py
4
6938
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 NUMA Extreme Systems (www.numaes.com) for Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be use...
agpl-3.0
-5,732,550,948,526,768,000
46.786207
149
0.610045
false
3.4645
false
false
false
pranavtendolkr/horizon
openstack_dashboard/api/base.py
40
12076
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
6,243,511,332,410,094,000
33.016901
79
0.593243
false
4.43156
false
false
false
sukisuki/mvn
mvn/square.py
2
4753
#!/usr/bin/env python """ This module contains one function: square """ import numpy import scipy import mvn.helpers as helpers from mvn.matrix import Matrix def square(vectors, var=None, full=False): """ calculates the eigen-vectors and eigen-values of the covariance matrix that would be produced by mu...
bsd-2-clause
-5,046,059,192,888,217,000
29.863636
96
0.592889
false
3.839257
false
false
false
m00dawg/holland
plugins/holland.lib.mysql/holland/lib/mysql/option/parser.py
1
6108
"""MySQL option file support""" import os import re import glob import codecs def expandpath(path): """Expand a path to an absolute path This will convert a relative path to an absolute path and also expand any user directories such as ~/ to the user's homedir. """ return os.path.abspath(os.path....
bsd-3-clause
4,804,406,650,861,552,000
30.8125
80
0.531762
false
4.416486
false
false
false
Azure/azure-sdk-for-python
scripts/templates/_operations_mixin.py
1
1609
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
8,633,886,816,317,268,000
46.352941
96
0.602859
false
4.519663
false
false
false
damonkelley/django-name
name/migrations/0001_initial.py
1
6874
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='BaseTicketing', fields=[ ('id', models.AutoFiel...
bsd-3-clause
5,341,854,275,446,142,000
51.075758
315
0.546116
false
4.108787
false
false
false
beefoo/still-i-rise
draw_sound.py
1
3171
# -*- coding: utf-8 -*- # Description: generate audio clips for lines, words, and syllables import argparse import json import os from pprint import pprint import re import subprocess import sys # input parser = argparse.ArgumentParser() parser.add_argument('-sf', dest="SOUND_FILE", default="clips/lines/line_000_1.w...
mit
8,532,838,854,767,355,000
52.745763
214
0.711132
false
2.969101
false
false
false
MikkelSchubert/paleomix
paleomix/nodes/newick.py
1
4120
#!/usr/bin/python3 # # Copyright (c) 2012 Mikkel Schubert <MikkelSch@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights ...
mit
558,125,395,391,680,300
37.148148
82
0.64733
false
3.711712
false
false
false
polmuz/pypy-image-demo
noborder.py
1
5589
from array import array class NoBorderImage(object): "An image class for people who dont care about border effects" def __init__(self, w, h, typecode='d', fromfile=None): self.width = w self.height = h if fromfile is not None: self.data = array(typecode) sel...
mit
-2,531,190,873,275,211,300
29.540984
94
0.50492
false
2.863217
false
false
false
dibondar/PyPhotonicReagents
libs/dev/sample_switcher.py
1
14574
######################################################################## # # This file contains classes for controlling sample Switcher # ######################################################################## from libs.gui.hardware_control import HardwareGUIControl from libs.dev.basic_device import BasicDevice from ...
bsd-3-clause
7,305,347,922,003,496,000
33.952038
126
0.652875
false
3.324361
false
false
false
mk23/snmpy
lib/snmpy/module/process_info.py
1
3259
import errno import logging import os import snmpy.module LOG = logging.getLogger() class process_data(object): def __init__(self, pid): self._f = len(os.listdir('/proc/%s/fd' % pid)) self._c = open('/proc/%s/cmdline' % pid).read().replace('\0', ' ').strip() self._t = os.stat('/proc/%s' % ...
mit
-4,416,533,769,005,351,400
31.267327
82
0.492482
false
3.657688
false
false
false
jcarreiro/jmc-python
essential_algorithms/exercise_1_2.py
1
2857
#!/usr/bin/python # # Solution to exercise 1.2 from the book _Essential Algorithms_. import math import numpy as np import matplotlib.pyplot as plt # Orders of growth. For some reason, matplotlib is happy when these are defined # as functions, but not happy if I try to give it lambdas? def inv_log(s): return 2 **...
mit
3,455,891,496,559,174,700
24.061404
79
0.502275
false
3.280138
false
false
false
nerdknight/beaglebone-black-stuff
n5110.py
1
9178
#!/usr/bin/python # -*- coding: UTF-8 -*- import Adafruit_BBIO.GPIO as GPIO import time PIN_SCE="P9_11" # LCD CS # Pin 3 PIN_RESET="P9_12" # LCD RST # Pin 4 PIN_DC="P9_13" # LCD Dat/Com # Pin 5 PIN_SDIN="P9_14" # LCD SPIDat # Pin 6 PIN_SCLK="P9_15" # LCD SPIClk# Pin 7 # LCD Gnd .... Pin 2 # LCD Vcc .... Pin 1 PIN...
gpl-2.0
5,284,405,530,558,225,000
22.460358
72
0.553036
false
1.89095
false
false
false
gajim/gajim
gajim/gtk/groupchat_settings.py
1
3010
# This file is part of Gajim. # # Gajim 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; version 3 only. # # Gajim is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
gpl-3.0
8,506,584,870,208,770,000
32.820225
76
0.558472
false
4.533133
false
false
false
everett-toews/pi-o-clock
clock/sched.py
2
2280
from collections import namedtuple import logging import action from action import actions from clock import bg from clock import utils logger = logging.getLogger(__name__) Alarm = namedtuple('Alarm', 'id name days hour minute next_run, action, param') Alarm.__new__.__defaults__ = (None, None, None, None, None, Non...
mit
-5,830,468,272,386,971,000
21.352941
82
0.592982
false
3.275862
false
false
false
tdryer/gifprime
gifprime/quantize.py
1
6666
"""Colour quantizer using "Adaptive Spatial Subdivision". Implemented as described by ImageMagick: http://www.imagemagick.org/script/quantize.php """ # The maximum depth of the colour octree. Should be in range [3, 6]. Higher is # slower but with higher quality. Anything less than 8 will cause loss on # images even ...
mit
-2,011,042,714,623,335,700
35.828729
79
0.582958
false
3.911972
false
false
false
cartologic/cartoview
cartoview/app_manager/management/commands/update_current_apps.py
1
1638
from __future__ import print_function import requests from django.core.management.base import BaseCommand from cartoview.app_manager.installer import AppJson, remove_unwanted from cartoview.app_manager.models import App from cartoview.store_api.api import StoreAppResource class Command(BaseCommand): help = 'Upd...
bsd-2-clause
-2,645,689,900,627,613,000
38.95122
78
0.550672
false
3.946988
false
false
false
eduardohenriquearnold/TFlow
plotData.py
1
1932
#Code to present data created by TFlow app graphically #Created in 24/06/2015 by Eduardo Henrique Arnold #Credits to Danial Taherzadeh (https://taher-zadeh.com/speeding-matplotlib-plotting-times-real-time-monitoring-purposes/) for the dynamic update of Matplotlib, significantly improving performance to achieve real tim...
gpl-3.0
9,221,752,192,082,829,000
25.833333
224
0.604555
false
3.198675
false
false
false
DBuildService/atomic-reactor
tests/constants.py
1
4698
# -*- coding: utf-8 -*- """ Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import os from textwrap import dedent HERE = os.path.dirname(__file__) FILES = os.path.join(HERE, 'files') MOCK = o...
bsd-3-clause
1,213,311,437,296,049,400
25.24581
98
0.718817
false
2.889299
true
false
false
cstavr/synnefo
snf-cyclades-app/synnefo/logic/management/commands/server-modify.py
2
4868
# Copyright (C) 2010-2014 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-3.0
4,640,596,962,207,937,000
36.736434
74
0.570255
false
4.229366
false
false
false
DanielWinklehner/py_particle_processor
py_particle_processor_qt/tools/abstract_tool.py
1
1206
from abc import ABC, abstractmethod # TODO: WIP class AbstractTool(ABC): def __init__(self, parent): self._name = None self._parent = parent self._has_gui = False self._need_selection = False self._min_selections = 1 self._max_selections = 1 self._selecti...
mit
-2,974,640,117,957,225,500
22.211538
63
0.577944
false
3.941176
false
false
false
ireapps/coding-for-journalists
5_geocode/completed/geocode_done.py
1
2619
# PROBLEM: We need coordinates for the addresses we parsed earlier. # # HOW WE'RE GOING TO DEAL WITH IT: # - Use a library called geopy to run an address through Google's geocoder # - Use a sleep function to pause so we don't swamp Google # - Keep track of it all with a keyed dictionary (coming in and going out)...
mit
2,607,359,621,642,045,000
44.912281
109
0.690867
false
3.589849
false
false
false
uogbuji/amara3-xml
pylib/uxml/uxpath/lexrules.py
1
2289
# amara3.uxml.uxpath.lexrules ''' Heavy debt to: https://github.com/emory-libraries/eulxml/blob/master/eulxml/xpath/lexrules.py ''' import re from ply.lex import TOKEN OPERATOR_NAMES = { 'or': 'OR_OP', 'and': 'AND_OP', 'div': 'DIV_OP', 'mod': 'MOD_OP', } tokens = [ 'PATH_SEP', 'ABBR...
apache-2.0
-145,919,353,355,869,820
20.59434
93
0.51813
false
2.46129
false
false
false
entpy/beauty-and-pics
beauty_and_pics/custom_form_app/forms/area51_form.py
1
3741
# -*- coding: utf-8 -*- from django import forms from datetime import date from dateutil.relativedelta import * from django.contrib.auth.models import User from custom_form_app.forms.base_form_class import * from account_app.models import * from website.exceptions import * import calendar, logging, sys # force utf8 r...
mit
-2,726,878,488,080,537,000
36.787879
186
0.629778
false
3.925498
false
false
false
rickerc/horizon_audit
horizon/conf/__init__.py
10
1525
import copy from django.utils.functional import empty # noqa from django.utils.functional import LazyObject # noqa class LazySettings(LazyObject): def _setup(self, name=None): from django.conf import settings # noqa from horizon.conf.default import HORIZON_CONFIG as DEFAULT_CONFIG # noqa ...
apache-2.0
6,875,307,505,977,455,000
42.571429
81
0.660984
false
4.088472
true
false
false
rymcimcim/django-foosball
foosball/urls.py
1
1289
# -*- coding: utf-8 -*- """django_foosball URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', ...
mit
2,750,766,683,777,530,400
35.828571
82
0.69744
false
3.493225
false
false
false
cemarchi/biosphere
Src/BioAnalyzer/Managers/BioDataManager.py
1
3217
from typing import List, Dict from Src.BioDataManagement.CrossCutting.Filters.FeListDnaMethylationSample import FeListDnaMethylationSample from Src.BioDataManagement.CrossCutting.Filters.FeListMessengerRnaSample import FeListMessengerRnaSample from Src.BioDataManagement.CrossCutting.Filters.FeListMicroRnaGeneTarget im...
bsd-3-clause
-778,104,744,715,079,300
60.865385
108
0.599627
false
3.852695
false
false
false
degustaf/symmetrical-eureka
SymmetricalEureka/migrations/0006_auto_20170419_0953.py
1
1301
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-19 09:53 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion def add_default_username(apps, schema_editor): userprofile = apps.get_model('SymmetricalEureka'...
mit
-2,845,920,574,999,784,000
32.358974
113
0.640277
false
3.918675
false
false
false
mkl-/scioncc
src/ion/processes/bootstrap/bootstrapper.py
3
2263
#!/usr/bin/env python """Bootstrap process that can execute bootstrap plugins""" from pyon.core.governance import get_system_actor, get_system_actor_header, build_actor_header from pyon.util.containers import get_safe, for_name, dict_merge from pyon.public import log, RT from ion.core.bootstrap_process import Bootstr...
bsd-2-clause
1,254,366,006,461,636,600
42.519231
97
0.63323
false
4.214153
true
false
false
MarsZone/DreamLand
templates/battle_field/worlddata/forms.py
1
3887
import sys from muddery.utils.localiztion_handler import localize_form_field from muddery.worlddata import forms_base class GameSettingsForm(forms_base.GameSettingsForm): pass class ClassCategoriesForm(forms_base.ClassCategoriesForm): pass class TypeclassesForm(forms_base.TypeclassesForm): pass clas...
bsd-3-clause
-1,623,400,038,251,496,400
17.07907
78
0.737844
false
3.540073
false
false
false
hugochinchilla/docker-101
demo/deploy/django_example/django_example/settings.py
1
3095
""" Django settings for django_example project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Bui...
mit
-9,063,533,504,262,568,000
26.389381
71
0.677868
false
3.497175
false
false
false
gusgollings/scbdo
scbdo/rhcp.py
1
19593
# SCBdo : DISC Track Racing Management Software # Copyright (C) 2010 Nathan Fraser # # 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 ...
gpl-3.0
-2,343,251,027,301,384,700
36.249049
81
0.521207
false
3.696095
true
false
false
weso/CWR-DataApi
tests/grammar/config/test_rules_tree.py
1
7394
# -*- coding: utf-8 -*- import unittest from cwr.grammar.factory.config import rule_rules_tree __author__ = 'Bernardo Martínez Garrido' __license__ = 'MIT' __status__ = 'Development' class TestConfigTerminalRule(unittest.TestCase): def setUp(self): self._rule = rule_rules_tree def test_empty(self)...
mit
-7,837,505,778,723,697,000
31.143478
75
0.387123
false
3.574952
true
false
false
vianuevm/Webparser
ENV/Lib/site-packages/flup/server/fcgi_single.py
19
6083
# Copyright (c) 2005, 2006 Allan Saddi <allan@saddi.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this lis...
gpl-2.0
-1,894,475,091,320,696,000
38.5
78
0.615157
false
4.079812
false
false
false
usersource/anno
anno_gec_server/message/anno_api_messages.py
1
7276
""" ProtoRPC message class definitions for Anno API. """ from protorpc import messages from protorpc import message_types from message.user_message import UserMessage from message.followup_message import FollowupMessage from message.community_message import CommunityMessage class AnnoMessage(messages.Message): "...
mpl-2.0
2,740,884,393,746,321,000
41.8
105
0.706157
false
3.795514
false
false
false
philpot/trafficcop-wat
pymod/htmltoken.py
1
2381
#!/usr/bin/python import sys, os import re import argparse import pprint from HTMLParser import HTMLParser from util import identity class HTMLTokenizer(HTMLParser): def __init__(self): self.buffer = [] # this works only for new-style class # super(HTMLShedder,self).__init__() HT...
apache-2.0
1,314,417,586,624,975,600
28.036585
125
0.570349
false
3.506627
false
false
false
odahoda/noisicaa
noisicaa/builtin_nodes/sample_track/model.py
1
11322
#!/usr/bin/python3 # @begin:license # # Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de> # # 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 y...
gpl-2.0
-1,979,163,635,116,728,800
32.39823
94
0.597686
false
3.763963
false
false
false
Pragmatismo/Pigrow
scripts/gui/info_modules/info_error_log.py
1
1965
#!/usr/bin/python3 import os homedir = os.getenv("HOME") def show_info(): # error_log_path = homedir + "/Pigrow/logs/err_log.txt" if not os.path.isfile(error_log_path): return "No error log, hopefully that means there have been no errors." cmd = "tail -25 " + error_log_path out = os.popen(...
gpl-3.0
-4,045,575,685,941,994,000
34.089286
99
0.521628
false
3.714556
false
false
false
mnahm5/django-estore
Lib/site-packages/braintree/paypal_account_gateway.py
4
1760
import braintree from braintree.paypal_account import PayPalAccount from braintree.error_result import ErrorResult from braintree.exceptions.not_found_error import NotFoundError from braintree.resource import Resource from braintree.successful_result import SuccessfulResult class PayPalAccountGateway(object): def ...
mit
4,407,714,023,835,953,000
50.764706
163
0.69375
false
4.02746
true
false
false
shawnhermans/olivaw
ml/tests/util.py
1
1962
from ml.models import * def create_sample_dataset(): category_choices = ['Foo', 'Bar', 'Baz'] boolean_choices = [True, False, True] NumericAttributeStatistics.objects.all().delete() CategoricalAttributeStatistics.objects.all().delete() DataAttribute.objects.all().delete() DataSetDefinition.obj...
bsd-3-clause
8,360,446,417,984,941,000
30.142857
74
0.646789
false
4.2103
false
false
false
porksmash/swarfarm
sw_parser/log_exporter.py
1
3912
from datetime import timedelta import os import os.path from drf_ujson.renderers import UJSONRenderer from django.conf import settings from bestiary.models import Dungeon from .serializers import * EXPORT_FOLDER = 'log_data' def export_scenarios(): queryset = RunLog.objects.filter(dungeon__category=Dungeon.CA...
apache-2.0
4,541,779,733,524,372,000
29.092308
106
0.662065
false
3.60221
false
false
false