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
Solar-Computing/solar-app2
app/controllers/api.py
1
5574
from flask import Blueprint, request, url_for, jsonify from datetime import datetime from app.models import Simulation, Home, Circuit, PowerConsumption, db from app.neurioclient import neurio_api from app.controllers import feedgenerator api = Blueprint('api', __name__) @api.route('/') def home(): return jsonify(...
mit
-7,618,498,850,840,462,000
38.814286
109
0.604593
false
3.453532
false
false
false
cogeorg/BlackRhino
networkx/classes/multigraph.py
1
40287
"""Base class for MultiGraph.""" # Copyright (C) 2004-2016 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. from copy import deepcopy import networkx as nx from networkx.classes.graph import Graph from network...
gpl-3.0
-8,791,278,103,226,574,000
33.610825
106
0.534614
false
3.961746
false
false
false
r0h4n/node-agent
tendrl/node_agent/tests/test_tendrl_glusterfs_health_counters.py
1
1413
import importlib import json import sys from mock import MagicMock from mock import patch from tendrl.node_agent.tests import mock_gluster_state sys.modules['tendrl_gluster'] = mock_gluster_state sys.modules['collectd'] = MagicMock() utils = importlib.import_module( "tendrl.node_agent." "monitoring.collectd.c...
lgpl-2.1
-2,392,761,092,182,179,000
38.25
73
0.70913
false
3.364286
false
false
false
toomoresuch/pysonengine
eggs/ipython-0.10.1-py2.6.egg/IPython/kernel/multienginefc.py
1
31084
# encoding: utf-8 """ Expose the multiengine controller over the Foolscap network protocol. """ __docformat__ = "restructuredtext en" #------------------------------------------------------------------------------- # Copyright (C) 2008 The IPython Development Team # # Distributed under the terms of the BSD Licens...
mit
3,314,654,835,127,355,000
39.792651
121
0.560642
false
4.668669
false
false
false
neurord/vrnd
header_parse.py
1
7668
import numpy as np def header_parse(header,maxvols,prninfo): #Define some substrings used in reading header underscore='_' dot='.' # #number of voxels in the file volnum=np.zeros(maxvols) regionID=list() structType=list() molecules=list() # volnames=header.split() for i ...
gpl-2.0
-2,093,465,860,988,798,000
35
118
0.582942
false
3.491803
false
false
false
kondalrao/fsm_engine
examples/simple_calc/simple_calc_actions.py
1
1471
__author__ = 'Kondal Rao Komaragiri' num1 = 0 num2 = 0 oper = '' res = '' # noinspection PyUnusedLocal def log(context): """ @param context: @type context: """ print ("Error Event Received.") # noinspection PyUnusedLocal,PyUnusedLocal def null(context): """ @param context: @type co...
gpl-2.0
-8,910,579,053,312,093,000
15.52809
42
0.515296
false
3.335601
false
false
false
ryanfeather/parsimony
src/parsimony/persistence/in_memory.py
1
1426
import pickle from . import Cache class MemCache(Cache): """Parameter Cache that will bring parameters from a store into local memory if it exists and persist updates to the store. """ def __init__(self, store): """Initialize by reading from the store :param: Store object """...
mit
4,730,040,574,616,918,000
29.361702
116
0.603787
false
4.256716
false
false
false
oblique-labs/pyVM
rpython/jit/metainterp/optimizeopt/test/test_costmodel.py
1
9458
import py from rpython.jit.metainterp.history import TargetToken, JitCellToken, TreeLoop from rpython.jit.metainterp.optimizeopt.util import equaloplists from rpython.jit.metainterp.optimizeopt.vector import (Pack, GenericCostModel, NotAProfitableLoop, VectorizingOptimizer, CostModel) from rpython.jit.metainte...
mit
-5,940,061,121,131,489,000
33.644689
90
0.586488
false
3.105056
true
false
false
garyd203/flying-circus
src/flyingcircus/_raw/ecr.py
1
1208
"""Raw representations of every data type in the AWS ECR service. See Also: `AWS developer guide for ECR <https://docs.aws.amazon.com/AmazonECR/latest/userguide/index.html>`_ This file is automatically generated, and should not be directly edited. """ from attr import attrib from attr import attrs from ..co...
lgpl-3.0
-2,961,253,537,282,821,000
27.093023
106
0.735099
false
4.053691
false
false
false
gusibi/dynamodb-py
dynamodb/table.py
1
22705
#! -*- coding: utf-8 -*- from __future__ import print_function import pprint from decimal import Decimal from botocore.exceptions import ClientError from botocore.vendored.requests.exceptions import ConnectionError from .connection import db from .helpers import get_attribute_type from .errors import ClientException...
gpl-3.0
5,201,905,679,309,256,000
37.127768
122
0.538403
false
4.548059
false
false
false
elsonidoq/fito
tests/test_operation_runner.py
1
2916
from collections import defaultdict import inspect import unittest from random import Random from fito.operation_runner import OperationRunner from fito.operations.operation import Operation from fito.specs.fields import NumericField, SpecField class SentinelOperation(Operation): def __init__(self, *args, **kwar...
mit
6,355,266,096,653,339,000
26.252336
73
0.613855
false
4.027624
true
false
false
Trim/papillon
papillon/polls/feeds.py
1
2251
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # 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 # Li...
gpl-3.0
6,745,902,386,875,787,000
35.290323
80
0.648444
false
3.968254
false
false
false
dealertrack/djangorest-alchemy
djangorest_alchemy/mixins.py
1
5082
# -*- coding: utf-8 -*- import six from django.core.paginator import InvalidPage, Page, Paginator from rest_framework import status from rest_framework.response import Response STATUS_CODES = { 'created': status.HTTP_201_CREATED, 'updated': status.HTTP_200_OK, 'accepted': status.HTTP_202_ACCEPTED } cla...
mit
-650,007,103,055,899,400
32.215686
78
0.615506
false
4.224439
false
false
false
MPDL/python-connector
FITSService.py
1
1875
from RestClient import RestClient import tempfile import webbrowser import urllib import requests import re import urllib2 import optparse class FITSService(RestClient): serviceTargetURL = "http://servicehub.mpdl.mpg.de/fits/api/view" def generateFromFile(self, serviceTargetURL, f): if(serviceTargetU...
mit
-8,252,195,908,693,657,000
32.482143
77
0.617067
false
4.111842
false
false
false
arjan/starpy
examples/priexhaustionbare.py
1
2389
#! /usr/bin/env python from twisted.application import service, internet from twisted.internet import reactor, defer from starpy import manager, fastagi, utilapplication, menu import os, logging, pprint, time from basicproperty import common, propertied, basic log = logging.getLogger( 'priexhaustion' ) log.setLevel( l...
bsd-3-clause
8,597,545,362,242,413,000
37.532258
78
0.712432
false
3.43741
false
false
false
interactiveaudiolab/nussl
nussl/datasets/hooks.py
1
16993
""" While *nussl* does not come with any data sets, it does have the capability to interface with many common source separation data sets used within the MIR and speech separation communities. These data set "hooks" subclass BaseDataset and by default return AudioSignal objects in labeled dictionaries for ease of use. ...
mit
8,009,003,460,360,825,000
36.737778
94
0.573018
false
3.942884
false
false
false
seblin/shcol
setup.py
1
1500
# -*- coding: utf-8 -*- # Copyright (c) 2013-2016, Sebastian Linke # Released under the Simplified BSD license # (see LICENSE file for details). import sys # Fail as early as possible, since some imports may cause errors on old versions if sys.version_info < (2, 7): sys.exit('ERROR: Python interpreter\'s version...
bsd-2-clause
5,564,231,373,148,809,000
31.608696
80
0.572667
false
4.087193
false
false
false
mattmilten/PySCIPOpt
examples/finished/lo_wines.py
1
1807
""" lo_wines.py: Simple SCIP example of linear programming. It solves the same instance as lo_wines_simple.py: maximize 15x + 18y + 30z subject to 2x + y + z <= 60 x + 2y + z <= 60 z <= 30 x,y,z >= 0 Variables correspond to the production of three types of wine bl...
mit
5,854,379,119,204,881,000
25.970149
99
0.605977
false
2.762997
false
false
false
tonioo/modoboa
modoboa/dnstools/migrations/0001_initial.py
1
1193
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2018-11-19 10:07 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('admin', '...
isc
5,732,815,011,272,078,000
37.483871
186
0.598491
false
3.976667
false
false
false
PennyQ/stero_3D_dust_map
maptools.py
1
86731
#!/usr/bin/env python # -*- coding: utf-8 -*- # # maptools.py # # Copyright 2013-2014 Greg Green <greg@greg-UX31A> # # 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 ...
gpl-3.0
-1,868,639,367,842,959,000
32.839641
224
0.487104
false
3.328255
false
false
false
fcfort/nyc-parking-ticket-checker
setup.py
1
1440
# Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: ...
apache-2.0
7,098,908,532,996,584,000
33.285714
79
0.657639
false
3.86059
false
false
false
shfengcj/pydm
pydm/trainset/pcaTS.py
1
2821
""" Created on Sat Jul 19 12:51:34 2015 @author: Chao-Jun Feng define PCA trainset class """ from __future__ import print_function import numpy as np import matplotlib.pyplot as pl from .trainset import trainset from scipy.linalg import eigh class pcaTS(trainset): """ PCA analysis of TS :param z: ...
gpl-2.0
-4,487,428,374,941,845,500
23.745614
101
0.489543
false
3.299415
false
false
false
elainenaomi/sciwonc-dataflow-examples
sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/python2.7/dist-packages/Pegasus/DAX2.py
1
26390
# Copyright 2009 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 law o...
gpl-3.0
5,225,621,850,554,932,000
28.289678
127
0.679992
false
3.066822
false
false
false
ebellm/ztf_summerschool_2015
notebooks/ztf_summerschool.py
1
1565
"""A collection of utility functions to support the notebooks""" import numpy as np import astropy.coordinates as coords import astropy.units as u import shelve, pickle from BaryTime import BaryTime P48_loc = coords.EarthLocation(lat=coords.Latitude('33d21m26.35s'), lon=coords.Longitude('-116d51m32.04s'), hei...
bsd-3-clause
4,820,583,083,983,230,000
33.021739
109
0.648562
false
3.111332
false
false
false
madscatt/zazzie_1.5
trunk/sassie/simulate/sas_dock/gui_mimic_sas_dock.py
1
1772
import sys import sassie.simulate.sas_dock.sas_dock as sas_dock import sassie.interface.input_filter as input_filter import sassie.interface.sas_dock_filter as sas_dock_filter import multiprocessing svariables = {} # BEGIN USER EDIT # BEGIN USER EDIT # BEGIN USER EDIT runname = 'run_0' pdbfile = '1ahw.pdb' number_pr...
gpl-3.0
3,727,596,271,418,022,400
28.533333
98
0.722348
false
2.933775
false
false
false
tensorflow/estimator
tensorflow_estimator/python/estimator/canned/v1/dnn_test_fc_v1_v1.py
1
17817
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-5,872,623,188,279,210,000
35.585216
98
0.654712
false
3.490792
true
false
false
JonSteinn/Kattis-Solutions
src/A Feast For Cats/Python 3/main.py
1
1526
from heapq import heappop, heappush, heapify class Graph: def __init__(self, n, adj): self.n = n self.adj = adj def mst(self,m): return 'yes' if self._prims(m) else 'no' def _prims(self,m): best = [0] * self.n remaining = set(range(1,self.n)) visited = [Tru...
gpl-3.0
-4,193,843,353,896,118,300
24.881356
55
0.431848
false
3.15942
false
false
false
gsastry/human-rl
humanrl/space_invaders.py
1
4681
import gym import numpy as np from humanrl import frame BARRIER_COLOR = [181, 83, 40] BARRIER_ROWS = (157, 175) INITIAL_BARRIER_PIXELS = 336 SHIP_COLOR = [50, 132, 50] SHIP_ROWS = (185, 195) def barrier_damage(image): is_barrier = np.sum(np.abs(image - BARRIER_COLOR), axis=2) == 0 return INITIAL_BARRIER_PIX...
mit
-8,266,057,155,630,410,000
29.796053
100
0.541765
false
3.087731
false
false
false
Lucas-Wong/ToolsProject
oracle/iConnRunAD.py
1
1484
#! /usr/bin/env python # _*_coding:utf-8_*_ import DataEncoding import parameter import json import requests import six import time class run_ad(): headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36', } ...
gpl-3.0
-2,998,685,273,209,953,300
25.5
146
0.580189
false
3.334831
false
false
false
Cyberface/nrutils_dev
nrutils/handlers/sxs.py
1
4402
# from nrutils.core.basics import smart_object, parent from os.path import getctime from numpy import array,cross,zeros,dot,abs,sign from numpy.linalg import inv, norm from numpy import sum as asum # Determine whether the folder containing a metadta file is valid: can it be used to reference waveform data? def valida...
mit
-994,253,318,268,500,700
27.4
382
0.60109
false
2.903694
false
false
false
StackTach/oahu
oahu/db_driver.py
1
6299
# Copyright (c) 2014 Dark Secret Software Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
6,836,780,101,150,374,000
30.974619
75
0.606128
false
4.429677
false
false
false
openhumanoids/exotica
exotations/solvers/exotica_scipy_solver/src/exotica_scipy_solver/end_pose_solver.py
2
4151
# -*- coding: utf-8 -*- from __future__ import print_function, division from scipy.optimize import ( minimize, Bounds, # LinearConstraint, NonlinearConstraint, # BFGS, SR1, ) import numpy as np from time import time class SciPyEndPoseSolver(object): """ Uses SciPy to solve a constrain...
bsd-3-clause
-1,422,488,468,963,522,000
29.522059
85
0.500361
false
4.030097
false
false
false
odoousers2014/LibrERP
sale_order_confirm/sale.py
1
20355
# -*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # Copyraght (c) 2013-2014 Didotech srl (<http://www.didotech.com>) # # This program i...
agpl-3.0
5,949,503,665,313,027,000
57.471264
408
0.609151
false
3.957215
false
false
false
coleifer/flask-peewee
flask_peewee/auth.py
1
7040
import functools import os from flask import Blueprint from flask import abort from flask import flash from flask import g from flask import redirect from flask import render_template from flask import request from flask import session from flask import url_for from peewee import * from wtforms import Form from wtform...
mit
2,250,710,601,745,974,300
29.344828
90
0.578977
false
4.187983
false
false
false
volodymyrss/3ML
threeML/plugins/HAWCLike.py
1
15496
import collections import os import sys import matplotlib.pyplot as plt import numpy as np from astromodels import Parameter from cthreeML.pyModelInterfaceCache import pyToCppModelInterfaceCache from hawc import liff_3ML from matplotlib import gridspec from threeML.io.file_utils import file_existing_and_readable, san...
bsd-3-clause
5,713,784,664,562,127,000
29.624506
155
0.574923
false
3.862413
false
false
false
building39/nebula2
scripts/cdmi_explorer/CDMIMain/__init__.py
1
2501
#!/usr/bin/env python ''' Created on Jun 8, 2013 @author: mmartin ''' from gi.repository import Gtk import sys from handlers import Handlers from CDMIConstants.constants import ( DEBUGPATH ) from CDMISession import CDMISession from UIMenu import UI_MENU class CDMIMainWindow(object): def __init__(self, ppa...
apache-2.0
-1,782,582,062,668,310,800
29.13253
75
0.618952
false
3.532486
false
false
false
raiden-network/raiden
raiden/utils/profiling/graph.py
1
12707
""" Module to plot profile data. For memory time-line with memory usage and number of blocks through time you can use the following command: python -m profiling memory timeline DATA_ROOT/*_memory.data For the latency of sampling, you can use the following plot: python -m profiling latency scatter DATA_ROOT/...
mit
6,140,321,756,438,998,000
32.439474
98
0.657433
false
3.789741
false
false
false
takaakiaoki/PyFoam
PyFoam/Applications/DisplayBlockMeshQt.py
1
51263
""" New implementation of DisplayBlockMesh using PyQT4 """ from PyFoam.RunDictionary.ParsedBlockMeshDict import ParsedBlockMeshDict from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile from PyFoam.Applications.PyFoamApplicationQt4 import PyFoamApplicationQt4 from PyFoam.Error import error,warning f...
gpl-2.0
6,241,710,939,870,441,000
36.309316
163
0.613035
false
3.889159
false
false
false
LeMaker/LNcommon
LNcommon/spi.py
1
2296
import posix import ctypes from fcntl import ioctl from .linux_spi_spidev import spi_ioc_transfer, SPI_IOC_MESSAGE SPIDEV = '/dev/spidev' class SPIInitError(Exception): pass class SPIDevice(object): """An SPI Device at /dev/spi<bus>.<chip_select>.""" def __init__(self, bus=0, chip_select=0, spi_callbac...
gpl-3.0
1,463,687,265,546,966,500
30.888889
71
0.582317
false
3.615748
false
false
false
veegee/guv
guv/hubs/timer.py
1
3110
import traceback import io import greenlet import time import functools from . import abc from guv import compat _g_debug = False # if true, captures a stack trace for each timer when constructed, this is useful # for debugging leaking timers, to find out where the timer was set up compat.patch() @functools.total...
mit
6,371,438,057,534,169,000
27.796296
99
0.57299
false
4.191375
false
false
false
pelikanchik/edx-platform
common/test/acceptance/edxapp_pages/studio/auto_auth.py
1
1853
""" Auto-auth page (used to automatically log in during testing). """ import urllib from bok_choy.page_object import PageObject from . import BASE_URL class AutoAuthPage(PageObject): """ The automatic authorization page. When allowed via the django settings file, visiting this url will create a user ...
agpl-3.0
1,527,509,453,388,308,500
28.412698
112
0.620076
false
4.299304
false
false
false
Micronaet/micronaet-bom
order_bom_explode_report/report/eliminare/mrp_parser.py
1
15371
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2012 Associazione OpenERP Italia # (<http://www.openerp-italia.org>). # Copyright(c)2008-2010 SIA "KN dati".(http://kndati.lv) All Rights Reserved. # Ge...
agpl-3.0
-6,441,437,087,967,436,000
38.924675
89
0.426062
false
4.728084
false
false
false
vedgar/ip
PJ/09_pseudokod.py
1
13457
"""Interpreter za pseudokod, s funkcijskim pozivima i dva tipa podataka. Podržane naredbe: ako je Uvjet naredba inače naredba ime = izraz ako je Uvjet naredba Ime = Uvjet ako nije Uvjet naredba vrati izraz dok je Uvjet naredba vrati Uvjet ...
unlicense
-8,890,924,174,284,661,000
32.012376
80
0.595711
false
2.382033
false
false
false
mjabri/holoviews
holoviews/plotting/util.py
1
1715
from ..core import HoloMap, CompositeOverlay from ..core.util import match_spec def compute_sizes(sizes, size_fn, scaling, base_size): """ Scales point sizes according to a scaling factor, base size and size_fn, which will be applied before scaling. """ sizes = size_fn(sizes) return (base_s...
bsd-3-clause
1,939,004,751,199,599,600
35.489362
89
0.630904
false
3.648936
false
false
false
Clinical-Genomics/scout
scout/commands/load/report.py
1
3181
"""Code for updating reports""" import logging import click from flask.cli import with_appcontext from scout.load.report import ( load_cnv_report, load_coverage_qc_report, load_delivery_report, load_gene_fusion_report, ) from scout.server.extensions import store LOG = logging.getLogger(__name__) @c...
bsd-3-clause
-1,586,948,194,995,203,600
28.183486
96
0.635964
false
3.61067
false
false
false
marcore/csv2edx
csv2edx/convertSrt2JSON.py
1
1269
import json import os, sys ,re import pysrt DEFAULT_REGEX="^[W|I][0-9A-Za-z]{5}([^-]*)?-" class ConvertSrt2JSON(object): def __init__(self,srcdir='',destdir='',filter_regex=DEFAULT_REGEX): self.srcdir = srcdir self.destdir = destdir self.filter_regex=filter_regex def convertFile(self...
agpl-3.0
-5,729,698,606,359,219,000
35.257143
81
0.575256
false
3.525
false
false
false
alejo8591/maker
knowledge/tests.py
1
15219
# encoding: utf-8 # Copyright 2013 maker # License """ Knowledge base: test suites """ from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse from django.contrib.auth.models import User as DjangoUser from maker.core.models import User, Group, Perspectiv...
mit
7,718,212,778,519,677,000
44.294643
103
0.611867
false
4.241639
true
false
false
Peter92/MouseTrack
start_tracking.py
1
11168
"""This is part of the Mouse Tracks Python application. Source: https://github.com/Peter92/MouseTracks """ from __future__ import absolute_import import sys from multiprocessing import freeze_support from mousetracks.config.settings import CONFIG, CONFIG_PATH from mousetracks.track import track from mousetracks.util...
gpl-3.0
4,655,769,094,328,803,000
43.146245
199
0.544054
false
4.209574
true
false
false
JaneliaSciComp/Neuroptikon
Source/lib/CrossPlatform/networkx/classes/function.py
1
4104
""" Functional interface to graph properties. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult(dschult@colgate.edu)""" # Copyright (C) 2004-2008 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # Al...
bsd-3-clause
-4,423,435,422,350,440,000
30.569231
114
0.601852
false
3.383347
false
false
false
GoogleCloudPlatform/grpc-gcp-python
firestore/examples/end2end/src/BeginTransaction.py
1
2260
#! /usr/bin/python import sys import os import json import grpc import time import subprocess from google.oauth2 import service_account import google.oauth2.credentials import google.auth.transport.requests import google.auth.transport.grpc from google.firestore.v1beta1 import firestore_pb2 from google.firestore.v1be...
apache-2.0
-7,716,868,265,945,559,000
32.731343
135
0.702655
false
3.903282
false
false
false
pandegroup/msmaccelerator
lib/adaptive/CountsSampler.py
1
1449
import numpy as np from scipy import stats class CountsSampler(object): """ A method for counts-based sampling. Involves a temperature factor 'beta' that controls the level of exploration vs. refinement. Works as follows: beta = 0 (high temp) : Full exploration, put simulations ...
gpl-3.0
4,406,271,715,452,098,000
33.5
90
0.57971
false
3.895161
false
false
false
MTG/essentia
src/examples/tutorial/example_musicextractor.py
1
5803
from __future__ import print_function from essentia.standard import MusicExtractor, YamlOutput from essentia import Pool from argparse import ArgumentParser import numpy import os import json import fnmatch import sys def isMatch(name, patterns): if not patterns: return False for pattern in patterns: ...
agpl-3.0
-5,380,595,359,751,643,000
36.198718
174
0.62864
false
3.977382
false
false
false
cmoberg/bottle-yang-extractor-validator
yangvalidator/yangvalidator/wsgi.py
1
1306
# Copyright The IETF Trust 2019, All Rights Reserved # Copyright 2015 Cisco and its affiliates # # 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...
bsd-3-clause
-8,633,329,429,949,283,000
35.277778
109
0.761103
false
3.720798
false
false
false
Stanford-Online/edx-ora2
openassessment/assessment/api/peer.py
1
36630
"""Public interface managing the workflow for peer assessments. The Peer Assessment Workflow API exposes all public actions required to complete the workflow for a given submission. """ import logging import json from django.db import DatabaseError, IntegrityError, transaction from django.utils import timezone from...
agpl-3.0
8,167,692,656,076,271,000
36.492323
117
0.658013
false
4.627922
false
false
false
ntma/IGP
parse_dataset.py
1
1889
import argparse import logging as lg from src.utils.io_pointcloud import PCLHolder def read_cameras_list(path): """ Loads the SFM camera list :param path: Path to the camera list file :return: [filepaths] """ cameras_list = None with open(path, "r") as f: cameras_list = [line.sp...
gpl-3.0
7,900,210,216,364,670,000
23.855263
104
0.640551
false
3.415913
false
false
false
ravenac95/lxc4u
tests/test_overlayutils.py
1
3768
from mock import Mock, patch, call from nose.tools import raises from lxc4u.overlayutils import * class TestCreatingOverlayGroup(object): def setup(self): self.lxc_service_patch = patch('lxc4u.lxc.LXCService') self.mkdir_patch = patch('os.mkdir') self.mount_patch = patch('overlay4u.mount')...
mit
1,795,094,801,802,548,700
31.205128
72
0.603769
false
3.554717
true
false
false
py-eww/eww
eww/quitterproxy.py
1
2958
# -*- coding: utf-8 -*- """ eww.quitterproxy ~~~~~~~~~~~~~~~~ QuitterProxy is a :py:class:`threading.local`-based proxy used to override the normal quit behavior on demand. It is very similar to IOProxy, but rather than proxying files, it proxies Quitter objects. We need to do this so calling...
mit
1,617,694,954,331,039,200
30.468085
79
0.611562
false
4.408346
false
false
false
noironetworks/horizon
openstack_dashboard/dashboards/admin/metadata_defs/views.py
1
7718
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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
-5,556,653,524,995,855,000
36.833333
79
0.623737
false
4.469021
false
false
false
haje01/swak
swak/config.py
1
7544
"""This module implements config.""" import os import sys import logging from collections import Mapping import yaml from swak.exception import ConfigError from swak.util import parse_and_validate_cmds, validate_tag ENVVAR = 'SWAK_HOME' CFG_FNAME = 'config.yml' MAIN_LOG_CFG = ''' logger: version: 1 formatt...
mit
-4,665,943,832,571,040,000
29.918033
104
0.592524
false
3.837233
true
false
false
faroit/mir_eval
mir_eval/util.py
1
28334
''' This submodule collects useful functionality required across the task submodules, such as preprocessing, validation, and common computations. ''' import os import inspect import six import numpy as np def index_labels(labels, case_sensitive=False): """Convert a list of string identifiers into numerical indi...
mit
1,133,713,111,285,043,200
29.532328
82
0.588304
false
4.149678
false
false
false
GuozhuHe/webspider
webspider/exceptions.py
1
1582
# !/usr/bin/env python # -*- coding: utf-8 -*- __all__ = ['BaseException', 'ResourceNotFoundWebException', 'DowngradeException'] class BaseException(Exception): ERROR_CODE = None STATUS_CODE = 200 def __init__(self, message, data=None, debug_message=None): if self.ERROR_CODE is None: ...
mit
-4,412,292,652,682,356,000
26.928571
110
0.639386
false
3.871287
false
false
false
feist/pcs
pcs/lib/cib/resource/bundle.py
1
27838
from lxml import etree from pcs.common import report_codes from pcs.lib import reports, validate from pcs.lib.cib.nvpair import ( append_new_meta_attributes, arrange_first_meta_attributes, META_ATTRIBUTES_TAG, ) from pcs.lib.cib.resource.primitive import TAG as TAG_PRIMITIVE from pcs.lib.cib.tools import E...
gpl-2.0
5,481,564,441,485,345,000
34.237975
80
0.626266
false
4.090215
false
false
false
openworm/PyOpenWorm
examples/NetworkInfo.py
1
3514
""" Get information about the network. In this case, we are interested in a small set of neurons. We go through each of the neurons and get connectivity information about each connection it has with another cell. This type of script could be useful for visualizing data, generating reports, or any number programmatic ...
mit
1,602,181,863,777,026,300
40.833333
126
0.616107
false
3.531658
false
false
false
studioml/studio
studio/completion_service/encryptor.py
1
3231
import sys from Crypto.PublicKey import RSA from Crypto.Cipher import PKCS1_OAEP import nacl.secret import nacl.utils import base64 class Encryptor: """ Implementation for experiment payload builder using public key RSA encryption. """ def __init__(self, keypath: str): """ param: ke...
apache-2.0
-6,167,505,507,237,310,000
31.31
88
0.607242
false
3.679954
false
false
false
keshav11/rapid
src/main.py
1
1147
import argparse import os class Rapid: def __init__(self): self.boiler_plate_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'boilerplate')) self.supports = list(os.listdir(self.boiler_plate_dir)) def boilerplate(self, language): if language in self.supports: ...
mit
-1,077,873,797,974,222,000
30
109
0.555362
false
3.955172
false
false
false
chrisxue815/leetcode_python
problems/test_0315_merge_sort.py
1
1247
import unittest from typing import List import utils # O(nlog(n)) time. O(n) space. Merge sort. class Solution: def countSmaller(self, nums: List[int]) -> List[int]: result = [0] * len(nums) def sort(dst, src, lo, hi): if lo + 1 >= hi: return mid = lo + (...
unlicense
6,072,814,040,361,411,000
23.45098
66
0.448276
false
3.59366
true
false
false
mbarsacchi/mbarsacchi.github.com
python/MarkovChain.py
1
4763
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Nov 14 10:59:19 2017 @author: marcobarsacchi """ import numpy.random as random class MarkovChain(object): """Simple Markov Chain Model. Parameters ---------- n : int Number of states. p : list, len (n) Base probabili...
mit
7,641,978,869,280,971,000
29.928571
95
0.535167
false
3.841129
false
false
false
SimonGreenhill/pyvolve
examples/simple_codon.py
2
1357
# This example script demonstrates how to evolve according to a simple codon model. All model parameters (except dN/dS!) are default: equal mutation rates and equal equilibrium frequencies. import pyvolve # Define a phylogeny, from a file containing a newick tree my_tree = pyvolve.read_tree(file = "file_with_tree.tre...
bsd-2-clause
4,366,034,117,544,847,400
60.727273
259
0.750921
false
3.112385
false
false
false
brandjon/frexp
frexp/test_util.py
1
1265
"""Unit tests for util.py.""" import unittest from frexp.util import * class UtilCase(unittest.TestCase): def test_stopwatch(self): n = 10 def dummytimer(): return n t = StopWatch(dummytimer) # Init. self.assertEqual(t.elapsed, 0) ...
mit
3,076,395,615,871,469,000
20.810345
47
0.484585
false
4.174917
true
false
false
andyrooger/OAT
src/interactive/visualisecmd.py
1
2097
""" Allow the user to visualise the current state of the program from the console. """ # OAT - Obfuscation and Analysis Tool # Copyright (C) 2011 Andy Gurden # # This file is part of OAT. # # OAT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
gpl-3.0
-3,908,274,352,624,427,500
32.822581
78
0.652361
false
3.964083
false
false
false
YuepengGuo/prophet
prophet/backtest.py
1
2927
from collections import defaultdict import pandas as pd from prophet.portfolio import Portfolio from prophet.exceptions import ProphetException from six import iteritems class BackTest(pd.Series): """ Timeseries data representing portfolio value over the backtest period. Note: Subclasses :class:`pd....
bsd-3-clause
3,945,879,852,010,735,000
30.473118
78
0.563375
false
4.609449
true
false
false
Amechi101/indieapp
_backend_api/migrations/0009_initial.py
1
9056
# -*- 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 model 'Brand' db.create_table(u'_backend_api_brand', ( ...
mit
2,697,130,347,528,065,500
77.077586
149
0.595848
false
3.456489
false
false
false
mwhooker/jsonselect
tests/test_conformance.py
1
4342
import glob import os import os.path import json from jsonselect import jsonselect from unittest import TestCase, skip import logging import sys log = logging.getLogger(__name__) class TestConformance(TestCase): pass def get_ctests(test_path): inputs = {} for selector_path in glob.iglob(os.path.join(...
isc
7,149,061,778,879,937,000
25.315152
75
0.494242
false
4.320398
true
false
false
matttproud/python_quantile_estimation
com/matttproud/quantile/__init__.py
1
6207
#!/usr/bin/python """ Copyright 2013 matt.proud@gmail.com (Matt T. Proud) 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 applicabl...
apache-2.0
6,181,347,903,127,725,000
31.497382
129
0.60029
false
4.265979
false
false
false
ktosiu/lollypop
src/widgets_album.py
1
17798
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # 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 vers...
gpl-3.0
3,904,328,272,029,288,000
33.693957
79
0.533431
false
4.111342
false
false
false
andrewsnowden/flask-starter
starter/config.py
1
1665
import os class BaseConfig: BASEDIR = os.path.abspath(os.path.dirname(__file__)) PROJECT_NAME = "starter" DEBUG = True SECRET_KEY = "$2a$12$LdKsgm9HGNC6LzKVzJ48ju" SQLALCHEMY_DATABASE_URI = "postgresql://postgres@localhost/{0}".format(PROJECT_NAME) # Load a database URL from configuration i...
mit
4,487,533,522,658,939,000
26.295082
88
0.651652
false
2.983871
false
false
false
philippeowagner/django-cronium
django_cronium/migrations/0001_initial.py
1
1764
# 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 'CronJobLog' db.create_table('django_cronium_cronjoblog', ( ('id', self.gf('dja...
mit
-922,407,182,566,715,900
42.04878
106
0.592971
false
3.652174
false
false
false
michigraber/neuralyzer
neuralyzer/utils/tiffutils.py
1
1457
''' Utility functions for tiff file handling. ''' def imarray_from_files_in_directory(directory, pat=r'\w*.tif'): ''' Returns an numpy array with the data in all files in directory matching a regexp pattern. ''' import numpy as np from PIL import Image from ..io import data_handler dh...
mit
-4,399,903,467,968,344,000
29.354167
78
0.660261
false
3.571078
false
false
false
SamiHiltunen/invenio-accounts
examples/app.py
1
4081
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
-6,010,426,815,830,053,000
26.567568
76
0.725
false
3.633126
false
false
false
suriya/save-your-vote
saveyourvote/wsgi.py
1
1492
""" WSGI config for saveyourvote project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATI...
mit
-3,164,321,541,683,901,000
44.212121
79
0.779491
false
3.926316
false
false
false
job/aclhound
aclhound/render.py
1
4428
#!/usr/bin/env python2.7 # Copyright (C) 2014-2015 Job Snijders <job@instituut.net> # # This file is part of ACLHound # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the...
bsd-2-clause
-2,786,830,791,903,398,000
37.842105
83
0.570009
false
4.047532
false
false
false
elishowk/django-poser
poser/utils/django_load.py
1
2874
# -*- coding: utf-8 -*- """ This is revision from 3058ab9d9d4875589638cc45e84b59e7e1d7c9c3 of https://github.com/ojii/django-load. ANY changes to this file, be it upstream fixes or changes for the poser *must* be documentet clearly within this file with comments. For documentation on how to use the functions describe...
agpl-3.0
8,553,228,008,733,105,000
31.670455
81
0.663187
false
3.997218
false
false
false
Fokko/incubator-airflow
airflow/contrib/operators/sagemaker_base_operator.py
1
3318
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
7,325,333,635,167,633,000
31.851485
90
0.634117
false
4.19469
true
false
false
si74/twitter-parody-bot
data/prep_corpus.py
1
1057
import twitter import os import re consumer_key = os.environ['consumer_key'] consumer_secret = os.environ['consumer_secret'] access_token_key = os.environ['access_token_key'] access_token_secret = os.environ['access_token_secret'] username = os.environ['username'] api = twitter.Api(consumer_key=consumer_key, ...
mit
-8,000,156,246,382,354,000
31.030303
101
0.667928
false
3.558923
false
false
false
nagyistoce/koalacloud
s3/BucketVerzeichnisErzeugen.py
1
5047
#!/usr/bin/env python # -*- coding: iso-8859-15 -*- import re from google.appengine.api import users from google.appengine.ext import webapp from google.appengine.api.urlfetch import DownloadError from library import logins3 class BucketVerzeichnisErzeugen(webapp.RequestHandler): def post(self): mobile ...
apache-2.0
-3,743,865,854,249,069,000
45.740741
133
0.587478
false
3.617921
false
false
false
mohsenmalmir/DeepLearningStack
Tutorials/AlexNet/CreateAlexNet.py
1
2671
from __future__ import print_function import theano import theano.tensor as T from theano.tensor.shared_randomstreams import RandomStreams import sys import time import numpy as np import DeepLearningStack from DeepLearningStack import FeedForwardNet #create a deep network defined in AlexNet.xml if __name__=="__mai...
mit
-7,308,698,036,074,899,000
40.092308
149
0.582179
false
4.322006
false
false
false
vmendez/DIRAC
Resources/Computing/glexecComputingElement.py
2
13887
""" A computing element class that attempts to use glexec if available then defaults to the standard InProcess Computing Element behaviour. """ __RCSID__ = "$Id$" import os import stat import distutils.spawn import DIRAC from DIRAC import S_OK, S_ERROR from DIRA...
gpl-3.0
5,330,122,332,762,519,000
39.135838
125
0.599554
false
3.751216
true
false
false
Xeratec/py-general
fractal_qt4_opengl_lib.py
1
11080
#!/usr/bin/python3 ''' @file fractal_qt4_opengl_lib.py @author Philip Wiese @date 12 Okt 2016 @brief PyQt4 QGLWidget to displays Mandelbrot Set with OpenGl ''' import sys, time # PyQt4 imports from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtOpenGL import QGLWidget # PyOpenGL imports import OpenGL.GL ...
mit
2,889,706,428,942,754,000
28.38992
98
0.586913
false
3.307463
false
false
false
HewlettPackard/python-proliant-sdk
examples/Rest/ex16_computer_details.py
1
5077
# Copyright 2016 Hewlett Packard Enterprise Development LP # # 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 requi...
apache-2.0
1,969,579,145,395,104,000
45.448598
79
0.524522
false
4.277169
false
false
false
ROGUE-JCTD/vida
vida/vida/api.py
1
9707
from django.conf.urls import url from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS from tastypie.utils import trailing_slash from tastypie.authentication import BasicAuthentication, Authentication, SessionAuthentication, MultiAuthentication from tastypie.authorization import Authorization from tasty...
mit
3,033,633,536,519,885,000
42.923077
177
0.529515
false
4.426357
false
false
false
li-xirong/jingwei
model_based/svms/mlengine_util.py
1
1122
import os import time from basic.common import printStatus from mlengine_const import DEFAULT_BLOCK_SIZE INFO = __file__ def classify_large_data(model, imset, feat_file, prob_output=False, blocksize=DEFAULT_BLOCK_SIZE): start = 0 results = [] read_time = 0.0 test_time = 0.0 while start < len(i...
mit
1,626,304,135,539,781,600
28.526316
116
0.616756
false
3.389728
false
false
false
axiom-data-science/pyaxiom
pyaxiom/netcdf/sensors/dsg/timeseries/cr.py
1
1599
#!python # coding=utf-8 from pyaxiom.netcdf import CFDataset from pyaxiom import logger class ContiguousRaggedTimeseries(CFDataset): @classmethod def is_mine(cls, dsg): try: rvars = dsg.get_variables_by_attributes(cf_role='timeseries_id') assert len(rvars) == 1 as...
mit
5,944,363,277,604,965,000
32.3125
94
0.601001
false
4.027708
false
false
false
chromium/chromium
tools/json_schema_compiler/compiler.py
5
8586
#!/usr/bin/env python3 # Copyright (c) 2012 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. """Generator for C++ structs from api json files. The purpose of this tool is to remove the need for hand-written code that conver...
bsd-3-clause
6,438,829,191,584,394,000
38.934884
80
0.632075
false
4.12194
false
false
false
pjuu/pjuu
pjuu/posts/forms.py
1
1308
# -*- coding: utf8 -*- """Web forms :license: AGPL v3, see LICENSE for more details :copyright: 2014-2021 Joe Doherty """ # 3rd party imports from flask_wtf import FlaskForm from flask_wtf.file import FileAllowed, FileField from wtforms import TextAreaField, RadioField, ValidationError # Pjuu imports from pjuu.post...
agpl-3.0
-4,105,466,425,571,656,000
30.142857
79
0.620795
false
3.737143
false
false
false
lindychi/mnec
store/urls.py
1
2070
from django.urls import path from . import views app_name = 'store' urlpatterns = [ path('', views.index_view, name='index'), path('order_by/category_score', views.index_order_by_category_score, name='index_order_by_category_score'), path('detail/<int:pk>/', views.ItemDataDetailView.as_view(), name='deta...
mit
2,692,829,581,260,713,000
68
121
0.711111
false
3.194444
false
true
false
seanlin0800/python_snippets
cached_property.py
1
1624
""" A cached-property for decorating methods in classes. Source: https://github.com/mitsuhiko/werkzeug/blob/master/werkzeug/utils.py """ # sentinel _missing = object() class cached_property(object): """A decorator that converts a function into a lazy property. The function wrapped is called the first time ...
unlicense
-8,282,506,575,242,465,000
32.833333
75
0.62069
false
4.342246
false
false
false
czgu/metaHack
env/bin/pildriver.py
1
15630
#!/Users/cgu/hackathon/meta/metaHack/env/bin/python """PILdriver, an image-processing calculator using PIL. An instance of class PILDriver is essentially a software stack machine (Polish-notation interpreter) for sequencing PIL image transformations. The state of the instance is the interpreter stack. The only metho...
apache-2.0
2,542,845,487,960,605,700
28.602273
95
0.584261
false
3.717004
false
false
false
3cky/netdata
collectors/python.d.plugin/ssg_nodes/ssg_nodes.chart.py
1
4025
import json from third_party.osgi_monitor import OsgiMonitorService # default module values (can be overridden per job in `config`) update_every = 10 priority = 60000 retries = 60 ORDER = ['datasource.pool', 'datasource.perf', 'conn.service', 'conn.auth', 'auth.service', \ 'game.tables', 'game.authz', 'game.p...
gpl-3.0
4,366,254,782,513,067,000
40.927083
112
0.541366
false
3.460877
false
false
false
sfromm/ansible-report
setup.py
1
1280
#!/usr/bin/env python import os import sys import glob __requires__ = ['SQLAlchemy >= 0.7'] import pkg_resources sys.path.append( os.path.join( os.path.dirname(os.path.abspath(__file__)), 'lib') ) from ansiblereport import __version__, __author__, __name__ from distutils.core import setup data_files = [] plugi...
gpl-3.0
3,410,876,928,398,141,400
28.767442
75
0.671875
false
3.42246
false
false
false
BU-hammerTeam/PyHammer
eyecheck.py
1
47837
from pyhamimports import * from gui_utils import * from spectrum import * class Eyecheck(QMainWindow): def __init__(self, specObj, options): super().__init__() # Store Input Variables self.specObj = specObj # The Spectrum object created in the pyhammer script self.options = ...
mit
1,506,878,551,958,921,200
45.534047
155
0.606832
false
4.262028
false
false
false