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
eing/moet
examples/pearl.py
1
5154
# # Copyright 2010 Intuit, Inc. # # Licensed under the Eclipse Public License, Version 1.0 (the "License"); # you may not use this file except in compliance with the License. Please # see the License for the specific language governing permissions and # limitations. You may obtain a copy of the License at # # http:/...
epl-1.0
-831,894,175,180,645,900
31.2125
74
0.482344
false
4.252475
false
false
false
shearern/rsync-usb
src/debug_ursync_target_hashes.py
1
4234
'''Dump the contents of the target hash file to be examined''' import sys import gflags from rsync_usb.ui.ConsoleUI import ConsoleUI from rsync_usb.ParameterError import ParameterError from rsync_usb.trx_files.TargetHashesReader import TargetHashesReader from rsync_usb.trx_files.TargetHashesReader impor...
gpl-2.0
-7,566,540,081,844,109,000
34.5
84
0.492678
false
4.338115
false
false
false
keon/algorithms
algorithms/tree/b_tree.py
1
9237
""" B-tree is used to disk operations. Each node (except root) contains at least t-1 keys (t children) and at most 2*t - 1 keys (2*t children) where t is the degree of b-tree. It is not a kind of typical bst tree, because this tree grows up. B-tree is balanced which means that the difference between height of left subt...
mit
-2,942,164,766,495,083,500
38.306383
123
0.574537
false
3.588578
false
false
false
EasyPost/beancmd
beancmd/beancmd.py
1
1788
import argparse import sys from . import __version__ from . import bury from . import flush from . import generate from . import kick from . import list_tubes from . import migrate from . import pause from . import peek from . import purge_buried from . import replay from . import stats from . import stats_tubes CO...
isc
2,348,757,235,685,940,700
30.928571
104
0.661633
false
3.492188
false
false
false
killerbat00/opalescence
opalescence/btlib/protocol/messages.py
1
13057
# -*- coding: utf-8 -*- """ Model classes for messages received over the bittorrent protocol. """ from __future__ import annotations __all__ = ['Message', 'Handshake', 'KeepAlive', 'Choke', 'Unchoke', 'Interested', 'NotInterested', 'Have', 'Bitfield', 'Request', 'Block', 'Piece', 'Cancel', 'MES...
mit
-4,946,819,081,459,884,000
23.729167
89
0.557479
false
3.941141
false
false
false
Snowlinux/snowupdate
UpdateManager/HelpViewer.py
1
1035
# helpviewer.py # -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4; coding: utf-8 -*- import os import subprocess # Hardcoded list of available help viewers # FIXME: khelpcenter support would be nice #KNOWN_VIEWERS = ["/usr/bin/yelp", "/usr/bin/khelpcenter"] KNOWN_VIEWERS = ["/usr/bin/yelp"] class HelpViewer: ...
gpl-2.0
-411,902,112,226,398,340
28.571429
74
0.570048
false
3.670213
false
false
false
hoechenberger/psychopy
psychopy/data/experiment.py
1
14885
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function # from future import standard_library # standard_library.install_aliases() from builtins import str import sys import copy import pickle import atexit from psychopy import logging from psychopy.tools.filetools import...
gpl-3.0
4,247,561,228,803,594,000
35.662562
80
0.57474
false
4.618368
false
false
false
cybershare/elseweb-v2
sadi-services-lifemapper/src/lifemapper/constants.py
1
2530
""" @summary: Constants for the Lifemapper web service clients @author: CJ Grady @version: 2.1.3 @status: release @license: Copyright (C) 2014, University of Kansas Center for Research Lifemapper Project, lifemapper [at] ku [dot] edu, Biodiversity Institute, 1345 Jayhawk Boulevard, Lawr...
gpl-2.0
-7,534,426,587,468,522,000
31.448718
80
0.595257
false
3.810241
false
false
false
janhui/test_engine
dev/old/shape/changeMeshToShp.py
1
4120
""" This script produces a shapefile from the gmsh mesh(.msh) file. """ import shapefile import sys class Errors: INVALID_MESH_FORMAT = "ERROR: The mesh file given is not in a suitable format. Please provide a mesh file generated using gmsh" NO_ELEMENTS_IN_MESH_FILE = "ERROR: The mesh file contains no elements" ...
lgpl-2.1
-3,654,105,200,366,542,300
27.219178
128
0.697087
false
3.125948
false
false
false
mnowotka/pyInChI
pyInChI/extr_ct.py
1
9830
from struct import Struct from mode import * from ichisize import * from incomdef import * class AtData(Struct): element = None maxvalence = None NUM_CHEM_ELEMENTS = 127 # well above number of known chem. elements AT_ISO_SORT_KEY_MULT = 32 # up to 32 identical hydrogen isotopes ...
mit
-7,587,834,133,775,738,000
36.807692
201
0.649135
false
2.828777
false
false
false
mudbungie/assorted-functions
wsgi.py
1
1534
import urllib.parse import dsportal import cgitb import cgi import rssgen import os cgitb.enable() def application(env, startResponse): os.chdir('/webserver/rss') method = env['REQUEST_METHOD'] try: contentLength = int(env['CONTENT_LENGTH']) postEnv = env.copy() postEnv['QUERY STRING'] = '' HTTPPost = cgi...
mit
2,149,474,261,468,049,000
30.306122
98
0.662973
false
3.124236
false
false
false
yougov/emanate
yg/emanate/events.py
1
1206
"""Classes for events in ``emanate``.""" import blinker from jaraco.classes.properties import classproperty __metaclass__ = type class Event: """Base class for ``emanate`` events.""" event_type = None def __init__(self, extra_context=None, extra_data=None): self._context = extra_context if extra...
mit
3,529,188,669,044,571,600
24.659574
62
0.616915
false
4.231579
false
false
false
workflo/dxf2gcode
python_examples/Ellipse_BiArc/clsGeometrie.py
1
3168
#!/usr/bin/python # -*- coding: cp1252 -*- # from math import radians, cos, sin,tan, atan2, sqrt, pow, pi, atan2 #====================================================================== class PointClass: def __init__(self,x=0,y=0): self.x=x self.y=y def __str__(self): return (...
gpl-3.0
3,363,748,197,134,820,000
37.111111
77
0.512626
false
2.788732
false
false
false
sebastianpulido/TransferErrors
TransferErrors/common.py
1
3610
#!/usr/bin/env python import os import json tmpdir = '/tmp/' workdir = os.environ['TRANSFERERRORS']+'/' webdir = os.environ['WEBDIR']+'/' siteNames = set([ 'T2_BE_IIHE','T2_ES_IFCA','T2_IT_Pisa','T2_RU_PNPI', 'T2_US_Caltech','T2_BE_UCL','T2_FI_HIP','T2_IT_Rome', 'T2_RU_RRC_KI','T2_US_Florida','T2_BR_S...
mit
1,014,994,218,535,671,800
31.232143
130
0.621607
false
2.610268
false
false
false
crashtack/code-katas
src/flight_paths.py
1
2085
from graph import Graph from distance import calculate_distance import sys import os from io import open import json def import_cities(): ''' Import the city flight connection path JSON file, Returns dictionary of cities ''' BASE_DIR = os.path.dirname(os.path.abspath(__file__)) filenam...
mit
4,975,214,039,935,399,000
25.730769
77
0.605276
false
3.832721
false
false
false
bede/tictax
tictax/cli.py
1
3106
import sys import argh import asyncio import warnings from Bio import SeqIO import pandas as pd from tictax import tictax def configure_warnings(show_warnings): '''Show or suppress warnings, mainly for TreeSwift Tree.mrca() operations''' if show_warnings: warnings.filterwarnings('always') else: ...
gpl-3.0
5,191,441,527,471,630,000
34.941176
95
0.580878
false
3.83187
false
false
false
celian-m/localizator
translations.py
1
3696
import csv import os import re def translate(file, path): csv_file = open(file, 'r') csv_reader = csv.reader(csv_file, delimiter=',') locales = [ {'identifier' : 'fr', 'column' : 3}, {'identifier' : 'en', 'column' : 5} ] for aLocale in locales: if not os.path.e...
apache-2.0
-4,936,775,638,955,110,000
31.13913
111
0.537608
false
3.940299
false
false
false
stvstnfrd/edx-platform
lms/djangoapps/bulk_email/admin.py
1
3607
""" Django admin page for bulk email models """ from config_models.admin import ConfigurationModelAdmin from django.contrib import admin from lms.djangoapps.bulk_email.forms import CourseAuthorizationAdminForm, CourseEmailTemplateForm from lms.djangoapps.bulk_email.models import BulkEmailFlag, CourseAuthorization, C...
agpl-3.0
-4,333,641,615,235,220,000
39.52809
168
0.714444
false
4.160323
false
false
false
Samathy/dotsync
src/receive.py
1
1886
import sys import socket import time import os import getpass path = [] #list to hold file paths def handshake(address): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #open socket s.bind((address,5010)) #bind socket s.listen(1) #wait for connection conn, addr = s.accept() #accept one connectio...
mit
260,146,225,761,651,420
30.966102
84
0.57052
false
3.88866
false
false
false
zoyoe/ectool
zoyoeec/core/ebay.py
1
18098
import django.core.handlers.wsgi import logging from django.template import loader,Context,RequestContext from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from ebaysdk import finding from ebaysdk.exception import ConnectionError from ebayapi.api import * from eb...
gpl-2.0
-6,843,008,013,043,061,000
37.67094
166
0.658747
false
3.349001
true
false
false
DCGM/EmotionService
service/worker.py
1
1286
import sqlite3 import time import os import sys from utils import query_db from subprocess import call execfile('config.py') conn = sqlite3.connect(DATABASE) conn.row_factory = sqlite3.Row def runScript( command): print os.getcwd() sys.stdout.flush() sys.stdout.flush() print command.split() comma...
bsd-2-clause
8,027,322,566,174,903,000
24.215686
99
0.548989
false
4.06962
false
false
false
bthirion/nipy
nipy/algorithms/clustering/hierarchical_clustering.py
2
29293
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ These routines perform some hierrachical agglomerative clustering of some input data. The following alternatives are proposed: - Distance based average-link - Similarity-based average-link - Distance ba...
bsd-3-clause
-284,653,643,990,100,480
28.322322
79
0.538012
false
3.443804
false
false
false
rparrapy/sugar
src/jarabe/view/palettes.py
1
11592
# Copyright (C) 2008 One Laptop Per Child # # 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 distribu...
gpl-2.0
-2,289,716,754,776,454,700
35.11215
79
0.628537
false
3.659091
false
false
false
atareao/utext
src/utext/insert_url_dialog.py
1
2857
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of utext # # Copyright (C) 2012-2016 Lorenzo Carbonell # lorenzo.carbonell.cerezo@gmail.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Soft...
gpl-3.0
-2,460,009,761,755,316,700
28.760417
71
0.59573
false
3.522811
false
false
false
luci/recipes-py
recipe_modules/scheduler/examples/triggers.py
2
1810
# Copyright 2019 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """This file is a recipe demonstrating reading triggers of the current build.""" import json from google.protobuf import json_format from PB.go...
apache-2.0
-7,253,337,383,634,844,000
24.857143
80
0.60442
false
3.441065
false
false
false
rozim/KaggleFindingElo
adaboost-mega.py
1
3433
#!/usr/bin/python import math import sys import cjson import gflags import collections import sklearn.ensemble import random import time import re FLAGS = gflags.FLAGS gflags.DEFINE_string('csv', 'submission.csv', '') gflags.DEFINE_string('field', '', '') gflags.DEFINE_integer('limit', 100, '') gflags.DEFINE_bool('ex...
mit
-4,092,689,598,630,619,000
28.34188
99
0.538305
false
3.254028
true
false
false
za-creature/puls
puls/views/admin/manufacturers.py
1
2181
# coding=utf-8 from __future__ import absolute_import, unicode_literals, division from puls.models import Manufacturer, ManufacturerForm from puls.compat import unquote_plus from puls import app, paginate import flask @app.route("/admin/manufacturers/", methods=["GET", "POST"], endpoint="manage_manufactur...
mit
1,888,874,150,736,158,000
29.71831
70
0.637322
false
3.587171
false
false
false
lewisamarshall/ionize
ionize/Ion/acidity.py
1
2389
from __future__ import division import warnings from math import log, sqrt import numpy as np from ..constants import gas_constant, kelvin, pitts def acidity(self, ionic_strength=None, temperature=None): """Return the effective acidity constant, Ka, for each valence state. The value is corrected for ionic s...
gpl-2.0
1,173,131,433,245,677,600
31.726027
85
0.672666
false
3.299724
false
false
false
jeanpimentel/contents
tests/functional/test_file_with_long_levels.py
1
3294
import sure import tempfile from contents import contents def test_file_with_long_levels(): content = '''/** * Project X * Author: Jean Pimentel * Date: August, 2013 */ /* > Intro */ Toc toc! Penny! Toc toc! Penny! Toc toc! Penny! /* >> The Big Bang Theory << */ The Big Bang Theory is an American sitcom cr...
gpl-3.0
-4,587,365,098,920,028,000
36.431818
255
0.517608
false
3.647841
false
false
false
catapult-project/catapult
devil/devil/android/install_commands.py
3
1905
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import posixpath from devil import devil_env from devil.android import device_errors from devil.android.constants import file_system BIN_DIR = '%...
bsd-3-clause
-1,481,925,828,002,387,000
34.277778
78
0.693963
false
3.567416
false
false
false
RDCEP/hybrid-dile-server
lib/diles/dile.py
1
2305
import os import pprint from numpy import linspace from numpy.ma import MaskedArray from netCDF4 import Dataset from dilegeometry import DileGeometry class Dile(DileGeometry): def __init__(self, z=0, y=0, x=0, variable=None, attributes=None): self.variable = variable self.attributes = attributes...
apache-2.0
-8,307,116,201,616,827,000
22.520408
91
0.64859
false
2.951344
false
false
false
lesiavl/selenium_perfomance_tests
25h8_load/locators.py
1
2559
#!/usr/bin/env python # -*- coding: utf-8 -*- owner_users = {'email': 'prozorroytenderowner@gmail.com', 'password': '123456'} provider_users = { 'prozorroyprovider2@gmail.com': '123456' } # 'prozorroyprovider1@gmail.com': '123456', broker = {'url': 'http://25h8.byus...
apache-2.0
-4,086,843,896,384,421,400
33.581081
172
0.691286
false
2.812088
false
false
false
f3at/feat
src/feat/gateway/client.py
1
3043
import json import urlparse from feat.common import log, defer, error from feat.web import httpclient, http class Client(log.Logger, log.LogProxy): def __init__(self, security_policy=None, logger=None): log.Logger.__init__(self, logger) log.LogProxy.__init__(self, logger) self.security_p...
gpl-2.0
-6,478,701,587,245,610,000
37.518987
78
0.542228
false
4.562219
false
false
false
GenealogyCollective/gprime
setup.py
1
2257
""" gprime setup """ import json import os from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, combine_commands, get_version, ) import setuptools HERE = os.path.abspath(os.path.dirname(__file__)) # The name of the project name="gprime" # Get our version with open(os.path.join(HERE,...
gpl-2.0
-4,366,853,638,063,103,000
24.077778
114
0.6358
false
3.201418
false
false
false
PatrikValkovic/grammpy
examples/calculator/run.py
1
4290
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 19.03.2019 15:39 :Licence MIT Part of grammpy """ from grammpy import * from grammpy.transforms import ContextFree, InverseContextFree, InverseCommon from grammpy.parsers import cyk # Terminals class PlusOperator(Terminal): pass class MinusOperator(Terminal)...
mit
4,911,819,328,102,684,000
30.777778
103
0.618415
false
3.69509
false
false
false
arenaoftitans/arena-of-titans-api
aot/api/views/play_actions.py
1
3704
# # Copyright (C) 2015-2020 by Last Run Contributors. # # This file is part of Arena of Titans. # # Arena of Titans is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, ...
agpl-3.0
3,284,655,310,582,589,000
34.27619
85
0.650648
false
3.779592
false
false
false
jpartogi/django-contact-form
contact_form/forms.py
1
1660
# $Id: forms.py ef5633b6df44 2009/09/06 14:08:22 jpartogi $ from django import forms from django.forms import ModelForm from django.utils.translation import ugettext as _ from contact_form.models import Message, Subject # Override the labels class ContactForm(ModelForm): sender_name = forms.CharField(label=_('You...
bsd-3-clause
8,187,945,798,001,632,000
35.086957
86
0.618675
false
4.05868
false
false
false
andyzsf/edx_data_research
reporting_scripts/navigation_tabs_data.py
1
3537
''' This module gets the number of users who access each navigation tab. For each course, you will have to get the event_type for each navigation tab and hardcode them in the NAVIGATION_TABS dictionary below. The only exception, currently, is courseware and discussion tabs because there are may event types that include...
mit
450,164,617,504,886,340
62.160714
605
0.750919
false
2.722864
false
false
false
Hydriz/DBReports
reports/wordlist.py
1
4259
# Copyright (C) 2015 Hydriz Scholz # # 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 ...
gpl-3.0
-2,233,347,074,485,106,200
31.272727
128
0.666119
false
2.92313
false
false
false
Stanford-Online/edx-analytics-dashboard
analytics_dashboard/settings/production.py
1
1578
"""Production settings and globals.""" from analytics_dashboard.settings.base import * from analytics_dashboard.settings.yaml_config import * from analytics_dashboard.settings.logger import get_logger_config LOGGING = get_logger_config() # ######### HOST CONFIGURATION # See: https://docs.djangoproject.com/en/1.5/re...
agpl-3.0
9,179,880,363,926,602,000
42.833333
166
0.705323
false
3.635945
false
false
false
SabrinaMasterson/Maya-Object-Generator
Desktop/Maya_Scripts/Torus.py
1
2316
import maya.cmds as cmds import random def PolyToruses(\ x = random.uniform(-10,10),\ x_r = 1,\ y = random.uniform(0,20),\ y_r = 1,\ z = random.uniform(-10,10),\ z_r = 1,\ xRot = random.uniform( 0, 360 ),\ xRot_r = 10,\ yRot = random.uniform( 0, 360 ),\ yRot_r = 10,\ zRot = random.uniform( 0, 360 ),\ zRot_r = 10,\ r ...
apache-2.0
-927,703,330,302,090,200
26.915663
88
0.547496
false
2.325301
false
false
false
googleads/google-ads-python
google/ads/googleads/v8/services/types/campaign_experiment_service.py
1
12446
# -*- 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 or...
apache-2.0
-4,109,170,292,933,235,700
37.295385
160
0.691467
false
4.45614
false
false
false
pculture/unisubs
apps/widget/rpc.py
1
47625
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
agpl-3.0
8,304,151,052,352,415,000
38.786967
139
0.602709
false
4.339012
true
false
false
jhamman/xarray
xarray/core/merge.py
1
29182
from typing import ( TYPE_CHECKING, AbstractSet, Any, Dict, Hashable, Iterable, List, Mapping, NamedTuple, Optional, Sequence, Set, Tuple, Union, ) import pandas as pd from . import dtypes, pdcompat from .alignment import deep_align from .utils import Frozen, di...
apache-2.0
-8,559,100,525,592,803,000
33.130994
94
0.603626
false
3.952594
false
false
false
mverwe/JetRecoValidation
PuThresholdTuning/python/akPu3PFJetSequence30_cff.py
1
1371
import FWCore.ParameterSet.Config as cms from HeavyIonsAnalysis.JetAnalysis.jets.akPu3PFJetSequence_PbPb_mc_cff import * #PU jets with 30 GeV threshold for subtraction akPu3PFmatch30 = akPu3PFmatch.clone(src = cms.InputTag("akPu3PFJets30")) akPu3PFparton30 = akPu3PFparton.clone(src = cms.InputTag("akPu3PFJets30")) ak...
cc0-1.0
-3,487,739,626,459,051,500
56.125
130
0.533187
false
3.579634
false
false
false
MOOCworkbench/MOOCworkbench
build_manager/views.py
1
3656
"""Views for build_manager, that manages CI config for experiments""" import logging from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.shortcuts import render from travispy.errors import TravisError from build_manager.travis_ci_helper import TravisCiHelper from...
mit
2,585,612,280,972,830,700
35.56
80
0.720186
false
3.634195
true
false
false
shanot/imp
modules/EMageFit/pyext/src/imp_general/representation.py
2
16247
"""@namespace IMP.EMageFit.imp_general.representation Utility functions to handle representation. """ import IMP import IMP.atom import IMP.core import IMP.algebra import string import logging log = logging.getLogger("representation") # """ Functions to deal with the representation of assemblies and managing...
gpl-3.0
6,344,887,802,455,991,000
34.551422
86
0.631501
false
3.459753
false
false
false
codebender/kaggle-caterpillar-tube-pricing-python
scripts/xgboost_model.py
1
4353
#forked from Gilberto Titericz Junior import pandas as pd import numpy as np from sklearn import ensemble, preprocessing import xgboost as xgb # load training and test datasets train = pd.read_csv('../input/train_set.csv', parse_dates=[2,]) test = pd.read_csv('../input/test_set.csv', parse_dates=[3,]) tube_data = pd...
mit
4,820,954,034,348,151,000
29.440559
131
0.694004
false
2.729154
true
false
false
cl4u2/chirp
chirp/bitwise_grammar.py
1
2829
# Copyright 2010 Dan Smith <dsmith@danplanet.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is ...
gpl-3.0
-8,713,748,101,987,043,000
24.486486
71
0.606575
false
3.540676
false
false
false
pbl64k/OpFlow
example-joe-the-barber.py
1
1488
# Largely equivalent to GPSS example at: # http://en.wikipedia.org/wiki/GPSS#Sample_code from opflow import * customer_num = 0 total_service_times = [] waiting_times = [] def create_customer(sim, gen): global customer_num customer_num += 1 return WorkUnit({'start': sim.now, 'work': 0.0}) def collect_cu...
bsd-2-clause
-3,839,344,484,308,471,000
27.075472
82
0.689516
false
2.95825
false
false
false
archatas/whoosh
whoosh/util/functools2.py
1
2645
try: from functools import wraps except ImportError: def curry(_curried_func, *args, **kwargs): def _curried(*moreargs, **morekwargs): return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) return _curried ### Begin from Python 2.5 functools.py ###########...
apache-2.0
-385,740,725,912,960,450
43.083333
88
0.59017
false
5.155945
false
false
false
Pfeter/SpaceShooter
stars.py
1
1656
import random import pygame BLACK = (0, 0, 0) class Stars(): def __init__(self, background, width, height, max_stars): self.background = background self.width = width self.height = height self.total_stars = max_stars self.positions = self.generate_positions() def gene...
mit
8,307,478,537,081,410,000
32.12
113
0.589976
false
3.407407
false
false
false
jonmsawyer/xml_security
decode.py
1
4577
#!/usr/bin/env python #Coding: UTF-8 from StringIO import StringIO import hmac from hashlib import sha1 import base64 from lxml import etree as ET import uuid def c14n(xml, exclusive=True): io_msg = StringIO(xml) et = ET.parse(io_msg) io_output = StringIO() et.write_c14n(io_output, exclusive=exclusive...
mit
-5,105,075,255,480,669,000
32.654412
496
0.619401
false
3.023118
false
false
false
TravisCG/SI_scripts
hotspot.py
1
2154
#!/usr/bin/python """ Read mutmat.snp.tsv (tab delimited file with snps) and create a table for hotspot analysis """ import sys class Interval: def __init__(self, start, stop, gene): self.start = start self.stop = stop self.gene = gene def findGene(intervals, pos, sindex, eindex): if eindex < sinde...
gpl-3.0
4,448,949,994,679,244,300
24.951807
67
0.663881
false
2.679104
false
false
false
Snagajob/slumbercache
slumbercache/serialize.py
1
2882
from slumbercache import exceptions _SERIALIZERS = { "json": True, "yaml": True, } try: import json except ImportError: _SERIALIZERS["json"] = False try: import yaml except ImportError: _SERIALIZERS["yaml"] = False class BaseSerializer(object): content_types = None key = None ...
bsd-2-clause
-2,353,683,174,633,764,400
25.440367
103
0.59195
false
4.32084
false
false
false
telefonicaid/murano-agent
muranoagent/openstack/common/gettextutils.py
1
18051
# Copyright 2012 Red Hat, Inc. # Copyright 2013 IBM Corp. # 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....
apache-2.0
2,003,964,548,599,413,000
36.68476
79
0.640075
false
4.517267
false
false
false
twitter/heron
heron/tools/tracker/src/python/handlers/exceptionhandler.py
2
5186
#!/usr/bin/env python3 # -*- encoding: 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 Apach...
apache-2.0
-599,097,691,548,044,800
37.992481
89
0.669495
false
4.185634
false
false
false
ministryofjustice/cla_backend
cla_backend/apps/diagnosis/views.py
1
2482
import json from rest_framework import mixins, viewsets, status from rest_framework.decorators import action from rest_framework.response import Response from core.drf.mixins import NestedGenericModelMixin from cla_eventlog import event_registry from legalaid.models import Case from diagnosis.models import DiagnosisT...
mit
5,075,089,877,646,739,000
32.093333
90
0.675262
false
3.677037
false
false
false
vrbagalkote/avocado-misc-tests-1
toolchain/valgrind.py
1
3330
#!/usr/bin/env python # 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 the hope that i...
gpl-2.0
8,485,635,683,104,004,000
35.593407
81
0.631532
false
3.983254
true
false
false
aidan-/ansible-modules-extras
monitoring/sensu_check.py
1
13617
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Anders Ingemann <aim@secoya.dk> # # This file is part of Ansible # # Ansible 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 Licen...
gpl-3.0
3,309,816,845,278,256,600
33.386364
151
0.571051
false
4.264641
true
false
false
timothycrosley/hug
tests/test_coroutines.py
1
3441
"""hug/test.py. Tests the support for asynchronous method using asyncio coroutines Copyright (C) 2016 Timothy Edmund Crosley 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,...
mit
-1,062,985,734,471,487,900
32.086538
112
0.696019
false
3.978035
true
false
false
lelit/tailor
vcpx/_process.py
1
40084
## From http://svn.red-bean.com/restedit/trunk/source/process.py # process - Subprocesses with accessible I/O streams # # Copyright (c) 2003-2004 by Peter Astrand <astrand@lysator.liu.se> # # By obtaining, using, and/or copying this software and/or its # associated documentation, you agree that you have read, understo...
gpl-3.0
522,418,881,786,876,300
33.085034
104
0.569429
false
4.410166
false
false
false
alphagov/notifications-api
migrations/versions/0119_add_email_reply_to.py
1
1172
""" Revision ID: 0119_add_email_reply_to Revises: 0118_service_sms_senders Create Date: 2017-09-07 15:29:49.087143 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql revision = '0119_add_email_reply_to' down_revision = '0118_service_sms_senders' def upgrade(): op.crea...
mit
-974,278,226,723,808,000
33.470588
108
0.672355
false
3.237569
false
false
false
meitham/python-client
test/test_buffer.py
1
5472
import os from neovim.compat import IS_PYTHON3 def test_get_length(vim): assert len(vim.current.buffer) == 1 vim.current.buffer.append('line') assert len(vim.current.buffer) == 2 vim.current.buffer.append('line') assert len(vim.current.buffer) == 3 vim.current.buffer[-1] = None assert len...
apache-2.0
4,754,260,292,300,067,000
32.570552
79
0.58845
false
3.001646
true
false
false
nicko96/Chrome-Infra
appengine/findit/waterfall/test/build_util_test.py
1
3817
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import datetime from testing_utils import testing from model.wf_build import WfBuild from waterfall import buildbot from waterfall import build_util clas...
bsd-3-clause
1,658,821,949,881,243,400
32.191304
76
0.693215
false
3.705825
true
false
false
Southpaw-TACTIC/Team
src/python/Lib/site-packages/PIL-1.1.7-py2.6-win32.egg/EGG-INFO/scripts/pilprint.py
1
2407
#!c:\python26\python.exe # # The Python Imaging Library. # $Id$ # # print image files to postscript printer # # History: # 0.1 1996-04-20 fl Created # 0.2 1996-10-04 fl Use draft mode when converting. # 0.3 2003-05-06 fl Fixed a typo or two. # VERSION = "pilprint 0.3/2003-05-05" from PIL im...
epl-1.0
1,565,474,715,646,574,300
23.88172
66
0.537183
false
3.200798
false
false
false
floodlight/loxigen-artifacts
pyloxi3/loxi/of14/meter_band.py
1
8003
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University # Copyright (c) 2011, 2012 Open Networking Foundation # Copyright (c) 2012, 2013 Big Switch Networks, Inc. # See the file LICENSE.pyloxi which should have been included in the source distribution # Automatically generated by LOXI from ...
apache-2.0
-5,066,891,747,147,255,000
29.780769
88
0.526053
false
3.666056
false
false
false
physicalattraction/kerstpuzzel
src/calculator.py
1
2202
import sys from math import pi def waarde_van_data(): for b in range(1, 10): for i in range(1, 10): digits_used = {b} if i in digits_used: continue i_string = str(i) for g in range(1, 10): digits_used = {b, i} ...
mit
-4,438,891,188,794,575,400
39.036364
110
0.35059
false
4.275728
false
false
false
zatonovo/slackbot
slackbot/dispatcher.py
1
8282
# -*- coding: utf-8 -*- import logging import re import time import importlib import threading import slacker import settings from slackbot.utils import to_utf8, WorkerPool logger = logging.getLogger(__name__) AT_MESSAGE_MATCHER = re.compile(r'^\<@(\w+)\>:? (.*)$') def from_bot(msg): return 'bot_id' in msg and ...
mit
-6,925,430,624,010,056,000
30.724138
116
0.545773
false
3.918599
false
false
false
Bachmann1234/hn-tldr
main.py
1
1806
from datetime import datetime from urllib.parse import urljoin from constants import REDIS_HOST, REDIS_PORT, REDIS_PASS, get_environment, URL, TITLE, SENTENCES, BODY, DATE_FOUND, \ HACKER_NEWS_ID from flask import Flask, render_template, request import redis from utils import get_stories from werkzeug.contrib.atom ...
apache-2.0
-7,574,556,968,880,315,000
29.610169
117
0.539867
false
3.770355
false
false
false
mccdaq/mcculw
examples/ui/DaqDevDiscovery01.py
1
5694
""" File: DaqDevDiscovery01.py Library Call Demonstrated: mcculw.ul.get_daq_device_inventory() mcculw.ul.create_daq_device() mcculw.ul.release_daq_device() Purpose: Discovers DAQ devices and assigns board number to ...
mit
574,620,334,552,142,100
36.96
79
0.615209
false
3.67592
false
false
false
willakat/toysm
toysm/ext/scapy.py
1
6973
################################################################################ # # Copyright 2014-2015 William Barsse # ################################################################################ # # This file is part of ToySM Extensions. # # ToySM Extensions is free software: you can redistribute it and/or modi...
lgpl-3.0
-3,312,802,494,494,077,000
34.576531
80
0.605191
false
4.380025
false
false
false
jayme-github/newznabbalancer
newznabbalancer/database.py
1
4004
import sqlite3 import os import datetime import logging ACTION_TYPES = ('grab', 'hit') # possible API actions class ActionTypeError(ValueError): message = 'atype must be one of %s' % ', '.join( '"%s"' % at for at in ACTION_TYPES) class AccountDB(object): '''Handle account data. ''' logger ...
gpl-3.0
6,693,348,692,977,251,000
37.133333
168
0.59041
false
3.93707
false
false
false
larsks/gruf
gruf/gerrit.py
1
7525
from __future__ import absolute_import import logging import shlex import subprocess import time import urlparse from thecache.cache import Cache from gruf.exc import * # NOQA from gruf.models import * # NOQA from . import git LOG = logging.getLogger(__name__) DEFAULT_REMOTE = 'gerrit' DEFAULT_GERRIT_PORT = 2941...
gpl-3.0
-7,977,515,104,316,157,000
27.289474
76
0.556545
false
4.11427
false
false
false
dustinlacewell/console
console/widgets/listbox.py
1
2895
# -*- coding: utf-8 -*- import urwid class FancyListBox(urwid.LineBox): def get_listbox(self, items): class _FancyListBox(urwid.ListBox): def keypress(_self, size, key): key = super(_FancyListBox, _self).keypress(size, key) self.update_corners(_self.ends_visibl...
mit
3,055,838,911,860,314,600
29.542553
82
0.53396
false
3.342258
false
false
false
alessandro-sena/slearning-stackoverflow
features.py
1
17993
import competition_utilities as cu import csv import datetime import time import features import numpy as np import pandas as pd import re import sys from sets import Set import nltk import math from sklearn.feature_extraction.text import * from nltk.stem.wordnet import WordNetLemmatizer import string from n_gram_graph...
bsd-2-clause
7,237,711,631,937,828,000
27.88122
798
0.531707
false
3.394906
false
false
false
JPeroutek/mycoin
gui.py
1
3277
""" The easiest way to understand this file is to try it out and have a look at the html it creates. It creates a very simple page that allows you to spend money.""" import copy import tools import blockchain import custom import http def spend(amount, pubkey, privkey, to_pubkey, DB): amount = int(amount * (10 **...
unlicense
-7,668,754,221,247,227,000
33.861702
103
0.592615
false
3.234946
false
false
false
atlassian/asap-authentication-python
atlassian_jwt_auth/verifier.py
1
4331
from collections import OrderedDict from functools import lru_cache import jwt import jwt.api_jwt from cryptography.hazmat.primitives.asymmetric.ec import ( EllipticCurvePublicKey ) from cryptography.hazmat.primitives.asymmetric.rsa import ( RSAPublicKey ) from jwt.exceptions import InvalidAlgorithmError from...
mit
-6,294,148,923,503,048,000
35.70339
77
0.598938
false
3.759549
false
false
false
Apsu/scrambler
scrambler/docker.py
1
7983
from __future__ import absolute_import # When can 3.x be now? import docker import json import Queue import time import traceback from scrambler.store import Store from scrambler.threads import Threads class Docker(): """Provide local docker management.""" def __init__(self, config, pubsub): # Sto...
gpl-2.0
1,262,817,445,728,288,300
33.708696
78
0.47288
false
5.57083
true
false
false
cimbi/pancircs
pancircs/conn_circs.py
1
4130
# -*- coding: utf-8 -*- """ Created on Sun Feb 21 23:45:40 2016 Library of circles evaluating relationships between nodes. Ing.,Mgr. (MSc.) Jan Cimbálník Biomedical engineering International Clinical Research Center St. Anne's University Hospital in Brno Czech Republic & Mayo systems electrophysiology lab Mayo Clinic...
bsd-3-clause
3,302,433,716,127,765,500
31.761905
79
0.604893
false
3.595819
false
false
false
zzzsgit/lab4_2
views.py
1
4580
# -*- coding: utf-8 -*- "test for lab4 R5&R6" from django.shortcuts import render_to_response from django.shortcuts import render #from django.http import HttpResponseRedirect from django.http import HttpResponse from models import Book from models import Author # Create your views here. def index(request): return...
gpl-2.0
-4,416,382,906,702,563,300
37.813559
98
0.596507
false
3.871513
false
false
false
dbiesecke/plugin.video.xstream
resources/lib/player.py
1
4390
from resources.lib.gui.guiElement import cGuiElement from resources.lib.handler.ParameterHandler import ParameterHandler from resources.lib.config import cConfig import logger from resources.lib.gui.gui import cGui import xbmc import time class XstreamPlayer(xbmc.Player): def __init__(self, *args, **kwargs): ...
gpl-3.0
-742,410,655,227,369,000
40.415094
108
0.546697
false
4.621053
false
false
false
showerst/openstates
openstates/pa/actions.py
1
1701
import re from billy.scrape.actions import Rule, BaseCategorizer # These are regex patterns that map to action categories. _categorizer_rules = ( # Capture some groups. Rule(r'Senators (?P<legislators>.+) a committee of conference'), Rule(r"(?P<version>Printer's No. \d+)"), Rule(r'(?i)introduced', 'b...
gpl-3.0
-531,039,955,899,993,150
33.714286
71
0.602587
false
3.264875
false
false
false
bkfrd/BEC-simulation
python3_script/e_print.py
1
1072
# "e_base.py" needed (under the same directory) if 'os' not in dir(): import os if 'math' not in dir(): import math print("\n" "Type 1 to show the first few " "numbers of the sequence {e_l} " "(defined in Originality.pdf)" "\n\n" "Type 2 to show the relative complement of {e_l} " ...
gpl-3.0
-7,987,048,616,278,681,000
24.52381
56
0.499067
false
3.171598
false
false
false
proversity-org/edx-platform
cms/djangoapps/contentstore/views/library.py
1
10227
""" Views related to content libraries. A content library is a structure containing XBlocks which can be re-used in the multiple courses. """ from __future__ import absolute_import import logging from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.exceptions imp...
agpl-3.0
4,601,344,022,035,032,600
37.160448
118
0.681627
false
4.174286
false
false
false
debasishm89/OpenXMolar
ExtDepLibs/winappdbg/win32/dbghelp.py
1
46621
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2016, Mario Vilas # 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...
bsd-3-clause
1,964,170,373,225,806,800
35.76735
118
0.625662
false
3.586783
false
false
false
awni/tensorflow
tensorflow/python/client/server_lib.py
1
5709
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-5,676,219,279,308,714,000
31.810345
80
0.659485
false
4.054688
false
false
false
pennersr/django-jhouston
jhouston/migrations/0001_initial.py
1
2104
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ErrorReport' db.create_table('jhouston_errorreport', ( ('id', self.gf('django....
mit
-5,957,941,108,542,231,000
45.755556
116
0.590304
false
3.684764
false
false
false
sameeptandon/sail-car-log
process/StereoCompute.py
1
9651
#!/usr/bin/env python ''' Performs OpenCV's StereoSGBM stereo matching. Usage py_stereo.py LeftImg RightImg ''' from Q50_config import * import sys, os from GPSReader import * from GPSTransforms import * from VideoReader import * from LidarTransforms import * import numpy as np import scipy as sp import cv2, cv from ...
bsd-2-clause
1,744,578,693,132,705,800
42.472973
544
0.645114
false
3.053148
false
false
false
theetcher/fxpt
fxpt/fx_refsystem/fx_references.py
1
14121
import os import re import math import maya.cmds as m from fxpt.fx_refsystem.com import messageBoxMaya, globalPrefsHandler, getRelativePath, getRefRootValue, expandPath from fxpt.fx_refsystem.log_dialog import log from fxpt.fx_refsystem.ref_handle import RefHandle, ATTR_REF_FILENAME, REF_NODE_SUFFIX, INSTANCES_SOURCE...
mit
-2,724,119,418,600,411,000
27.936475
126
0.613696
false
4.222787
false
false
false
geodynamics/lithomop
lithomop3d/lithomop3d/ElementTypeDef.py
1
5580
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Lithomop3d by Charles A. Williams # Copyright (c) 2003-2005 Rensselaer Polytechnic Institute # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated...
mit
-8,103,146,907,488,984,000
41.59542
82
0.517742
false
4.049347
false
false
false
chaosmaker/pyload
module/plugins/hoster/MegasharesCom.py
1
5028
# -*- coding: utf-8 -*- """ 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 ...
gpl-3.0
-8,445,721,491,430,360,000
43.105263
139
0.604813
false
3.439124
false
false
false
artem-smotrakov/httpooh
helper.py
1
7942
#!/usr/bin/python import textwrap import config import random class AbstractTest: def name(self): return self.__class__.__name__ def description(self): return 'Here should be a description but someone was too lazy!' def info(self, *messages): print_with_indent(self.__class__.__name__, messages...
gpl-3.0
3,081,989,011,501,168,600
30.515873
101
0.543944
false
3.755083
true
false
false
Organice/django-organice
organice/management/commands/mixins/initblog.py
1
3112
""" A label command (sub-command) for the Organice management command. """ from django.utils.translation import ugettext as _ from ._helper import HelperMixin class InitblogCommandMixin(HelperMixin): def initblog_command(self): """ Create sample blog entries """ self.log(_('Blog:...
apache-2.0
2,946,595,599,703,593,500
50.866667
115
0.513496
false
4.328234
false
false
false
saippuakauppias/django-banzai
banzai/models.py
1
4382
# coding: utf-8 from django.db import models STATUS_GOOD_CODES = ( ('S001', u'Пакет не был найден по указанному URL'), ('S002', u'Пакет загружен на сервер'), ('S004', u'Пакет рассылается'), ('S005', u'Пакет отправлен, ожидаем удаление информации о ' u'пакете из системы'), ('S006', u'...
mit
-8,192,312,687,807,585,000
34.346535
77
0.591597
false
2.345598
false
false
false
lielongxingkong/ics_demo
ics_demo/dao/interfaces/vsan/vsan.py
1
1256
from ics_demo.dao.interfaces import base from ics_demo.dao.orm.vsan import VsanStore from ics_demo.helpers import uuidgen def get_all(): return base.class_get_all_to_dict(VsanStore) def get_one(uuid): return base.class_get_one_by_uuid_to_dict(VsanStore, uuid) def get_obj(uuid): return ...
mit
5,592,532,032,155,847,000
30.25641
97
0.68551
false
3.50838
false
false
false
SOM-Research/Gitana
exporters/report/html_generator.py
1
7433
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'valerio cosentino' from exporters import resources import os class HtmlGenerator(): """ This class handles the generation of an HTML page embedding charts """ BOOTSTRAP_COLUMNS = 12 CHARTS_PER_LINE = 2 def __init__(self, logger): ...
mit
-3,571,375,669,135,862,000
35.615764
118
0.415983
false
4.761691
false
false
false
fzimmermann89/pyload
module/plugins/hoster/FastshareCz.py
1
2759
# -*- coding: utf-8 -*- import re import urlparse from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" __version__ = "0.37" __status__ = "testing" __pattern__ = r'http://(?:www\.)?fasts...
gpl-3.0
-7,936,365,395,115,161,000
32.646341
144
0.562523
false
3.308153
false
false
false
elba7r/builder
frappe/utils/data.py
1
22166
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals # IMPORTANT: only import safe functions as this module will be included in jinja environment import frappe import operator import re, urllib, datetime, math import babel.dates fr...
mit
-5,555,181,876,184,886,000
27.165184
145
0.668727
false
2.950745
false
false
false
harlov/django-mama-cas
mama_cas/migrations/0001_initial.py
1
3930
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operati...
bsd-3-clause
-915,575,184,926,615,000
46.349398
175
0.579898
false
4.386161
false
false
false