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
YetAnotherTimeTracker/yatt
components/keyboard_builder.py
1
8578
""" Created by anthony on 09.12.2017 keyboard_builder """ import json import logging from telegram import InlineKeyboardButton, InlineKeyboardMarkup from emoji import emojize from abc import ABC, abstractmethod from components.message_source import message_source from config.state_config import Action, CallbackData, L...
mit
322,103,586,581,024,400
34.098361
130
0.59645
false
3.986965
false
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_py3.py
1
4768
# 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
-7,978,256,446,087,864,000
45.745098
314
0.641149
false
3.917831
true
false
false
froyobin/horizon
openstack_dashboard/api/swift.py
1
11720
# 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,600,883,313,530,580,000
33.369501
79
0.588908
false
4.208259
false
false
false
TAMU-CPT/galaxy-tools
tools/webapollo/create_bot_account.py
1
1306
#!/usr/bin/env python import sys import time import random import argparse from webapollo import WAAuth, WebApolloInstance def pwgen(length): chars = list("qwrtpsdfghjklzxcvbnm") return "".join(random.choice(chars) for _ in range(length)) if __name__ == "__main__": parser = argparse.ArgumentParser( ...
gpl-3.0
6,688,415,140,086,996,000
27.391304
71
0.6317
false
3.289673
false
false
false
google-research/google-research
tf3d/utils/preprocessor_utils.py
1
51379
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
7,248,648,716,047,035,000
43.990368
80
0.673213
false
3.643642
false
false
false
scissorhands/pynal
index_microservice.py
1
1287
from requester import Requester import json req = Requester() localTest = False print('Loading function') def respond(err, res=None): return { 'statusCode': '400' if err else '200', 'body': err.message if err else json.dumps(res), 'headers': { 'Content-Type': 'application/json...
mit
-7,226,657,269,895,813,000
24.254902
84
0.547786
false
4.192182
false
false
false
ManiacTwister/dionaea
tst.py
1
4621
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An example IRC log bot - logs a channel's events to a file. If someone says the bot's name in the channel followed by a ':', e.g. <foo> logbot: hello! the bot will reply: <logbot> foo: I am a log bot Run this script with two arguments, t...
gpl-2.0
3,232,283,562,164,790,300
28.819355
79
0.628003
false
3.987058
false
false
false
DBuildService/atomic-reactor
tests/plugins/test_imagebuilder.py
1
4298
# -*- coding: utf-8 -*- """ Copyright (c) 2017 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 subprocess from io import StringIO from dockerfile_parse import DockerfileParser from atomic_reactor.plugin ...
bsd-3-clause
-856,871,862,291,765,400
32.578125
95
0.688692
false
3.587646
true
false
false
calispac/digicampipe
digicampipe/scripts/concatenate.py
1
2274
#!/usr/bin/env python """ concatenate the input fits files to one output. Useful to merge the output of several runs (f.e. hillas.fits from pipeline.py) Usage: digicam-concatenate <OUTPUT> <INPUTS>... Options: -h --help Show this screen. """ from astropy.table import Table, vstack from docopt i...
gpl-3.0
5,729,239,564,986,040,000
28.153846
78
0.575198
false
3.79
false
false
false
quininer/isperdal
tests/test_response.py
1
2239
#!/usr/bin/env python # encoding: utf-8 from io import BytesIO import asyncio from isperdal.response import Response from isperdal.utils import Result, Err class fakeStreamIO(): def __init__(self, buffer=b''): self.buffer = BytesIO(buffer) @asyncio.coroutine def read(self): return self....
mit
-160,623,255,711,589,820
26.641975
64
0.603841
false
3.382175
true
false
false
isogeo/isogeo-plugin-qgis
modules/isogeo_pysdk/models/thesaurus.py
1
6551
# -*- coding: UTF-8 -*- #! python3 # noqa E265 """ Isogeo API v1 - Model of Thesaurus entity See: http://help.isogeo.com/api/complete/index.html#definition-thesaurus """ # ############################################################################# # ########## Libraries ############# # ###################...
gpl-3.0
-145,629,370,743,624,300
27.606987
91
0.456419
false
4.27332
false
false
false
carthage-college/django-djpsilobus
djpsilobus/bin/create_item.py
1
1279
# -*- coding: utf-8 -*- import os, sys # env os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djpsilobus.settings.shell') import django django.setup() from django.conf import settings from djpsilobus.core.utils import create_item import argparse YEAR = settings.YEAR SESS = 'RA' # set up command-line options des...
mit
2,744,912,373,722,259,500
18.089552
76
0.589523
false
3.339426
false
false
false
pombredanne/pants
src/python/pants/subsystem/subsystem.py
1
9021
# 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 inspect from...
apache-2.0
-4,503,986,979,740,292,000
34.376471
100
0.704467
false
4.07821
false
false
false
xuhcc/airy
airy/units/project.py
1
1613
import logging from marshmallow import ValidationError from airy.models import Project, TaskStatus from airy.exceptions import ProjectError from airy.database import db from airy.serializers import ProjectSerializer logger = logging.getLogger(__name__) def get(project_id, task_status): project = db.session.que...
mit
347,272,064,971,457,660
30.019231
76
0.66894
false
3.886747
false
false
false
cavestruz/StrongCNN
data/combine_bands_parallel.py
1
2762
from astropy.io.fits import getdata, writeto import numpy as np from glob import glob import os, time, sys from multiprocessing import Pool time_now = time.time() # To identify unique ids # IDs_dir='/data/avestruz/StrongCNN/Challenge/FinalData/GroundBased/' # IDs_glob=['*[12]*', '*[34]*', '*[56]', '*[7...
mit
-3,782,651,069,749,726,700
39.617647
153
0.631789
false
3.11036
false
false
false
LeahGabrielle/CMPUT404-assignment-web-client
httpclient.py
1
4950
#!/usr/bin/env python # coding: utf-8 # Copyright 2016 Abram Hindle, https://github.com/tywtyw2002, and https://github.com/treedust, Leah Olexson # # 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...
apache-2.0
-4,791,016,644,915,281,000
32.445946
127
0.583636
false
3.53067
false
false
false
fzimmermann89/pyload
module/plugins/hoster/OboomCom.py
1
4726
# -*- coding: utf-8 -*- # # Test links: # https://www.oboom.com/B7CYZIEB/10Mio.dat import re from module.plugins.internal.utils import json from module.plugins.internal.Hoster import Hoster from module.plugins.captcha.ReCaptcha import ReCaptcha class OboomCom(Hoster): __name__ = "OboomCom" __type__ = ...
gpl-3.0
8,458,924,895,958,565,000
32.048951
121
0.542531
false
3.526866
false
false
false
Yepoleb/pygogapi
gogapi/normalization.py
1
1618
from gogapi import names GOG_TO_IETF = { "brazilian": "pt-BR", "brazilian-portuguese": "pt-BR", "czech": "cs-CZ", "english": "en-US", "french": "fr-FR", "german": "de-DE", "hungarian": "hu-HU", "italian": "it-IT", "japanese": "ja-JP", "neutral": "*", "polish": "pl-PL", ...
mit
5,335,934,196,250,909,000
19.74359
45
0.453646
false
2.382916
false
false
false
jzbontar/orange-tree
Orange/data/table.py
1
48324
import os import zlib from collections import MutableSequence, Iterable, Sequence, Sized from itertools import chain from numbers import Real import operator from functools import reduce from warnings import warn import numpy as np import bottlechest as bn from scipy import sparse as sp from .instance import * from O...
gpl-3.0
4,466,894,080,470,622,000
36.664848
81
0.506601
false
3.990751
false
false
false
achaudhry/adhan
updateAzaanTimers.py
1
2796
#!/usr/bin/env python import datetime import time import sys sys.path.insert(0, '/home/pi/adhan/crontab') from praytimes import PrayTimes PT = PrayTimes() from crontab import CronTab system_cron = CronTab(user='pi') now = datetime.datetime.now() strPlayFajrAzaanMP3Command = 'omxplayer -o local /home/pi/adhan/Adhan...
lgpl-3.0
-1,138,263,820,909,050,100
28.755319
96
0.711016
false
2.870637
false
false
false
ebrensi/heatflask
heatflask/models.py
1
71377
# Standard library imports import json import uuid import time from bson import ObjectId from operator import truth from bson.binary import Binary from contextlib import contextmanager from datetime import datetime, timedelta from itertools import islice, repeat, starmap, takewhile # Third party imports import gevent ...
gpl-3.0
-8,847,231,189,969,211,000
29.792494
115
0.503327
false
4.423737
false
false
false
wodo/WebTool3
webtool/server/serializers/frontend/values.py
1
4784
from rest_framework import serializers from .core import MoneyField class StateListField(serializers.ListField): id = serializers.PrimaryKeyRelatedField(source='pk', read_only=True) state = serializers.CharField(source='name', read_only=True) description = serializers.CharField(read_only=True) class Ca...
bsd-2-clause
3,355,087,975,945,073,000
40.241379
109
0.76944
false
3.914894
false
false
false
dalab/dissolve-struct
helpers/brutus_setup.py
1
1791
'''Setup dissolve^struct environment on Brutus. (To be executed ON Brutus in the home directory.) ''' __author__ = 'tribhu' import os import argparse from benchmark_utils import * from retrieve_datasets import retrieve, download_to_gen_dir from paths import PROJECT_DIR, JARS_DIR, DATA_DIR LIB_JAR_URL = 'https://dl....
apache-2.0
-2,591,523,950,246,154,000
31.581818
110
0.659966
false
3.025338
false
false
false
google/grr
grr/server/grr_response_server/databases/mysql.py
1
21167
#!/usr/bin/env python """MySQL implementation of the GRR relational database abstraction. See grr/server/db.py for interface. """ import contextlib import logging import math import random import time from typing import Callable import warnings # Note: Please refer to server/setup.py for the MySQLdb version that is ...
apache-2.0
-1,700,236,500,574,913,800
34.57479
80
0.668919
false
3.927816
true
false
false
belatrix/BackendAllStars
employees/views.py
1
29729
from .models import Employee, Location, Position, Role, EmployeeDevice from .serializers import EmployeeSerializer, EmployeeAvatarSerializer, EmployeeListSerializer from .serializers import EmployeeLocationListSerializer, EmployeePositionListSerializer, EmployeeRoleListSerializer from .serializers import EmployeeTopTot...
apache-2.0
6,049,332,171,966,577,000
36.584071
116
0.628612
false
4.397131
true
false
false
rescrv/gitswitch
gitswitch/__init__.py
1
1933
# Copyright (c) 2015, Robert Escriva # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
bsd-3-clause
-3,126,302,541,150,071,000
49.868421
80
0.738231
false
4.156989
false
false
false
mvo5/snapcraft
tests/unit/test_errors.py
1
35692
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2017-2018 Canonical Ltd # # 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 ...
gpl-3.0
3,520,889,261,481,084,400
38.0931
114
0.44192
false
5.060542
true
false
false
cstaubli/neuralNetwork
src/MNIST_backquery.py
1
1045
import numpy as np import scipy.special as sc import matplotlib.pyplot as pp from NeuralNetwork import NeuralNetwork input_nodes = 784 hidden_nodes = 200 output_nodes = 10 learning_rate = 0.2 nn = NeuralNetwork(input_nodes, hidden_nodes, output_nodes, learning_rate) data_file_train = open("../../Downloads/mnist_trai...
mit
-2,458,329,376,467,386,400
26.5
77
0.653589
false
3.119403
false
false
false
alexander-svendsen/ev3-python
behaviors/fuzzy.py
1
7320
# -*- coding: utf-8 -*- def falling_fuzzy(small_value, big_value, value): """ Will return how true the provided value is depending on the small and big numbers. The closer the value is to small_value the more true it is. The closer it is to the big_value the less true it is. @type small_value: float ...
mit
-5,634,563,076,176,928,000
34.197115
118
0.638251
false
4.515731
false
false
false
natemara/jumprunpro-python
setup.py
1
1076
from setuptools import setup from os import path BASE_PATH = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(BASE_PATH, 'README.rst'), 'r') as f: long_description = f.read() setup( name='python-jumprunpro', version='0.0.2', author='Nate Mara', author_em...
mit
1,568,404,348,361,246,000
27.315789
73
0.685874
false
3.091954
false
false
false
LeonardCohen/coding
py/menucase/SourceCode/setup.py
1
1165
#!/usr/bin/env python import re from setuptools import setup # load our version from our init file init_data = open('menu/__init__.py').read() matches = re.search(r"__version__ = '([^']+)'", init_data, re.M) if matches: version = matches.group(1) else: raise RuntimeError("Unable to load version") requiremen...
gpl-2.0
-2,027,599,097,329,618,200
29.657895
83
0.627468
false
4.045139
false
false
false
petroniocandido/pyFTS
pyFTS/partitioners/Util.py
1
3049
""" Facility methods for pyFTS partitioners module """ import numpy as np import pandas as pd import matplotlib as plt import matplotlib.colors as pltcolors import matplotlib.pyplot as plt #from mpl_toolkits.mplot3d import Axes3D from pyFTS.benchmarks import Measures from pyFTS.common import Membership, Util from pyF...
gpl-3.0
-7,867,580,158,973,801,000
33.258427
110
0.631683
false
3.433559
false
false
false
destijl/grr
grr/lib/flows/general/registry.py
1
7401
#!/usr/bin/env python """Gather information from the registry on windows.""" import re import stat from grr.lib import aff4 from grr.lib import artifact from grr.lib import artifact_utils from grr.lib import flow from grr.lib.aff4_objects import aff4_grr from grr.lib.aff4_objects import standard # For ArtifactCollect...
apache-2.0
-8,502,684,529,613,473,000
33.910377
80
0.674098
false
3.764496
false
false
false
DarioGT/OMS-PluginXML
org.modelsphere.sms/lib/jython-2.2.1/Tools/jythonc/main.py
1
8961
# Copyright (c) Corporation for National Research Initiatives """Usage: jythonc [options] [module]* where options include: --ignore-warning -i silence the jythonc deprecation warning --package package -p package put all compiled code into the named Java package --jar jarfile ...
gpl-3.0
-5,805,641,670,190,629,000
26.906452
231
0.551389
false
4.129493
false
false
false
Dascr32/tempy
tempy/scripts/analyzer.py
1
2963
import os import tempfile import prettytable from contextlib import suppress from collections import OrderedDict from tempy.scripts import converter TEMP_DIR = tempfile.gettempdir() def dir_tree(root_dir_path=TEMP_DIR): root_dirs_detail = "." root_files = "" for element in os.listdir(root_dir_path): ...
mit
-3,387,558,169,147,191,000
26.183486
87
0.619305
false
3.318029
false
false
false
chengdujin/newsman
newsman/tools/text_based_feeds/remove_bad_feeds.py
1
1812
#!/usr/bin/env python #-*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding('UTF-8') sys.path.append('../..') from config.settings import Collection, db import feedparser col = Collection(db, 'feeds') """ f = open('db_id_list', 'r') feed_ids = f.readlines() feed_ids = [feed_id.strip() for feed_id i...
agpl-3.0
-5,265,236,164,158,546,000
32.555556
110
0.456402
false
3.930586
true
false
false
OptimalPayments/Python_SDK
src/PythonNetBanxSDK/HostedPayment/HostedPaymentService.py
1
14343
''' Created on 30-Jan-2015 @author: Asawari.Vaidya ''' from PythonNetBanxSDK import HostedPayment from PythonNetBanxSDK import common class HostedPaymentService(object): ''' classdocs ''' # Define URL paths for Order _MONITOR_PATH = '/hosted/monitor' _URI = '/hosted/v1' _O...
mit
5,433,925,117,311,389,000
34.496183
92
0.460991
false
4.779407
false
false
false
dongweiming/speakerdeck
tornado/7_done_callback_in_class_sleep.py
1
1317
#!/bin/env python import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from concurrent.futures import ThreadPoolExecutor from functools import partial, wraps import time from tornado.options import define, options define("port", default=8000, help="run on the given port", type=in...
apache-2.0
4,736,209,081,503,727,000
27.630435
81
0.660592
false
3.954955
false
false
false
yuvipanda/jupyterhub-kubernetes-spawner
setup.py
1
1418
from __future__ import print_function import sys from setuptools import find_packages from setuptools import setup v = sys.version_info if v[:2] < (3, 6): error = "ERROR: jupyterhub-kubespawner requires Python version 3.6 or above." print(error, file=sys.stderr) sys.exit(1) setup( name='jupyterhub-k...
bsd-3-clause
7,484,030,894,656,896,000
26.803922
81
0.598731
false
3.328638
false
false
false
DominikSchlecht/bibToPDF
bibToPDF.py
1
1224
import pdfkit import re import urllib2 import os from urlparse import urlparse # Open the file with open ("ref_liste.bib", "r") as myfile: data=myfile.read()#.replace('\n', '') # Create the list listOrig = re.findall("url = {.+}", data) listStripped = [] # Strip the url = { and } and store in listStripped for l...
mit
-1,664,918,445,562,978,800
20.473684
68
0.552288
false
3.326087
false
false
false
gonadarian/kagen
kagen/languages.py
1
2370
import sys import json import time import pymongo import threading from kagen import utils from queue import Queue from threading import Thread from datetime import datetime from kagen.utils import config logger = utils.get_logger("languages") dir_data = config["paths"]["dir_data"] lang = config["run"]["language"] dt...
mit
8,538,711,520,533,561,000
26.55814
76
0.589451
false
3.66306
true
false
false
ANCIR/southafrica
src/sa_pa_load.py
1
4912
import os import json import logging # from pprint import pprint from common import database, DATA_PATH log = logging.getLogger('pa') DATA_FILE = os.path.join(DATA_PATH, 'pa', 'pombola.json') pa_parties = database['sa_pa_parties'] pa_committees = database['sa_pa_committees'] pa_persons = database['sa_pa_persons'] pa...
mit
-3,338,801,708,528,631,000
34.854015
73
0.48351
false
4.127731
false
false
false
hanwen/artisjokke
stepmake/bin/ls-latex.py
1
3882
#!@PYTHON@ # name isn't really appropriate now ... name = 'ls-latex' version = '0.1' import sys import os import string import __main__ import glob import re format_names = {'ps.gz': 'Compressed PostScript', 'html' : 'HTML' } def gulp_file(f): try: i = open(f) i.seek (0, 2) n = i.tell () i.seek...
mit
4,253,950,513,687,588,000
17.311321
72
0.554611
false
2.402228
false
false
false
0compute/makeenv
makeenv/build/docextract.py
1
1556
import base64 import csv import sys FIELDS = ("summary", "detail") def extract_doc(stream): targets = dict() target = None for line in stream: # only comment lines if not line.startswith("#"): continue # strip off the comment, trailing whitespace, and a single lead...
mit
3,061,406,965,105,990,000
27.814815
79
0.523136
false
4.549708
false
false
false
thunlp/OpenNE
src/openne/line.py
1
11072
from __future__ import print_function import random import math import numpy as np from sklearn.linear_model import LogisticRegression import tensorflow as tf from .classify import Classifier, read_node_label class _LINE(object): def __init__(self, graph, rep_size=128, batch_size=1000, negative_ratio=5, order=3)...
mit
-5,420,315,001,920,805,000
39.856089
161
0.52836
false
3.694361
false
false
false
kylewu/gaeblog
lib/bootstrap3/renderers.py
1
12053
from django.forms import (TextInput, DateInput, FileInput, CheckboxInput, ClearableFileInput, Select, RadioSelect, CheckboxSelectMultiple) from django.forms.extras import SelectDateWidget from django.forms.forms import BaseForm, BoundField from django.utils.encoding import force_text from django.utils.html import c...
gpl-3.0
-8,597,621,984,154,109,000
38.133117
257
0.593213
false
3.92095
false
false
false
subramgo/Py4DS
07_BaseEstimator.py
1
3031
""" Demonstrate how to build a quick and dirty Base Line Model using scikit learn """ # Load Libraries import numpy as np from sklearn import datasets from sklearn.metrics import accuracy_score, confusion_matrix # Let us use Iris dataset iris = datasets.load_iris() x = iris.data y = iris.target from sklearn.dumm...
apache-2.0
7,064,592,021,978,935,000
26.306306
123
0.679314
false
2.959961
false
false
false
deanishe/alfred-searchio
src/lib/searchio/cmd/toggle.py
1
1873
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2017 Dean Jackson <deanishe@deanishe.net> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2017-12-10 # """searchio toggle <setting> Toggle a workflow setting on/off. Usage: searchio toggle <setting> searchio toggle -h Options: ...
mit
4,970,042,501,431,328,000
21.297619
76
0.624666
false
3.240484
false
false
false
Riebart/slot-c
Lambda/PostParticipant.py
1
1043
import json import time import boto3 ddb = boto3.client('dynamodb') def handler(event, context): try: print "X-Forwarded-For %s %s" % (repr(time.time()), event['InputParams']['header']['X-Forwarded-For'].replace(',','')) except: pass if 'MessagesTa...
apache-2.0
2,745,838,118,512,036,400
27.972222
107
0.536913
false
4.476395
false
false
false
Panos512/invenio
modules/websearch/lib/search_engine_query_parser.py
1
60631
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2008, 2010, 2011, 2012, 2013 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,...
gpl-2.0
5,362,998,865,806,903,000
41.879066
262
0.536458
false
3.99598
false
false
false
jakobzhao/wbcrawler3
backup/getOL.py
1
1621
# !/usr/bin/python # -*- coding: utf-8 -*- ''' Created on Oct 10, 2012 @author: Bo Zhao @email: Jakobzhao@gmail.com @website: http://yenching.org @organization: The Ohio State University ''' import sqlite3 import networkx as nx import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['M...
mit
8,190,734,424,875,956,000
25
108
0.683627
false
2.620513
false
false
false
varunmehta/photobooth
tests/displayjpg.py
1
1863
#!/usr/bin/env python import sys import time import traceback from signal import alarm, signal, SIGALRM import pygame now = "20140516121953" total_pics = 4 # number of pics to be taken w = 800 h = 450 transform_x = 600 # how wide to scale the jpg when replaying transfrom_y = 450 # how high to scale the jpg when ...
mit
1,025,581,892,687,532,800
31.684211
89
0.659152
false
3.45
false
false
false
Nervanti/eettee
api/snippets/views.py
1
8028
from snippets.models import Snippet, Tag from snippets.serializers import SnippetSerializer, TagSerializer from rest_framework import generics from django.contrib.auth.models import User from snippets.serializers import UserSerializer from rest_framework import permissions from snippets.permissions import IsOwnerOrRead...
mit
3,053,191,305,952,604,700
37.233333
142
0.659193
false
4.325431
false
false
false
UITools/saleor
saleor/product/filters.py
1
4137
from collections import OrderedDict from django.db.models import Q from django.forms import CheckboxSelectMultiple from django.utils.translation import pgettext_lazy from django_filters import MultipleChoiceFilter, OrderingFilter, RangeFilter from ..core.filters import SortedFilterSet from .models import Attribute, P...
bsd-3-clause
-5,137,634,278,517,840,000
37.305556
77
0.65313
false
4.405751
false
false
false
FFroehlich/AMICI
tests/performance/test.py
2
2657
#!/usr/bin/env python3 import amici import sys import CS_Signalling_ERBB_RAS_AKT_petab as model_module def main(): arg = sys.argv[1] model = model_module.getModel() solver = model.getSolver() # TODO edata = amici.ExpData(model) edata.setTimepoints([1e8]) edata.setObservedData([1.0]) ...
bsd-2-clause
5,378,787,865,668,688,000
39.257576
75
0.694769
false
3.459635
false
false
false
ricardog/raster-project
blocks.py
1
2511
#!/usr/bin/env python import fiona import numpy as np import numpy.ma as ma import rasterio import rasterio.features import rasterio.mask import pandas as pd import sys import pdb shp_file = '/Users/ricardog/src/eec/data/from-adriana/tropicalforests.shp' shp_file = '/Users/ricardog/src/eec/predicts/playground/tmp/to...
apache-2.0
-719,309,479,938,873,100
42.293103
82
0.557149
false
3.146617
false
false
false
ProkopHapala/SimpleSimulationEngine
cpp/common/math/derivation/BiotSawartIntegrals.py
1
4253
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt #VortexQuantum = 1.0/(4*np.pi) VortexQuantum = 1.0 # === Functions def IwireElement(y,x): return VortexQuantum* y/np.sqrt(x**2+y**2)**3 def IwireFinite(y,x1,x2): # finite wire with constant distribution of current # integral_a sin(a...
mit
-8,923,493,385,072,589,000
30.503704
98
0.58641
false
2.121197
false
false
false
cmusatyalab/GigaSight
src/UploadServer/no_signal_cloud_server.py
1
8521
#!/usr/bin/env python from collections import deque import asyncore import socket import tempfile import struct import time import logging from threading import Thread import Queue OutputDirs = deque() #OutputDirs.extend(("/tmp/test0-", "/mnt/tmp/test1-" )) OutputDirs.extend(("/tmp/test0-", "/tmp/test1-" )) Port = 808...
gpl-2.0
5,465,493,089,507,466,000
24.210059
210
0.637953
false
2.940304
false
false
false
Johnzero/OE7
openerp/release.py
1
2941
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
9,106,151,877,326,273,000
48.847458
121
0.66644
false
3.392157
false
false
false
fortyninemaps/karta
tests/grid_tests.py
1
33333
""" Unit tests for raster functions """ import unittest import os import numpy as np import numpy.testing as npt from test_helper import TESTDATA import karta from karta import RegularGrid class RegularGridTests(unittest.TestCase): def setUp(self): pe = peaks(n=49) self.rast = RegularGrid((0.0, ...
mit
-1,182,814,452,637,159,400
45.947887
103
0.511805
false
2.692053
true
false
false
our-city-app/oca-backend
src/rogerthat/settings.py
1
11671
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
3,287,275,056,232,238,000
49.52381
190
0.56439
false
4.566119
false
false
false
devsim/devsim
testing/noise_res.py
1
2229
# Copyright 2013 Devsim 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 or agreed to in writing, s...
apache-2.0
-2,075,594,265,298,277,400
41.056604
136
0.740691
false
2.936759
false
false
false
nirs/vdsm
tests/storage/mpathconf_test.py
1
2636
# # Copyright 2020 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in th...
gpl-2.0
2,737,707,858,353,670,000
22.963636
71
0.695751
false
3.254321
true
false
false
Gabotero/GNURadioNext
gr-blocks/python/qa_tag_debug.py
1
1441
#!/usr/bin/env python # # Copyright 2012-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
gpl-3.0
2,507,476,752,387,931,600
31.75
70
0.680777
false
3.540541
true
false
false
jszokoli/jsTK
jsRenamer/jsRenamer_ui.py
1
12042
import maya.cmds as cmds from functools import partial from . import custom_renamer from . import field_replacer from . import template_renamer from . import bonus_tools from . import renamer_settings as settings ######CollapseCommands##################################################### ############################...
gpl-3.0
6,968,500,557,390,415,000
26.556064
143
0.498754
false
3.98346
false
false
false
canarie/dair
OpenStack/misc/hardware.py
1
6283
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Openstack, LLC. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
apache-2.0
-28,713,282,382,201,856
44.201439
183
0.56438
false
4.533189
false
false
false
abeschneider/algorithm_notes
mergesort.py
1
2739
import numpy as np from IPython.display import clear_output from ipywidgets import * from step import StepExample from pjdiagram import * def merge(left, right): i = j = 0 result = [] while i < len(left) or j < len(right): if i >= len(left): result.append(right[j]) j += 1...
mit
5,105,404,817,888,927,000
24.839623
84
0.552026
false
3.502558
false
false
false
KRMAssociatesInc/eHMP
ehmp/product/production/jds/packRO.py
1
1934
#!/usr/bin/env python # Pack .m files into M[UMPS] routine transfer format (^%RO) # # python packRO.py *.m > routines.ro # # or # # ls *.m | python packRO.py > routines.ro # #--------------------------------------------------------------------------- # Copyright 2011 The Open Source Electronic Health Record Agent #...
apache-2.0
5,362,215,589,623,865,000
30.704918
119
0.58273
false
3.75534
false
false
false
pkilambi/python-gnocchiclient
gnocchiclient/openstack/common/apiclient/exceptions.py
1
13004
# Copyright 2010 Jacob Kaplan-Moss # Copyright 2011 Nebula, Inc. # Copyright 2013 Alessio Ababilov # Copyright 2013 OpenStack Foundation # 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 # ...
apache-2.0
-3,594,659,954,348,561,000
26.148225
79
0.654106
false
4.344805
false
false
false
jraymondli/JeremyCode
jeremy-python/codeforces/prob6b-Presidents_Office.py
1
4308
################################################## # Solution for prob 6b, President's office # finished, on test 20 # # This problem counts the number of desks that share a side with the president's desk(known as his associates). ################################################## layout = [] prezDeskY = [] prezDeskX ...
gpl-2.0
-1,887,390,708,797,643,800
46.340659
140
0.594011
false
3.759162
false
false
false
cwaldbieser/txcas
txcas/json_service_manager.py
1
9216
# Standard library import cgi import itertools import json import sys from textwrap import dedent import urlparse # Application modules from txcas.interface import IServiceManager, IServiceManagerFactory import txcas.settings # External modules from twisted.internet import reactor from twisted.plugin import IPlugin ...
gpl-3.0
6,314,659,935,648,708,000
30.240678
103
0.549479
false
4.256813
true
false
false
yt-project/unyt
docs/extensions/show_all_units.py
1
6661
from docutils.parsers.rst import Directive try: maketrans = "".maketrans except AttributeError: # python2 fallback from string import maketrans import unyt import unyt.dimensions as dims from unyt import Unit from unyt.exceptions import UnitsNotReducible from unyt._unit_lookup_table import name_alternati...
bsd-3-clause
-1,228,624,653,273,465,600
30.419811
95
0.546164
false
3.863689
false
false
false
jgowans/correlation_plotter
dram_reader.py
1
1101
#!/usr/bin/env python SNAPBLOCK_NAME = 'snapshot' SNAPSHOT_SIZE = 8 * (2**20) import corr import struct import matplotlib.pyplot as plt import numpy import time fpga = corr.katcp_wrapper.FpgaClient("localhost") fpga.snapshot_arm("adc0_snap", man_trig=False, man_valid=False, offset=-1, circular_capture=False) time.sl...
mit
-6,892,896,276,509,387,000
32.363636
114
0.689373
false
2.560465
false
false
false
jefemagril/fermipy
fermipy/model_utils.py
1
5901
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function import os import copy import yaml import numpy as np from fermipy import utils def get_function_par_names(name): """Get the list of parameters associated with a function. Parameter...
bsd-3-clause
-8,673,874,106,473,633,000
23.690377
78
0.566514
false
3.725379
false
false
false
lono-devices/lono-python
lono/lonoclient.py
1
5989
import requests import json import re from device import Device class LonoClient(object): """ This class is used to communicate with Lono, an internet-of-things conencted sprinkler controller and one of the first outdoor smart home companies. (If you aren't familiar, check us out at http://l...
mit
-7,704,560,314,129,709,000
31.906593
105
0.549507
false
4.060339
false
false
false
Zarthus/Reconcile
.travis/test_module.py
1
6912
""" The MIT License (MIT) Copyright (c) 2014 - 2015 Jos "Zarthus" Ahrens and contributors 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 rig...
mit
6,753,431,619,193,677,000
33.217822
118
0.610677
false
4.089941
false
false
false
anetasie/sherpa
sherpa/astro/datastack/plot_backend/plot_dummy.py
2
1392
# # Copyright (C) 2010, 2014, 2015 Smithsonian Astrophysical Observatory # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any late...
gpl-3.0
-9,072,150,496,490,720,000
29.26087
74
0.750718
false
3.741935
false
false
false
sorenh/python-django-greenfan
greenfan/management/commands/turn-off-non-build-nodes.py
1
1716
# # Copyright 2012 Cisco Systems, Inc. # # Author: Soren Hansen <sorhanse@cisco.com> # # 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...
apache-2.0
-1,588,627,230,691,060,200
32
83
0.687646
false
3.754923
false
false
false
ovalseven8/ToxMe
src/response.py
1
1396
""" ToxMe Copyright (C) 2016 <ovalseven8> 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 in the ...
gpl-3.0
-3,690,067,208,653,064,700
34.794872
88
0.73639
false
3.664042
false
false
false
Yangqing/caffe2
caffe2/python/layers/concat.py
1
4433
# Copyright (c) 2016-present, Facebook, 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...
apache-2.0
1,204,752,938,652,694,000
35.336066
88
0.579066
false
4.05581
false
false
false
duyuan11/glumpy
examples/isocurves.py
1
2497
#! /usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. # --------------------------------------------------------------------------...
bsd-3-clause
8,043,435,746,623,919,000
24.479592
79
0.60032
false
2.860252
false
false
false
chawlanikhil24/glustercli-python
gluster/cli/peer.py
1
2643
# -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com> # This file is part of GlusterFS. # # This file is licensed to you under your choice of the GNU Lesser # General Public License, version 3 or any later version (LGPLv3 or # later), or the GNU General Public License, version 2 (GPL...
gpl-2.0
-1,122,894,541,689,397,100
26.247423
91
0.603103
false
3.808357
false
false
false
developerworks/horizon
horizon/dashboards/nova/access_and_security/keypairs/views.py
1
2458
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 # no...
apache-2.0
-3,148,462,620,912,065,000
33.138889
78
0.709113
false
4.145025
false
false
false
imreeciowy/wfrp-gen
Being.py
1
1437
class Being(): def __init__(self, base_line_1, body1, base_line_2, body2, wounds_table, fate_table): self.base_line_1 = base_line_1 self.body1 = body1 self.base_line_2 = base_line_2 self.body2 = body2 self.wounds_table = wounds_table self.fate_table = fate_table cla...
mit
-5,220,204,129,817,047,000
28.9375
89
0.491301
false
2.561497
false
false
false
natec425/pybcca
pybcca/tui_helper.py
1
2419
from threading import Thread from queue import Queue import curses import time def listen_to_ticks(rate, input_queue): while True: input_queue.put('TICK') time.sleep(1 / rate) def listen_to_keys(input_queue, get_input): while True: try: input_queue.put(get_input()) ...
mit
2,659,222,071,516,116,000
27.458824
93
0.583299
false
4.038397
false
false
false
dustin/wokkel
wokkel/xmppim.py
1
22482
# -*- test-case-name: wokkel.test.test_xmppim -*- # # Copyright (c) 2003-2009 Ralph Meijer # See LICENSE for details. """ XMPP IM protocol support. This module provides generic implementations for the protocols defined in U{RFC 3921<http://www.xmpp.org/rfcs/rfc3921.html>} (XMPP IM). All of it should eventually move ...
mit
526,134,234,500,754,100
29.587755
79
0.593186
false
4.458945
false
false
false
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/openmdao.lib-0.13.0-py2.7.egg/openmdao/lib/drivers/slsqpdriver.py
1
6736
""" slsqpdriver.py - Contains a driver that wraps the SLSQP optimizer as used in pyOpt: Minimize a function using Sequential Least SQuares Programming. SLSQP is a gradient optimizer that can handle both equality and inequality constraints. """ # pylint: disable=E0611,F0401 from math import isnan from numpy import ze...
gpl-2.0
450,522,784,191,715,700
31.541063
80
0.578979
false
3.479339
false
false
false
coberger/DIRAC
WorkloadManagementSystem/DB/JobLoggingDB.py
1
7503
""" JobLoggingDB class is a front-end to the Job Logging Database. The following methods are provided addLoggingRecord() getJobLoggingInfo() getWMSTimeStamps() """ import time import sys from types import StringTypes, IntType, LongType from DIRAC import gLogger, S_OK, S_...
gpl-3.0
5,374,737,329,414,648,000
38.489474
108
0.515527
false
4.095524
false
false
false
madformuse/server
server/lobbyconnection.py
1
54956
import asyncio import hashlib import zlib import cgi import base64 import json import urllib.parse import zipfile import os import shutil import random import re import pymysql import rsa import time import smtplib import string import email from email.mime.text import MIMEText from PySide.QtCore import QIODevice, QF...
gpl-3.0
-7,916,653,111,401,984,000
39.798812
275
0.539195
false
4.279396
true
false
false
rfleschenberg/django-shop
shop/modifiers/base.py
1
7806
# -*- coding: utf-8 -*- from __future__ import unicode_literals class BaseCartModifier(object): """ Cart Modifiers are the cart's counterpart to backends. It allows to implement taxes and rebates / bulk prices in an elegant and reusable manner: Every time the cart is refreshed (via it's update() meth...
bsd-3-clause
874,495,456,300,939,600
41.194595
100
0.670382
false
4.591765
false
false
false
korotkyn/ibis
ibis/expr/types.py
1
26176
# Copyright 2014 Cloudera Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
apache-2.0
-8,437,189,225,828,377,000
22.392315
79
0.580417
false
4.20836
false
false
false
lilulu/openmc
openmc/settings.py
1
45497
from collections import Iterable from numbers import Real, Integral import warnings from xml.etree import ElementTree as ET import sys import numpy as np from openmc.clean_xml import * from openmc.checkvalue import (check_type, check_length, check_value, check_greater_than, check_less_t...
mit
-4,487,367,848,129,478,000
36.600826
80
0.621382
false
4.241354
false
false
false
DataReplyUK/datareplyuk
GenesAssociation/spark-2.0.0-bin-hadoop2.7/examples/src/main/python/sql.py
1
3128
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
339,505,073,238,758,000
36.686747
94
0.672315
false
3.852217
false
false
false
tkphd/pycalphad
pycalphad/tests/test_database.py
1
6194
""" The test_database module contains tests for the Database object. """ from __future__ import print_function from pyparsing import ParseException from pycalphad import Database, Model from pycalphad.io.tdb import expand_keyword from pycalphad.tests.datasets import ALCRNI_TDB, ALFE_TDB, ALNIPT_TDB, ROSE_TDB, DIFFUSION...
mit
-2,406,162,405,250,317,000
35.650888
116
0.656603
false
3.215992
true
false
false
lewisodriscoll/sasview
src/sas/sasgui/perspectives/fitting/resultpanel.py
1
3548
""" FitPanel class contains fields allowing to fit models and data :note: For Fit to be performed the user should check at least one parameter on fit Panel window. """ import wx import wx.lib.newevent from wx.aui import AuiNotebook as Notebook import datetime from bumps.gui.convergence_view import Convergence...
bsd-3-clause
-430,617,101,140,696,400
34.838384
98
0.622322
false
3.650206
false
false
false
rychuhardy/krysztaly-adpto
resources/judge/judge.py
1
2449
#!/usr/bin/python import sys import os def readBoard(fname): try: f=open(fname) s = f.readline() (W,K) = s.split() W = int(W) K = int(K) N = int(f.readline()) # print "wymiary",W,K,N t={} t["W"]=W t["K"]=K t["N"]=N for w in range(W): for k in range(K): t[w,k...
mit
5,546,611,646,527,904,000
6.51227
55
0.432013
false
2.537824
false
false
false
lazydragon/elk-ecs
lambda/lambda_function.py
1
1558
import os import re import string import logging import urllib import zlib import boto3 import redis REDIS_SERVER = os.environ['REDIS_SERVER'] REDIS_PORT = os.environ['REDIS_PORT'] REDIS_DB = os.environ['REDIS_DB'] REDIS_KEY = os.environ['REDIS_KEY'] DEST_BUCKET = os.environ['DEST_BUCKET'] DEST_PREFIX = os.environ['...
apache-2.0
5,430,283,681,980,292,000
30.795918
150
0.598203
false
3.01354
false
false
false
CMPUT-466-551-ML-Project/NILM-Project
nilm/markov.py
1
4099
def find_means(l, Y, k): # memo[m,k] is the minimum value of the optimization we can do over # {Y[0],...,Y[m-1]} with k means to use. memo = {} # means[m,k] is the value of the k means used to obtain the minimum # value over the {Y[0],...,Y[m-1]} means = {} for m in range(1,len(Y)+1): ...
gpl-2.0
3,459,171,566,702,417,400
32.598361
112
0.535984
false
3.025092
false
false
false
MaZderMind/imposm
imposm/base.py
1
3261
# Copyright 2011 Omniscale (http://omniscale.com) # # 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
4,418,163,463,848,045,000
28.125
74
0.587856
false
3.65583
false
false
false
unhaltable/txti
api/ssh-sign.py
1
10440
#!/usr/bin/python # A handy python script to use SSH host keys and known_host files to # encrypt/decrypt or sign/verify files. The basic idea is to have a HTTP # server without SSL, but you still can use it (internally) as package-distribution # or update server if you just ever connected to it via SSH and ensured # t...
mit
-3,619,467,810,263,964,700
25.769231
127
0.614943
false
2.819336
false
false
false