repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
pombredanne/DoSOCS
src/fileInfo.py
3
22341
#!/usr/bin/python ''' <SPDX-License-Identifier: Apache-2.0> Copyright 2014 University of Nebraska at Omaha (UNO) 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/L...
apache-2.0
-3,958,380,125,494,267,400
41.717017
140
0.48091
false
4.564978
false
false
false
andresmauro17/mediapp
src/apps/historia_ingreso_homecare/models.py
1
5077
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import from django.db import models from datetime import datetime class HistoriaClinicaIngreso(models.Model): SI_NO_CHOICES = (('SI', 'SI'),('NO','NO'),) paciente = models.OneToOneField(Paciente, on_delete = models.CASC...
mit
-6,823,027,517,120,042,000
49.77
131
0.720898
false
2.604926
false
false
false
vrs01/mopidy
mopidy/compat.py
6
1399
from __future__ import absolute_import, unicode_literals import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if PY2: import ConfigParser as configparser # noqa import Queue as queue # noqa import thread # noqa def fake_python3_urllib_module(): import types imp...
apache-2.0
-6,907,950,119,296,282,000
23.982143
57
0.639028
false
3.843407
false
false
false
simpleenergy/pingpong
pingpong/migrations/0017_auto_20190202_0247.py
1
1805
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime import pingpong.models class Migration(migrations.Migration): dependencies = [ ('pingpong', '0016_auto_20190125_2046'), ] operations = [ migrations.CreateModel( ...
mit
-4,445,629,339,362,088,400
37.404255
121
0.567867
false
4.434889
false
false
false
asajeffrey/servo
tests/wpt/update.py
5
1366
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. import os import sys from wptrunner import wptcommandline from update import updatecommandline here = os.path.split(__...
mpl-2.0
8,212,809,810,311,806,000
27.458333
98
0.660322
false
3.423559
false
false
false
gnott/elife-bot
S3utility/s3_notification_info.py
2
1101
class S3NotificationInfo: def __init__(self, event_name, event_time, bucket_name, file_name, file_etag, file_size): self.event_name = event_name self.event_time = event_time self.bucket_name = bucket_name self.file_name = file_name self.file_etag = file_etag self.fil...
mit
2,937,065,053,005,852,700
36.965517
121
0.565849
false
3.707071
false
false
false
willettk/rgz-analysis
python/multi_ir.py
2
1125
from consensus import db consensus = db['consensus_multi_ir'] catalog = db['catalog_dr1'] count = 0 with open('ir_clicks.csv', 'w') as f: print >> f, 'catalog_id,zooniverse_id,ir_ra,ir_dec,ir_level,radio_level,n_total,n_radio,n_ir,clicks' for con in consensus.find({'first_id':{'$exists':True}}): ...
mit
1,726,473,020,618,667,000
57.210526
162
0.494222
false
3.429878
false
false
false
davidbrough1/pymks_share
pymks_share/data_manager.py
1
4239
from pymongo import MongoClient from bson.binary import Binary import cPickle as pickle import numpy as np class DataManager(MongoClient): def __init__(self, url): super(DataManager, self).__init__(url) def fetch_data(self, dataset_name): db = self.pymks db_dict = db.db_metadata.find...
mit
-3,722,731,408,277,996,000
42.255102
79
0.519226
false
4.172244
false
false
false
AlessandroZ/LaZagne
Linux/lazagne/softwares/wallet/kde.py
1
2012
#!/usr/bin/env python # -*- coding: utf-8 -*- ####################### # # By Quentin HARDY # ####################### from lazagne.config.module_info import ModuleInfo from lazagne.config import homes class Kde(ModuleInfo): def __init__(self): self.appid = 'Get KDE keyring' self.bus_info = [ ...
lgpl-3.0
-8,210,509,813,502,358,000
30.936508
106
0.454274
false
4.421978
false
false
false
modsy/incubator-airflow
airflow/contrib/hooks/bigquery_hook.py
3
31510
""" This module contains a BigQuery Hook, as well as a very basic PEP 249 implementation for BigQuery. """ import logging import time from airflow.contrib.hooks.gc_base_hook import GoogleCloudBaseHook from airflow.hooks.dbapi_hook import DbApiHook from apiclient.discovery import build from pandas.io.gbq import GbqCon...
apache-2.0
-1,299,112,374,700,451,300
38.98731
168
0.589749
false
4.518858
true
false
false
Dipsingh/mpls-pce
pcep_handler.py
1
35570
__author__ = 'dipsingh' import string import struct import socket import binascii import json class PCEP(object): """ 6.1. Common Header 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
mit
-2,567,897,749,900,257,300
45.496732
177
0.438881
false
3.506852
false
false
false
uppi/adventofcode2016
adventofcode/adv_9.py
1
1446
import re CONTROL_SEQ = re.compile("\((\d+)x(\d+)\)") def expand(input_str): input_str = input_str.strip() score = 0 while input_str: match = CONTROL_SEQ.search(input_str) if match is None: return score + len(input_str) else: score += match.start() ...
mit
8,997,397,420,521,461,000
29.125
91
0.529737
false
3.492754
false
false
false
jensengroup/propka-3.1
propka/run.py
1
4804
""" Script functionality ==================== The :mod:`run` module provides a high-level interface to PROPKA 3. The :program:`propka3` script consists of the :func:`main` function. If similar functionality is desired from a Python script (without having to call the :program:`propka` script itself) then the :func:`si...
lgpl-2.1
4,483,527,831,565,497,300
38.702479
79
0.671316
false
3.905691
false
false
false
evilpie/servo
tests/wpt/css-tests/tools/html5lib/html5lib/treebuilders/dom.py
920
8469
from __future__ import absolute_import, division, unicode_literals from xml.dom import minidom, Node import weakref from . import _base from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory def getDomBuilder(DomImplementation): Dom = DomImplementation class A...
mpl-2.0
1,695,116,534,286,119,700
36.30837
85
0.531822
false
4.878456
false
false
false
luminoray/pokemon-tool
pokecoach.py
1
3504
import os import urllib.request import datetime import json server_url = 'http://www.smogon.com/' date_format = '%Y-%m' auto_download = True class PokeCoachError(Exception): '''Exception for errors raised by PokeCoach''' pass class SmogonError(PokeCoachError): '''Exception caused when data is not found...
gpl-3.0
4,808,256,095,627,143,000
33.352941
90
0.551084
false
3.959322
false
false
false
ehelms/Opus
opus/lib/prov/instance.py
2
4420
############################################################################## # Copyright 2010 North Carolina State University # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # ...
apache-2.0
-5,050,522,787,346,017,000
36.142857
285
0.551131
false
4.955157
false
false
false
GoogleCloudPlatform/healthcare
datathon/datathon_etl_pipelines/generic_imaging/decompress_gcs.py
1
4028
r"""Decompress files in GCS Storage using GCS Transcoding. See https://cloud.google.com/storage/docs/transcoding for details on the eligibility of input files. Common usage patterns are: Removing the .gz suffix on decompressed files: --path_sub_pattern='(.*)\.gz' --path_sub_repl='\1' Placing the decompressed files...
apache-2.0
2,275,556,041,741,259,000
34.333333
83
0.700596
false
3.733086
false
false
false
jonadmark/repd
src/metric/monitor_manager/__init__.py
1
2436
import json import threading class MonitorManager: def __init__(self, metric_manager, resources): """Form a MonitorManager. Arguments: metric_manager -- a reference to a MetricManager resources -- a list of monitor groups and arguments """ self.metric_manager = met...
mit
-465,743,929,106,730,400
34.304348
79
0.53243
false
4.711799
false
false
false
michaelbrooks/twitter-feels
twitter_feels/apps/demo_vis/migrations/0002_auto__add_field_demotimeframe_cleanup_time.py
1
1522
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'DemoTimeFrame.cleanup_time' db.add_column(u'demo_vis_demo...
mit
-5,787,967,037,910,094,000
42.514286
126
0.594612
false
3.721271
false
false
false
UnnamedMoose/DIYROV
Software/controlInterface/communicationProtocol.py
2
2533
# -*- coding: utf-8 -*- """ Created on Sun May 24 16:34:31 2015 @author: artur """ # TODO wrap-up sending and receiving data protocols from Arduino here #TODO hold serial connection to the Arduino here import sys, serial, glob # constants for dfinig the format of a data packet OUTPUT_START_CHAR = '>' INPUT_START_C...
mit
4,480,873,531,049,815,600
29.166667
104
0.590604
false
4.039872
false
false
false
RNAcentral/rnacentral-import-pipeline
tests/databases/ensembl/metadata/databases_test.py
1
1247
# -*- coding: utf-8 -*- """ Copyright [2009-2018] EMBL-European Bioinformatics Institute 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...
apache-2.0
-802,999,745,876,958,800
30.175
74
0.709703
false
3.825153
false
false
false
andresfcardenas/marketing-platform
userprofile/backends/simple/views.py
51
1730
from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth import login from django.contrib.auth.models import User from registration import signals from registration.views import RegistrationView as BaseRegistrationView class RegistrationView(BaseRegistrationView): ""...
bsd-3-clause
-5,300,343,045,763,425,000
37.444444
110
0.661272
false
4.818942
false
false
false
transedward/ml-playground
reinforcement/mc_prediction.py
1
2580
import numpy as np from collections import defaultdict def mc_prediction(policy, env, num_episodes, discount_factor=1.0): """ Monte Carlo prediction algorithm. Calculates the value function for a given policy using sampling. Args: policy: A function that maps an state to action probabilities. ...
mit
2,733,515,881,920,061,000
37.507463
88
0.590698
false
4.582593
false
false
false
airodactyl/qutebrowser
qutebrowser/utils/standarddir.py
4
12752
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
-4,576,444,442,060,080,000
30.48642
79
0.638331
false
3.94921
true
false
false
TurboTurtle/sos
sos/report/plugins/cgroups.py
3
1225
# This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution ...
gpl-2.0
1,248,542,453,257,729,500
26.840909
74
0.622041
false
3.734756
false
false
false
Distrotech/fop
test/fotree/unittests/table/collapsed-conditional-borders_test-generator.py
7
21418
#!/usr/bin/python # # 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...
apache-2.0
1,494,816,527,059,935,000
49.753555
122
0.502941
false
3.750306
true
false
false
mitdrc/director
src/python/director/simpletimer.py
9
1991
import time class SimpleTimer(object): def __init__(self): self.reset() def now(self): return time.time() def elapsed(self): return self.now() - self.t0 def reset(self): self.t0 = self.now() class FPSCounter(object): def __init__(self): self.averageCo...
bsd-3-clause
-5,795,579,484,860,047,000
22.987952
93
0.61778
false
4.063265
false
false
false
uwosh/uwosh.libraryguides
uwosh/libraryguides/browser/util.py
1
4769
from zope.interface import implements, Interface, Attribute from Products.CMFCore.utils import getToolByName from DateTime import DateTime def formatDelimited(content,keys,delimiter="|"): parts = content.split(delimiter) data = {} for k in range(len(keys)): try: data[keys[k...
gpl-2.0
-3,005,089,103,396,797,400
35.551181
127
0.621095
false
4.284816
false
false
false
irmen/Pyro5
examples/shoppingcart/clients.py
1
2064
import random from Pyro5.api import Proxy import Pyro5.errors shop = Proxy("PYRONAME:example.shop") print("Simulating some customers.") harrysCart = shop.enter("Harry") sallysCart = shop.enter("Sally") shoplifterCart = shop.enter("shoplifter") # harry buys 4 things and sally 5, shoplifter takes 3 items # note that w...
mit
-5,251,753,289,334,700,000
32.836066
92
0.719961
false
3.160796
false
false
false
darka/p2pfs
src/file_database.py
1
5914
from stat import S_IFDIR, S_IFLNK, S_IFREG import pickle import time import os import sqlite3 class FileObject(object): attr_fields = 'st_atime, st_ctime, st_mode, st_mtime, st_nlink, st_size'.split(', ') def __init__(self): self.attrs = {} self.contents = {} class FileDatabase(object): def __init__(sel...
gpl-3.0
5,719,713,609,256,790,000
30.795699
107
0.639669
false
3.177861
false
false
false
phr34k/serpent
serpent/serpent.py
1
4685
import os, tarfile, StringIO, warnings warnings.simplefilter("ignore") path=os.path _prebuild = [] _postbuild = [] _targets = targets _premake = [] _install = [] _artifacts = [] _publish = [] default = (); def select(values): if True in values: return values[True] if default in values: ...
mit
-6,064,636,778,933,065,000
24.331461
111
0.576307
false
3.407273
false
false
false
goofwear/MediaBrowser.Kodi
resources/lib/ThemeMedia.py
2
11895
################################################################################################# # Start of ThemeMedia Thread # plays theme music when applicable ################################################################################################# import xbmc import xbmcgui import xbmcaddon import json i...
gpl-2.0
5,052,394,784,080,537,000
42.101449
239
0.554687
false
4.415367
false
false
false
Akki5/pong
pong.py
1
3438
# CodeSkulptor runs Python programs in your browser. # Click the upper left button to run this simple demo. # CodeSkulptor runs in Chrome 18+, Firefox 11+, and Safari 6+. # Some features may work in other browsers, but do not expect # full functionality. It does NOT run in Internet Explorer. import simplegui import ...
mit
3,433,419,456,618,184,000
27.890756
135
0.643979
false
2.781553
false
false
false
googkit/googkit
test/commands/test_init.py
1
2216
import unittest from test.stub_config import * from test.stub_environment import StubEnvironment from googkit.commands.init import InitCommand from googkit.compat.unittest import mock from googkit.lib.error import GoogkitError class TestInitCommand(unittest.TestCase): def setUp(self): self.env = StubEnv...
mit
4,353,323,611,407,424,500
32.074627
83
0.599278
false
3.840555
true
false
false
tktrungna/leetcode
Python/maximum-gap.py
1
1725
""" QUESTION: Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array contains less than 2 elements. You may assume all elements in the array are non-negative integers and fit in the 32-bit signed integer ran...
mit
4,307,897,559,297,702,000
30.962963
110
0.531014
false
3.336557
false
false
false
microcosm-cc/microco.sm
microcosm_admin/views.py
1
8609
from django.core.urlresolvers import reverse from django.http.response import HttpResponseNotFound import grequests from django.http import HttpResponseRedirect from django.shortcuts import render from api.exceptions import APIException from api.resources import Site from api.resources import SiteList from api.resour...
gpl-2.0
-4,382,931,708,750,350,000
41.618812
129
0.57405
false
4.417137
false
false
false
NCI-GDC/gdcdatamodel
gdcdatamodel/validators/json_validators.py
1
2083
from gdcdictionary import gdcdictionary from jsonschema import Draft4Validator import re missing_prop_re = re.compile("\'([a-zA-Z_-]+)\' is a required property") extra_prop_re = re.compile("Additional properties are not allowed \(u\'([a-zA-Z_-]+)\' was unexpected\)") def get_keys(error_msg): missing_prop = missi...
apache-2.0
-6,991,657,751,394,025,000
37.574074
105
0.566011
false
4.191147
false
false
false
lopiola/integracja_wypadki
scripts/fars_accident_mapper.py
1
16652
#!/usr/bin/python # -*- coding: utf-8 -*- """ This module handles mapping of rows from FARS data into common format. Significant attributes: ST_CASE - case ID PERSONS FATALS VE_TOTAL - number of vehicles YEAR MONTH DAY DAY_WEEK HOUR MINUTE LATITUDE LONGITUD ROAD_FCN """ from parsing import fars_common from parsing im...
mit
-2,659,933,753,292,409,000
27.367973
104
0.472196
false
3.543733
false
false
false
cancerregulome/gidget
commands/feature_matrix_construction/util/miscClin.py
1
66086
#!/usr/bin/env python import numpy import sys import miscMath import miscTCGA import rand2x2 debugFlag = 0 #------------------------------------------------------------------------------ def buildHist(iVec): minI = 0 maxI = max(iVec) numBins = maxI - minI + 1 iHist = [0] * numBins for ii in r...
mit
1,392,716,695,932,201,500
33.064948
169
0.447145
false
3.56624
false
false
false
richardvanbeers/tropogoaws
main.py
1
6759
from troposphere import (Template, GetAZs, Select, Ref, Parameter, Base64, Join, GetAtt, Output, ) from troposphere import iam, ec2, efs, ecr from troposphere.s3 import Bucket, PublicRead from awacs.aws import (Allow, Policy, Principal, Statement) from awacs.sts import (AssumeRole) from rvb.n...
mit
588,161,598,043,506,300
24.314607
155
0.560438
false
3.276297
false
false
false
benhoyle/Hue
pycron.py
1
1948
from crontab import CronTab import datetime import sqlite3 as lite import ConfigParser def gettime(sunevent, db_path): #sunevent is a string: 'Sunset' or 'Sunrise' con = lite.connect(db_path) #Get last sunset time qry = "SELECT r_datetime FROM sun WHERE sunevent='%s' ORDER BY r_datetime DESC LIMIT 1" % sunevent...
mit
-4,436,810,042,762,346,000
27.647059
99
0.705852
false
2.819103
true
false
false
Jumpscale/jumpscale6_core
lib/JumpScale/portal/codegentools/CodeGeneratorActorLocal.py
1
3122
from JumpScale import j from CodeGeneratorBase import CodeGeneratorBase class CodeGeneratorActorLocal(CodeGeneratorBase): def __init__(self, spec, typecheck=True, dieInGenCode=True): CodeGeneratorBase.__init__(self, spec, typecheck, dieInGenCode) self.actorpath = j.system.fs.joinPaths(j.core.co...
bsd-2-clause
5,751,867,541,204,601,000
31.520833
122
0.600897
false
3.488268
false
false
false
adhoc-dev/odoo-support
web_support_client/__openerp__.py
1
1807
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
lgpl-3.0
2,837,999,272,603,856,400
31.267857
79
0.572773
false
3.971429
false
false
false
yasikstudio/devrank
www/icecream/bibibig/views.py
1
3152
#-*- coding:utf-8 -*- from django.http import HttpResponse, Http404, HttpResponseRedirect from django.template import RequestContext, Context from django.shortcuts import * from django.views.generic.base import View from django.utils.safestring import * from devrankmodels import DevRankModel from oauthmanagers import O...
mit
-2,106,232,728,092,049,700
32.892473
74
0.543464
false
4.082902
false
false
false
daevaorn/sentry
src/sentry/api/serializers/models/team.py
2
2947
from __future__ import absolute_import import itertools from collections import defaultdict from sentry.app import env from sentry.api.serializers import Serializer, register, serialize from sentry.models import ( OrganizationAccessRequest, OrganizationMemberTeam, Project, ProjectStatus, Team ) @register(T...
bsd-3-clause
-7,592,902,356,115,548,000
31.744444
85
0.561249
false
4.431579
false
false
false
kkujawinski/cookiecutter
tests/test_generate_files.py
22
6238
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_generate_files ------------------- Tests formerly known from a unittest residing in test_generate.py named TestGenerateFiles.test_generate_files_nontemplated_exception TestGenerateFiles.test_generate_files TestGenerateFiles.test_generate_files_with_trailing_newli...
bsd-3-clause
-3,718,857,343,794,863,600
31.259067
78
0.67459
false
3.563824
true
false
false
joausaga/ideascaly
examples/vote_comment_idea.py
1
1606
import ConfigParser from ideascaly.auth import AuthNonSSO from ideascaly.api import API config = ConfigParser.ConfigParser() config.read('config') community = config.get('example','community_url') token = config.get('example','token') idea_to_vote_id = 139718 # Replace with yours idea_to_comment_id = 121848 # Repla...
mit
167,019,721,887,134,700
25.783333
111
0.681818
false
2.990689
true
false
false
datamade/large-lots
lots_admin/utils.py
1
4696
from datetime import datetime import pytz import urllib.parse from io import StringIO from collections import OrderedDict from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template from django.conf import settings from lots_admin.look_ups import DENIAL_REASONS, APPLICATION_STA...
mit
-5,829,672,737,579,850,000
31.164384
147
0.614353
false
3.919866
false
false
false
bretttegart/treadmill
lib/python/treadmill/runtime/__init__.py
1
8679
"""Treadmill runtime framework. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import errno import glob import logging import os import random import socket import stat import tarfile import six from treadmill ...
apache-2.0
2,037,746,502,958,057,500
30.675182
78
0.600184
false
3.753893
false
false
false
Semen52/nlp4u
bot/bot.py
1
3131
#!/usr/bin/ python # -*- coding: utf-8 -*- # *************************************** # # # Author: Semen Budenkov # Date: 30/01/2017 # # *************************************** # """ This Bot uses the Updater class to handle the bot. A few handler functions are defined. Then, those functions are passed to the D...
mit
7,495,514,835,362,010,000
29.105769
94
0.657298
false
3.918648
false
false
false
OpenSciViz/cloud
openstack/pike/assets/novaconsole/console-client-poll.py
5
2426
#!/usr/bin/python import os import sys import argparse import websocket import tty import termios import logging import select import socket class UserExit(Exception): '''Raised inside the event loop when someone enters the disconnect escape sequence.''' pass def parse_args(): p = argparse.Argument...
mit
1,237,787,680,004,279,000
23.755102
74
0.507832
false
4.612167
false
false
false
xiaoqiangwang/e4py
e4py/data.py
1
13415
from __future__ import print_function import enum import pprint class ArrayFlag(enum.IntEnum): Scalar = 0x00 VarSizeArray = 0x01 BoundSizeArray = 0x02 FixedSizeArray = 0x03 def __str__(self): return self.name class DataFlag(enum.IntEnum): # Boolean Boolean = 0 # Integer ...
bsd-3-clause
3,040,699,008,316,287,500
35.15903
124
0.466269
false
3.506273
false
false
false
fedspendingtransparency/data-act-broker-backend
dataactcore/scripts/pull_fpds_data.py
1
88936
import boto3 import logging import argparse import requests import xmltodict import asyncio import datetime import time import re import json import math from sqlalchemy import func from dateutil.relativedelta import relativedelta from requests.exceptions import ConnectionError, ReadTimeout from urllib3.exceptions ...
cc0-1.0
5,876,518,414,355,370,000
45.66107
120
0.621289
false
3.816341
false
false
false
inconvergent/differential-mesh
main_sources.py
1
4339
#!/usr/bin/python3 # -*- coding: utf-8 -*- from numpy import pi from numpy import sqrt from numpy import zeros from numpy import cos from numpy import sin from numpy import power from numpy import floor from numpy.random import random TWOPI = pi*2. MID = 0.5 NMAX = 10e7 SIZE = 10000 ONE = 1./SIZE*0.5 RAD = 5*ONE...
mit
-6,192,471,873,024,826,000
18.284444
74
0.61558
false
2.763694
false
false
false
tfmorris/freebase-python
test/getlogindetails.py
5
1283
import os import os.path import getpass import freebase from freebase.api.session import MetawebError passwordfile = "test/.password.txt" def main(create_password_file=False): USERNAME, PASSWORD = "", "" if not os.path.isfile(passwordfile): print "In order to run the tests, we need to use a vali...
bsd-2-clause
2,077,079,098,181,571,600
28.181818
96
0.625097
false
4.125402
false
false
false
jonnor/qt-creator
src/libs/3rdparty/botan/wrappers/swig/tests/block.py
14
1116
#!/usr/bin/python import botan, base64 class MyCipher(botan.BlockCipher): def __init__(self): botan.BlockCipher.__init__(self, 16, 16, 32, 8) def encrypt(self, val): print "encrypt", val return val.swapcase() def decrypt(self, val): print "decrypt", val return val.s...
lgpl-2.1
6,157,274,556,041,124,000
20.461538
55
0.659498
false
3.253644
false
false
false
algbioi/snowball
algbioi/com/csv.py
1
10635
""" CSV read/write module version: 1.2 The MIT License (MIT) Copyright (c) 2014 Ivan Gregor 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 wi...
gpl-3.0
-6,454,662,912,592,904,000
33.641694
117
0.615327
false
4.203557
false
false
false
pombredanne/PythonJS
pythonjs/runtime/pythonpythonjs.py
3
14937
# PythonJS Low Level Runtime # by Amirouche Boubekki and Brett Hartshorn - copyright 2013 # License: "New BSD" __NULL_OBJECT__ = Object.create( null ) __WEBWORKER__ = False __NODEJS__ = False __BROWSER__ = False ## note browser and nodejs can both be true in the case of NodeWebkit if typeof(process) != 'undefined': ...
bsd-3-clause
-8,728,516,888,373,271,000
32.119734
150
0.658968
false
3.496489
false
false
false
CospanDesign/nysa-gui
NysaGui/host/common/protocol_utils/sf_camera/camera_utils.py
1
5686
# Copyright (c) 2014 Cospan Design (nysa@cospandesign.com) # This file is part of Nysa (wiki.cospandesign.com/index.php?title=Nysa). # # Nysa 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 o...
gpl-2.0
-1,458,480,839,808,970,000
30.241758
92
0.576328
false
3.973445
false
false
false
adamdeprince/python-citibike-data
setup.py
1
1237
#!/usr/bin/env python """ py-citibike """ from setuptools import setup setup( name='citibike', version='0.0.4', author='Adam DePrince', author_email='deprince@googlealumni.com', description='Easiest way for python programmers to download and work with NYC\'s public citibike dataset', long_desc...
gpl-3.0
4,235,048,966,064,537,000
25.891304
110
0.612773
false
3.455307
false
false
false
TalatCikikci/heritago
heritago/heritages/forms.py
3
1339
from django import forms from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from django.shortcuts import (render_to_response, render) from django.http import HttpResponseRedirect from django.template.context_processors import csrf from dja...
mit
2,172,086,126,256,329,000
24.75
75
0.702016
false
4.277955
false
false
false
mattrobenolt/python-mineshaft
setup.py
1
1253
#!/usr/bin/env python """ mineshaft ~~~~~~~~~ :copyright: (c) 2014 by Matt Robenolt. :license: BSD, see LICENSE for more details. """ from setuptools import setup install_requires = ['requests>=2.0.0'] with open('README.rst') as f: long_description = f.read() setup( name='mineshaft', version='0.0.0', ...
bsd-3-clause
7,115,544,470,826,363,000
27.477273
65
0.621708
false
3.774096
false
false
false
endlessm/chromium-browser
third_party/catapult/dashboard/dashboard/sheriff_config/service_client.py
1
2355
# Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utilities for service client""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from googlea...
bsd-3-clause
4,059,121,213,023,930,000
33.130435
79
0.707431
false
4.197861
false
false
false
tomjon/pylon
pylon.py
1
22140
# -*- coding: utf-8 -*- # PYthon LOgic eNgine (finding facts in second-order logic systems) # # Exists(x) s.t. W(x) and A(x, 'this') # # where W(x) iff x is a (real) word # and A(x, y) iff x is an anagram of y # Second example: # # Exists(x) s.t. W(x) and A(x, y) and W(y) # So a predicate impl will have to indicat...
apache-2.0
-92,673,889,447,291,820
29.119728
275
0.492863
false
3.562027
false
false
false
Nic30/HWToolkit
hwt/hdl/types/hdlType.py
1
4045
from enum import Enum from hwt.doc_markers import internal from hwt.synthesizer.exceptions import TypeConversionErr class MethodNotOverloaded(NotImplementedError): pass @internal def default_reinterpret_cast_fn(typeFrom, sigOrVal, toType): raise TypeConversionErr( "Reinterpretation of %r of type \n...
mit
7,671,308,155,224,380,000
27.892857
77
0.602719
false
3.931001
false
false
false
clothbot/python-play
parsing/import_ply_test.py
1
1046
import sys # Explicitly use ../ply from git submodule path sys.path.insert(1,'../ply') import ply.lex as plex class MyLexer: tokens = ( 'NUMBER', 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'LPAREN', 'RPAREN', ) t_PLUS = r'\+' t_MINUS = r'-' t_TIMES ...
mit
16,004,564,028,989,172
17.678571
52
0.473231
false
3.113095
false
false
false
my-poi/raptor
raptor.app/controllers/avail_space.py
1
1333
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import shutil class AvailSpace: def __init__(self, logger): self.logger = logger # Sprawdź ilość dostępnego miejsca i odzyskaj jeśli potrzeba def check(self): avail_space = self.get_avail_space() print(str(avail_space)) ...
gpl-3.0
7,130,124,978,393,427,000
28.511111
78
0.513554
false
3.628415
false
false
false
HybridF5/jacket
jacket/objects/extend/image_sync.py
1
3147
# Copyright 2013 IBM Corp. # # 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 agree...
apache-2.0
-646,573,106,537,288,800
34.359551
78
0.645377
false
3.75537
false
false
false
cscorley/whatthepatch
whatthepatch/snippets.py
1
1402
# -*- coding: utf-8 -*- import os from shutil import rmtree def remove(path): if os.path.exists(path): if os.path.isdir(path): rmtree(path) else: os.remove(path) # find all indices of a list of strings that match a regex def findall_regex(items, regex): ...
mit
1,381,733,715,337,187,800
21.366667
79
0.531384
false
3.728723
false
false
false
jimberlage/servo
tests/wpt/web-platform-tests/tools/wptrunner/setup.py
16
2555
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import glob import os import sys import textwrap from setuptools import setup, find_packages here = os.path.split(__fi...
mpl-2.0
-6,143,160,730,891,527,000
34.985915
92
0.592172
false
4.120968
true
false
false
sagiss/sardana
src/sardana/macroserver/recorders/examples/xas.py
1
12040
#!/usr/bin/env python ############################################################################## ## ## This file is part of Sardana ## ## http://www.sardana-controls.org/ ## ## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain ## ## Sardana is free software: you can redistribute it and/or modify ## it un...
lgpl-3.0
936,097,271,075,766,100
41.54417
124
0.542193
false
4.08274
false
false
false
pinae/WikipediaLoader
data_creator.py
1
4208
#!/usr/bin/python3 # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals import os from random import shuffle import numpy as np import h5py from encoder import encode def read_data(): raw_data = [] raw_data_size = 0 filenames = os.listdir("articles") shuffle(filen...
gpl-3.0
-14,917,573,043,090,942
35.912281
82
0.66635
false
3.551055
true
false
false
SchulzLab/TFAnalysis
Preprocessing/IntegrateLeaderboard.py
1
4561
import os import sys import argparse import subprocess #This script combines the TEPIC annotations in bins with the open chromatin predictions for leader data #arg1=Path to the TEPIC annotations #arg2=Path to the DNase coverage bed files for the center bin #arg3=Path to the DNase coverage bed files for the left bin #a...
mit
-3,769,660,783,523,275,300
40.844037
168
0.675948
false
2.695626
false
false
false
phlax/pootle
pootle/apps/pootle_log/getters.py
5
1089
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from django.contrib.auth import get_user_mod...
gpl-3.0
-6,206,815,251,743,403,000
25.560976
77
0.74472
false
3.501608
false
false
false
JQIamo/artiq
artiq/compiler/embedding.py
1
48958
""" The :class:`Stitcher` class allows to transparently combine compiled Python code and Python code executed on the host system: it resolves the references to the host objects and translates the functions annotated as ``@kernel`` when they are referenced. """ import sys, os, re, linecache, inspect, textwrap, types as...
lgpl-3.0
-1,973,215,662,783,030,500
44.247689
101
0.549083
false
4.36813
false
false
false
mcdenhoed/redo
button.py
1
1260
from levelformat import Button as bf import pygame import os class Button(pygame.sprite.Sprite): images = {} def __init__(self, buttonFormat): pygame.sprite.Sprite.__init__(self) if not Button.images: inactiveImgPath = os.path.join("assets", "images", "buttonInactive.png") ...
bsd-3-clause
-8,828,002,875,791,791,000
38.375
90
0.626984
false
3.888889
false
false
false
fpeder/pyXKin
xkin/test/test_stft.py
1
1412
#!/usr/bin/env python # -*- coding: utf-8 -*- import cv2 import numpy as np import sys; sys.path.append('../') from gesture import GestureResample from gesture import stft class TestSTFT(): def __init__(self, width=640, height=480): self._width = width self._height = height self._win =...
bsd-2-clause
7,394,316,966,096,055,000
21.774194
70
0.493626
false
3.503722
false
false
false
AnhellO/DAS_Sistemas
Ago-Dic-2017/Luis Estrada/solid_principles/dependency_invertion_principle.py
1
1743
from abc import ABCMeta, abstractmethod class ISwitch(object): __metaclass__ = ABCMeta @abstractmethod def is_on(self): pass @abstractmethod def press(self): pass class ISwitchable(object): __metaclass__ = ABCMeta @abstractmethod def turn_on(self): pass ...
mit
3,674,651,604,931,956,700
18.806818
56
0.600115
false
3.492986
false
false
false
Ledoux/ShareYourSystem
Pythonlogy/ShareYourSystem/Standards/Modelers/Findoer/__init__.py
2
5115
# -*- coding: utf-8 -*- """ <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> Findoer (sorry Finder is already an important module in python standards, so just to be sure to not override...) instances helps to find in a hdf5 table RowedVariablesList corresponding to the ...
mit
-4,553,578,005,968,283,000
17.874539
112
0.629521
false
3.01592
false
false
false
cobrab11/blacksmith-2
expansions/session_stats/code.py
3
3070
# coding: utf-8 # BlackSmith mark.2 # exp_name = "session_stats" # /code.py v.x6 # Id: 10~4c # Code © (2010-2012) by WitcherGeralt [alkorgun@gmail.com] class expansion_temp(expansion): def __init__(self, name): expansion.__init__(self, name) def command_exc_info(self, stype, source, body, disp): if body: ...
apache-2.0
-3,285,958,368,110,114,000
32.725275
170
0.613555
false
2.625321
false
false
false
fedya/ajenti
plugins/users/backend.py
17
3869
from subprocess import * from ajenti.api import * from ajenti.com import * from ajenti.utils import * class User: login = '' uid = 0 gid = 0 home = '' shell = '' info = '' groups = [] class Group: name = '' gid = 0 users = [] class UsersBackend(Plugin): icon = '/dl/use...
lgpl-3.0
8,104,016,329,027,501,000
26.635714
85
0.508917
false
2.948933
false
false
false
anybox/connector
connector/queue/job.py
1
23475
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
-794,975,764,627,419,900
31.832168
82
0.57082
false
4.267406
false
false
false
cleinias/Homeo
src/RobotSimulator/Webots_tests/testWebotsBraitenberg-type2.py
1
2379
''' Created on Sep 17, 2013 Test connection to Webots with a simulation of a Braitenberg type 2 vehicle @author: stefano ''' from RobotSimulator.WebotsTCPClient import WebotsTCPClient from RobotSimulator.Transducer import * testClient = WebotsTCPClient() testClient._clientPort = 10020 testSocket = testClient.getCli...
gpl-3.0
8,259,426,943,979,748,000
37.387097
102
0.598991
false
4.210619
true
false
false
SECOORA/GUTILS
gutils/tests/test_watch.py
1
5007
#!python # coding=utf-8 import os import time import shutil from glob import glob from pyinotify import ( IN_CLOSE_WRITE, IN_MOVED_TO, ThreadedNotifier, WatchManager ) from gutils import safe_makedirs from gutils.slocum import SlocumMerger from gutils.watch.binary import Slocum2AsciiProcessor from gut...
mit
892,641,972,383,435,900
26.360656
117
0.588376
false
3.662765
true
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_list_result_py3.py
1
1188
# 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
9,159,432,702,082,571,000
36.125
77
0.585859
false
4.288809
false
false
false
sjml/twitter-oauth-helper
TwitterOAuthHelper.py
1
4998
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import webbrowser import BaseHTTPServer import urlparse from rauth import OAuth1Service, utils HOSTNAME = "localhost" LISTEN_PORT = 8000 keepServing = True header = "" footer = "" responseTemplate = "" inputTemplate = "" errorTemplate = "" with open(...
mit
-2,904,222,360,552,794,600
33.468966
104
0.581032
false
3.96038
false
false
false
balloob/github3.py
tests/unit/test_repos_repo.py
1
60383
"""Unit tests for Repositories.""" import datetime import mock import pytest from base64 import b64encode from github3 import GitHubError from github3.repos.repo import (Comparison, Contents, Hook, RepoComment, RepoCommit, Repository) from github3.models import GitHubCore from . import...
bsd-3-clause
-1,927,653,481,773,990,000
30.614136
79
0.569117
false
4.139508
true
false
false
d-meiser/cold-atoms
setup.py
1
3774
from setuptools import setup import sys import os exec(open('src/coldatoms/version.py').read()) def require_build(argv): """This tells us whether we need to build the package.""" info_commands = ['--help-commands', '--name', '--version', '-V', '--fullname', '--author', '--author-ema...
gpl-3.0
1,876,032,517,468,325,600
31.25641
81
0.547165
false
4.09772
false
false
false
dm03514/func-y-task-engine
funcytaskengine/transition_conditions/__init__.py
1
1704
import functools from funcytaskengine.event_fulfillment.return_values import Valuesable, EventSuccessDecoratorResult from funcytaskengine.parsers.loaders import DynamicConfigLoader from funcytaskengine.transition_conditions.exceptions import ConditionNotMet class TransitionConditionFactory(DynamicConfigLoader): ...
gpl-3.0
5,648,431,876,113,560,000
27.4
99
0.648474
false
4.605405
false
false
false
hsr-ba-fs15-dat/opendatahub
src/main/python/hub/odhql/ast.py
1
23543
"""Classes for ODHQLs Abstract Syntax Tree.""" from collections import Sequence from enum import Enum from hub.odhql.exceptions import TokenException class ASTBase(object): """Base class for all AST classes.""" def accept(self, visitor): """ Basic support for the visitor pattern. """ visit...
mit
-4,238,231,526,359,069,000
27.851716
119
0.588328
false
4.407151
false
false
false
Alwnikrotikz/kegbot
pykeg/src/pykeg/core/admin.py
1
2924
# -*- coding: latin-1 -*- # Copyright 2009 Mike Wakerly <opensource@hoho.com> # # This file is part of the Pykeg package of the Kegbot project. # For more information on Pykeg or Kegbot, see http://kegbot.org/ # # Pykeg is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publ...
gpl-2.0
8,149,814,994,540,416,000
34.658537
91
0.73803
false
3.181719
false
false
false
ScottishCyclops/DistributedBlend
autorender.py
1
2212
#!/usr/bin/python3 # -*- coding: UTF-8 -*- ''' DistributedBlend is a software designed to render multiple blender files on multiple GPUs with the click of a button Copyright (C) 2017 Scott Winkelmann This program is free software: you can redistribute it and/or modify it under the terms of the GNU ...
gpl-3.0
4,370,924,938,276,349,000
36.491525
111
0.725588
false
3.761905
false
false
false
uclouvain/OSIS-Louvain
webservices/api/serializers/section.py
1
5147
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
5,835,392,771,683,312,000
47.54717
119
0.724058
false
4.25641
false
false
false
allisson/django-pagseguro2
pagseguro/admin.py
1
1051
from django.contrib import admin from pagseguro.models import Checkout, Transaction, TransactionHistory class CheckoutAdmin(admin.ModelAdmin): list_display = ( "id", "code", "date", "success", ) list_display_links = ("id",) search_fields = [ "code", ] ...
mit
-6,373,792,350,650,510,000
22.355556
77
0.623216
false
3.807971
false
false
false
josiahcarlson/timezone-utils
parse_timezone_kml.py
1
4234
from collections import defaultdict try: import simplejson as json json # silence pyflakes except ImportError: import json from os import path import sys import time def _get_from(what, data, start): start = data.index(what, start) start = data.index('<font COLOR=', start) start = nstart = dat...
lgpl-2.1
1,917,467,802,976,942,800
33.991736
114
0.603921
false
3.898711
false
false
false
kjedruczyk/phabricator-tools
py/abd/abdt_branch.py
1
22219
"""Implement operations for branch-based reviews.""" # ============================================================================= # CONTENTS # ----------------------------------------------------------------------------- # abdt_branch # # Public Classes: # Branch # .is_abandoned # .is_null # .is_new # ...
apache-2.0
-3,062,515,958,061,183,000
34.324324
79
0.58459
false
4.011374
false
false
false
ivanalejandro0/leap_pycommon
src/leap/common/events/__init__.py
1
3610
# -*- coding: utf-8 -*- # __init__.py # Copyright (C) 2013 LEAP # # 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. # # Th...
gpl-3.0
-1,377,691,264,188,621,300
35.1
78
0.712188
false
4.139908
false
false
false
evancich/apm_motor
modules/PX4Firmware/integrationtests/demo_tests/direct_manual_input_test.py
5
3327
#!/usr/bin/env python #*************************************************************************** # # Copyright (c) 2015 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # ...
gpl-3.0
-5,896,500,793,323,433,000
35.966667
116
0.691614
false
4.148379
true
false
false
johndoe31415/biblint
TextFragmentTrackerTests.py
1
6039
#!/usr/bin/python3 # # biblint - Static checking of BibTeX files to find errors or inconsistencies. # Copyright (C) 2016-2016 Johannes Bauer # # This file is part of biblint. # # biblint is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
gpl-3.0
3,256,099,088,654,376,400
49.325
362
0.558039
false
2.554569
true
false
false
jaypipes/enamel
enamel/tests/functional/db/test_migrations.py
1
5560
# 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 # d...
apache-2.0
4,923,889,535,520,033,000
33.968553
78
0.660252
false
4.257274
true
false
false