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
meteorfox/PerfKitBenchmarker
perfkitbenchmarker/linux_packages/ycsb.py
1
28681
# Copyright 2016 PerfKitBenchmarker 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 appli...
apache-2.0
-1,323,101,496,213,141,800
34.85125
80
0.644364
false
3.744745
false
false
false
kupiakos/pybcd
bcdelement.py
1
3754
from common import * from elements import * from bcddevice import BCDDevice class BCDElement: obj = None _type = None _changed = False _identifier = None _enum = None _value = None fmt = None def __init__(self, obj, type): self.obj = obj self._type = type ...
mit
-2,685,742,574,924,046,300
26.807407
83
0.478689
false
4.152655
false
false
false
ceph/radosgw-agent
radosgw_agent/util/log.py
1
2537
import logging import sys def get_dev_logger(name='dev.radosgw_agent'): """ A simple utility to be able to log things that are meant for developer-eyes and not for user facing. All developer logs must be prepended with `dev` so this utility ensures that is the case. To use it:: dev_log =...
mit
9,070,884,113,438,311,000
27.505618
92
0.653134
false
3.608819
false
false
false
jmccrae/wn-rdf
stresstest.py
1
1210
import multiprocessing import sqlite3 import time import urllib def do_query(uri): t1 = time.time() try: for line in urllib.urlopen(uri): pass print "Got %s in %f" % (uri, time.time() - t1) except Exception as e: print "Failed on %s: %s" % (uri, str(e)) if __name__ == ...
bsd-3-clause
1,839,928,328,675,111,000
33.571429
98
0.6
false
3.427762
false
false
false
acutesoftware/AIKIF
aikif/.z_prototype/create_word_lists.py
1
5833
# coding: utf-8 # create_word_lists.py written by Duncan Murray 3/2/2014 # creates a simple list of verbs, nouns and adjectives for # simple 'bag of words' parsing. # First implementation uses the following dataset: # WordNet 3.1 Copyright 2011 by Princeton University. import os import sys from xml.dom.minidom ...
gpl-3.0
-5,059,939,750,035,146,000
40.077465
138
0.640665
false
3.350373
false
false
false
shish/sdog
sdog/monitor.py
1
4065
#!/usr/bin/env python import socket import os import subprocess from optparse import OptionParser from time import time, sleep from select import select import sys try: from setproctitle import setproctitle except ImportError: def setproctitle(title): pass def main(argv=sys.argv): parser = Optio...
mit
-6,080,029,052,725,349,000
32.04878
120
0.518819
false
3.938953
false
false
false
online-behaviour/machine-learning
getTweetText.py
1
1768
#!/usr/bin/python3 -W all """ getTweetText.py: extract tweet text from json file usage: getTweetText.py < file 20170418 erikt(at)xs4all.nl """ import csv import json import re import sys # command name for error messages COMMAND = sys.argv[0] patternNewline = re.compile("\n") # open csv output with sys.s...
apache-2.0
-3,595,196,623,432,548,000
38.288889
79
0.639706
false
3.507937
false
false
false
knowmetools/km-api
km_api/know_me/migrations/0006_subscription.py
1
2495
# Generated by Django 2.0.6 on 2018-10-20 23:41 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import permission_utils.model_mixins class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL...
apache-2.0
4,595,380,879,259,776,500
33.178082
89
0.420441
false
5.709382
false
false
false
mrksu/flac2m
src/paths.py
1
4790
#!/usr/bin/env python3 from typing import List, Tuple import os from common import error_exit MusicDir = Tuple[str, List[str]] # A tuple of dir name and all of its files MusicMap = List[MusicDir] # List of dirs containing music def find_music(roots: List[str]) -> MusicMap: music_dirs = [] for ...
gpl-3.0
7,273,973,328,679,862,000
29.653846
80
0.604559
false
3.582022
false
false
false
fnp/wolnelektury
src/social/models.py
1
6767
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from random import randint from django.db import models from django.conf import settings from django.core.exceptions import ValidationError from django.urls import ...
agpl-3.0
-6,219,693,261,399,555,000
38.8
152
0.635087
false
3.855271
false
false
false
abrt/faf
src/pyfaf/storage/migrations/versions/1c7edfbf8941_drop_reportunknownpackage_running_fields.py
1
3689
# Copyright (C) 2015 ABRT Team # Copyright (C) 2015 Red Hat, Inc. # # This file is part of faf. # # faf is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) ...
gpl-3.0
-5,371,299,803,623,686,000
36.642857
79
0.657089
false
3.638067
false
false
false
rpadilha/rvpsite
rvpsite/blog/migrations/0001_initial.py
1
2442
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-15 16:02 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import s3direct.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ ...
agpl-3.0
-2,348,001,654,431,502,000
41.666667
228
0.561266
false
3.878788
false
false
false
Lucretiel/autocommand
test/test_automain.py
1
1906
# Copyright 2014-2016 Nathan West # # This file is part of autocommand. # # autocommand is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
lgpl-3.0
7,467,804,652,391,681,000
27.029412
77
0.654774
false
4.004202
true
false
false
mhotwagner/backstage
facade/models.py
1
2837
from django.db import models from ckeditor.fields import RichTextField from solo.models import SingletonModel from phonenumber_field import modelfields as phonenumber_models from foti.models import Foto from opere.models import Opera from scritti.models import Scritto class Profile(SingletonModel): name = mod...
mit
-9,128,234,938,688,416,000
29.836957
143
0.650335
false
3.718218
false
false
false
qPCR4vir/orange3
Orange/canvas/canvas/items/utils.py
3
3147
import numpy import sip from PyQt4.QtGui import QColor, QRadialGradient, QPainterPathStroker from PyQt4.QtCore import QObject, QSignalMapper from PyQt4.QtCore import pyqtSignal as Signal def saturated(color, factor=150): """Return a saturated color. """ h = color.hsvHueF() s = color.hsvSaturationF()...
bsd-2-clause
2,656,843,960,027,728,400
28.411215
85
0.68033
false
3.481195
false
false
false
bbqsrc/kbdgen
pysrc/kbdgen/gen/osxutil.py
2
30141
import copy import json import uuid import pathlib import itertools import subprocess import re from collections import OrderedDict import xml.etree.ElementTree as etree from xml.etree.ElementTree import Element, SubElement from ..bundle import parse_desktop_layout from ..base import get_logger from ..cldr import CP_...
apache-2.0
-701,396,370,112,063,200
30.199793
86
0.497329
false
3.7117
false
false
false
plaice/Zebrackets
src/zebrackets/zebraFont.py
1
8776
#!/usr/bin/python3 # File zebraFont.py # # Copyright (c) Blanca Mancilla, John Plaice, 2015, 2016 # # 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 you...
gpl-3.0
613,869,908,422,646,400
38.35426
80
0.635939
false
3.673504
false
false
false
zhenwendai/RGP
gpnarx.py
1
1997
from __future__ import print_function import GPy import numpy as np def transformTimeSeriesToSeq(Y, timeWindow): Ntr,D = Y.shape blocksNumber = Ntr - timeWindow X = np.zeros((blocksNumber, timeWindow*D)) Ynew = np.zeros((blocksNumber,D)) for i in range(blocksNumber): tmp = Y[i:i+timeWindow...
bsd-3-clause
-546,439,118,895,596,200
26
105
0.548322
false
2.796919
false
false
false
Spiderlover/Toontown
toontown/suit/SuitInvasionManagerAI.py
1
11138
import time from random import random, randint, choice from direct.directnotify import DirectNotifyGlobal from direct.task import Task from toontown.battle import SuitBattleGlobals from toontown.toonbase.ToontownGlobals import IDES_OF_MARCH import SuitDNA from SuitInvasionGlobals import * class SuitInvasionManagerAI:...
mit
4,798,560,781,277,343,000
36.628378
109
0.5993
false
3.671061
false
false
false
super13/tensorflow-speech-recognition-pai
src/smodels/RNN/utils.py
1
1207
import os import tensorflow as tf from configparser import ConfigParser from utilities.set_dirs import get_conf_dir conf_dir = get_conf_dir(debug=False) parser = ConfigParser(os.environ) parser.read(os.path.join(conf_dir, 'neural_network.ini')) # AdamOptimizer beta1 = parser.getfloat('optimizer', 'beta1') beta2 = pa...
mit
4,560,532,424,190,191,000
32.527778
87
0.654515
false
3.983498
false
false
false
sguotciq/django-test
mysite/mysite/urls.py
1
1262
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
gpl-2.0
7,233,505,913,969,201,000
36.147059
77
0.644216
false
3.235897
false
false
false
codebox/algorithms
graph_data_structures.py
1
1452
class DirectedAdjacencyMatrix: def __init__(self, n): self.n = n self.data = [[0] * n for i in range(n)] def connect(self, i_from, i_to): self.data[i_from][i_to] += 1 def disconnect(self, i_from, i_to): self.data[i_from][i_to] = max(0, self.data[i_from][i_to] - 1) def ...
mit
477,269,199,493,675,600
29.893617
86
0.544077
false
2.95723
false
false
false
vmagamedov/kinko
kinko/compile/incremental_dom.py
1
9185
from json.encoder import encode_basestring from slimit import ast as js from ..types import NamedArgMeta, VarArgsMeta, VarNamedArgsMeta from ..utils import split_args, normalize_args from ..nodes import Tuple, Symbol, Placeholder, String, Number from ..utils import Environ from ..compat import text_type from ..checke...
bsd-3-clause
-2,293,292,613,418,274,800
30.135593
79
0.587371
false
3.497715
true
false
false
mottosso/pyblish-magenta
pyblish_magenta/vendor/capture.py
1
15009
"""Maya Capture Playblasting with independent viewport, camera and display options """ import re import sys import contextlib from maya import cmds version_info = (1, 1, 0) __version__ = "%s.%s.%s" % version_info __license__ = "MIT" def capture(camera=None, width=None, height=None, ...
lgpl-3.0
-8,235,345,355,411,183,000
30.399582
81
0.625225
false
4.266345
false
false
false
phoebe-project/phoebe2-docs
2.1/examples/minimal_contact_binary.py
1
5694
#!/usr/bin/env python # coding: utf-8 # Minimal Contact Binary System # ============================ # # Setup # ----------------------------- # Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update ...
gpl-3.0
-6,267,416,586,209,777,000
15.946429
359
0.680541
false
3.043292
false
false
false
ThoriumGroup/thorium
setup.py
1
7980
#!/usr/bin/env python """ setup.py ======== This is a generic as possible setup.py template. The goal is to retrieve almost all of the information from the main module file, rather than relying on values explicitly entered here. ## Usage This setup.py script needs to modified in the following ways: - `MAIN_FILE` n...
mit
982,966,810,194,731,900
34.784753
81
0.545865
false
3.988006
false
false
false
sslattery/Chimera
doc/spn/fuel_assembly/sp3/fs_azilut02.py
1
16598
############################################################################### ## fs.py ## 9te [angband.ornl.gov] ## Wed Jan 12 10:37:50 2011 ############################################################################### ## Copyright (C) 2008 Oak Ridge National Laboratory, UT-Battelle, LLC. ##------------------------...
bsd-3-clause
735,892,012,629,939,000
27.617241
111
0.457826
false
2.5504
false
false
false
kekivelez/DjangoSkeleton
tcshealth/users/views.py
1
7243
from django.shortcuts import render # Create your views here. import uuid from rest_framework import status from rest_framework.response import Response from rest_framework import generics from rest_framework import serializers as DRFserializers from rest_framework import permissions from rest_framework import rendere...
gpl-2.0
-2,183,183,850,071,830,500
30.77193
104
0.620047
false
4.660875
false
false
false
purushothamc/myibitsolutions
strings/justified_text.py
1
1674
def fullJustify(strings_list, number): result = [] if not strings_list or number <= 0: return result current_length, idx, firstWord = 0, 0, True for word in strings_list: if firstWord: result.append(word) current_length += len(result[-1]) firstWord = F...
gpl-3.0
-5,097,210,866,806,517,000
31.843137
74
0.470729
false
4.082927
false
false
false
opencord/voltha
voltha/adapters/adtran_olt/test/codec/test_olt_state.py
1
4156
# Copyright 2017-present Adtran, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
-6,060,464,990,337,727,000
27.272109
84
0.703321
false
2.964337
true
false
false
riklaunim/django-custom-multisite
setup.py
1
4043
from distutils.core import setup from distutils.command.install_data import install_data from distutils.command.install import INSTALL_SCHEMES import os import sys class osx_install_data(install_data): # On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../ # which is wrong. Python 2...
bsd-3-clause
-6,663,430,971,561,462,000
39.43
117
0.666337
false
3.729705
false
false
false
wakatime/wakadump
setup.py
1
1515
from setuptools import setup about = {} with open('wakadump/__about__.py') as f: exec(f.read(), about) packages = [ about['__title__'], ] install_requires = [x.strip() for x in open('requirements.txt').readlines()] setup( name=about['__title__'], version=about['__version__'], license=about['__...
bsd-3-clause
2,962,711,954,959,608,000
29.3
76
0.579538
false
4.050802
false
false
false
Autodesk/molecular-design-toolkit
moldesign/integrators/verlet.py
1
2603
from __future__ import print_function, absolute_import, division from future.builtins import * from future import standard_library standard_library.install_aliases() # Copyright 2017 Autodesk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with ...
apache-2.0
-1,039,936,645,698,552,800
34.657534
95
0.661544
false
3.82232
false
false
false
mgohde/nudge-tools
tools/dbtool.py
1
4655
#!/usr/bin/python import os import sys # Because of course Python has XML parsing built in. import xml.etree.ElementTree as ET # dbtool.py -- Quick and dirty tool to insert XML formatted storylines into the database. def nodesearch(nodename, node): for n in node: if n.tag==nodename: return n ...
gpl-2.0
5,467,210,576,468,532,000
30.241611
208
0.570569
false
3.948261
false
false
false
Nolski/airmozilla
airmozilla/manage/forms.py
1
29803
import re import datetime from collections import defaultdict import dateutil.parser import pytz from django import forms from django.db.models import Count from django.conf import settings from django.contrib.auth.models import User, Group from django.utils.timezone import utc from django.utils.safestring import mar...
bsd-3-clause
-2,282,395,597,957,980,700
31.115302
79
0.562863
false
4.28081
false
false
false
mdg/pygrate
test/migration_test.py
1
5291
import unittest import os.path import types from pygration.migration import VersionNumber, Loader import pygration @pygration.step_class class TestStep(object): ADD_FILE = 'add.sql' class StepTest(unittest.TestCase): def test_class_decorator(self): self.assertEqual("test.migration_test", TestStep.ve...
apache-2.0
-2,929,203,148,356,788,000
32.916667
78
0.612361
false
3.429034
true
false
false
ianmiell/OLD-shutitdist
inetutils/inetutils.py
1
1466
"""ShutIt module. See http://shutit.tk """ from shutit_module import ShutItModule class inetutils(ShutItModule): def is_installed(self, shutit): return shutit.file_exists('/root/shutit_build/module_record/' + self.module_id + '/built') def build(self, shutit): shutit.send('mkdir -p /tmp/build/inetutils') ...
gpl-2.0
-6,905,995,326,169,488,000
25.178571
114
0.686903
false
2.599291
true
false
false
zmr/namsel
accuracy_test.py
1
2139
#encoding: utf-8 import cPickle as pickle from classify import load_cls, label_chars from cv2 import GaussianBlur from feature_extraction import get_zernike_moments, get_hu_moments, \ extract_features, normalize_and_extract_features from functools import partial import glob from multiprocessing.pool import Pool im...
mit
-5,771,223,519,204,429,000
23.872093
107
0.640019
false
3.202096
true
false
false
tensorflow/probability
tensorflow_probability/python/vi/optimization.py
1
14806
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
-8,091,259,992,861,452,000
46.915858
80
0.690261
false
3.948267
false
false
false
aver803bath5/igene_bot
bot.py
1
1802
# -*- coding: utf-8 -*- from telegram.ext import Updater from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, RegexHandler, ConversationHandler) from bs4 import BeautifulSoup from configparser import ConfigParser from models import * import logging import re import requ...
mit
-7,335,339,185,011,991,000
37.217391
102
0.658134
false
3.100529
false
false
false
uxebu/tddbin-backend
src/tddbin/settings.py
1
3937
""" Django settings for tddbin project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
mit
9,179,233,704,222,769,000
24.564935
161
0.677927
false
3.417535
false
false
false
WoodNeck/tataru
cogs/sound.py
1
7698
import os import asyncio import logging from discord import opus, ClientException from discord.ext import commands from discord.opus import OpusNotLoaded from cogs.utils.music import Music from cogs.utils.music_type import MusicType from cogs.utils.music_player import MusicPlayer OPUS_LIBS = ['libopus-0.x86.dll', 'lib...
mit
120,925,598,734,384,880
37.854839
131
0.619206
false
2.952206
false
false
false
ronaldhan/python-data
sqlite2mysql_test.py
1
3652
# -*- coding: utf-8 -*- import sqlite3 as lite import MySQLdb import python_mysql as mydb try: dbPath="C:/Program Files (x86)/火车采集器V8/Data" fileName="/5/SpiderResult.db3" tableName='yhxxl' conn=lite.connect(dbPath+fileName) conn.row_factory=lite.Row cur=conn.cursor() ...
apache-2.0
7,242,926,501,114,921,000
39.953488
170
0.524418
false
3.210574
false
false
false
Tinkerforge/brickv
src/brickv/plugin_system/plugins/red/program_page_ruby.py
1
10155
# -*- coding: utf-8 -*- """ RED Plugin Copyright (C) 2014-2015 Matthias Bolte <matthias@tinkerforge.com> Copyright (C) 2014 Olaf Lüke <olaf@tinkerforge.com> program_page_ruby.py: Program Wizard Ruby Page This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public ...
gpl-2.0
354,112,692,375,024,500
46.009259
123
0.593067
false
4.237896
false
false
false
snua12/zlomekfs
tests/nose-tests/remoteZfs.py
1
10216
#! /bin/env python """ locally, we wrap every RemoteReference into RemoteObject """ from twisted.spread import pb from twisted.internet import reactor from twisted.python.failure import Failure import sys import os import logging import tempfile from insecticide.snapshot import SnapshotDescription from insecticid...
gpl-2.0
279,440,433,751,394,370
27.858757
89
0.586139
false
4.261994
false
false
false
ivmech/iviny-scope
lib/xlsxwriter/test/comparison/test_chart_font05.py
1
2453
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013, John McNamara, jmcnamara@cpan.org # import unittest import os from ...workbook import Workbook from ..helperfunctions import _compare_xlsx_files class TestCompareXLSXFiles(unittest.TestC...
gpl-3.0
-8,548,962,040,107,279,000
25.663043
79
0.482674
false
3.803101
true
false
false
rafaellc28/Latex2MiniZinc
latex2minizinc/Expression.py
1
1933
class Expression: """ Class representing a expression node in the AST of a MLP """ def __init__(self): self.indice = -1 self.identifier = None self.identifierName = None self.identifierList = None self.isInSet = False self.isSet = None self.isVar ...
mit
-3,935,649,969,850,362,400
24.434211
60
0.619762
false
4.363431
false
false
false
Kotaimen/awscfncli
awscfncli2/cli/commands/validate/validate.py
1
1394
import click from awscfncli2.cli.context import Context from awscfncli2.cli.utils.deco import command_exception_handler from awscfncli2.cli.utils.pprint import echo_pair_if_exists @click.command('validate') @click.pass_context @command_exception_handler def cli(ctx): """Validate template file.""" assert isin...
mit
-3,338,195,612,921,171,000
31.418605
80
0.649211
false
4.1
false
false
false
Magicked/crits
crits/core/form_consts.py
6
7769
class Action(): ACTION_TYPE = "Action type" BEGIN_DATE = "Begin date" ANALYST = "Analyst" END_DATE = "End date" PERFORMED_DATE = "Performed date" ACTIVE = "Active" REASON = "Reason" DATE = "Date" OBJECT_TYPES = "TLOs" PREFERRED = "Preferred TLOs" class Common(): ADD_INDICATO...
mit
2,378,035,569,143,578,000
21.782991
99
0.635474
false
3.48855
false
false
false
hlmnrmr/liveblog
server/liveblog/syndication/consumer.py
1
5521
import logging from bson import ObjectId from superdesk.resource import Resource from superdesk.services import BaseService from superdesk.errors import SuperdeskApiError from superdesk import get_resource_service from flask import current_app as app from flask import Blueprint from flask_cors import CORS from liveblo...
agpl-3.0
8,520,539,062,319,369,000
32.05988
118
0.583409
false
4.000725
false
false
false
mtanida/image_collection_browser
scripts/generate_coordinates.py
1
3397
# -*- coding: utf-8 -*- # Description: generates a json file that contains the item ids in order they appear in the UI # Example usage: # python generate_coordinates.py ../data/ ../js/coords.json 100 10 10 50 20 3 from PIL import Image import json import math import os import sys # input if len(sys.argv) < 8: ...
cc0-1.0
-7,558,643,986,225,678,000
29.603604
186
0.603179
false
3.353406
false
false
false
Murali-group/GraphSpace
graphspace/settings/local.py
1
1543
from graphspace.settings.base import * # variables for setting up account through which GraphSpace emails EMAIL_HOST = 'NONE' EMAIL_HOST_USER = 'NONE' EMAIL_HOST_PASSWORD = 'NONE' # If error is thrown, display the error in the browser (ONLY FOR LOCAL MACHINES) DEBUG = True TEMPLATE_DEBUG = True MAINTENANCE = False #...
gpl-2.0
-5,357,395,885,401,904,000
30.489796
136
0.72197
false
3.289979
false
false
false
weijia/django-excel-to-model
django_excel_to_model/management/commands/import_excel_according_to_model.py
1
7251
import argparse import importlib import os from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand from django_excel_to_model.field_tools import get_valid_excel_field_name from django_excel_to_model.file_readers.csv_reader import CsvFile from django_excel_to_model...
bsd-3-clause
8,626,901,737,644,630,000
43.484663
123
0.645428
false
3.680711
false
false
false
dajusc/trimesh
trimesh/voxel/ops.py
1
12278
import numpy as np from .. import util from ..constants import log def fill_orthographic(dense): shape = dense.shape indices = np.stack( np.meshgrid(*(np.arange(s) for s in shape), indexing='ij'), axis=-1) empty = np.logical_not(dense) def fill_axis(axis): base_local_indices ...
mit
7,499,729,113,100,000,000
27.225287
75
0.571347
false
3.68598
false
false
false
Fewbytes/cosmo-manager-rest-client
cosmo_manager_rest_client/swagger/BlueprintsApi.py
1
4585
######## # Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
-8,626,685,693,253,415,000
33.216418
79
0.563359
false
4.46446
false
false
false
qma/pants
tests/python/pants_test/backend/jvm/tasks/test_classpath_util.py
1
2852
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pant...
apache-2.0
5,572,896,934,268,120,000
36.526316
93
0.564867
false
4.321212
true
false
false
tsmrachel/remo
remo/remozilla/tasks.py
1
5981
from __future__ import unicode_literals from datetime import datetime, timedelta from urllib import quote from django.conf import settings from django.contrib.auth.models import User from django.db import transaction from django.utils import timezone import requests import waffle from celery.task import periodic_tas...
bsd-3-clause
-3,315,522,485,804,188,000
39.412162
96
0.552918
false
4.116311
false
false
false
googleads/google-ads-python
google/ads/googleads/v6/services/services/offline_user_data_job_service/transports/base.py
1
5512
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
-2,307,035,603,748,183,600
35.503311
83
0.654209
false
4.150602
false
false
false
lopezdp/ConstructionEstimatingProject
feetInchesCalc.py
1
1539
import math def measurements(): programOn = True subTotal = 0 program_continue = input("Do you want to keep a running total of your measurements? 1 for yes, 2 for no: "); if (program_continue == 1): print " " feet = input("Enter feet portion of distance: "); inch = input("Ent...
mit
-607,609,784,470,793,300
33.977273
121
0.561404
false
4.19346
false
false
false
syhpoon/xyzcmd
libxyz/ui/cmd.py
1
26667
#-*- coding: utf8 -* # # Max E. Kuznecov ~syhpoon <syhpoon@syhpoon.name> 2008 # # This file is part of XYZCommander. # XYZCommander is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by # the Free Software Foundation, either version 3 of the Licens...
gpl-3.0
-8,162,099,913,548,764,000
26.778125
80
0.456369
false
4.393245
false
false
false
multmeio/mongoforms_dfields
mongoforms_dfields/models.py
1
1449
from mongoengine import * __all__ = ['DynamicFields', 'has_dfields'] def has_dfields(cls): class new_cls(cls): @property def _dfields(self): return DynamicFields._dfields(self.__class__.__name__) #return new_cls cls._dfields = DynamicFields._dfields(cls.__name__) return ...
bsd-3-clause
671,419,907,069,339,400
32.697674
67
0.606625
false
3.696429
false
false
false
nasseralkmim/SaPy
sapy/plotter.py
1
4743
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d.art3d import Line3D from matplotlib.lines import Line2D import numpy as np def window(name): return plt.figure(name) def show(): plt.show() return None def undeformed(model): """Plot the undeformed st...
gpl-3.0
-5,779,562,700,302,910,000
27.065089
76
0.557453
false
2.865861
false
false
false
MeteoSwiss-APN/dawn
dawn/examples/python/unstructured_stencil.py
1
3291
#!/usr/bin/env python ##===-----------------------------------------------------------------------------*- Python -*-===## # _ # | | # __| | __ ___ ___ ___ # / _` |/ _` \ \ /\ / / '_ | # | (_| | (_| |\ V V /| | | | # \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain ## ## # This file is distributed under the MIT...
mit
-6,889,278,726,625,721,000
29.472222
109
0.502887
false
3.979444
false
false
false
GeoffEvans/aol_model
aol_model/tests/test_ray.py
1
2020
from aol_model.ray import Ray from numpy import allclose, array import pytest from aol_model.vector_utils import normalise position = [0,0,2] wavevector_unit = [1,0,0] wavelength = 10 energy = 1 def test_setting_non_unit_vector(): with pytest.raises(ValueError): Ray(position, [1,0,0.1], wavelength, energy...
gpl-3.0
5,728,991,373,070,086,000
36.407407
82
0.663366
false
2.748299
true
false
false
LaboratoireMecaniqueLille/crappy
crappy/blocks/generator.py
1
5313
# coding: utf-8 from time import time, sleep from .block import Block from . import generator_path from .._global import CrappyStop class Generator(Block): """This block is used to generate a signal. It can be used to drive a machine. This block can take inputs, and each path can use these inputs to take dec...
gpl-2.0
5,740,492,613,717,999,000
35.641379
79
0.613025
false
3.631579
false
false
false
xperroni/DevAI2014MOOC
agent03.py
1
6019
#!/usr/bin/env python r''' Implementation of the agent algorithm in tables 33-1 and 33-2 of the IDEAL MOOC lessons, with modifications required in the programming assignment. For details see http://liris.cnrs.fr/ideal/mooc/lesson.php?n=033 ''' from collections import namedtuple from itertools import cycle # Defaul...
gpl-3.0
-8,876,382,352,429,805,000
32.438889
109
0.627347
false
3.99668
false
false
false
artnez/faceoff
scripts/run-server.py
1
1416
#! /usr/bin/env python """ Runs Faceoff as a standalone web server. Do not use this is in production. Copyright: (c) 2012-2014 Artem Nezvigin <artem@artnez.com> License: MIT, see LICENSE for details """ from sys import path from os import environ from os.path import dirname, join path.append(join(dirname(__file__),...
mit
-6,100,939,657,828,664,000
43.25
97
0.716808
false
3.371429
false
false
false
hzlf/openbroadcast
website/apps/alibrary/migrations/0070_auto__add_field_playlistitemplaylist_fade_cross.py
1
44115
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'PlaylistItemPlaylist.fade_cross' db.add_column('alibrary_playlistitemplaylist', 'fade_cross'...
gpl-3.0
-444,404,339,995,123,100
95.11329
228
0.556545
false
3.614798
false
false
false
mitchellrj/touchdown
docs/conf.py
1
6509
# -*- coding: utf-8 -*- # # touchdown documentation build configuration file, created by # sphinx-quickstart on Tue Jun 28 13:27:09 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
apache-2.0
8,320,803,518,411,920,000
31.222772
80
0.710401
false
3.725816
true
false
false
KevinPike/pycache
pycache/factory.py
1
1570
from pycache.client import BaseClient, CacheClient from twisted.internet.protocol import ClientFactory class BaseFactory(ClientFactory): def __init__(self, command, rest, version, headers, data, response): self.response = response self.command = command self.rest = rest self.header...
mit
-941,296,832,950,062,100
36.380952
83
0.663057
false
4.289617
false
false
false
AdotDdot/sproxy
sproxy.py
1
17349
#!/usr/bin/env python # # sproxy.py # Copyright (C) 2014 by A.D. <adotddot1123@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope ...
gpl-3.0
-7,804,019,473,612,624,000
32.884766
135
0.621707
false
3.26109
false
false
false
pyladieshre/pyladies
profiles/migrations/0002_auto_20170301_1823.py
1
1075
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-01 16:23 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('profiles', '0001_initial'), ] operations = [ migrations.RemoveField( ...
mit
6,117,124,205,016,900,000
26.564103
73
0.547907
false
4.317269
false
false
false
spzala/heat-translator
translator/hot/translate_outputs.py
1
1734
# # 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
-2,684,508,997,003,707,400
37.533333
75
0.583622
false
4.423469
false
false
false
ethertricity/bluesky
bluesky/traffic/route.py
1
40143
""" Route implementation for the BlueSky FMS.""" from os import path from numpy import * import bluesky as bs from bluesky.tools import geo from bluesky.tools.aero import ft, kts, g0, nm, mach2cas from bluesky.tools.misc import degto180 from bluesky.tools.position import txt2pos from bluesky import stack from ...
gpl-3.0
8,999,277,182,077,421,000
34.262873
116
0.463667
false
3.659677
false
false
false
m-sanders/wagtail
wagtail/wagtailcore/blocks/field_block.py
1
15150
from __future__ import absolute_import, unicode_literals import datetime import six from django import forms from django.db.models.fields import BLANK_CHOICE_DASH from django.template.loader import render_to_string from django.utils.encoding import force_text from django.utils.dateparse import parse_date, parse_time,...
bsd-3-clause
-8,166,659,378,905,206,000
38.659686
149
0.65538
false
4.162088
false
false
false
kalov/ShapePFCN
caffe-ours/python/caffe/io.py
1
12728
import numpy as np import skimage.io from scipy.ndimage import zoom from skimage.transform import resize try: # Python3 will most likely not be able to load protobuf from caffe.proto import caffe_pb2 except: import sys if sys.version_info >= (3, 0): print("Failed to include caffe_pb2, things mi...
gpl-3.0
4,644,182,825,572,241,000
32.232376
110
0.57731
false
3.756789
false
false
false
killabytenow/chirribackup
chirribackup/chunk.py
1
17877
#!/usr/bin/env python # -*- coding: UTF-8 -*- ############################################################################### # chirribackup/chunk.py # # Represents a chunk (in disk and database) # # ----------------------------------------------------------------------------- # Chirri Backup - Cheap and ugly backup ...
gpl-3.0
1,141,182,365,382,941,700
36.554622
107
0.510573
false
4.316832
false
false
false
DomenicD/dom_ml_playground
python/src/learning_algorithms/backpropagation.py
1
3948
from python.src.neural_networks.neural_network_utils import NeuralNetworkUtils from python.src.neurons.neurons import NeuronType import math import random # http://home.agh.edu.pl/~vlsi/AI/backp_t_en/backprop.html # http://www.cse.unsw.edu.au/~cs9417ml/MLP2/ class TrainingResult(object): def __init__(self, epo...
mit
3,596,455,763,504,661,500
33.622807
79
0.578561
false
4.577726
false
false
false
doug-willowit/Pentaho-reports-for-OpenERP
openerp_addon/pentaho_reports/core.py
1
8394
# Todo: # multiple prpt files for one action - allows for alternate formats. import io import os import logging import subprocess import xmlrpclib import base64 import netsvc import pooler import report from osv import osv, fields from tools.translate import _ from datetime import datetime from .java_oe import ...
gpl-2.0
8,452,356,818,902,484,000
40.554455
237
0.598165
false
4.128874
true
false
false
Hawaii-Smart-Energy-Project/Maui-Smart-Grid
src/static-data-insert/insertSCADAWeatherData.py
1
3206
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script for inserting Kihei SCADA temperature and humidity data. Usage: With the current working directory set to the path containing the data files, python insertSCADAWeatherData.py """ __author__ = 'Daniel Zhang (張道博)' __copyright__ = 'Copyright (c) 2013, Uni...
bsd-3-clause
2,025,799,630,373,709,300
26.586207
79
0.4625
false
3.539823
false
false
false
hertzwhenip/virtual-hammond
server/tests/test_rtttl_parser.py
1
2592
import unittest from sound.rtttl_parser import RtttlParser class TestRtttlParser(unittest.TestCase): SONG = { 'rtttl': 'The Simpsons:d=4,o=5,b=160:c.6,e6,f#6,8a6,g.6,e6,c6,8a,8f#,8f#,8f#,2g,8p,8p,8f#,8f#,8f#,8g,a#.,8c6,8c6,8c6,c6', 'name': 'The Simpsons', 'defaults': ['d=4', 'o=5', 'b=160']...
mit
-3,223,086,175,731,740,000
31.4
371
0.574074
false
2.714136
true
false
false
MattDevo/edk2
BaseTools/Source/Python/UPT/Library/DataType.py
1
34284
## @file # This file is used to define class for data type structure # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # distribution...
bsd-2-clause
-7,997,813,902,356,939,000
33.787056
103
0.630002
false
2.710626
false
false
false
johnctitus/troposphere
troposphere/elasticache.py
1
5742
# Copyright (c) 2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. import re from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer, network_port def validate_node_group_id(node_group_id): if re.match(r'\d{1,4}', node_group_id): ret...
bsd-2-clause
-3,716,745,561,203,455,500
35.573248
79
0.621038
false
4.222059
false
false
false
shyamsg/SantasHelpers
chooseRegions.py
1
1551
#! /usr/bin/env python import argparse import numpy as np if __name__ == '__main__': parser = argparse.ArgumentParser(description="Choosen regions from the reference genome randomly") parser.add_argument("-i", "--inFai", dest="fai", type=str, metavar="InputFai", required=True, help='Input fai file.') par...
gpl-2.0
-2,323,732,259,144,801,000
36.829268
144
0.681496
false
2.971264
false
false
false
yxdong/ybk
ybk/frontend/analysis.py
1
1815
from datetime import datetime, timedelta from flask import render_template, request from flask.ext.login import login_required from .views import frontend from ybk.models import Exchange, Collection from ybk.settings import get_conf @frontend.route('/analysis/') @login_required def analysis(): nav = 'analysis'...
mit
-1,996,561,718,319,700,000
29.762712
68
0.597796
false
3.510638
false
false
false
iulian787/spack
var/spack/repos/builtin/packages/amdfftw/package.py
2
4829
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from spack import * from spack.pkg.builtin.fftw import FftwBase class Amdfftw(FftwBase): """FFTW (AMD Opti...
lgpl-2.1
-6,301,221,080,735,432,000
36.146154
94
0.59971
false
3.974486
true
false
false
tghack/tg17hack
crypto/badcrypt/src/monoalfencryption.py
1
1033
from string import letters, digits from random import shuffle def random_monoalpha_cipher(pool=None): """Generate a Monoalphabetic Cipher""" if pool is None: pool = letters + digits original_pool = list(pool) shuffled_pool = list(pool) shuffle(shuffled_pool) return dict(zip(original_poo...
mit
7,349,783,800,624,586,000
33.433333
72
0.696031
false
3.868914
false
false
false
koomik/CouchPotatoServer
couchpotato/core/plugins/renamer.py
1
66589
import fnmatch import os import re import shutil import time import traceback from couchpotato import get_db from couchpotato.api import addApiView from couchpotato.core.event import addEvent, fireEvent, fireEventAsync from couchpotato.core.helpers.encoding import toUnicode, ss, sp from couchpotato.core.helpers.variab...
gpl-3.0
-1,406,769,838,317,215,200
46.631617
323
0.507561
false
4.674224
false
false
false
bharatendra/ctools
token-hexkey.py
1
1336
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License...
apache-2.0
-5,021,201,686,931,444,000
31.585366
80
0.727545
false
3.731844
false
false
false
oxhagolli/ubhacking
UBHacking/pillpal/alphapillpal/views/accounts.py
1
4971
from django.shortcuts import render from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User, Group from django.http import HttpResponseRedirect, HttpResponseForbidden, \ Http404, HttpResponseBadRequest, HttpResponse from django.core.urlresolvers import reverse from dj...
mit
-8,790,507,695,025,733,000
33.289655
83
0.626031
false
4.315104
false
false
false
ajb/pittsburgh-purchasing-suite
purchasing/wexplorer/views.py
1
13399
# -*- coding: utf-8 -*- import re from flask import ( render_template, current_app, request, abort, flash, redirect, url_for ) from flask_login import current_user from purchasing.database import db from purchasing.utils import SimplePagination from purchasing.decorators import wrap_form, requires_roles from...
bsd-3-clause
-8,969,974,666,736,317,000
32.921519
103
0.618703
false
3.892795
false
false
false
BenClegg/piromancer-synth
synth/buttons.py
1
2343
# Licensed under GPLv3 (https://www.gnu.org/licenses/gpl.html) import time import threading import RPi.GPIO as GPIO # Button input pins P_BTN_OSC_WAVEFORM = 11 P_BTN_FILT_TYPE = 13 # PTM momentary switches should be connected to these pins and GND # Wave IDs WAVE_SUPERSAW = 1 # Roland JP-8000 emulation WAVE_SINE = 2...
gpl-3.0
7,878,142,144,141,442,000
33.970149
85
0.662399
false
3.445588
false
false
false
tgl-dogg/BCC-2s14-PI4-SteampunkSpider
src/steampunk_spider/visualisacoes/lancamentosPorEstacao.py
1
4623
import math from math import pi, radians, sin, cos, degrees import mysql.connector from mysql.connector import errorcode size(2048, 2048) stroke(0) strokewidth(1) nofill() translate(1024, 1024) beginpath(0, 0) c = oval(-1024, -1024, 2048, 2048) endpath(draw = False) drawpath(c) months = ["Jan", "Feb", "Mar", "Apr"...
mit
-1,711,026,775,163,383,800
29.622517
116
0.568029
false
3.104768
false
false
false
christianknu/eitu
eitu/views.py
1
2436
from django.http import HttpResponse, JsonResponse import logging from eitu.core import fetch_schedules, render, fetch_wifi import eitu.constants as constants import eitu.formaters as formaters from datetime import datetime import pytz import json def index(request): # Logging logging.getLogger().setLevel(l...
mit
3,228,202,691,440,036,000
34.26087
163
0.592105
false
3.635277
false
false
false
commtrack/commtrack-old-to-del
apps/xformmanager/management/commands/sync_schema.py
1
3624
""" This script downloads synchronization data from a remote server, deletes local xforms and submissions, and loads the data """ import bz2 import sys import tarfile import urllib2 import httplib import cStringIO from urlparse import urlparse from optparse import make_option from django.core.management.base import La...
bsd-3-clause
7,485,331,129,967,110,000
35.606061
115
0.625
false
3.956332
false
false
false
ActiveState/code
recipes/Python/412982_Use_PIL_make_contact_sheet_montage/recipe-412982.py
1
1718
def make_contact_sheet(fnames,(ncols,nrows),(photow,photoh), (marl,mart,marr,marb), padding): """\ Make a contact sheet from a group of filenames: fnames A list of names of the image files ncols Number of columns in the contact sheet n...
mit
6,723,089,231,762,139,000
31.415094
68
0.5844
false
3.834821
false
false
false
gitterHQ/ansible
v2/ansible/parsing/yaml/composer.py
1
1212
from yaml.composer import Composer from yaml.nodes import MappingNode class AnsibleComposer(Composer): def __init__(self): self.__mapping_starts = [] super(Composer, self).__init__() def compose_node(self, parent, index): # the line number where the previous token has ended (plus empty ...
gpl-3.0
-8,253,240,035,466,746,000
42.285714
79
0.609736
false
4.344086
false
false
false
tarsqi/ttk
utilities/convert.py
1
46925
"""convert.py Some format conversion utilities. Run all commands below from the parent directory using the -m option. 1. Convert LDC TimeBank into a modern TimeBank in the TTK format. $ python -m utilities.convert --timebank2ttk TIMEBANK_DIR TTK_DIR Converts TimeBank 1.2 as released by LDC into a version with...
apache-2.0
-3,801,298,380,938,140,700
39.072588
98
0.620266
false
3.540441
false
false
false
chrisseto/osf.io
api/nodes/views.py
1
154904
import re from django.apps import apps from modularodm import Q as MQ from rest_framework import generics, permissions as drf_permissions from rest_framework.exceptions import PermissionDenied, ValidationError, NotFound, MethodNotAllowed, NotAuthenticated from rest_framework.response import Response from rest_framewor...
apache-2.0
5,522,730,103,969,849,000
42.052807
306
0.614697
false
4.750782
false
false
false
arbn/pysaml2
src/saml2/assertion.py
1
24504
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010-2011 Umeå 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...
bsd-2-clause
-5,398,401,206,502,696,000
33.464135
80
0.538261
false
4.65748
false
false
false