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
adjustive/dapp
dproject/settings.py
1
3656
""" Django settings for dproject project. Generated by 'django-admin startproject' using Django 1.9.6. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os ...
gpl-3.0
-6,799,277,370,082,388,000
25.492754
91
0.683807
false
3.378928
false
false
false
christopher-wahl/sdss_qso_python
analysis/slope_fit.py
1
4730
from typing import Callable, Union from numpy import diag, sqrt from scipy.optimize import curve_fit from spectrum import Iterable, Spectrum, Tuple def __linear_func( x: float, m: float, b: float ) -> float: return m * x + b def __quad_func( x: float, a: float, b: float, c: float ) -> float: return a * (x...
mit
-2,830,930,559,680,619,500
34.298507
120
0.628753
false
3.347488
false
false
false
alok108/doghustle
doghustle/auth/forms.py
1
1676
from django.contrib.auth.forms import UserCreationForm,AuthenticationForm from django import forms from django.contrib.auth.models import User class SimpleUserCreation(UserCreationForm): email = forms.EmailField(required=True, widget=forms.widgets.TextInput(attrs={'class':'form-control','placeholder': 'Email Address'...
gpl-2.0
3,129,969,944,355,798,500
51.375
135
0.74105
false
3.888631
false
false
false
jggatc/pyjsdl
surface.py
1
12005
#Pyjsdl - Copyright (C) 2013 James Garnon <https://gatc.ca/> #Released under the MIT License <https://opensource.org/licenses/MIT> from pyjsdl.pyjsobj import HTML5Canvas from pyjsdl.rect import Rect, rectPool from pyjsdl.color import Color from __pyjamas__ import JS import sys if sys.version_info < (3,): from pyj...
mit
-6,440,782,024,990,421,000
31.622283
148
0.541608
false
3.839143
false
false
false
chapmanb/metasv
metasv/process_age_alignment.py
1
22283
from __future__ import print_function import logging import multiprocessing from collections import defaultdict import pybedtools from defaults import MIN_INV_SUBALIGN_LENGTH, MIN_DEL_SUBALIGN_LENGTH logger = logging.getLogger(__name__) def get_insertion_breakpoints(age_records, intervals, expected_bp_pos, window=20...
bsd-2-clause
6,027,422,886,592,959,000
57.639474
243
0.612709
false
3.286093
false
false
false
EnviDat/ckanext-oaipmh_repository
ckanext/oaipmh_repository/oaipmh_error.py
1
3392
class OAIPMHError(Exception): def __init__(self, code, message): self.code = code self.message = message def set_message(self, message): self.message = message def as_xml_dict(self): return {'error': {'@code': self.code, '#text': self.message}} def __repr__(self): ...
agpl-3.0
-6,533,082,040,135,875,000
36.688889
92
0.625
false
4.167076
false
false
false
LI3DS/lids-api
api_li3ds/apis/sensor.py
1
2589
# -*- coding: utf-8 -*- from flask_restplus import fields from api_li3ds.app import api, Resource, defaultpayload from api_li3ds.database import Database nssensor = api.namespace('sensors', description='sensors related operations') sensor_model_post = nssensor.model( 'Sensor Model Post', { 'name': ...
gpl-3.0
7,488,057,765,695,068,000
27.766667
79
0.592507
false
3.835556
false
false
false
BruceDLong/CodeDog
xlator_Java.py
1
47251
#This file, along with Lib_Java.py specify to the CodeGenerater how to compile CodeDog source code into Java source code. import progSpec import codeDogParser from progSpec import cdlog, cdErr, logLvl from codeGenerator import codeItemRef, codeUserMesg, codeAllocater, codeParameterList, makeTagText, codeAction, getMode...
gpl-2.0
-8,974,714,541,891,909,000
48.895459
687
0.614569
false
3.655501
false
false
false
trendels/rhino
examples/content_type_versioning.py
1
1165
import json from rhino import Mapper, get # Our internal representation report = { 'title': 'foo', 'author': 'Fred', 'date': '2015-01-09', 'tags': ['a', 'b', 'c'], } # Base class for our representations class report_repr(object): @classmethod def serialize(cls, report): obj = dict([(k...
mit
-6,860,919,423,660,768,000
24.326087
78
0.657511
false
3.200549
false
false
false
fsxfreak/club-suite
clubsuite/suite/migrations/0002_auto_20170219_0729.py
1
3641
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-19 07:29 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ...
mit
4,585,127,599,005,000,700
46.907895
156
0.573469
false
4.095613
false
false
false
adamdempsey90/fargo3d
utils/python/indices.py
1
1131
import re def index(i,j,k): ''' Fargo3d index calculator. Input: Strings i,j,k, with the value of the desired index on each direction. Output: The monodimentional fargo3d index. ''' value = '' print i,j,k #Trivial option if i == 'i' and j == 'j' and k == 'k': value += 'l' ...
gpl-3.0
4,786,915,709,673,327,000
24.704545
85
0.431477
false
3
false
false
false
fergalmoran/dss
spa/api/v1/ShowResource.py
1
1087
from tastypie import fields from tastypie.authorization import Authorization from tastypie.exceptions import ImmediateHttpResponse from tastypie.http import HttpBadRequest from spa.api.v1.BaseResource import BaseResource from spa.models import Show from spa.models.show import ShowOverlapException DATE_FORM...
bsd-2-clause
6,732,884,751,629,679,000
29.970588
76
0.641214
false
4.418699
false
false
false
bearstech/modoboa
modoboa/admin/templatetags/admin_tags.py
1
8642
"""Admin extension tags.""" from __future__ import unicode_literals from functools import reduce from django import template from django.core.urlresolvers import reverse from django.template.loader import render_to_string from django.utils.safestring import mark_safe from django.utils.translation import ugettext as ...
isc
8,241,718,290,447,684,000
29.864286
76
0.560287
false
3.827281
false
false
false
tensorflow/neural-structured-learning
research/kg_hyp_emb/models/base.py
1
8413
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
4,393,025,333,323,162,000
34.952991
80
0.66314
false
3.981543
false
false
false
beeftornado/sentry
src/sentry/integrations/metric_alerts.py
1
2544
from __future__ import absolute_import from datetime import timedelta from django.core.urlresolvers import reverse from sentry.incidents.logic import get_incident_aggregates from sentry.incidents.models import IncidentStatus, IncidentTrigger, INCIDENT_STATUS from sentry.utils.assets import get_asset_url from sentry.u...
bsd-3-clause
5,311,452,514,871,115,000
34.830986
96
0.634434
false
3.90184
false
false
false
cortesi/qtile
libqtile/utils.py
1
8226
# Copyright (c) 2008, Aldo Cortesi. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify,...
mit
4,046,155,213,415,968,000
29.354244
79
0.587649
false
4.034331
false
false
false
ktheory/ipcat
IpDbGenerate.py
1
1493
#!/usr/bin/env python import pprint from operator import itemgetter from socket import inet_aton from struct import unpack from urllib import urlopen pp = pprint.PrettyPrinter(indent=4, width=50) iplist = {} #fetch remote datacenter list and convert to searchable datastructure external_list = 'https://raw.github.com/...
gpl-3.0
2,662,191,604,263,788,500
27.188679
77
0.608171
false
3.488318
false
false
false
aviarypl/mozilla-l10n-addons-server
src/olympia/files/utils.py
1
51113
import collections import contextlib import errno import hashlib import json import os import io import re import shutil import stat import struct import tarfile import tempfile import zipfile from datetime import datetime, timedelta from six import text_type from django import forms from django.conf import settings ...
bsd-3-clause
889,460,815,450,143,100
36.092163
79
0.610647
false
4.02877
false
false
false
alexsavio/aizkolari
aizkolari_featsets.py
1
3744
#!/usr/bin/python #from IPython.core.debugger import Tracer; debug_here = Tracer() import os, subprocess, re import numpy as np import aizkolari_utils as au #measures = ['jacs', 'modulatedgm', 'norms', 'trace', 'geodan'] measures = ['jacs', 'modulatedgm'] #measures = ['trace'] dists = ['pearson', 'bhattacharyy...
bsd-3-clause
-1,374,853,581,680,293,000
31.556522
161
0.549947
false
2.943396
true
false
false
JaapJoris/bps
numberedmodel/models.py
1
1584
from django.db import models class NumberedModel(models.Model): def number_with_respect_to(self): return self.__class__.objects.all() def _renumber(self): '''Renumbers the queryset while preserving the instance's number''' queryset = self.number_with_respect_to() field_name = ...
agpl-3.0
6,606,948,540,788,826,000
35
75
0.583333
false
4.258065
false
false
false
tonybaloney/st2
st2common/tests/unit/test_logger.py
1
13949
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
apache-2.0
3,687,753,405,142,566,000
34.766667
99
0.623772
false
3.929296
true
false
false
timpalpant/KaggleTSTextClassification
others/vw_to_submission.py
1
4546
import os import subprocess from collections import defaultdict from datetime import datetime import csv from csv import DictReader import math from glob import glob # Data locations loc_train = "../data/train.csv" loc_test = "../data/test.csv" loc_labels = "../data/trainLabels.csv" loc_best = "test.pred2...
gpl-3.0
-8,946,471,879,089,341,000
33.53125
339
0.527497
false
2.795818
true
false
false
candidtim/vagrant-appindicator
vgapplet/machineindex.py
1
4627
# Copyright 2014, candidtim (https://github.com/candidtim) # # This file is part of Vagrant AppIndicator for Ubuntu. # # Vagrant AppIndicator for Ubuntu 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 v...
gpl-3.0
2,921,425,436,328,671,700
33.022059
106
0.688999
false
3.843023
false
false
false
sch3m4/intelmq
intelmq/bots/parsers/malwarepatrol/parser_dansguardian.py
1
1085
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from intelmq.lib import utils from intelmq.lib.bot import Bot from intelmq.lib.message import Event class DansParserBot(Bot): def process(self): report = self.receive_message() if report is None or not report.contains("r...
agpl-3.0
7,067,288,390,485,369,000
24.232558
61
0.570507
false
3.945455
false
false
false
adherrling/destiny-gotg
model.py
1
1400
#!/usr/bin/python import os import json, sqlite3 import initdb import builddb import requests, zipfile import shutil import discordBot APP_PATH = "/etc/destinygotg" DBPATH = f"{APP_PATH}/guardians.db" def check_db(): """Check to see if a database exists""" return os.path.isfile(os.environ['DBPATH']) def init...
mit
8,286,232,855,663,104,000
29.434783
95
0.684286
false
3.398058
false
false
false
RainbowRail/rainbowrail
rrail_pkg/app.py
1
2105
#!/usr/bin/env python import bottle, socket import yaml import os, io, time import build # Site path path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '_site') src_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '_template') # Method to set up site def setup(path): # Link site ...
mit
9,113,480,922,288,468,000
28.236111
93
0.545843
false
3.368
false
false
false
BrentDorsey/pipeline
jupyterhub.ml/config/jupyterhub/jupyterhub_config.py
1
16882
import os # Configuration file for jupyterhub. #------------------------------------------------------------------------------ # Configurable configuration #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ #...
apache-2.0
8,332,629,188,906,026,000
35.227468
584
0.674387
false
3.573666
true
false
false
ingadhoc/odoo-saas-manager
addons/saas_manager/instance_additional.py
1
1560
# -*- coding: utf-8 -*- ############################################################################## # # Saas Manager # Copyright (C) 2014 Sistemas ADHOC # No email # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as ...
agpl-3.0
-7,807,300,565,723,389,000
29.588235
122
0.621154
false
4.193548
false
false
false
sgnn7/sgfc
sgfc_drone.py
1
2957
#!/usr/bin/env python2 import time from functools import partial import sgfc_communication import sgfc_io from sgfc_communication.protobufs import sgfc_pb2 as fc_proto class SgfcDrone(object): def __init__(self): self._throttle = 0.0 self._yaw = 0.0 self._pitch = 0.0 def comm_callb...
lgpl-2.1
1,260,848,690,594,583,000
32.602273
92
0.448766
false
4.23639
false
false
false
neuront/eirx
src/eirx/parse.py
1
3057
import re WHITE_RGBA = (255, 255, 255) BLACK_RGBA = (0, 0, 0) def _get_size(size): for m in _SIZE_RE: match = m[0].match(size) if match: return m[1](match.groupdict()) raise ValueError('Invalid size') def _get_RGBA(opt, index): if len(opt) > index + 6: return tuple(i...
mit
-3,878,455,098,277,635,600
27.305556
79
0.527314
false
3.132172
false
false
false
yrakcaz/music-style-classifier
tests/test.py
1
2101
#! env python2.7 import sys, subprocess import json def main(): argv = sys.argv argc = len(argv) if (argc != 2 or (argv[1] != "--svm" and argv[1] != "--knn")): print("Use --knn or --svm option!") sys.exit() print("\033[34m\033[1m================================================\033[0m\0...
gpl-2.0
6,798,761,934,914,217,000
34.610169
100
0.439315
false
3.329635
false
false
false
dendyyangky/sgeede_b2b
sgeede_internal_transfer/wizard/wizard_stock_internal_transfer.py
2
9955
from openerp import netsvc from openerp import models, fields, api from openerp.tools.translate import _ import openerp.addons.decimal_precision as dp from datetime import datetime from openerp.osv import osv import time class wizard_stock_internal_transfer(models.TransientModel): _name = 'wizard.stock.internal.trans...
unlicense
-4,496,261,562,275,443,000
37.288462
128
0.644701
false
3.096423
false
false
false
AMOboxTV/AMOBox.LegoBuild
plugin.video.mrpiracy/resources/lib/Player.py
1
8028
#!/usr/bin/python # -*- coding: utf-8 -*- import os import xbmcgui import xbmc import xbmcvfs import time import urllib import urllib2 import re import sys import traceback import json from t0mm0.common.net import Net __SITE__ = 'http://kodi.mrpiracy.xyz/' __COOKIE_FILE__ = os.path.join(xbmc.translatePath('special:/...
gpl-2.0
8,139,695,628,807,528,000
41.670213
414
0.551982
false
3.320364
false
false
false
lyijin/working_with_dna_meth
filter_miscalled_Cs.py
1
2696
#!/usr/bin/env python3 """ > filter_miscalled_Cs.py < Script to process the .cov files produced by bismark_methylation_extractor, and removes methylated positions that potentially arise by chance. A super-conservative estimate of 1% miscall rate is assumed (might be as low as 0.1%, evidenced by the CHG and CHH call ...
gpl-3.0
7,099,377,819,242,962,000
33.139241
84
0.660608
false
3.510417
false
false
false
geophysics/mtpy
mtpy/imaging/plotstrike2d.py
1
53768
# -*- coding: utf-8 -*- """ Created on Thu May 30 18:28:24 2013 @author: jpeacock-pr """ #============================================================================== import matplotlib.pyplot as plt import numpy as np import os from matplotlib.ticker import MultipleLocator import mtpy.imaging.mtplottools as mtpl i...
gpl-3.0
8,961,299,997,132,101,000
41.639175
108
0.408459
false
4.427536
false
false
false
gmauro/presta
presta/datasets.py
1
2265
""" """ import glob import os class DatasetsManager(object): def __init__(self, logger, ids): self.ids = ids self.logger = logger self.fastq_collection = dict() self.fastq_counter = 0 def collect_fastq_from_fs(self, base_path): results = dict() count = 0 ...
mit
499,289,946,597,377,500
35.532258
128
0.430022
false
4.330784
false
false
false
jgoclawski/django-facebook-auth
facebook_auth/models.py
1
9449
import collections from datetime import timedelta import json import logging try: from urllib.error import HTTPError import urllib.parse as urlparse except ImportError: import urlparse from urllib2 import HTTPError from django.conf import settings from django.contrib.auth import models as auth_models...
mit
3,231,946,060,336,171,000
33.996296
79
0.621653
false
4.092248
false
false
false
mattpap/sympy-polys
sympy/utilities/pytest.py
1
3948
"""py.test hacks to support XFAIL/XPASS""" # XXX this should be integrated into py.test # XXX but we can't force everyone to install py-lib trunk import sys try: # functools is not available in Python 2.4 import functools except ImportError: has_functools = False else: has_functools = True try: #...
bsd-3-clause
-4,433,186,619,953,015,000
27
72
0.561297
false
3.920556
true
false
false
imiolek-ireneusz/eduActiv8
game_boards/game081.py
1
23574
# -*- coding: utf-8 -*- import os import pygame import random from math import pi, cos, acos, sin, sqrt import classes.board import classes.extras as ex import classes.game_driver as gd import classes.level_controller as lc import classes.simple_vector as sv class Board(gd.BoardGame): def __init__(self, mainloo...
gpl-3.0
-2,524,319,700,950,565,000
40.797872
120
0.488759
false
3.107976
false
false
false
Olical/dcpu16py
asm_pyparsing.py
1
16612
#! /usr/bin/env python """ pyparsing based grammar for DCPU-16 0x10c assembler """ try: from itertools import izip_longest except ImportError: from itertools import zip_longest as izip_longest try: basestring except NameError: basestring = str import logging; log = logging.getLogger("dcpu16_asm") log...
mit
7,136,708,367,839,636,000
33.972632
102
0.565736
false
3.809218
false
false
false
SequencingDOTcom/App-Chains-Sequencing.com-Real-Time-API
python/UsageExample.py
1
2357
# encoding: utf-8 from __future__ import unicode_literals from AppChains import AppChains class UsageExample(object): token = '<your token goes here>' url = 'api.sequencing.com' def __init__(self): self.chains = AppChains(self.token, self.url) #print(self.get_public_beacon_test()) ...
mit
-6,927,457,079,036,015,000
34.179104
72
0.515062
false
4.09913
true
false
false
proycon/foliatools
foliatools/xslt.py
1
4500
# -*- coding: utf8 -*- import lxml.etree import sys import glob import getopt import os.path import io def transform(xsltfilename, sourcefilename, targetfilename = None, encoding = 'utf-8', **kwargs): xsldir = os.path.dirname(__file__) if xsltfilename[0] != '/': xsltfilename = os.path.join(xsldir, xsltfilenam...
gpl-3.0
-5,817,704,970,516,492,000
35
149
0.587333
false
3.719008
false
false
false
MDAnalysis/GridDataFormats
gridData/gOpenMol.py
1
10453
# gridDataFormats --- python modules to read and write gridded data # Copyright (c) 2009-2014 Oliver Beckstein <orbeckst@gmail.com> # Released under the GNU Lesser General Public License, version 3 or later. # # Part of the documentation and format specification: Copyright CSC, 2005 """ :mod:`gOpenMol` --- the gOpenMo...
lgpl-3.0
-8,192,271,792,387,138,000
37.858736
149
0.591313
false
3.725232
false
false
false
sixohsix/twitter
setup.py
1
2203
from setuptools import setup, find_packages with open("README") as f: long_description = f.read() version = '1.18.0' setup(name='twitter', version=version, description="An API and command-line toolset for Twitter (twitter.com)", long_description=long_description, long_description_content_...
mit
6,502,890,697,609,322,000
40.566038
84
0.600545
false
4.042202
false
false
false
RPGOne/Skynet
pytorch-master/torch/autograd/function.py
1
9610
import torch import torch._C as _C import torch.utils.hooks as hooks from collections import OrderedDict class Function(_C._FunctionBase): """Records operation history and defines formulas for differentiating ops. Every operation performed on :class:`Variable` s creates a new function object, that perfor...
bsd-3-clause
1,698,297,703,847,405,600
37.75
102
0.650052
false
4.372157
false
false
false
zerodays/gradientni-spust-predstavitev
Elipsa/select_data.py
2
3571
from gradient_descent import get_data def select_data(): done = False while not done: try: print('Select input data set:') print(' 1 Mars half year') print(' 2 Mars full (whole year measured every Earth month)') print(' 3 Mars small (every fourth...
gpl-3.0
6,817,748,943,440,151,000
40.523256
121
0.486138
false
3.735356
false
false
false
NabilZaman/data_structures
python-data-structures/B-tree/btree.py
1
13381
#!/usr/bin/env python """ btree.py This file contains an implementation of a B-Tree as outlined in https://en.wikipedia.org/wiki/B-tree. """ def find_index_in_sorted_list(key, L): """ Helper function. Return index closest (above) key in sorted list. """ if not L: return 0 if len(L) == 1: ...
mit
-8,827,456,034,595,784,000
34.873995
80
0.561841
false
4.102085
true
false
false
dario-ramos/tp3_cloud-events
src/model/guest_repository.py
1
1057
#!/usr/bin/env python from abc import ABCMeta, abstractmethod from google.appengine.ext import ndb from google.appengine.ext import db from event_guest import EventGuest class IEventGuestRepository: __metaclass__ = ABCMeta @abstractmethod def create(self, guestFirstName, guestLastName, gu...
gpl-2.0
8,995,529,977,190,002,000
26.102564
78
0.657521
false
4.331967
false
false
false
dinhkute/Incisive-AIESEC
webroot/Pj/mysite/mysite/polls/urls.py
1
2551
from django.conf.urls import url from . import views from django.contrib.auth.views import (login, logout, password_reset, password_reset_complete, password_reset_done, ...
apache-2.0
-9,020,143,675,355,446,000
60.268293
108
0.593885
false
3.424161
false
true
false
jtauber/pyuca
test.py
1
8168
# coding: utf8 from __future__ import unicode_literals import sys import unittest PYTHON3 = sys.version_info >= (3,) V8_0_0 = sys.version_info >= (3, 5) V10_0_0 = sys.version_info >= (3, 7) class SmokeTest(unittest.TestCase): def test_cafe(self): from pyuca import Collator c = Collator() ...
mit
-2,176,341,617,226,708,500
32.596708
78
0.578393
false
3.001471
true
false
false
amitjamadagni/sympy
sympy/combinatorics/tests/test_partitions.py
3
3304
from sympy.combinatorics.partitions import (Partition, IntegerPartition, RGS_enum, RGS_unrank, RGS_rank, random_integer_partition) from sympy.utilities.pytest import raises from sympy.utilities.iterables import default_sort_key, par...
bsd-3-clause
5,293,114,591,856,392,000
32.714286
75
0.548729
false
3.096532
false
false
false
tsdmgz/ansible
lib/ansible/modules/network/nxos/nxos_snapshot.py
1
14173
#!/usr/bin/python # # 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 License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
292,380,842,566,198,300
32.426887
106
0.596133
false
4.252325
false
false
false
jacquerie/inspire-next
inspirehep/modules/workflows/workflows/article.py
1
12747
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
gpl-3.0
1,027,301,321,972,007,800
23.372849
78
0.556915
false
3.79601
false
false
false
kwikteam/phy
phy/plot/gloo/array.py
1
2303
# ----------------------------------------------------------------------------- # Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- """ Vertex Array objects are OpenGL objects that s...
bsd-3-clause
7,233,584,848,580,602,000
26.094118
79
0.570994
false
4.033275
false
false
false
jimrybarski/fylm
fylm/model/workunit.py
1
1243
class WorkUnit(object): def __init__(self, model, required_data_sources, dependencies=None): """ :param model: the data structure that is being populated with data :param required_data_sources: one of: "nd2", "imagereader" :type required_data_sources: str :param depen...
mit
7,536,287,025,366,467,000
32.621622
92
0.635559
false
4.407801
false
false
false
ibusybox/algorithm
src/python/test_sort.py
1
3366
#!/usr/bin/env python #coding: utf-8 import unittest import sort class TestInsertionSort(unittest.TestCase): def setUp(self): print "start insertion sort test" def tearDown(self): print "end insertion sort test" def test_case01(self): A = [3,2,1] print "origin A=%s" % A ...
apache-2.0
-3,799,206,955,780,221,400
29.324324
55
0.549614
false
3.148737
true
false
false
HonzaKral/warehouse
tests/conftest.py
1
4822
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
apache-2.0
-7,687,774,955,321,452,000
28.224242
78
0.660929
false
3.866881
true
false
false
mbareta/edx-platform-ft
lms/djangoapps/affiliates/urls.py
1
1342
""" URLs for the Affiliate Feature. """ from django.conf.urls import patterns, url urlpatterns = patterns('', url(r'^$', 'affiliates.views.index', name='index'), url(r'^admin$', 'affiliates.views.admin', name='admin'), url(r'^csv_admin$', 'affiliates.views.csv_admin', name='csv_admin'), url(r'^csv_exp...
agpl-3.0
5,093,399,337,685,562,000
57.347826
124
0.625931
false
2.930131
false
false
false
storborg/typelift
typelift/dewoff.py
1
4596
import struct import zlib from cStringIO import StringIO def read_woff_header(f): """ Read the WOFF header from a file-like object, consuming the file up to the end of the header. Reference here: http://www.w3.org/TR/WOFF/#WOFFHeader """ fmt = '>IIIHHIHHIIIII' buf = f.read(struct.calcsize...
mit
1,986,326,004,806,239,200
27.196319
78
0.534595
false
3.842809
false
false
false
eng-tools/sfsimodels
sfsimodels/functions.py
1
10123
from collections import OrderedDict import numpy as np import sfsimodels.exceptions # # def convert_stress_to_mass(q, width, length, gravity): # """ # Converts a foundation stress to an equivalent mass. # # :param q: applied stress [Pa] # :param width: foundation width [m] # :param length: foundatio...
mit
693,612,150,368,522,200
30.150769
104
0.53581
false
3.280298
false
false
false
mzbenami/pyeapi
test/unit/test_eapilib.py
1
5296
import unittest import json from mock import Mock, patch import pyeapi.eapilib class TestEapiConnection(unittest.TestCase): def test_execute_valid_response(self): response_dict = dict(jsonrpc='2.0', result=[], id=id(self)) mock_send = Mock(name='send') mock_send.return_value = json.dump...
bsd-3-clause
-7,965,464,696,578,998,000
36.828571
83
0.670128
false
3.857247
true
false
false
sergey-lebedev/concor
bots/algorithms.py
1
17788
import copy import random import time DEBUG = False inf = float("infinity") def adjacency_list_generator(): #adjacency_list adjacency_list = {} ij_list = [(i, j) for i in range(width) for j in range(height)] for (i, j) in ij_list: link_list = [] #link_list = {} for direction in...
mit
-1,127,524,987,407,583,500
34.647295
103
0.534461
false
4.126189
false
false
false
waynechu/PythonProject
dns/rdtypes/ANY/CSYNC.py
2
4721
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2004-2007, 2009-2011, 2016 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notic...
mit
-6,451,602,005,815,375,000
36.468254
75
0.57509
false
4.094536
false
false
false
webbpinner/OpenVDMv2
server/workers/lowering_directory.py
1
18277
#!/usr/bin/env python3 """ FILE: lowering_directory.py DESCRIPTION: Gearman worker the handles the tasks of creating a new lowering data directory and updating the lowering directory structure when additional subdirectories must be added. BUGS: NOTES: AUTHOR: Webb Pinner COMPANY: Capable Solutions ...
gpl-3.0
-6,683,112,757,770,289,000
38.993435
209
0.663621
false
3.648104
true
false
false
openemr/demo-data-generator
demodata/scripts/patient.py
1
4202
"""Generate patient data""" import barnum from demodata.util import * __copyright__ = "Copyright (C) 2017 Robert Down" __author__ = "Robert Down <robertdown@live.com>" __license__ = "GNU GPL3" def generate_patients(count=1): random.seed() patients = [] for x in range(0, count): sex = 'Male' if r...
gpl-3.0
-1,416,938,328,447,985,700
33.727273
116
0.519039
false
3.262422
false
false
false
stevenmirabito/GoalSentry
api/goalsentry/__init__.py
1
5717
""" Goal Sentry API Main Application """ from flask import Flask, request from database import session as db from json import dumps as jsonify from utilities import row2dict import authentication import models app = Flask(__name__) @app.route("/") def hello(): return "<h1>Goal Sentry API</h1>" """ Standard Re...
mit
2,658,503,353,929,986,000
21.245136
112
0.603463
false
3.509515
false
false
false
recurser/trac-gantt-calendar
ganttcalendar/ticketcalendar.py
1
5253
import re, calendar, time from datetime import datetime, date, timedelta from genshi.builder import tag from trac.core import * from trac.web import IRequestHandler from trac.web.chrome import INavigationContributor, ITemplateProvider from trac.util.datefmt import to_datetime, utc class TicketCalendarPlugin(Componen...
bsd-3-clause
5,199,380,876,074,111,000
37.065217
179
0.555111
false
3.678571
false
false
false
alien3211/lom-web
posts/models.py
1
2992
from django.contrib.contenttypes.models import ContentType from django.db import models from django.contrib.auth.models import User from django.db.models import Q from django.urls import reverse from django.utils.text import slugify, mark_safe from django.db.models.signals import pre_save from django.utils import timez...
mit
-1,002,450,773,182,722,300
29.845361
126
0.684158
false
3.850708
false
false
false
votervoice/openstates
openstates/il/bills.py
1
27275
# -*- coding: utf-8 -*- import re import os import datetime import pytz import scrapelib import lxml.html from pupa.scrape import Scraper, Bill, VoteEvent from pupa.utils import convert_pdf from ._utils import canonicalize_url session_details = { '100th-special': { 'speaker': 'Madigan', 'preside...
gpl-3.0
-341,049,044,906,176,830
37.687943
97
0.531329
false
3.617854
false
false
false
n3011/deeprl
core/solver.py
1
8788
# -------------------------------------------------------------------# # Released under the MIT license (https://opensource.org/licenses/MIT) # Contact: mrinal.haloi11@gmail.com # Copyright 2017, Mrinal Haloi # -------------------------------------------------------------------# import tensorflow as tf import numpy as ...
mit
6,081,689,562,235,361,000
44.533679
182
0.529358
false
3.443574
false
false
false
klahnakoski/MoDataSubmission
pyLibrary/thread/threads.py
1
26992
# encoding: utf-8 # # # 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/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # # THIS THREADING MODULE IS PERMEATED BY THE ple...
mpl-2.0
7,233,190,474,011,335,000
28.957825
138
0.507928
false
4.201089
false
false
false
vga101/gaiasky
assets/scripts/showcases/line-objects-update.py
1
1773
# This script showcases lines and parked runnables # # The script creates a line object between the positions of the Earth and the Moon. Then, # it parks a runnable which updates the line points with the new positions of the # objects, so that the line is always up to date, even when the objects move. Finally, # time i...
mpl-2.0
-6,904,757,617,755,331,000
23.287671
89
0.692611
false
2.91133
false
false
false
kuke/models
fluid/PaddleCV/rcnn/models/resnet.py
1
6075
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. # #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...
apache-2.0
242,667,341,747,501,120
32.563536
80
0.58963
false
3.28201
false
false
false
joshl8n/school-projects
bank-accounts/main.py
1
2889
from account import Account from checking import Checking from savings import Savings def acc_type(): # initializes which account to create print print "Which account would you like to open?" print "[c] Checking Account" print "[s] Savings Account" print "[q] Quit" while True: account = raw_input("Enter an o...
gpl-3.0
-3,457,749,278,412,813,000
27.048544
108
0.672897
false
3.235162
false
false
false
asm-products/nested-communities-core
volunteering/tests/test_models.py
1
27071
import unittest from datetime import date, time from django.db import IntegrityError from django.test import TestCase import factories as f from volunteering.models import (Activity, Assignment, Attribute, Campaign, Duty, Event, Location, Sendable, TriggerBase, ...
agpl-3.0
2,781,549,438,229,064,000
36.703343
79
0.63544
false
3.586988
true
false
false
lukebakken/riak-python-pbcpp
riak/benchmark.py
1
4509
from __future__ import print_function import os import gc import sys import traceback __all__ = ['measure', 'measure_with_rehearsal'] def measure_with_rehearsal(): """ Runs a benchmark when used as an iterator, injecting a garbage collection between iterations. Example:: for b in riak.benchmark...
unlicense
1,267,404,760,362,510,800
26.662577
79
0.505877
false
4.261815
false
false
false
raimund89/PyShow
main.py
1
1289
# PyShow - a slide show IDE and scripting language. # # Copyright (C) 2017 Raimond Frentrop # # 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 opti...
gpl-3.0
9,134,828,114,468,982,000
31.225
76
0.74166
false
3.859281
false
false
false
timsavage/denim
denim/package/__init__.py
1
1384
# -*- encoding:utf8 -*- """ Methods for managing OS packages. An alternative package manager can be selected by settings the: ``deploy_package_manager`` env variable. Note: Different distributions/operating systems have different naming conventions for packages. For example Apache is referred to as apache on Debian s...
bsd-2-clause
6,832,159,986,885,219,000
22.862069
72
0.687139
false
4
false
false
false
CognizantOneDevOps/Insights
PlatformAgents/com/cognizant/devops/platformagents/agents/ci/teamcity/TeamCityAgent3.py
1
3153
#------------------------------------------------------------------------------- # Copyright 2017 Cognizant Technology Solutions # # 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:...
apache-2.0
-7,294,705,972,704,179,000
49.047619
132
0.623216
false
4.260811
false
false
false
ottovan/PhotoDataLab
import.py
1
2885
#! /bin/python3 import csv #For csv file handling import re #Regular expressions import sys #System processes import os #Work on files and folders depending on your OS #import pdb #Debugger #pdb.set_trace() #Input arguments #sys.argv[1] = Input file name #sys.argv[2] = Output file name #sys.argv[3] = Folder name (Def...
gpl-3.0
8,225,624,620,948,556,000
32.16092
124
0.606932
false
3.741894
false
false
false
googleads/google-ads-python
google/ads/googleads/v7/services/services/group_placement_view_service/transports/base.py
1
3708
# -*- 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,312,947,143,067,942,400
36.08
79
0.662621
false
4.29664
false
false
false
pachyderm/pfs
examples/ml/neon/inference/auto_inference.py
2
3880
#!/usr/bin/env python """ Example that does inference on an LSTM networks for amazon review analysis $ python examples/imdb/auto_inference.py --model_weights imdb.p --vocab_file imdb.vocab --review_files /pfs/reviews --output_dir /pfs/out """ from __future__ import print_function from future import standard_lib...
apache-2.0
-5,668,632,449,984,851,000
34.925926
88
0.663144
false
3.479821
false
false
false
donbright/piliko
experiment/bernoulli/pythbernlem3d.py
1
2317
from fractions import Fraction import sys # rational paramterization / approximation of bernoulli's lemniscate # in a 3 dimensional 'dumbbell' arrangement. # (note - this uses terms from Norman Wildberger's rational # trigonometry/chromogeometry. briefly for a vector from 0,0 to x,y: # # blue quadrance (x,y) = x^2 +...
bsd-3-clause
4,990,532,558,360,858,000
25.94186
72
0.644368
false
2.317
false
false
false
updownlife/multipleK
dependencies/biopython-1.65/Scripts/GenBank/find_parser_problems.py
1
1430
#!/usr/bin/env python """Find GenBank records that the parser has problems with within a big file. This is meant to make it easy to get accession numbers for records that don't parse properly. Usage: find_parser_problems.py <GenBank file to parse> """ # standard library from __future__ import print_function import s...
gpl-2.0
-4,434,093,523,328,598,000
24.087719
76
0.638462
false
3.513514
false
false
false
claudiofinizio/learn-python
TDD/learn_tests/wxGUI_modal.py
1
1681
import wx class MyFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title) btn = wx.Button(self, label="SomeProcessing") self.Bind(wx.EVT_BUTTON, self.SomeProcessing, btn) def SomeProcessing(self,event): self.dlg = Dlg_GetUserInput(self) ...
mit
8,824,939,908,386,655,000
30.735849
79
0.599048
false
3.465979
false
false
false
mytest-e2/ritest-e2
lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py
1
104940
from Plugins.Plugin import PluginDescriptor from Screens.Console import Console from Screens.ChoiceBox import ChoiceBox from Screens.MessageBox import MessageBox from Screens.Screen import Screen from Screens.Standby import TryQuitMainloop from Screens.Ipkg import Ipkg from Components.ActionMap import ActionMap, Number...
gpl-2.0
-1,043,935,059,696,353,900
41.554745
242
0.694149
false
3.2911
true
false
false
closeio/quotequail
quotequail/_patterns.py
1
3164
# -*- coding: utf-8 -*- import re REPLY_PATTERNS = [ u'^On (.*) wrote:$', # apple mail/gmail reply u'^Am (.*) schrieb (.*):$', # German u'^Le (.*) a écrit :$', # French u'El (.*) escribió:$', # Spanish u'^(.*) написал\(а\):$', # Russian u'^Den (.*) skrev (.*):$', # Swedish u'^Em (.*) escr...
mit
1,889,049,090,240,398,000
24.434426
84
0.565904
false
2.658955
false
false
false
schesis/csx
csx.py
1
37312
#!/usr/bin/env python3 # csx.py - Extended Cascading Stylesheets. # Copyright (C) 2009 Zero Piraeus # # 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 y...
gpl-3.0
-684,098,559,107,336,600
30.380992
79
0.49598
false
4.079598
false
false
false
zalando/patroni
tests/test_aws.py
1
2023
import boto.ec2 import sys import unittest import urllib3 from mock import Mock, patch from collections import namedtuple from patroni.scripts.aws import AWSConnection, main as _main class MockEc2Connection(object): @staticmethod def get_all_volumes(*args, **kwargs): oid = namedtuple('Volume', 'id')...
mit
-7,008,248,690,051,154,000
35.781818
112
0.659911
false
3.52439
true
false
false
alex/jwcrypto
jwcrypto/jwk.py
1
10325
# Copyright (C) 2015 JWCrypto Project Contributors - see LICENSE file from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives.asymmetric import ec from jwcrypto.common import base64url_decode import json # draft-ietf-jose-...
lgpl-3.0
-4,073,168,078,696,465,000
36.40942
78
0.495787
false
4.030055
false
false
false
nerdvegas/rez
src/rez/utils/sourcecode.py
1
11114
from rez.utils.formatting import indent from rez.utils.data_utils import cached_property from rez.utils.logging_ import print_debug from rez.utils import py23 from inspect import getsourcelines from textwrap import dedent from glob import glob import traceback import os.path def early(): """Used by functions in p...
lgpl-3.0
-5,989,282,987,858,868,000
30.044693
83
0.580619
false
4.241985
false
false
false
mmasaki/trove
trove/guestagent/datastore/experimental/postgresql/service/access.py
1
3285
# Copyright (c) 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 # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
-4,512,601,558,100,570,600
34.322581
79
0.598478
false
4.58159
false
false
false
Connor-R/nba_shot_charts
processing/table_exporter.py
1
5599
import argparse from time import time import csv import os from py_db import db db = db("nba_shots") def initiate(): start_time = time() print "\nexporting to .csv" for statType in ('Player', 'Team', 'PlayerCareer'): for rangeType in ('Reg', 'Pre', 'Post'): print '\t', statType, rang...
mit
7,872,525,690,449,116,000
36.831081
273
0.58957
false
3.15259
false
false
false
kawashiro/dewyatochka2
src/dewyatochka/core/log/output.py
1
4059
# -*- coding: UTF-8 """ Log output handlers implementation Classes ======= Handler -- Abstract output handler STDOUTHandler -- Console output handler FileHandler -- Text file output handler NullHandler -- Empty handler (stub) """ import sys import logging import fcntl import termios import ...
gpl-3.0
4,817,703,408,906,691,000
24.36875
104
0.58438
false
4.440919
false
false
false
ArturGaspar/w3lib
tests/test_url.py
1
37051
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import unittest from w3lib.url import (is_url, safe_url_string, safe_download_url, url_query_parameter, add_or_replace_parameter, url_query_cleaner, file_uri_to_path, parse_data_uri, path_to_file_uri, any_to_uri, urljoin_rfc, canonical...
bsd-3-clause
1,854,225,113,798,313,700
55.941176
497
0.599391
false
3.048819
true
false
false
googleads/google-ads-python
google/ads/googleads/v8/enums/types/user_list_combined_rule_operator.py
1
1166
# -*- 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
-7,409,470,100,416,270,000
30.513514
74
0.707547
false
4.076923
false
false
false
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/contrib/gis/management/commands/inspectdb.py
1
1530
from django.core.management.commands.inspectdb import \ Command as InspectDBCommand class Command(InspectDBCommand): db_module = 'django.contrib.gis.db' gis_tables = {} def get_field_type(self, connection, table_name, row): field_type, field_params, field_notes = super(Command, self)...
mit
-9,104,450,396,811,775,000
47.354839
112
0.626797
false
4.058355
false
false
false
ini-bdds/ermrest
ermrest/sanepg2.py
1
6608
# # Copyright 2013 University of Southern California # # 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 l...
apache-2.0
-7,061,611,559,697,385,000
35.508287
105
0.623184
false
4.408272
false
false
false
desion/terminal
web/http_server.py
1
7072
#!/usr/bin/env python #coding:utf-8 import os.path import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import socket import struct import json from conf import terminal_servers_conf from tornado.options import define, options define("port", default=8000, help="run on the given po...
bsd-3-clause
7,699,235,526,345,135,000
32.67619
120
0.49293
false
4.092593
false
false
false
arkem/texthole
common.py
1
3695
import models import base64 import json import logging import os import time from google.appengine.ext import db from google.appengine.api import memcache def generate_id(): return base64.b64encode(os.urandom(6), '-_') def error_message(user, data, message = ""): return json.dumps({'status': False, ...
bsd-2-clause
-8,369,444,276,560,896,000
27.867188
74
0.598106
false
3.785861
false
false
false