repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
afb/0install
zeroinstall/injector/handler.py
1
9160
""" Integrates download callbacks with an external mainloop. While things are being downloaded, Zero Install returns control to your program. Your mainloop is responsible for monitoring the state of the downloads and notifying Zero Install when they are complete. To do this, you supply a L{Handler} to the L{policy}. "...
lgpl-2.1
4,241,712,712,980,864,500
31.253521
125
0.69083
false
OpenDroneMap/WebODM
app/api/common.py
1
1763
from django.core.exceptions import ObjectDoesNotExist, SuspiciousFileOperation from rest_framework import exceptions import os from app import models def get_and_check_project(request, project_pk, perms=('view_project',)): """ Django comes with a standard `model level` permission system. You can check whe...
mpl-2.0
4,351,260,022,897,503,700
40.023256
92
0.724334
false
zlcnup/csmath
hw4_lm/lm.py
1
2784
# -*- coding: utf-8 -*- #!/usr/bin/enzl_v python from pylab import * from numpy import * from math import * def data_generator(N): #生成向量函数F:ai*exp(bi*x)的系数数组 zl_mean = [3.4,4.5] zl_cozl_v = [[1,0],[0,10]] zl_coff = np.random.multivariate_normal(zl_mean,zl_cozl_v,N) #生成观测值向量y x = np.random.unif...
mit
-685,786,909,710,917,200
28.573034
124
0.518237
false
atizo/pygobject
ltihooks.py
1
2327
# -*- Mode: Python; py-indent-offset: 4 -*- # ltihooks.py: python import hooks that understand libtool libraries. # Copyright (C) 2000 James Henstridge. # # 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 Fou...
lgpl-2.1
-552,883,266,822,510,400
37.783333
75
0.593468
false
eBay/cronus-agent
agent/agent/lib/agent_thread/deactivate_manifest.py
1
5040
#pylint: disable=W0703,R0912,R0915,R0904,W0105 ''' Copyright 2014 eBay Software Foundation 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 req...
apache-2.0
1,921,334,820,953,624,800
38.069767
153
0.639286
false
cizixs/tftp
tftp/tftp_client.py
1
7600
import sys import struct import binascii import argparse import tftp from tftp import SocketBase from tftp import get_opcode from tftp import default_port from tftp import make_data_packet from tftp import make_ack_packet class State(object): START, DATA = range(2) # Make packet functions. def make_request_pa...
mit
-6,937,391,200,844,491,000
31.340426
83
0.550526
false
mduggan/toumeika
shikin/review.py
1
4611
# -*- coding: utf-8 -*- """ Shikin review page and associated API """ from sqlalchemy import func import datetime import random from flask import render_template, abort, request, jsonify, session from . import app, ocrfix from .model import DocSegment, DocSegmentReview, User from .util import dologin def get_user_o...
bsd-2-clause
2,451,348,942,650,668,500
27.81875
114
0.605942
false
falkTX/Cadence
src/systray.py
1
23718
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # KDE, App-Indicator or Qt Systray # Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.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; e...
gpl-2.0
3,553,723,061,951,008,000
33.624818
130
0.548571
false
Griffiths117/TG-s-IRC
client/IRClient.py
1
4985
import socket, _thread, tkinter as tk, tkinter.ttk as ttk from time import strftime, sleep from tkinter import messagebox, simpledialog #===========================================================================# class BasicInputDialog: def __init__(self,question,title=None,hideWindow=True): if title == ...
mit
-6,780,789,818,688,822,000
29.956522
141
0.595907
false
xunilrj/sandbox
courses/MITx/MITx 6.86x Machine Learning with Python-From Linear Models to Deep Learning/project3/mnist/part2-twodigit/mlp.py
1
2432
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from train_utils import batchify_data, run_epoch, train_model, Flatten import utils_multiMNIST as U path_to_data_dir = '../Datasets/' use_mini_dataset = True batch_size = 64 nb_classes = 10 nb_epoch = 30 num_classes = 10 img_rows, im...
apache-2.0
6,854,202,822,458,918,000
33.253521
126
0.636924
false
TraceContext/tracecontext-spec
test/server.py
1
3239
from aiohttp import ClientSession, ClientTimeout, ContentTypeError, web from multidict import MultiDict class AsyncTestServer(object): scopes = {} def __init__(self, host, port, timeout = 5): self.host = host self.port = port self.timeout = ClientTimeout(total = timeout) self.app = web.Application() self....
apache-2.0
-567,431,452,355,279,040
27.663717
82
0.661624
false
kichkasch/pisi
pisiconstants.py
1
4235
""" Module for definition of shared constants between the modules. This file is part of Pisi. Pisi 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 ...
gpl-3.0
-7,278,563,369,972,107,000
48.244186
178
0.756789
false
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/openmdao.main-0.13.0-py2.7.egg/openmdao/main/test/test_scaler_adder_example.py
1
5419
""" Tests the scaler/adder example in our docs. This test was inconvenient to test in its place in the docs. """ # pylint: disable-msg=C0111,C0103 import unittest from openmdao.lib.datatypes.api import Float from openmdao.lib.drivers.api import SLSQPdriver from openmdao.main.api import Assembly,Component from openmda...
gpl-2.0
-6,789,788,535,626,708,000
33.737179
114
0.60823
false
ruuk/service.xbmc.tts
enabler.py
1
3477
# -*- coding: utf-8 -*- import os, sys, xbmc, xbmcaddon DISABLE_PATH = os.path.join(xbmc.translatePath('special://profile').decode('utf-8'), 'addon_data', 'service.xbmc.tts', 'DISABLED') ENABLE_PATH = os.path.join(xbmc.translatePath('special://profile').decode('utf-8'), 'addon_data', 'service.xbmc.tts', 'ENABLED') de...
gpl-2.0
9,017,643,453,152,437,000
32.12381
187
0.625252
false
uclouvain/osis
base/models/session_exam_deadline.py
1
4136
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
-3,591,662,348,334,433,300
42.072917
117
0.685127
false
eharney/cinder
cinder/tests/unit/volume/drivers/dell_emc/sc/test_fc.py
1
43968
# Copyright (c) 2014 Dell 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 a...
apache-2.0
-1,594,430,307,689,691,000
48.513514
79
0.455854
false
mabhub/Geotrek
geotrek/settings/base.py
1
17906
import os import sys from django.contrib.messages import constants as messages from geotrek import __version__ from . import PROJECT_ROOT_PATH def gettext_noop(s): return s DEBUG = False TEMPLATE_DEBUG = DEBUG TEST = 'test' in sys.argv VERSION = __version__ ADMINS = ( ('Makina Corpus', 'geobi@makina-corp...
bsd-2-clause
-7,784,692,578,393,617,000
30.414035
108
0.631744
false
fiji-flo/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/environment.py
1
8310
import json import os import multiprocessing import signal import socket import sys import time from mozlog import get_default_logger, handlers, proxy from wptlogging import LogLevelRewriter from wptserve.handlers import StringHandler here = os.path.split(__file__)[0] repo_root = os.path.abspath(os.path.join(here, o...
mpl-2.0
7,157,560,631,007,877,000
32.373494
106
0.58231
false
jelly/calibre
manual/conf.py
2
7503
# -*- coding: utf-8 -*- # # calibre documentation build configuration file, created by # sphinx-quickstart.py on Sun Mar 23 01:23:55 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pick...
gpl-3.0
4,534,027,237,254,408,000
30.389121
111
0.692082
false
nmarcetic/weblines.io
weblines/apps/cms/tests/test_models.py
1
2950
""" Domain objects test suites """ from django.db import IntegrityError from django.test import TestCase from weblines.apps.cms import models class PageTestCase(TestCase): """ Contains page-related test scenarios """ def test_creation(self): """ Tests various creation scenarios ...
gpl-2.0
6,279,059,706,440,562,000
32.146067
79
0.606102
false
sojournexx/python
Assignments/TanAndrew_assign6.py
1
5318
#Andrew Tan, 3/25, Section 010 import myfunctions import random #Ask user for inputs and check validity while True: qns = int(input("How many problems would you like to attempt? ")) if qns <= 0: print("Invalid number, try again\n") continue else: break while True: ...
mit
-6,892,856,213,811,609,000
28.045198
223
0.511847
false
DBHeise/fileid
runtests.py
1
2380
import requests, json, argparse, os, subprocess, xmltodict envDict = {} ignoreFiles = [".gitignore",".gitattributes","LICENSE"] ignoreExt = [".md",".txt",".json",".ps1",".py"] def findBinaries(basefolder): testBinaries = [] fileidBinaries = [] for root, dirs, files in os.walk(basefolder): for file in files: i...
mit
-585,351,895,886,946,000
27.011765
84
0.678992
false
tradej/pykickstart-old
tests/commands/zerombr.py
1
1629
# # Martin Gracik <mgracik@redhat.com> # # Copyright 2009 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that it # will be use...
gpl-2.0
-8,884,366,830,419,637,000
33.659574
79
0.710866
false
FEniCS/dolfin
demo/undocumented/adaptive-poisson/python/demo_adaptive-poisson.py
1
2889
"""This demo program solves Poisson's equation - div grad u(x, y) = f(x, y) on the unit square with source f given by f(x, y) = exp(-100(x^2 + y^2)) and homogeneous Dirichlet boundary conditions. Note that we use a simplified error indicator, ignoring edge (jump) terms and the size of the interpolation con...
lgpl-3.0
-1,866,448,215,433,288,200
29.410526
87
0.661821
false
theintencity/flash-videoio
examples/django-apps/project/experts/models.py
1
3541
import datetime from google.appengine.api import users from google.appengine.ext import db class User(db.Model): name = db.StringProperty('Full Name') account = db.UserProperty() phone_number = db.PhoneNumberProperty('Phone Number') address = db.PostalAddressProperty('Postal Address') website = db....
lgpl-3.0
-634,891,817,617,899,600
36.680851
153
0.672409
false
thesilencelies/SonnetConvs
InceptionModule.py
1
1790
#implimentation of the standard inceptionnet v3 inception module in sonnet import tensorflow as tf import sonnet as snt class InceptionModule(snt.AbstractModule): def __init__(self, output_channels, name="inception_module"): super(InceptionModule, self).__init__(name=name) self._output_channels = output_cha...
apache-2.0
-6,797,985,732,095,887,000
43.75
81
0.632961
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations/_hub_virtual_network_connections_operations.py
1
8982
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
4,938,271,912,548,516,000
48.9
215
0.656647
false
YutingZhang/lmdis-rep
exp-ae-aflw-30.py
1
2231
import tensorflow as tf import os import sys from copy import copy from model.pipeline import Pipeline from tensorflow.python import debug as tf_debug if __name__ == "__main__": num_keypoints = 30 patch_feature_dim = 8 decoding_levels = 5 kp_transform_loss = 1e4 recon_weight = 0.001 learni...
apache-2.0
-6,170,820,400,219,724,000
32.298507
121
0.618557
false
q14035/pimouse_ros
scripts/motors2.py
1
2178
#!/usr/bin/env python #encoding: utf8 import sys, rospy, math from pimouse_ros.msg import MotorFreqs from geometry_msgs.msg import Twist from std_srvs.srv import Trigger, TriggerResponse class Motor(): def __init__(self): if not self.set_power(False): sys.exit(1) rospy.on_shutdown(self.set_power) self.sub_raw ...
gpl-3.0
1,233,239,839,957,850,400
29.676056
87
0.674472
false
antoinecarme/pyaf
tests/perf/test_ozone_debug_perf.py
1
1566
import pandas as pd import numpy as np # from memory_profiler import profile # from memprof import * import pyaf.ForecastEngine as autof import pyaf.Bench.TS_datasets as tsds #get_ipython().magic('matplotlib inline') # @memprof def test_ozone_debug_perf(): b1 = tsds.load_ozone() df = b1.mPastData # df...
bsd-3-clause
6,925,707,315,643,373,000
25.1
87
0.664112
false
assamite/TwatBot
tweets/reasoning.py
1
4674
''' .. py:module:: reasoning :platform: Unix Reasoning object for the tweets. ''' import logging import traceback logger = logging.getLogger('tweets.default') class Reasoning(): '''Reasoning for the tweets. Class is used to hold information about the tweet's construction, and contains few u...
mit
2,346,785,769,061,129,700
34.409091
104
0.545999
false
forman/dectree
dectree/codegen.py
1
21170
import ast from collections import OrderedDict from io import StringIO from typing import List, Dict, Any, Tuple, Optional import dectree.propfuncs as propfuncs from dectree.config import CONFIG_NAME_INPUTS_NAME, CONFIG_NAME_OUTPUTS_NAME, CONFIG_NAME_PARAMS_NAME from .config import get_config_value, \ CONFIG_NAME_...
mit
-4,495,577,015,104,126,000
43.288703
119
0.531885
false
swarna-k/MyDiary
app/models.py
1
1566
from app import db from werkzeug import generate_password_hash, check_password_hash class User(db.Model): id = db.Column(db.Integer, primary_key = True) firstname = db.Column(db.String(100)) lastname = db.Column(db.String(100)) email = db.Column(db.String(120), unique=True) pwdhash = db.Column(db.String(5...
bsd-3-clause
1,779,423,689,113,203,200
29.705882
75
0.65645
false
omarkadry/rsa_algorithm
RSA.py
1
5283
#!/usr/bin/python #Algoriths Project Part 1a #Omar Kadry #CMSC 441 #Dr. Marron #IMPLEMENTATION NOTES #Python's built in pow function uses Binary Exponentiation and reducing modulo n to compute modular #exponentiation. This is the same algorithm as MODULAR-EXPONENTIATION(a,b,n) as used in the text #For large number mutl...
mit
2,305,337,433,324,493,600
33.305195
633
0.769071
false
mprat/learningjulia
nbconvert_config.py
1
7416
from nbconvert.preprocessors import ExecutePreprocessor, Preprocessor import numpy as np def jekyllurl(path): """ Take the filepath of an image output by the ExportOutputProcessor and convert it into a URL we can use with Jekyll """ return path.replace("../..", "") def svg_filter(svg_xml): "...
mit
-4,977,311,403,519,195,000
38.238095
132
0.551106
false
KmolYuan/pyslvs
test/test_core.py
1
3764
# -*- coding: utf-8 -*- """Pyslvs core module test.""" __author__ = "Yuan Chang" __copyright__ = "Copyright (C) 2016-2021" __license__ = "AGPL" __email__ = "pyslvs@gmail.com" from math import sqrt, radians from pyslvs import ( Coord, SolverSystem, pxy, ppp, plap, pllp, plpp, palp, expr_solving, t_config, par...
agpl-3.0
-3,383,056,336,825,432,600
33.53211
80
0.582359
false
bubbleboy14/cantools
cantools/scripts/index.py
1
8655
""" ### Usage: ctindex [--mode=MODE] [--domain=DOMAIN] [--port=PORT] [--skip=SKIP] ### Options: -h, --help show this help message and exit -m MODE, --mode=MODE may be: 'refcount' (default - count up all foreignkey references for sort orders and such); 'index' (assign ...
mit
-251,470,952,256,595,680
37.300885
118
0.645407
false
mpeuster/son-emu
src/emuvim/api/openstack/openstack_dummies/keystone_dummy_api.py
1
16828
# Copyright (c) 2015 SONATA-NFV and Paderborn University # 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 re...
apache-2.0
-1,443,519,102,164,560,100
35.822757
120
0.455253
false
wuher/diablo
test/test_resource.py
1
23625
# -*- coding: utf-8 -*- # test_resource.py --- # import json import base64 from twisted.internet import defer, reactor from twisted.web import server from twisted.web.test.test_web import DummyRequest from twisted.trial import unittest from twisted.internet.defer import succeed from twisted.python import log from t...
mit
5,369,552,455,020,991,000
32.274648
85
0.607619
false
arpadpe/plover
plover/machine/keyboard.py
1
4230
# Copyright (c) 2010 Joshua Harlan Lifton. # See LICENSE.txt for details. "For use with a computer keyboard (preferably NKRO) as a steno machine." from plover.machine.base import StenotypeBase from plover.oslayer.keyboardcontrol import KeyboardCapture class Keyboard(StenotypeBase): """Standard stenotype interfa...
gpl-2.0
-4,720,774,508,469,126,000
35.153846
86
0.591253
false
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/nose-0.10.1-py2.5.egg/nose/plugins/isolate.py
1
3674
"""Use the isolation plugin with --with-isolation or the NOSE_WITH_ISOLATION environment variable to clean sys.modules after each test module is loaded and executed. The isolation module is in effect similar to wrapping the following functions around the import and execution of each test module:: def setup(module...
bsd-3-clause
-7,653,814,076,835,601,000
36.489796
76
0.67828
false
graik/labhamster
labhamster/admin.py
1
12409
## Copyright 2016 - 2018 Raik Gruenberg ## This file is part of the LabHamster project (https://github.com/graik/labhamster). ## LabHamster is released under the MIT open source license, which you can find ## along with this project (LICENSE) or at <https://opensource.org/licenses/MIT>. from __future__ import unicode...
mit
5,380,798,477,713,165,000
34.864162
128
0.539608
false
fdudatamining/framework
tests/draw/test_simple.py
1
1233
import numpy as np import pandas as pd from unittest import TestCase from framework import draw X = np.array([1, 2, 3, 4, 5]) class TestSimplePlots(TestCase): def test_kinds(self): self.assertIsNotNone(draw.draw_kinds) def test_line(self): draw.draw(clear=True, kind='line', x=X, y=X) draw.draw(clear=...
gpl-2.0
-2,851,734,426,032,515,600
29.073171
78
0.636659
false
wa3l/mailr
email_model.py
1
1590
from flask.ext.sqlalchemy import SQLAlchemy import html2text as convert import time db = SQLAlchemy() class Email(db.Model): """ Email model Store emails going through the app in a database. """ id = db.Column(db.Integer, primary_key=True) to_email = db.Column(db.String(254)) to_name ...
mit
-104,383,001,852,401,000
28.444444
74
0.583648
false
ronaldsantos63/Gera_SPED_SysPDV
resources_rc.py
1
125636
# -*- coding: utf-8 -*- # Resource object code # # Created: ter 29. set 21:52:13 2015 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x01\x57\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\...
mit
4,097,503,754,306,612,700
58.234323
129
0.724808
false
QualiSystems/AWS-Shell
package/tests/test_domain_services/test_instance_waiter.py
1
6035
from unittest import TestCase from mock import Mock, patch from cloudshell.cp.aws.domain.services.waiters.instance import InstanceWaiter instance = Mock() instance.state = {'Name': ''} class helper: @staticmethod def change_to_terminate(a): instance.state['Name'] = InstanceWaiter.TERMINATED @st...
isc
-1,264,604,737,494,325,500
40.335616
112
0.612262
false
juju/juju-gui-charm
hooks/charmhelpers/core/templating.py
1
3186
# Copyright 2014-2015 Canonical Limited. # # This file is part of charm-helpers. # # charm-helpers is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 as # published by the Free Software Foundation. # # charm-helpers is distributed in the hope ...
agpl-3.0
-3,079,095,182,892,421,000
38.333333
84
0.677652
false
nkalodimas/invenio
modules/bibupload/lib/bibupload.py
1
143104
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 ...
gpl-2.0
413,680,829,889,584,100
48.092281
287
0.555743
false
kivy/plyer
plyer/facades/wifi.py
1
4169
''' Wifi Facade. ============= The :class:`Wifi` is to provide access to the wifi of your mobile/ desktop devices. It currently supports `connecting`, `disconnecting`, `scanning`, `getting available wifi network list` and `getting network information`. Simple examples --------------- To enable/ turn on wifi scannin...
mit
-8,623,485,429,783,333,000
21.294118
74
0.623411
false
jakevdp/lombscargle
lombscargle/implementations/utils.py
1
5934
from __future__ import print_function, division import numpy as np try: from scipy import special as scipy_special except ImportError: scipy_special = None # Precomputed factorials FACTORIALS = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800, 8717829120...
bsd-3-clause
7,082,537,745,301,977,000
30.903226
79
0.582406
false
17zuoye/luigi
luigi/contrib/hdfs/snakebite_client.py
1
10933
# -*- 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
-2,731,325,352,027,294,000
38.90146
120
0.60697
false
a25kk/biobee
docs/conf.py
1
5997
# -*- coding: utf-8 -*- # Build configuration file. # This file is execfile()d with the current directory set to its # containing dir. # Note that not all possible configuration values are present in this # autogenerated file. # All configuration values have a default; values that are commented out # serve to show the ...
mit
-6,147,307,173,122,633,000
31.770492
79
0.711689
false
zmathew/django-backbone
backbone/tests/tests.py
1
28973
from __future__ import unicode_literals import datetime from decimal import Decimal import json from django.contrib.auth.models import User, Permission from django.core.urlresolvers import reverse from django.test import TestCase from django.utils.translation import ugettext as _ from backbone.tests.models import Pr...
bsd-3-clause
-2,077,347,136,853,208,800
42.243284
109
0.636731
false
kapilt/cloud-custodian
c7n/resources/s3.py
1
112011
# Copyright 2015-2017 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
-1,985,373,751,195,002,600
34.820595
132
0.518708
false
jonathanstrong/functor
setup.py
1
1091
#!/usr/bin/env python # Bootstrap installation of Distribute import distribute_setup distribute_setup.use_setuptools() import os from setuptools import setup PROJECT = u'Functor' VERSION = '0.1' URL = '' AUTHOR = u'Jonathan Strong' AUTHOR_EMAIL = u'jonathan.strong@gmail.com' DESC = "Implements a function-object pa...
mit
4,604,809,639,414,675,000
20.82
63
0.628781
false
fusic-com/flask-webcache
tests/test_storage.py
1
12927
from __future__ import unicode_literals import unittest from datetime import timedelta, datetime from six.moves.cPickle import dumps, loads from six import iteritems from flask import Flask, send_file from werkzeug.wrappers import Response from werkzeug.datastructures import HeaderSet from werkzeug.contrib.cache impor...
mit
-3,667,972,195,193,208,300
45.003559
117
0.61886
false
eroicaleo/LearningPython
interview/leet/124_Binary_Tree_Maximum_Path_Sum.py
1
1054
#!/usr/bin/env python from tree import * class Solution: def maxPathSum(self, root): """ :type root: TreeNode :rtype: int """ if root == None: return 0 self.maxSum = root.val self.maxPathSumNode(root) return self.maxSum def maxPathSu...
mit
-2,902,822,416,752,697,000
30
118
0.598672
false
ChileanVirtualObservatory/flask_endpoint
endpoint/run.py
1
1314
#This file is part of ChiVO, the Chilean Virtual Observatory #A project sponsored by FONDEF (D11I1060) #Copyright (C) 2015 Universidad Tecnica Federico Santa Maria Mauricio Solar # Marcelo Mendoza # Universidad de Chile Die...
gpl-3.0
6,914,507,212,773,058,000
47.666667
81
0.667428
false
niklasf/python-prompt-toolkit
prompt_toolkit/layout/utils.py
1
2590
from __future__ import unicode_literals from prompt_toolkit.utils import get_cwidth __all__ = ( 'token_list_len', 'token_list_width', 'token_list_to_text', 'explode_tokens', 'find_window_for_buffer_name', ) def token_list_len(tokenlist): """ Return the amount of characters in this token ...
bsd-3-clause
693,291,599,595,765,100
23.205607
80
0.602317
false
devbitstudio/portfolio
settings.py
1
5950
# Django settings for devbitstudio project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG DOMAIN = 'devbitstudio.com' EMAIL_HOST = 'localhost' EMAIL_PORT = 25 #~ DEFAULT_FROM_EMAIL = 'contact@devbitstudio.com' SERVER_EMAIL = 'contact@devbitstudio.com' EMAIL_SUBJECT_PREFIX = 'DevBitStudio - ' CURRENT_PATH = os.path...
mit
-7,184,461,981,706,605,000
32.806818
120
0.689412
false
ChromeDevTools/devtools-frontend
scripts/deps/roll_deps.py
2
2410
#!/usr/bin/env vpython # # Copyright 2019 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. """ Update manually maintained dependencies from Chromium. """ import argparse import os import shutil import subprocess import sys ...
bsd-3-clause
2,989,384,766,150,173,000
36.076923
84
0.692946
false
google/makani
avionics/motor/motor_client.py
1
50178
#!/usr/bin/python # Copyright 2020 Makani Technologies 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 applicabl...
apache-2.0
-5,446,123,190,470,756,000
35.626277
103
0.645343
false
JarbasAI/JarbasAI
jarbas_models/tf_tacotron/models/modules.py
1
3455
import tensorflow as tf from tensorflow.contrib.rnn import GRUCell def prenet(inputs, is_training, layer_sizes=[256, 128], scope=None): x = inputs drop_rate = 0.5 if is_training else 0.0 with tf.variable_scope(scope or 'prenet'): for i, size in enumerate(layer_sizes): dense = tf.layers...
gpl-3.0
2,314,599,216,257,785,300
31.28972
100
0.541245
false
zhangg/trove
trove/guestagent/datastore/mysql/service.py
1
3685
# Copyright 2013 OpenStack Foundation # Copyright 2013 Rackspace Hosting # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 co...
apache-2.0
-3,997,285,619,942,811,600
33.764151
78
0.612212
false
mdomke/signaling
tests/test_signals.py
1
3866
import mock import pytest from signaling.exceptions import InvalidEmit from signaling.exceptions import InvalidSlot from signaling import Signal class Receiver(object): def __init__(self): self.m = mock.Mock() def slot(self): self.m() class TestSignalSlot(object): def setup_method(se...
mit
992,258,306,603,419,400
27.014493
64
0.600103
false
mikemintz/neutron
modules/iq.py
1
4752
# -*- coding: koi8-r -*- ## OJAB iq module ## Copyright (C) Boris Kotov <admin@avoozl.ru> ## ## 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 op...
gpl-2.0
-6,113,828,099,328,659,000
39.271186
195
0.62016
false
smurfix/pybble
pybble/cache/__init__.py
1
1978
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division, unicode_literals ## ## This is part of Pybble, a WMS (Whatever Management System) based on ## Jinja2/Haml, Werkzeug, Flask, and Optimism. ## ## Pybble is Copyright © 2009-2014 by Matthias Urlichs <matthias@urlichs.de>, ## it is li...
gpl-3.0
7,012,280,615,499,374,000
24.960526
82
0.695895
false
natj/bender
paper/figs/fig9.py
1
4141
import numpy as np import math from pylab import * from palettable.wesanderson import Zissou_5 as wsZ import matplotlib.ticker as mtick from scipy.interpolate import interp1d from scipy.interpolate import griddata from scipy.signal import savgol_filter def smooth(xx, yy): yy = savgol_filter(yy, 7, 2) np.cl...
mit
426,456,998,150,507,200
23.358824
92
0.63632
false
gaborvecsei/Color-Tracker
examples/tracking.py
1
2306
import argparse from functools import partial import cv2 import color_tracker # You can determine these values with the HSVColorRangeDetector() HSV_LOWER_VALUE = [155, 103, 82] HSV_UPPER_VALUE = [178, 255, 255] def get_args(): parser = argparse.ArgumentParser() parser.add_argument("-low", "--low", nargs=3,...
mit
-4,765,477,397,888,369,000
34.476923
127
0.647008
false
jefftc/changlab
Betsy/Betsy/modules/convert_simplevariantfile_to_matrix.py
1
8224
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, in_data, out_attributes, user_options, num_cores, out_filename): from genomicode import filelib from genomicode import SimpleVariant...
mit
3,985,949,250,645,467,600
36.552511
79
0.508512
false
wrenchzc/photomanager
tests/test_command_update.py
1
1307
from tests.utils import remove_file from photomanager.lib.pmconst import PMDBNAME from photomanager.commands.index import CommandIndex from photomanager.commands.update import CommandUpdate from photomanager.db.dbutils import get_db_session, close_db_session from photomanager.db.models import ImageMeta cmd_inx_test_ro...
mit
-8,557,492,756,590,856,000
27.955556
118
0.66462
false
dzorlu/sdc-segmentation
train.py
1
4118
import sys import tensorflow as tf from tensorflow.python.ops import math_ops sys.path.append("slim/") slim = tf.contrib.slim TRAIN_DIR = "/tmp/tf" class Trainer(object): def __init__(self, nb_classes, optimizer, learning_rate): self.nb_classes = nb_classes # learning rate can be a placeholder tensor ...
mit
8,798,008,712,275,257,000
41.453608
99
0.639631
false
ge0rgi/cinder
cinder/volume/drivers/dell_emc/vmax/provision_v3.py
1
46116
# Copyright (c) 2012 - 2015 EMC Corporation. # 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 # # Unle...
apache-2.0
-5,951,031,079,355,960,000
42.382879
79
0.574334
false
Aorjoa/aiyara-ceph-dash
.tox/flake8/lib/python2.7/site-packages/flake8/formatting/default.py
1
2191
"""Default formatting class for Flake8.""" from flake8.formatting import base class SimpleFormatter(base.BaseFormatter): """Simple abstraction for Default and Pylint formatter commonality. Sub-classes of this need to define an ``error_format`` attribute in order to succeed. The ``format`` method relies o...
bsd-2-clause
-733,534,517,707,735,400
26.3875
78
0.624829
false
all-of-us/raw-data-repository
rdr_service/lib_fhir/fhirclient_4_0_0/models/endpoint_tests.py
1
6296
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. # 2019, SMART Health IT. import os import io import unittest import json from . import endpoint from .fhirdate import FHIRDate class EndpointTests(unittest.TestCase): def instantiate_from(self, filename): ...
bsd-3-clause
9,115,488,887,219,823,000
48.968254
118
0.676302
false
WisniewskiP/meson
install_meson.py
1
3639
#!/usr/bin/env python3 # Copyright 2013-2014 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by...
apache-2.0
-5,287,735,341,432,281,000
35.029703
89
0.710085
false
Gricha/django-empty
django-empty-auth/newproject/settings.py
1
3305
""" Django settings for newproject project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
unlicense
1,989,905,234,812,430,300
25.653226
75
0.722844
false
SKIRT/PTS
magic/region/panda.py
1
4117
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
agpl-3.0
-4,254,293,722,206,895,000
30.661538
110
0.548105
false
jor-/matrix-decomposition
setup.py
1
2841
# Copyright (C) 2017-2018 Joscha Reimer jor@informatik.uni-kiel.de # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later versi...
agpl-3.0
-9,103,944,859,064,064,000
35.423077
246
0.699754
false
ella/mypage
mypage/pages/migrations/0003_change_default_value_on_site_fk.py
1
3108
from south.db import db from django.db import models from mypage.pages.models import * class Migration: def forwards(self, orm): # Changing field 'Page.site' db.alter_column('pages_page', 'site_id', models.ForeignKey(orm['sites.Site'], default= lambda :settings.SITE_ID)) ...
bsd-3-clause
-1,818,358,948,859,231,000
42.774648
121
0.485521
false
bpsinc-native/src_third_party_libjingle_source_talk
PRESUBMIT.py
2
5115
# libjingle # Copyright 2013 Google Inc. # # 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 above copyright notice, # this list of conditions and the following dis...
bsd-3-clause
-1,188,175,575,473,091,600
43.094828
80
0.682502
false
EvangelouSotiris/flightradiationcalc
main.py
1
5469
import time import requests ############################################################## ############## REQUESTS MANAGEMENT/ LINKS #################### ############################################################## headers = {'User-Agent' : 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52...
gpl-3.0
-8,451,631,178,383,616,000
41.069231
135
0.588956
false
KSG-IT/ksg-nett
api/serializers.py
1
4959
from django.conf import settings from rest_framework import serializers from rest_framework_simplejwt.serializers import TokenObtainSlidingSerializer from api.exceptions import InsufficientFundsException, NoSociSessionError from economy.models import SociProduct, ProductOrder, SociSession, SociBankAccount class Cust...
gpl-3.0
6,613,007,558,135,177,000
36.545455
119
0.650525
false
fordcars/SDL3D
tools/Frameworkify/frameworkify.py
1
3860
#!/usr/bin/env python -S # -*- coding: utf-8 -*- r""" frameworkify ~~~~~~~~~~~~ A small command line tool that can rewrite the paths to dynamic loaded libraries in .dylib files so that they reference other paths. By default it will rewrite the path so that it points to the bundle's Frameworks ...
gpl-3.0
-5,696,709,541,733,503,000
31.720339
78
0.644041
false
william-richard/moto
tests/test_ec2/test_instances.py
1
62435
from __future__ import unicode_literals from botocore.exceptions import ClientError import pytest from unittest import SkipTest import base64 import ipaddress import six import boto import boto3 from boto.ec2.instance import Reservation, InstanceAttribute from boto.exception import EC2ResponseError from freezegun i...
apache-2.0
-5,225,527,537,591,672,000
35.704879
155
0.682262
false
acbilson/forbidden-island
tests/test_print.py
1
1905
import sys sys.path.append('../src') from tiles import * from tile import * class Test(object): def __init__(self): self.board = "" def gen_board(self, tiles): segments = [] rows = [[0,1], [2,3,4,5], [6,7,8,9,10,11], [12,13,14,15,16...
gpl-3.0
8,462,663,968,441,839,000
23.74026
104
0.467192
false
Inboxen/website
views/inbox/delete.py
1
2017
## # Copyright (C) 2013 Jessica Tallon & Matt Molyneaux # # This file is part of Inboxen. # # Inboxen is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, o...
agpl-3.0
-7,981,159,622,210,445,000
36.351852
118
0.706495
false
juan-cb/django-cookie-law
setup.py
1
1609
#!/usr/bin/env python import os from setuptools import setup, find_packages from itertools import chain from glob import glob import cookielaw CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', ...
bsd-2-clause
-8,123,308,249,982,098,000
27.22807
88
0.649472
false
sonali0901/zulip
analytics/views.py
1
37020
from __future__ import absolute_import, division from django.conf import settings from django.core import urlresolvers from django.db import connection from django.db.models import Sum from django.db.models.query import QuerySet from django.http import HttpResponseNotFound, HttpRequest, HttpResponse from django.templa...
apache-2.0
1,357,763,504,589,575,200
32.502262
123
0.557969
false
luboslenco/cyclesgame
blender/arm/utils.py
1
24354
import bpy import json import os import glob import platform import zipfile import re import subprocess import webbrowser import numpy as np import arm.lib.armpack import arm.make_state as state import arm.log as log class NumpyEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, np.ndarra...
lgpl-3.0
2,749,772,502,997,039,600
35.08
127
0.581137
false
ozamiatin/glance
glance/common/utils.py
1
26028
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2014 SoftLayer Technologies, Inc. # Copyright 2015 Mirantis, Inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
29,378,260,714,325,270
34.078167
79
0.552059
false
keitaroyam/yamtbx
cctbx_progs/dano_vs_d.py
1
1364
""" Usage: phenix.python dano_vs_d.py your.sca 20 """ import iotbx.file_reader from cctbx.array_family import flex def run(hklin, n_bins): for array in iotbx.file_reader.any_file(hklin).file_server.miller_arrays: # skip if not anomalous intensity data if not (array.is_xray_intensity_array() and a...
bsd-3-clause
3,833,057,630,944,875,500
31.47619
88
0.60044
false
jamespcole/home-assistant
homeassistant/components/eight_sleep/binary_sensor.py
1
1832
"""Support for Eight Sleep binary sensors.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice from . import CONF_BINARY_SENSORS, DATA_EIGHT, NAME_MAP, EightSleepHeatEntity _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['eight_sleep'] async def async_setup_platform(hass,...
apache-2.0
-4,521,372,871,055,284,700
28.548387
77
0.622817
false
iw3hxn/LibrERP
purchase_order_version/models/inherit_purchase_order_line.py
1
2019
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2004-2014 Didotech srl (<http://www.didotech.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
agpl-3.0
2,852,159,605,738,768,400
43.866667
120
0.616642
false
Tealium/nagios
files/default/plugins/check_mongodb_backup.py
1
6143
#!/usr/bin/env python desc = """ Checks the status of the most recent MongoDB backup or, with the --snap option, checks that the snapshots for the most recent backup were completed. """ import kazoo from kazoo.client import KazooClient from kazoo.client import KazooState import yaml import argparse import time from d...
apache-2.0
3,951,950,523,133,966,300
27.178899
110
0.608335
false
fkie/rosrepo
src/rosrepo/util.py
1
6206
# coding=utf-8 # # ROSREPO # Manage ROS workspaces with multiple Gitlab repositories # # Author: Timo Röhling # # Copyright 2016 Fraunhofer FKIE # # 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 a...
apache-2.0
8,527,631,097,278,525,000
28.131455
155
0.652538
false
Hearen/OnceServer
pool_management/bn-xend-core/xend/BNVMAPI.py
1
374814
import traceback import inspect import os import Queue import string import sys import threading import time import xmlrpclib import socket import struct import copy import re import XendDomain, XendDomainInfo, XendNode, XendDmesg, XendConfig import XendLogging, XendTaskManager, XendAPIStore, XendIOCont...
mit
-6,386,652,897,247,954,000
40.294742
164
0.508084
false
KyleKing/PiAlarm
.archive-python/modules/tm1637.py
1
6795
"""Manipulate a TM1637 7-segment display.""" import math import threading from time import localtime, sleep from . import config as cg from .context import IO IO.setwarnings(False) IO.setmode(IO.BCM) HexDigits = [0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, ...
mit
-4,063,615,821,204,735,500
28.16309
98
0.547903
false
fresskarma/tinyos-1.x
tools/python/pytos/util/MessageSnooper.py
1
4759
#!/usr/bin/python #$Id: MessageSnooper.py,v 1.2 2005/10/27 02:23:37 kaminw Exp $ # "Copyright (c) 2000-2003 The Regents of the University of California. # All rights reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose, without fee, and without written a...
bsd-3-clause
8,937,040,000,648,870,000
37.691057
98
0.709603
false
stankovski/AutoRest
ClientRuntimes/Python/msrestazure/msrestazure/azure_active_directory.py
1
17399
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
mit
1,136,198,482,296,480,600
37.488938
79
0.620797
false