repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
eaplatanios/tensorflow
tensorflow/python/framework/meta_graph.py
3
38105
# Copyright 2015 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
9,088,307,620,125,188,000
37.882653
176
0.657105
false
google-research/graph-attribution
graph_attribution/visualizations.py
1
4159
# 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 agreed to in writing, ...
apache-2.0
7,167,958,857,120,401,000
35.165217
79
0.666987
false
kapilt/cloud-custodian
tools/c7n_azure/tests_azure/test_tags.py
2
3500
# Copyright 2015-2018 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
-4,470,880,270,085,404,000
40.176471
87
0.684
false
aml-development/ozp-backend
tests/ozpcenter_api/test_api_listing_review.py
1
5412
""" Tests for listing reviews """ import collections from django.test import override_settings from rest_framework import status from tests.ozp.cases import APITestCase from unittest import skip from ozpcenter.utils import shorthand_dict from ozpcenter import model_access as generic_model_access from ozpcenter.scripts...
apache-2.0
-7,542,694,975,305,206,000
41.952381
168
0.629527
false
corso-python-prato/share-system-team2
client/test_client_daemon.py
1
73274
#!/usr/bin/env python # -*- coding: utf-8 -*- import hashlib import unittest import os import shutil import json import time from mock import Mock import client_daemon import tstutils from contextlib import contextmanager ######################################################################################### # W...
apache-2.0
-178,292,516,337,342,600
39.843924
120
0.634905
false
huahbo/src
user/karl/rsf2numpy4.py
5
1288
#!/usr/bin/env python import rsf.api as rsf import numpy as np import scipy as sp import matplotlib.pyplot as plt import sys import os import c_m8r as c_rsf import m8r # next challenge is to get input file names from command line # use Msfin.c as example print "program name",sys.argv[0] print "type sys.argv=",type(s...
gpl-2.0
-2,731,687,981,239,630,000
24.76
75
0.701863
false
mozilla/popcorn_maker
vendor-local/lib/python/whoosh/lang/morph_en.py
21
48616
""" Contains the variations() function for expanding an English word into multiple variations by programatically adding and removing suffixes. Translated to Python from the ``com.sun.labs.minion.lexmorph.LiteMorph_en`` class of Sun's `Minion search engine <https://minion.dev.java.net/>`_. """ import re from whoosh.c...
bsd-3-clause
5,869,503,350,824,287,000
50.664187
267
0.627633
false
streed/pyConditions
pyconditions/pre.py
1
4219
from functools import wraps from .inspector import Gadget from .exceptions import PyCondition, PyConditionError from .stage import Stage class Pre(object): def __init__(self): self.funcTable = {} class PreCondition(object): context = Pre() def __init__(self, name): self.name = name ...
apache-2.0
-5,616,237,128,750,372,000
26.219355
96
0.540412
false
DavidLP/home-assistant
homeassistant/components/sma/sensor.py
5
6220
"""SMA Solar Webconnect interface.""" import asyncio from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_SSL, CONF_VERIFY_SSL, EVENT_HOMEASSISTANT...
apache-2.0
-2,190,290,634,040,283,400
29.341463
79
0.621865
false
fivejjs/GPy
GPy/models/gradient_checker.py
4
4642
# ## Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) from ..core.model import Model import itertools import numpy from ..core.parameterization import Param def get_shape(x): if isinstance(x, numpy.ndarray): return x.shape return () def at...
bsd-3-clause
-5,612,117,826,201,153,000
40.079646
238
0.566997
false
DIRACGrid/DIRAC
src/DIRAC/Core/Tornado/Server/TornadoService.py
2
25581
""" TornadoService is the base class for your handlers. It directly inherits from :py:class:`tornado.web.RequestHandler` """ from __future__ import absolute_import from __future__ import division from __future__ import print_function __RCSID__ = "$Id$" from io import open import os import time import threading from...
gpl-3.0
4,470,104,001,165,459,000
33.804082
117
0.647434
false
prodromou87/gem5
src/dev/arm/Gic.py
7
2921
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
-3,183,069,607,638,039,000
46.885246
84
0.767545
false
oVirt/vdsm
lib/vdsm/storage/sdm/api/remove_bitmap.py
2
2034
# # Copyright 2020 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in th...
gpl-2.0
8,437,950,995,472,279,000
33.474576
78
0.665192
false
minesense/VisTrails
vistrails/packages/spreadsheet/widgets/__init__.py
6
1977
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
bsd-3-clause
-7,197,050,156,997,716,000
49.692308
79
0.697521
false
akshaybabloo/Car-ND
Project_3/old_model/preprocessor_modeler_old.py
1
1845
import csv import os import pickle import logging import cv2 import numpy as np logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) log.info("Pickler started.") log.info("Reading path.") full_path_csv = os.path.abspath('data' + os.sep + 'driving_log.csv') full_path_img = os.path.abspath('data'...
mit
2,179,802,572,355,703,000
26.954545
75
0.696477
false
rockstor/rockstor-core
src/rockstor/cli/sm_console.py
2
2550
""" Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
-1,945,098,368,526,340,600
31.692308
79
0.576471
false
google-code-export/dojango
dojango/data/modelstore/fields.py
13
7153
import utils from exceptions import FieldException import methods __all__ = ('FieldException', 'StoreField' 'ReferenceField', 'DojoDateField') class StoreField(object): """ The base StoreField from which all ```StoreField```s derive """ def __init__(self, model_field=None, store_field=None, g...
bsd-3-clause
4,524,929,874,736,888,300
35.309645
110
0.554872
false
danilnagy/taxiMap
app.py
1
7480
from flask import Flask from flask import render_template from flask import request from flask import Response import pickle import numpy as np import json import time import sys import random import math import pyorient from sklearn import preprocessing from sklearn import svm from multiprocessing import Pool fro...
gpl-2.0
3,851,740,123,006,733,000
22.897764
180
0.649599
false
agx/git-buildpackage
gbp/rpm/__init__.py
1
41170
# vim: set fileencoding=utf-8 : # # (C) 2006,2007 Guido Günther <agx@sigxcpu.org> # (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foun...
gpl-2.0
6,685,438,709,130,834,000
40.000996
119
0.544395
false
sdh11/gnuradio
gr-filter/python/filter/qa_pfb_synthesizer.py
7
3654
#!/usr/bin/env python # # Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
gpl-3.0
-1,714,712,042,324,372,000
35.178218
81
0.539956
false
lfzyx/ButterSalt
buttersalt/views/user/__init__.py
1
2554
from flask import Blueprint, render_template, flash, redirect, request, url_for, current_app from flask_login import login_user, logout_user, login_required, UserMixin from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, PasswordField, BooleanField from wtforms.validators import InputRequired, ...
mit
8,538,722,602,906,794,000
38.292308
113
0.632341
false
changsimon/trove
trove/cmd/api.py
1
1071
# Copyright 2011 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 requ...
apache-2.0
-4,937,435,471,287,725,000
40.192308
78
0.720822
false
tkaitchuck/nupic
external/darwin64/lib/python2.6/site-packages/PIL/ImImagePlugin.py
13
9719
# # The Python Imaging Library. # $Id: ImImagePlugin.py 2285 2005-02-07 23:52:14Z fredrik $ # # IFUNC IM file handling for PIL # # history: # 1995-09-01 fl Created. # 1997-01-03 fl Save palette images # 1997-01-08 fl Added sequence support # 1997-01-23 fl Added P and RGB save support # 1997-05-31 fl Read floa...
gpl-3.0
1,093,223,873,222,919,300
28.01194
79
0.459615
false
CrystallineEntity/bulbs
bulbs/views/install.py
1
1938
from sys import modules from pyramid.view import view_config from pyramid.response import Response from bulbs.components.user import register_user @view_config(route_name="install", renderer="install.mako") def response(request): if request.method == "POST": dbtype = request.params.get("dbtype") ...
mit
2,048,089,351,121,681,700
30.274194
82
0.603199
false
TakayukiSakai/tensorflow
tensorflow/python/kernel_tests/listdiff_op_test.py
18
3661
# Copyright 2015 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
3,978,407,412,740,930,000
26.946565
80
0.575526
false
honzamach/pynspect
pynspect/tests/test_filters_idea.py
1
19028
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # This file is part of Pynspect package (https://pypi.python.org/pypi/pynspect). # Originally part of Mentat system (https://mentat.cesnet.cz/). # # Copyright (C) since 2016 CESNET, z.s.p.o (h...
mit
4,530,051,227,202,984,400
46.806533
217
0.61192
false
docmeth02/CouchPotatoServer
libs/tornado/platform/select.py
79
2633
#!/usr/bin/env python # # Copyright 2012 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
gpl-3.0
-2,198,320,978,732,137,200
33.644737
80
0.644132
false
hande-qmc/hande
tools/pyhande/pyhande/testcode.py
1
3387
'''Functions for obtaining data subsets to be tested by testcode''' import pyhande.extract def extract_test_data(fname, underscore=True): '''Extract data from a HANDE file and select a desired subset to be tested. Parameters ---------- fname : string filename containing HANDE calculation output. underscore :...
lgpl-2.1
8,878,159,706,924,835,000
36.21978
84
0.609979
false
ccphillippi/AFP
afp/afp/linalg.py
1
1665
''' .. module:: linalg This module contains the sparse matrix operations required for processing that do not reside in scipy/numpy .. moduleauthor:: Christopher Phillippi <c_phillippi@mfe.berkeley.edu> ''' import numpy as np def cov( sparse, isSample = True ): """Computes a covariance matrix for ver...
mit
4,782,506,074,592,374,000
35
109
0.637838
false
cysnake4713/pyctp
example/pyctp2/test/test_position.py
7
28891
#-*- coding:utf-8 -*- import logging import time import unittest import unittest.mock as mock from ..common.base import ( XOPEN,XCLOSE,XCLOSE_TODAY, LONG,SHORT, BaseObject, TEST_PATH, MAX_VALUE, ) from ..common.contract_type i...
mit
4,603,201,135,710,142,000
40.302899
171
0.644479
false
yamt/tempest
tempest/api/identity/admin/v3/test_tokens.py
10
6798
# Copyright 2012 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 requ...
apache-2.0
-1,223,476,949,507,721,000
44.932432
79
0.595028
false
gst/amqpy
amqpy/tests/test_consumer.py
1
2678
import logging from .. import Message, AbstractConsumer from ..exceptions import Timeout log = logging.getLogger('amqpy') class Consumer(AbstractConsumer): def run(self, msg: Message): log.info('{.consumer_tag} received message: {} {}'.format(self, msg.properties, msg.body)) msg.ack() class T...
mit
-6,700,913,082,055,823,000
26.050505
98
0.56348
false
jayceyxc/hue
apps/beeswax/src/beeswax/data_export.py
3
4040
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
-2,640,306,070,540,333,600
30.317829
153
0.687129
false
WinawerLab/sco
sco/analysis/core.py
1
14632
#################################################################################################### # sco/analysis/core.py # Core implementation of the analysis module of the sco library # by Noah C. Benson import numpy as np import scipy as sp, scipy.spatial as sps import pyrsistent as pyr import nibabel, nibabel.fr...
gpl-3.0
4,709,483,565,074,099,000
55.933852
106
0.640514
false
renner/spacewalk
backend/server/importlib/test/test_strict_channel_package_subscription.py
10
2248
# # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
-4,189,442,840,588,006,000
30.661972
83
0.682829
false
poranmeloge/test-github
stm32_rtt_wifi/bsp/stm32f40x/rtconfig.py
3
3461
import os # toolchains options ARCH='arm' CPU='cortex-m4' CROSS_TOOL='keil' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = '...
gpl-2.0
3,130,016,982,738,321,400
26.468254
130
0.542907
false
bsanders/kazoo
kazoo/tests/test_lease.py
1
9472
import datetime import uuid from kazoo.recipe.lease import NonBlockingLease from kazoo.recipe.lease import MultiNonBlockingLease from kazoo.testing import KazooTestCase class MockClock(object): def __init__(self, epoch=0): self.epoch = epoch def forward(self, seconds): self.epoch += seconds...
apache-2.0
8,624,119,457,698,760,000
39.652361
77
0.552048
false
HyperBaton/ansible
test/units/modules/network/f5/test_bigip_device_auth.py
22
4099
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
-5,169,993,978,351,431,000
30.290076
91
0.640888
false
Onager/plaso
tests/parsers/winreg_plugins/shutdown.py
1
1896
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the LastShutdown value plugin.""" import unittest from plaso.lib import definitions from plaso.parsers.winreg_plugins import shutdown from tests.parsers.winreg_plugins import test_lib class ShutdownWindowsRegistryPluginTest(test_lib.RegistryPluginTestCase...
apache-2.0
4,725,126,016,497,467,000
32.857143
77
0.707806
false
tonnrueter/pymca_devel
PyMca/PyMcaPlugins/SortPlotsWindow.py
1
52171
import numpy, copy from PyMca import PyMcaDirs from PyMca import ConfigDict from os.path import splitext from os import linesep as newline from PyMca import PyMcaQt as qt from PyMca.PyMca_Icons import IconDict from PyMca import ScanWindow as sw DEBUG = True if DEBUG: numpy.set_printoptions(threshold=50) class XM...
gpl-2.0
2,236,814,920,959,410,400
35.869965
456
0.520002
false
tysonholub/twilio-python
twilio/rest/preview/understand/assistant/assistant_fallback_actions.py
1
10300
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.l...
mit
2,524,290,258,630,546,400
34.640138
118
0.665146
false
xunzhang/dynet
setup.py
1
16197
import distutils.sysconfig import logging as log import platform import zipfile import sys from distutils.command.build import build as _build from distutils.command.build_py import build_py as _build_py from distutils.command.install_data import install_data as _install_data from distutils.errors import DistutilsSetup...
apache-2.0
3,837,792,147,917,005,000
39.4925
289
0.603198
false
felipenaselva/felipe.repository
plugin.program.super.favourites/player.py
5
4477
# # Copyright (C) 2014- # Sean Poyser (seanpoyser@gmail.com) # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # Thi...
gpl-2.0
-5,484,364,484,477,616,000
27.515924
115
0.612017
false
relman/sevpn-mgmt-py
SevpnMgmtPy/admin_api/rpc_server_info.py
1
2314
# -*- coding: utf-8 -*- from SevpnMgmtPy.admin_api.os_info import OsInfo class RpcServerInfo: def __init__(self, server_product_name='', server_version_string='', server_build_info_string='', server_ver_int=0, server_build_int=0, server_host_name='', server_type=0, server_build_date=0L, ser...
mit
-6,610,991,881,135,181,000
49.422222
119
0.601556
false
tcyb/nextgen4b
nextgen4b/analyze/analyze.py
1
2850
import logging import sys import numpy as np import pandas as pd import tqdm import yaml from Bio import SeqIO from ..process.filter import cull_alignments ##################### # Dataframe creation and manipulation ##################### def get_positional_misinc(seqs, template, n, letterorder=['C', 'A', 'T', 'G']...
mit
-8,585,476,103,750,309,000
31.758621
90
0.589474
false
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/units/bar_unit_demo.py
1
1875
""" ========================= Group barchart with units ========================= This is the same example as :doc:`the barchart demo<../api/barchart>` in centimeters. .. only:: builder_html This example requires :download:`basic_units.py <basic_units.py>` """ import numpy as np from basic_units import cm, inch ...
mit
-1,175,294,659,780,712,000
23.350649
82
0.591467
false
nelsongoh/tembotsu
eventannouncer.py
1
1351
from google.appengine.api import urlfetch from users import User import webapp2 import urllib import urllib2 import json import logging # For Telegram's URL and Bot Token TOKEN = '210023445:AAGtsEyXgwOUXsGGa5E9yS0DYyHnKpmCeOs' BASE_URL = 'https://api.telegram.org/bot' + TOKEN + '/' # This class was intended to be ca...
apache-2.0
-5,462,620,518,103,973,000
36.527778
105
0.586232
false
danialbehzadi/Nokia-RM-1013-2.0.0.11
webkit/Source/WebCore/WebCore.gyp/scripts/action_maketokenizer.py
24
3567
#!/usr/bin/python # # Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
gpl-3.0
-2,140,649,268,947,687,200
34.316832
83
0.689936
false
DVLab-NLP2016/Final_Project
data/model/main.py
1
3163
from __future__ import division, print_function, absolute_import import tflearn from tflearn.data_utils import to_categorical, pad_sequences from tflearn.layers.core import input_data, dropout, fully_connected from tflearn.layers.embedding_ops import embedding from tflearn.layers.recurrent import bidirectional_rnn, Ba...
mit
-2,717,366,331,574,085,000
31.947917
140
0.681631
false
rileymcdowell/genomic-neuralnet
genomic_neuralnet/methods/neural_net_dominance.py
1
2614
import numpy as np from genomic_neuralnet.config import MAX_EPOCHS, CONTINUE_EPOCHS, TRY_CONVERGENCE, USE_ARAC from pybrain.structure import FeedForwardNetwork, LinearLayer, SigmoidLayer, FullConnection from pybrain.supervised.trainers import BackpropTrainer from pybrain.datasets import SupervisedDataSet, SupervisedDa...
mit
-3,593,557,114,715,729,000
38.606061
118
0.680566
false
lthurlow/Network-Grapher
proj/external/networkx-1.7/networkx/external/decorator/_decorator3.py
27
8850
########################## LICENCE ############################### ## ## Copyright (c) 2005-2011, Michele Simionato ## All rights reserved. ## ## Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## Redistributions in byteco...
mit
-9,078,698,010,226,782,000
40.943128
80
0.576836
false
ioannis-e/mpc-hc
src/mpc-hc/mpcresources/UpdatePOT.py
10
1129
# (C) 2013, 2015-2016 see Authors.txt # # This file is part of MPC-HC. # # MPC-HC 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. # # M...
gpl-3.0
4,851,643,732,705,542,000
34.28125
88
0.733392
false
mice-software/maus
tests/integration/test_examples/test_examples.py
1
4946
# This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus # # MAUS 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. # #...
gpl-3.0
7,662,978,065,375,764,000
33.347222
80
0.606349
false
Dubrzr/dsfaker
dsfaker/generators/autoincrement.py
1
1497
import numpy from . import Generator class Autoincrement(Generator): def __init__(self, start: float=0.0, step: float=1.0, dtype: numpy.dtype=numpy.int64): self.start = start self.offset = 0 self.dtype = dtype self.step = step def get_single(self): self.offset += 1 ...
mit
-2,438,838,302,301,159,400
30.851064
109
0.594522
false
DAAP/DAAP10
DAAP10.1.2.py
1
91757
# NOTE: This program does not support either NADF or Z-Dictionaries. # This is DAAP10.1.2.py; it is based on DAAP09.6, it adds an # additional function: The construction of density functions based # on user defined segmentation. # Copyright (C) 2016 Bernard Maskit, Wilma Bucci and Sean Murphy # This program is...
gpl-3.0
-5,144,581,525,376,886,000
40.840857
119
0.397234
false
chapmanb/metasv
metasv/tigra_contig.py
5
2018
from svregion import * class TigraContig: def __init__(self, name="", sequence=None): if sequence is not None: self.sequence = sequence self.parse_name(name) def parse_name(self, name): name_fields = name.strip().split() name_split = name_fields[0].split(".") ...
bsd-2-clause
1,322,416,795,674,761,000
36.37037
120
0.53667
false
droodle/kansha
kansha/gallery/comp.py
1
7862
#-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from ..authentication.database import validators from ..flow import comp as flow from ..toolbox im...
bsd-3-clause
-5,679,127,159,267,829,000
35.910798
145
0.581913
false
mtnman38/Validate
valpy/validate.py
1
2788
# ValPy -- Validate.R in Python # Author: Dustin Landers # Contact: (770 289-8830 :: dustin.landers@gmail.com """Dependencies""" from commandline import * from fileimport import * from checkhidden import * from gwas import * import numpy as np """Main function and execution""" def main(): initializeGraphics() fol...
gpl-2.0
-2,521,994,734,659,560,400
28.989247
115
0.709469
false
sileht/deb-openstack-quantum
quantum/plugins/cisco/db/nexus_models.py
4
1376
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011, Cisco Systems, 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-...
apache-2.0
5,517,035,840,371,208,000
35.210526
78
0.699128
false
PeteW/luigi
test/contrib/cascading_test.py
6
2942
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
4,207,441,320,888,145,000
35.775
77
0.60639
false
wagnerand/zamboni
docs/settings/settings_local.prod.py
5
1781
from settings import * DEBUG = False TEMPLATE_DEBUG = False # The default database should point to the master. DATABASES = { 'default': { 'NAME': 'zamboni', 'ENGINE': 'django.db.backends.mysql', 'HOST': '', 'PORT': '', 'USER': '', 'PASSWORD': '', 'OPTIONS': ...
bsd-3-clause
8,752,208,859,473,257,000
24.442857
72
0.578327
false
GNOME/ontv
ontv/utils.py
1
1681
# -*- coding: utf-8 -*- # Copyright (C) 2004-2010 Johan Svedberg <johan@svedberg.com> # This file is part of OnTV. # OnTV 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 ...
gpl-2.0
-6,619,739,375,679,556,000
27.982759
80
0.687091
false
xzturn/tensorflow
tensorflow/python/keras/datasets/cifar10.py
3
2977
# Copyright 2015 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
-6,747,769,181,492,940,000
35.304878
80
0.667786
false
adityacs/ansible
lib/ansible/modules/cloud/ovirt/ovirt_affinity_labels.py
8
6867
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # 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 #...
gpl-3.0
68,656,335,361,258,050
32.173913
128
0.611912
false
RAtechntukan/CouchPotatoServer
couchpotato/core/plugins/manage.py
7
12264
import os import time import traceback from couchpotato import get_db from couchpotato.api import addApiView from couchpotato.core.event import fireEvent, addEvent, fireEventAsync from couchpotato.core.helpers.encoding import sp from couchpotato.core.helpers.variable import splitString, getTitle, tryInt, getIdentifier...
gpl-3.0
805,459,405,368,647,700
37.205607
162
0.503832
false
kmacinnis/sympy
sympy/core/function.py
1
76646
""" There are two types of functions: 1) defined function like exp or sin that has a name and body (in the sense that function can be evaluated). e = exp 2) undefined function with a name but no body. Undefined functions can be defined using a Function class as follows: f = Function('f') (the result...
bsd-3-clause
-2,389,078,919,471,687,000
32.543107
99
0.552423
false
pmarques/ansible
lib/ansible/module_utils/facts/virtual/openbsd.py
33
2838
# 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 distributed in the hope that ...
gpl-3.0
1,009,534,715,057,780,600
37.351351
81
0.689922
false
damiendallimore/SplunkModularInputsPythonFramework
implementations/bugsense/bin/responsehandlers.py
3
1835
#add your custom response handler class to this module import json import datetime #the default handler , does nothing , just passes the raw output directly to STDOUT class DefaultResponseHandler: def __init__(self,**args): pass def __call__(self, response_object,raw_response_output,respon...
apache-2.0
5,591,097,337,563,899,000
30.118644
100
0.582561
false
wongkaiweng/LTLMoP
src/specEditor.py
7
76297
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ==================================== specEditor.py - Specification Editor ==================================== A development environment for specifications written in structured English, allowing for editing, compilation, and execution/simulation """ ...
gpl-3.0
-2,119,281,946,707,133,700
43.592051
212
0.613235
false
dredkin/deluge-rbb
setup.py
1
2689
# # setup.py # # Copyright (C) 2014 dredkin <dmitry.redkin@gmail.com> # # Basic plugin template created by: # Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com> # Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com> # Copyright (C) 2009 Damien Churchill <damoxc@gmail.com> # # Deluge is free software. # # Y...
gpl-2.0
4,057,974,974,142,851,000
34.853333
87
0.686129
false
mavit/ansible
test/units/modules/network/ios/test_ios_facts.py
12
3496
# 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 distributed in the hope that ...
gpl-3.0
9,020,230,495,497,695,000
38.280899
124
0.648741
false
martinjos/nn-circle
nntrain.py
1
2460
#!/usr/bin/env python3 import argparse import nnabla as nn import nnabla.functions as F # it crashes without this import numpy.random as R import itertools as IT from nn_circle import * from nn_smt2 import * from shared import * parser = argparse.ArgumentParser(description='Generate ReLU neural network for unit ci...
apache-2.0
-3,270,117,396,711,714,000
37.4375
104
0.608537
false
xulabs/projects
segmentation/FCN.py
1
3625
from __future__ import division import numpy as np import math,pickle,os,pdb from model import FCN8, FCN1,FCN_aspp,FCN_ed,FCN_ed2 import tensorflow as tf import keras from keras import optimizers, metrics from keras.models import Sequential, Model, load_model from keras.callbacks import EarlyStopping, ModelCheckpoin...
gpl-3.0
-553,180,745,586,743,400
29.462185
125
0.677517
false
Theer108/invenio
invenio/legacy/oaiharvest/daemon.py
10
26038
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 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 # Li...
gpl-2.0
-8,990,733,079,312,683,000
42.835017
152
0.541324
false
Orav/kbengine
kbe/src/lib/python/Tools/scripts/analyze_dxp.py
7
4312
""" Some helper functions to analyze the output of sys.getdxp() (which is only available if Python was built with -DDYNAMIC_EXECUTION_PROFILE). These will tell you which opcodes have been executed most frequently in the current process, and, if Python was also built with -DDXPAIRS, will tell you which instruction ...
lgpl-3.0
5,029,320,043,475,003,000
31.426357
79
0.634508
false
twitter/pants
contrib/confluence/src/python/pants/contrib/confluence/tasks/confluence_publish.py
1
4765
# coding=utf-8 # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os import textwrap from pants.backend.docgen.targets.doc import Page from pants.b...
apache-2.0
-14,436,992,191,217,276
35.098485
99
0.658552
false
aviarypl/mozilla-l10n-addons-server
src/olympia/bandwagon/tests/test_serializers.py
2
7651
# -*- coding: utf-8 -*- import mock from rest_framework import serializers from waffle.testutils import override_switch from olympia.amo.tests import ( BaseTestCase, addon_factory, collection_factory, TestCase, user_factory) from olympia.bandwagon.models import CollectionAddon from olympia.bandwagon.serializers im...
bsd-3-clause
-7,101,353,454,555,274,000
41.494444
79
0.666231
false
yephper/django
django/http/utils.py
1
1049
""" Functions that modify an HTTP request or response in some way. """ # This group of functions are run as part of the response handling, after # everything else, including all response middleware. Think of them as # "compulsory response middleware". Be careful about what goes here, because # it's a little fid...
bsd-3-clause
-629,477,131,726,397,700
35.464286
79
0.65205
false
google/sqlcommenter
python/sqlcommenter-python/google/cloud/sqlcommenter/psycopg2/extension.py
1
3405
#!/usr/bin/python # # Copyright 2019 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 ag...
apache-2.0
4,906,894,552,269,002,000
38.137931
78
0.670778
false
angad/libjingle-mac
scons-2.2.0/engine/SCons/Builder.py
14
34010
"""SCons.Builder Builder object subsystem. A Builder object is a callable that encapsulates information about how to execute actions to create a target Node (file) from source Nodes (files), and how to create those dependencies for tracking. The main entry point here is the Builder() factory method. This provides a...
bsd-3-clause
-6,613,012,961,745,362,000
37.779932
186
0.592091
false
Johnetordoff/osf.io
scripts/tests/test_node_log_events.py
8
2834
import pytz import datetime from tests.base import OsfTestCase from osf_tests.factories import UserFactory, NodeLogFactory from nose.tools import * # PEP8 asserts from osf.models import NodeLog from scripts.analytics.node_log_events import NodeLogEvents class TestNodeLogAnalytics(OsfTestCase): def setUp(self):...
apache-2.0
7,915,230,408,323,647,000
39.485714
111
0.610092
false
harish2rb/pyGeoNet
pygeonet_V3/pygeonet_plot.py
2
3272
import numpy as np import matplotlib.pyplot as plt from matplotlib import cm import prepare_pygeonet_defaults as defaults def raster_plot(Array, title): """ Plot raster image :param Array: The input Array :param title: The raster plot title :return: A matplotlib figure """ i...
gpl-3.0
1,728,946,861,114,760,700
30.72
94
0.656174
false
caiuspb/home-assistant
homeassistant/components/rollershutter/demo.py
6
2378
""" homeassistant.components.rollershutter.demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo platform for the rollorshutter component. """ from homeassistant.const import EVENT_TIME_CHANGED from homeassistant.helpers.event import track_utc_time_change from homeassistant.components.rollershutter import Rollershutter...
mit
6,977,317,075,390,707,000
27.650602
77
0.574432
false
cryptickp/heat
heat/tests/autoscaling/test_scaling_policy.py
2
10039
# # 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 # ...
apache-2.0
4,559,444,506,958,326,000
42.085837
78
0.641697
false
Southpaw-TACTIC/TACTIC
src/tactic/ui/app/tactic_branding_wdg.py
2
2616
########################################################### # # Copyright (c) 2009, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
1,417,643,239,423,756,500
34.351351
118
0.507645
false
mblondel/scikit-learn
sklearn/covariance/robust_covariance.py
20
29613
""" Robust location and covariance estimators. Here are implemented estimators that are resistant to outliers. """ # Author: Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import warnings import numbers import numpy as np from scipy import linalg from scipy.stats import chi2 from . import empir...
bsd-3-clause
7,049,694,653,673,032,000
40.885431
79
0.636342
false
AaronTao1990/scrapy
scrapy/xlib/pydispatch/robustapply.py
23
2002
"""Robust apply mechanism Provides a function "call", which can sort out what arguments a given callable object can take, and subset the given arguments to match only those which are acceptable. """ import inspect def function(receiver): """Get function-like callable object for given receiver returns (funct...
bsd-3-clause
5,307,601,082,117,289,000
33.517241
97
0.636364
false
funkring/fdoo
addons-funkring/commission_sale/commission.py
1
11057
# -*- coding: utf-8 -*- # -*- encoding: utf-8 -*- ############################################################################# # # Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
agpl-3.0
4,497,279,604,492,237,000
41.860465
199
0.469929
false
lyft/incubator-airflow
airflow/contrib/hooks/gcp_sql_hook.py
5
1791
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-143,000,692,571,706,640
34.117647
97
0.727527
false
ubc/compair
compair/learning_records/xapi/verb.py
1
1959
from tincan import Verb, LanguageMap class XAPIVerb(object): verbs = { 'viewed': 'http://id.tincanapi.com/verb/viewed', 'commented': 'http://adlnet.gov/expapi/verbs/commented', 'authored': 'http://activitystrea.ms/schema/1.0/author', 'removed': 'https://w3id.org/xapi/dod-isd/verbs/r...
gpl-3.0
-2,250,346,186,730,035,000
41.608696
75
0.614089
false
hugheaves/solo-led-control
demo_scripts/attitude_leds.py
1
1322
#!/usr/bin/python from time import sleep from SoloLED import SoloLED def attitude_callback(self, attr_name, attitude): print "Attitude: {0}".format(attitude) back_left = -attitude.roll + attitude.pitch back_right = attitude.roll + attitude.pitch front_left = -attitude.roll - attitude.pitch front_ri...
gpl-3.0
9,180,652,471,143,094,000
34.72973
127
0.689864
false
jeromecn/caravel_viz_full
tests/import_export_tests.py
1
17401
"""Unit tests for Caravel""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from sqlalchemy.orm.session import make_transient import json import pickle import unittest from caravel import db, models from .base_test...
apache-2.0
-7,401,625,264,988,875,000
40.93012
82
0.602264
false
bathepawan/workload-automation
wlauto/workloads/anomaly2/__init__.py
5
2354
# Copyright 2014-2015 ARM Limited # # 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 w...
apache-2.0
1,103,596,353,541,525,100
36.967742
95
0.644435
false
Orav/kbengine
kbe/res/scripts/common/Lib/ctypes/__init__.py
2
17561
"""create and manipulate C data types in Python""" import os as _os, sys as _sys __version__ = "1.1.0" from _ctypes import Union, Structure, Array from _ctypes import _Pointer from _ctypes import CFuncPtr as _CFuncPtr from _ctypes import __version__ as _ctypes_version from _ctypes import RTLD_LOCAL, RTLD_G...
lgpl-3.0
-787,998,514,830,317,700
30.460259
97
0.597859
false
seocam/mirror-test
colab/super_archives/managers.py
2
1201
from django.db import models from haystack.query import SearchQuerySet class NotSpamManager(models.Manager): """Only return objects which are not marked as spam.""" def get_queryset(self): return super(NotSpamManager, self).get_queryset().exclude(spam=True) class HighestScore(NotSpamManager): ...
gpl-2.0
-5,718,639,643,900,581,000
26.930233
76
0.605329
false
equa/wal-e
wal_e/worker/s3/s3_deleter.py
14
1104
from wal_e import exception from wal_e import retries from wal_e.worker.base import _Deleter class Deleter(_Deleter): @retries.retry() def _delete_batch(self, page): # Check that all keys are in the same bucket; this code is not # designed to deal with fast deletion of keys from multiple ...
bsd-3-clause
-3,225,231,764,019,943,000
39.888889
73
0.605978
false
joakim-hove/ert
python/python/ert_gui/plottery/plot_style.py
3
2999
class PlotStyle(object): def __init__(self, name, color="#000000", alpha=1.0, line_style="-", marker="", width=1.0, size=7.5, enabled = True): super(PlotStyle, self).__init__() self.name = name self.color = color self.alpha = alpha self.line_style = line_style self.ma...
gpl-3.0
6,010,645,127,361,356,000
25.776786
193
0.573858
false
cogu/autosar
tests/arxml/ar3_datatype_test.py
1
7179
import os, sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))) import autosar from tests.arxml.common import ARXMLTestClass import unittest def _create_packages(ws): package=ws.createPackage('DataType', role='DataType') package.createSubPackage('CompuMethod', rol...
mit
-3,521,616,400,650,964,500
44.616883
122
0.617217
false
thewtex/ITK
Modules/ThirdParty/pygccxml/src/pygccxml/declarations/templates.py
13
3500
# Copyright 2014-2017 Insight Software Consortium. # Copyright 2004-2009 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt """ template instantiation parser This module provides functionality necessary to * :func:`parse <pygccxml.declarations.tem...
apache-2.0
4,146,161,326,367,299,600
24
79
0.676857
false
huggingface/pytorch-transformers
src/transformers/models/auto/__init__.py
1
8236
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
3,838,477,519,862,161,000
38.596154
119
0.660029
false