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
achow101/bitcoin
contrib/devtools/test-security-check.py
13
5500
#!/usr/bin/env python3 # Copyright (c) 2015-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Test script for security-check.py ''' import os import subprocess import unittest def write_testcode(...
mit
1,314,844,903,281,383,400
55.122449
184
0.628545
false
archix/SimpleAPIBoilerplate
utils/models/meta.py
1
9690
from flask import json from sqlalchemy import not_ import datetime from extensions import db class Model(db.Model): """Base SQLAlchemy Model for automatic serialization and deserialization of columns and nested relationships. Usage:: >>> class User(Model): >>> id = db.Column(db.Integ...
gpl-3.0
-7,038,442,577,098,879,000
37.300395
97
0.44066
false
jforge/brick-mqtt-proxy
brick-mqtt-proxy.py
1
99496
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Brick MQTT Proxy Copyright (C) 2015-2017 Matthias Bolte <matthias@tinkerforge.com> Copyright (C) 2017 Ishraq Ibne Ashraf <ishraq@tinkerforge.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License a...
gpl-2.0
-7,394,515,960,011,033,000
51.783024
307
0.604185
false
open-cloud/xos
lib/xos-genx/xosgenx/generator.py
2
14235
# Copyright 2017-present Open Networking 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 required by applicable law or agr...
apache-2.0
-6,051,380,843,218,182,000
34.5875
114
0.539867
false
vzer/ToughRADIUS
toughradius/console/admin/param_forms.py
1
4870
#coding:utf-8 from toughradius.console.libs import pyforms from toughradius.console.libs.pyforms import dataform from toughradius.console.libs.pyforms import rules from toughradius.console.libs.pyforms.rules import button_style,input_style boolean = {0:u"否", 1:u"是"} booleans = {'0': u"否", '1': u"是"} bool_bypass = {'0'...
agpl-3.0
-5,280,956,592,056,908,000
51.545455
148
0.712061
false
deepmind/dm-haiku
haiku/_src/embed_test.py
1
3751
# Copyright 2019 DeepMind Technologies Limited. 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 ...
apache-2.0
-4,315,887,944,373,415,400
34.056075
80
0.656625
false
hasgeek/lastuser
lastuser_core/models/helpers.py
1
2867
# -*- coding: utf-8 -*- from .user import ( USER_STATUS, User, UserEmail, UserEmailClaim, UserExternalId, UserOldId, db, ) __all__ = ['getuser', 'getextid', 'merge_users'] def getuser(name): if '@' in name: # TODO: This should have used UserExternalId.__at_username_services__...
bsd-2-clause
-5,985,482,440,712,031,000
34.395062
102
0.611789
false
devnev/sesspy
setup.py
1
1354
from setuptools import setup, find_packages setup( name = "sesspy", version = "0.3.1", url = "http://nevill.ch/sesspy/", packages = find_packages(exclude=['tests']), install_requires = [], extras_require = { "sqlalchemy": ["sqlalchemy"], }, package_data = { '': [ ...
gpl-3.0
6,859,801,116,403,127,000
32.02439
89
0.584934
false
AndyDeany/pygame-template
pygametemplate/console.py
1
1213
from pygametemplate.hotkey import Hotkey class Console(object): def __init__(self, game, *, toggle_fps_hotkey=None): """Create a Console instance. `toggle_fps_hotkey` defaults to Ctrl+F. """ self.game = game toggle_fps_hotkey = toggle_fps_hotkey or Hotkey(self.game, "f", ...
mit
-2,817,762,012,081,443,000
30.102564
82
0.588623
false
CJnZ/Unblock-Youku
dns-reverse-proxy/url-list-manager.py
10
5917
# vim:fileencoding=utf-8:sw=4:et:syntax=python # Update url_list online https = require("https") http = require("http") fs = require("fs") murl = require("url") shared_urls = require("../shared/urls.js") lutils = require("./lutils") log = lutils.logger def require_str(content, fname): """require() call using str...
agpl-3.0
7,555,295,378,061,583,000
31.872222
107
0.545209
false
TheWardoctor/Wardoctors-repo
plugin.video.saltsrd.lite/default.py
1
142269
""" SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
apache-2.0
-731,917,117,904,936,000
50.453526
236
0.602577
false
mathandy/svgtree
rings4rings.py
1
48738
from misc4rings import (Theta_Tstar, normalLineAtT_toInner_intersects_withOuter, isDegenerateSegment, isCCW, areaEnclosed, isApproxClosedPath, pathXpathIntersections, remove_degenerate_segments) import options4rings as opt from andysmod import bool...
mit
2,867,992,715,726,004,000
48.330972
296
0.569843
false
roadmapper/ansible
lib/ansible/modules/network/nxos/nxos_snmp_traps.py
18
7641
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
8,242,341,957,177,713,000
31.514894
96
0.574663
false
somic/paasta
paasta_tools/frameworks/task_store.py
1
8406
import copy import json from typing import Any from typing import Dict from typing import Tuple from typing import Type from typing import TypeVar from typing import Union from kazoo.client import KazooClient from kazoo.exceptions import BadVersionError from kazoo.exceptions import NodeExistsError from kazoo.exception...
apache-2.0
-8,859,340,874,580,179,000
35.547826
117
0.623007
false
GregWatson/PyVeri
VeriParser/PreProcess.py
1
12739
################################################## # # PreProcess - class to perform preprcoessing on a raw source file # ################################################## import ParserError, re from SourceText import SourceText from VMacro import VMacro from ParserHelp import * import sys ''' Preprocess a source v...
mit
-2,614,302,628,154,292,000
39.699681
105
0.488578
false
SLAMon/SLAMon
slamon/afm/tests/testing_routes_tests.py
2
5058
from slamon.afm.routes.testing import testing_routes # Shows as unused but is actually required for routes from slamon.afm.afm_app import app from slamon.afm.tests.agent_routes_tests import AFMTest from webtest import TestApp import jsonschema class TestDevRoutes(AFMTest): task_list_response_schema = { '...
apache-2.0
-4,732,729,330,317,374,000
34.125
118
0.507513
false
systers/hyperkitty
example_project/wsgi.py
2
1173
""" WSGI config for HyperKitty project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/wsgi/ """ import os # import sys # import site # For some unknown reason, sometimes mod...
gpl-3.0
-6,744,704,900,840,194,000
29.868421
78
0.685422
false
tswast/google-cloud-python
vision/google/cloud/vision_v1p3beta1/gapic/product_search_client_config.py
4
4551
config = { "interfaces": { "google.cloud.vision.v1p3beta1.ProductSearch": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], "non_idempotent": [], }, "retry_params": { "default": { "in...
apache-2.0
3,453,082,347,446,821,000
39.274336
67
0.3931
false
margguo/python-ivi
ivi/agilent/agilent6038A.py
7
1739
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
mit
-7,735,010,441,181,392,000
33.78
77
0.67165
false
number7/budgetminder
GData/Tests/GDataTestHTTPServer.py
2
9502
#!/usr/bin/python # # 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 # ...
mit
-7,799,563,558,175,543,000
33.933824
80
0.656072
false
jtk54/spinnaker
testing/citest/spinnaker_testing/base_scenario_support.py
2
4469
# Copyright 2017 Google Inc. 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 applicable law or a...
apache-2.0
3,706,213,101,113,180,700
35.333333
79
0.703066
false
fluentpython/example-code
03-dict-set/support/container_perftest.py
7
1460
""" Container ``in`` operator performance test """ import sys import timeit SETUP = ''' import array selected = array.array('d') with open('selected.arr', 'rb') as fp: selected.fromfile(fp, {size}) if {container_type} is dict: haystack = dict.fromkeys(selected, 1) else: haystack = {container_type}(selected...
mit
2,378,384,408,277,433,000
25.545455
70
0.583562
false
hiuwo/acq4
acq4/analysis/tools/Utility.py
1
37603
""" Utils.py - general utility routines - power spectrum - elliptical filtering - handling very long input lines for dictionaries - general measurement routines for traces (mean, std, spikes, etc) "declassed", 7/28/09 p. manis Use as: import Utility as Utils then call Utils.xxxxx() """ # January, 2009 # Paul B. Manis...
mit
8,074,997,900,721,364,000
35.975418
557
0.568705
false
ecreall/nova-ideo
novaideo/views/user_management/see_registrations.py
1
2583
# Copyright (c) 2014 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi from pyramid.view import view_config from substanced.util import Batch from dace.util import getSite from dace.objectofcollaboration.principal.util import get_current...
agpl-3.0
-6,852,239,687,660,419,000
30.888889
80
0.663957
false
x2Ident/x2Ident
mitmproxy/test/netlib/http/test_response.py
2
4795
from __future__ import absolute_import, print_function, division import email import time from netlib.http import Headers from netlib.http import Response from netlib.http.cookies import CookieAttrs from netlib.tutils import raises, tresp from .test_message import _test_passthrough_attr, _test_decoded_attr...
gpl-3.0
-1,903,286,615,273,040,000
31.767606
111
0.582273
false
hguemar/cinder
cinder/tests/api/contrib/test_volume_type_access.py
8
13569
# # 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
-7,550,927,305,561,521,000
43.782178
78
0.570713
false
cgstudiomap/cgstudiomap
main/eggs/python_stdnum-1.2-py2.7.egg/stdnum/at/businessid.py
3
2268
# businessid.py - functions for handling Austrian company register numbers # # Copyright (C) 2015 Holvi Payment Services Oy # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by t...
agpl-3.0
-8,678,424,513,366,203,000
31.4
75
0.71649
false
bafana5/wKRApp
wKRApp/views.py
1
3366
from wKRApp import app from flask import Flask, render_template, url_for, request, redirect, session, flash, g from flask.ext.sqlalchemy import SQLAlchemy from ipdb import set_trace from functools import wraps # import sqlite3 # config import os # app.config.from_object(os.environ['APP_SETTINGS']) # app.config.from_...
mit
-4,646,386,358,432,778,000
24.892308
94
0.641117
false
ua-snap/downscale
snap_scripts/baseline_climatologies/cru_cl20_climatology_preprocess_2km_OLD.py
1
6667
# # # PREPROCESS CRU CL20 1961-1990 CLIMATOLOGY DATA (http://www.cru.uea.ac.uk/cru/data/hrg/tmc) # # author: Michael Lindgren (malindgren@alaska.edu) -- Sept. 2016 # # # # import numpy as np def xyz_to_grid( x, y, z, xi, yi, method='linear', output_dtype=np.float32 ): ''' interpolate points to a grid. simple wrappe...
mit
-7,133,843,686,221,857,000
42.292208
195
0.666717
false
jazkarta/edx-platform-for-isc
lms/djangoapps/instructor/tests/test_enrollment.py
6
18109
# -*- coding: utf-8 -*- """ Unit tests for instructor.enrollment methods. """ import json import mock from abc import ABCMeta from courseware.models import StudentModule from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from django.utils.translation impor...
agpl-3.0
-4,978,220,356,829,922,000
33.487619
128
0.62946
false
picolix/cf-php-bluemix
lib/httpd/extension.py
14
1792
# 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 use ...
apache-2.0
-8,392,346,827,973,793,000
31.581818
74
0.628906
false
josanvel/BazarPapeleriaLulita
CodigoBazarLulita/IngresarProducto.py
1
4034
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ingresarproducto.ui' # # Created: Sun Mar 15 12:31:18 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 exce...
gpl-2.0
-6,358,320,857,863,521,000
50.063291
173
0.699058
false
msjoinder/EXIFzero
minimal_exif_writer.py
1
16830
""" Offers one class, MinimalExifWriter, which takes a jpg filename in the constructor. Allows you to: remove exif section, add image description, add copyright. Typical usage: f = MinimalExifWriter('xyz.jpg') f.newImageDescription('This is a photo of something very interesting!') f.newCopyright('Jose Blow, All Righ...
gpl-3.0
-8,163,865,281,723,483,000
35.58913
140
0.598515
false
jirikuncar/invenio
invenio/modules/search/searchext/units/citedexcludingselfcites.py
7
1653
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 # License, or (at your option) any...
gpl-2.0
-4,106,544,662,706,156,000
37.44186
78
0.701149
false
f03lipe/eMec-db-retriever
src/queryassembler.py
1
4942
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- """ This module defines the QueryAssembler class. Part of the pydbcollector package. by @f03lipe, 2011-2012 """ class QueryAssembler(object): """ Assembles an SQL query to retrieve data from server. This class defines default query snippets to be added to the queri...
mit
5,283,218,452,178,943,000
38.556452
180
0.641313
false
cfarquhar/openstack-ansible
osa_toolkit/filesystem.py
4
10521
# Copyright 2014, Rackspace US, 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 agreed to in w...
apache-2.0
8,111,415,517,427,129,000
32.4
79
0.652885
false
tempbottle/kwplayer
kuwo/TopList.py
4
4653
# Copyright (C) 2013-2014 LiuLang <gsushzhsosgsu@gmail.com> # Use of this source code is governed by GPLv3 license that can be found # in the LICENSE file. import time from gi.repository import GdkPixbuf from gi.repository import Gtk from kuwo import Config _ = Config._ from kuwo import Net from kuwo import Widget...
gpl-3.0
5,369,660,901,661,805,000
35.928571
80
0.552117
false
MatthieuDartiailh/eapii
eapii/visa/standards.py
1
3643
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # Copyright 2014 by Eapii Authors, see AUTHORS for more details. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENCE, distributed with this software. #------------...
bsd-3-clause
-7,927,440,676,249,917,000
34.028846
79
0.551743
false
looker/sentry
src/sentry/eventtypes/base.py
4
1107
from __future__ import absolute_import from sentry.utils.strings import truncatechars, strip class BaseEvent(object): id = None def __init__(self, data): self.data = data def has_metadata(self): raise NotImplementedError def get_metadata(self): raise NotImplementedError ...
bsd-3-clause
-47,770,865,815,998,790
23.065217
89
0.586269
false
163gal/Time-Line
libs_arm/wx/lib/analogclock/helpers.py
9
27261
# AnalogClock's base classes # E. A. Tacao <e.a.tacao |at| estadao.com.br> # http://j.domaindlx.com/elements28/wxpython/ # 15 Fev 2006, 22:00 GMT-03:00 # Distributed under the wxWidgets license. from time import strftime, localtime import math import wx from styles import * #-----------------------------------...
gpl-3.0
-2,115,285,473,991,342,800
26.676142
79
0.512527
false
jakevdp/megaman
megaman/embedding/tests/test_isomap.py
4
2327
# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE import sys import numpy as np import scipy as sp import scipy.sparse as sparse from scipy.spatial.distance import squareform, pdist from itertools import product from sklearn import manifold, datasets from sklearn.neighbors import NearestNei...
bsd-2-clause
5,677,321,358,824,208,000
37.783333
115
0.658788
false
armab/st2contrib
packs/orion/tests/test_action_node_create.py
1
4998
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
6,106,616,948,749,239,000
35.217391
74
0.516607
false
PatidarWeb/poedit
deps/boost/tools/regression/xsl_reports/boost_wide_report.py
29
29776
# Copyright (c) MetaCommunications, Inc. 2003-2007 # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import shutil import codecs import xml.sax.handler import xml.sax.saxutils import glob import re import os.pat...
mit
4,577,968,203,933,966,300
34.65988
214
0.503728
false
michael-lazar/praw3
tests/test_comments.py
1
11603
"""Tests for Comment class.""" from __future__ import print_function, unicode_literals import pickle import mock from praw import errors, helpers from praw.objects import Comment, MoreComments from .helper import OAuthPRAWTest, PRAWTest, betamax class CommentTest(PRAWTest): def betamax_init(self): self.r...
gpl-3.0
-938,182,191,784,976,600
40.14539
79
0.64242
false
darren-wang/gl
glance/api/middleware/version_negotiation.py
6
3713
# 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
8,677,422,790,592,900,000
33.06422
78
0.615675
false
plumgrid/plumgrid-nova
nova/filters.py
9
3238
# Copyright (c) 2011-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 # # Un...
apache-2.0
3,815,857,725,473,622,500
35.795455
78
0.605312
false
KaranToor/MA450
google-cloud-sdk/.install/.backup/lib/third_party/dulwich/patch.py
7
10594
# patch.py -- For dealing with packed-style patches. # Copyright (C) 2009-2013 Jelmer Vernooij <jelmer@samba.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; version 2 # of the License or ...
apache-2.0
7,687,223,049,708,310,000
33.508143
98
0.597036
false
CINPLA/expipe
setup.py
1
1354
# -*- coding: utf-8 -*- from setuptools import setup import os from setuptools import setup, find_packages long_description = open("README.md").read() with open("requirements.txt", mode='r') as f: install_requires = f.read().split('\n') install_requires = [e for e in install_requires if len(e) > 0] d = {} exec...
gpl-3.0
561,457,691,354,488,400
31.214286
86
0.615669
false
matthiask/django-mooch
mooch/postfinance.py
1
6553
import locale import logging from hashlib import sha1 from django import http from django.conf.urls import url from django.contrib import messages from django.core.exceptions import ImproperlyConfigured, ValidationError from django.core.mail import mail_managers from django.shortcuts import redirect from django.templa...
mit
4,776,739,833,738,807,000
33.489474
88
0.521288
false
arnaudsj/pybrain
pybrain/datasets/reinforcement.py
6
2283
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from sequential import SequentialDataSet from dataset import DataSet from scipy import zeros class ReinforcementDataSet(SequentialDataSet): def __init__(self, statedim, actiondim): """ initialize the reinforcement dataset, add the 3 fields state, acti...
bsd-3-clause
1,552,774,143,539,416,300
39.767857
92
0.638633
false
saandrews/pulsar
pulsar-client-cpp/python/functions/serde.py
2
2664
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
apache-2.0
6,516,800,897,333,343,000
34.065789
75
0.752252
false
repotvsupertuga/tvsupertuga.repository
script.module.liveresolver/lib/liveresolver/resolvers/zerocast.py
10
2171
# -*- coding: utf-8 -*- ''' Liveresolver Add-on Copyright (C) 2016 natko1412 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your opti...
gpl-2.0
-9,051,616,642,844,487,000
35.183333
183
0.609397
false
page-io/Cactus
cactus/tests/integration/s3/__init__.py
9
2048
#coding:utf-8 import os from cactus.deployment.s3.engine import S3DeploymentEngine from cactus.utils.helpers import checksum from cactus.tests.integration import IntegrationTestCase, DebugHTTPSConnectionFactory, BaseTestHTTPConnection, \ TestHTTPResponse class DummyAWSCredentialsManager(object): def __init_...
bsd-3-clause
-4,714,865,855,429,717,000
30.507692
112
0.65918
false
ESS-LLP/erpnext-healthcare
erpnext/manufacturing/report/production_analytics/production_analytics.py
12
4568
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _, scrub from frappe.utils import getdate from erpnext.stock.report.stock_analytics.stock_analytics import (get_period_date_ran...
gpl-3.0
-3,396,043,446,235,539,500
29.251656
126
0.677539
false
guillaumebel/nibbles-clutter
gnome-sudoku/src/lib/colors.py
1
2044
# -*- coding: utf-8 -*- def rgb_to_hsv (r,g,b,maxval=255): if type(r)==int: r = r/float(maxval) if type(g)==int: g = g/float(maxval) if type(b)==int: b = b/float(maxval) # Taken from # http://www.easyrgb.com/math.php?MATH=M20#text20 var_min = min(r,g,b) var_max = max(r,g,b) delta = var_m...
gpl-2.0
-3,950,238,025,224,076,000
27.388889
70
0.457436
false
carlosb1/examples-python
architecture/chatserver.py
1
3299
import socket import select import signal import sys from communication import send, receive class ChatServer(object): def sighandler(self,signum,frame): print('Shutting down server...') for o in self.outputs: o.close() self.server.close() def __init__(self, port=3490, back...
gpl-2.0
6,259,956,968,485,038,000
35.252747
116
0.42528
false
pcdummy/socketrpc
socketrpc/__init__.py
1
6060
# -*- coding: utf-8 -*- # vim: set et sts=4 sw=4 encoding=utf-8: # ############################################################################### # # This file is part of socketrpc, it is a compat library for shared data # between twisted_srpc and gevent_srpc # # Copyright (C) 2011 Rene Jochum <rene@jrit.at> # ######...
bsd-3-clause
8,474,475,311,637,327,000
36.407407
87
0.533993
false
mohierf/mod-webui
module/regenerator.py
1
66203
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # Frederic Mohier, frederic.mohier@gmail.com # # This file is part of Shink...
agpl-3.0
-8,760,738,743,202,586,000
40.068859
116
0.570473
false
johnynek/netmodeler
pytools/gdd.py
2
1337
#!/usr/bin/python #This is a python version of the graph_degree_dist.cpp code: from pynetmod import * net = Network(cin) print "#loaded network" ns = IntStats() if False: for meth in net.getNIMembers(): ns.collectN(net, meth) print "%s (Node):" % meth; print "\tave: %f" % ns.getAverage(); print "\tm2:...
gpl-2.0
5,159,223,848,668,642,000
27.446809
60
0.626028
false
ebar0n/django
tests/backends/tests.py
12
31274
"""Tests related to django.db.backends that haven't been organized.""" import datetime import threading import unittest import warnings from django.core.management.color import no_style from django.db import ( DEFAULT_DB_ALIAS, DatabaseError, IntegrityError, connection, connections, reset_queries, transaction,...
bsd-3-clause
8,204,491,491,207,911,000
38.93742
112
0.620127
false
ImaginaryLandscape/django-cumulus
cumulus/management/commands/syncfiles.py
1
11355
import datetime import fnmatch import optparse import os import re from django.conf import settings from django.core.management.base import CommandError, NoArgsCommand from cumulus.authentication import Auth from cumulus.settings import CUMULUS from cumulus.storage import get_headers, get_content_type, get_gzipped_c...
bsd-3-clause
-4,800,797,637,791,206,000
41.52809
105
0.565214
false
admiralobvious/vyper
vyper/errors.py
1
1587
class ConfigFileNotFoundError(Exception): """Denotes failing to find configuration file.""" def __init__(self, message, locations, *args): self.message = message self.locations = ", ".join(str(l) for l in locations) super(ConfigFileNotFoundError, self).__init__(message, locations, *args...
mit
6,197,484,613,048,238,000
32.765957
86
0.666037
false
theheros/kbengine
kbe/src/lib/python/Lib/unittest/test/test_assertions.py
51
11863
import datetime import warnings import unittest class Test_Assertions(unittest.TestCase): def test_AlmostEqual(self): self.assertAlmostEqual(1.00000001, 1.0) self.assertNotAlmostEqual(1.0000001, 1.0) self.assertRaises(self.failureException, self.assertAlmostEqual,...
lgpl-3.0
-7,332,875,693,342,941,000
40.479021
92
0.515047
false
SoftwareDefinedBuildings/smap
python/tinyos/message/__init__.py
6
1655
# # Copyright (c) 2005 # The President and Fellows of Harvard College. # # 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...
bsd-2-clause
2,143,325,264,955,813,000
52.387097
77
0.772205
false
LiaoPan/blaze
blaze/__init__.py
13
2475
from __future__ import absolute_import, division, print_function try: import h5py # if we import h5py after tables we segfault except ImportError: pass from pandas import DataFrame from odo import odo, convert, append, resource, drop from odo.backends.csv import CSV from odo.backends.json import JSON, JSONLi...
bsd-3-clause
-7,494,897,213,509,236,000
29.9375
80
0.745859
false
tianxiawuzhei/cocos-quick-cpp
publibs/cocos2dx/tools/cocos2d-console/plugins/plugin_package/helper/set_framework_helper.py
6
3934
import os import os.path import json import re import shlex import cocos from MultiLanguage import MultiLanguage class SetFrameworkHelper(object): def __init__(self, project, package_name, version): self._package_name = package_name self._package_path = project["packages_dir"] + os.sep + packag...
mit
7,517,647,855,172,593,000
34.441441
177
0.539654
false
simartin/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/testing/acceptance_test.py
3
40210
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import textwrap import types import attr import py import six import pytest from _pytest.compat import importlib_metadata from _pytest.main import EXIT_NOTESTSCOLL...
mpl-2.0
-4,402,272,539,979,977,700
32.0338
114
0.544971
false
amueller/advanced_training
mglearn/plots.py
1
3078
from .plot_linear_svc_regularization import plot_linear_svc_regularization from .plot_interactive_tree import plot_tree_progressive, plot_tree_partition from .plot_animal_tree import plot_animal_tree from .plot_rbf_svm_parameters import plot_svm from .plot_knn_regression import plot_knn_regression from .plot_knn_classi...
bsd-2-clause
-2,806,230,652,244,266,000
47.09375
89
0.651072
false
dcneeme/d4c
mb.py
1
3615
#mb.py - using pymodbus in serial mode to read and write modbus command. only for linux! # parameters mba regadd count to read # parameters mba regadd hexdata to write (1 register only) # only for archlinux and only for 1 or 2 registers write at this stage # selle too ajal ei tasu muid sama seriali kasutavaid as...
gpl-3.0
-161,333,197,346,817,380
38.617978
123
0.649793
false
rgayon/plaso
plaso/parsers/sqlite_plugins/windows_timeline.py
1
9900
# -*- coding: utf-8 -*- """SQLite parser plugin for Windows 10 Timeline database files.""" from __future__ import unicode_literals import json from dfdatetime import posix_time as dfdatetime_posix_time from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions fro...
apache-2.0
-387,559,241,829,818,050
42.043478
80
0.679596
false
gkoelln/youtube-dl
youtube_dl/extractor/sonyliv.py
24
1529
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import smuggle_url class SonyLIVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?sonyliv\.com/details/[^/]+/(?P<id>\d+)' _TESTS = [{ 'url': "http://www.sonyliv.com/details/episodes/5024612095001...
unlicense
7,466,026,087,372,639,000
37.225
121
0.584696
false
cmajames/py_touhou
pytouhou/games/sample/game.py
1
7672
# -*- encoding: utf-8 -*- ## ## Copyright (C) 2011 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> ## ## 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; version 3 only. ## ## This program is distri...
gpl-3.0
5,043,808,531,601,340,000
43.091954
117
0.512774
false
cscanlin/Super-Simple-VLOOKUP-in-Python
python_vlookup/python_vlookup.py
1
3133
from builtins import input from collections import Iterable import csv # Returns a list of lists, where each row of the csv is a sublist def get_csv_data(csv_file_path): with open(csv_file_path, 'r') as csvfile: for row in csv.reader(csvfile): yield row # Creates a dictionary with the ...
mit
7,505,803,180,778,867,000
38.74026
112
0.629429
false
vgrem/Office365-REST-Python-Client
office365/sharepoint/files/file.py
1
18032
from office365.runtime.client_result import ClientResult from office365.runtime.http.http_method import HttpMethod from office365.runtime.http.request_options import RequestOptions from office365.runtime.queries.service_operation_query import ServiceOperationQuery from office365.runtime.resource_path import ResourcePat...
mit
5,321,818,484,125,837,000
35.95082
120
0.52673
false
cuongnv23/ansible
lib/ansible/modules/network/avi/avi_alertemailconfig.py
27
3729
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # # 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...
gpl-3.0
5,406,416,330,351,382,000
29.818182
81
0.648163
false
OpenSPA/dvbapp
lib/python/Plugins/Extensions/DVDBurn/DVDTitle.py
29
6521
from Components.config import config, ConfigSubsection, ConfigSubList, ConfigInteger, ConfigText, ConfigSelection, getConfigListEntry, ConfigSequence, ConfigYesNo import TitleCutter class ConfigFixedText(ConfigText): def __init__(self, text, visible_width=60): ConfigText.__init__(self, default = text, fixed_size = ...
gpl-2.0
-1,764,415,652,769,457,700
37.364706
162
0.701273
false
tfroehlich82/erpnext
erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
3
24784
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe, erpnext import frappe.model from frappe.utils import cint, flt, today, nowdate, add_days import frappe.defaults from erp...
gpl-3.0
4,113,275,564,396,692,500
33.615922
131
0.694117
false
karamelchef/kagent-chef
files/default/kagent_utils/kagent_utils/http.py
1
2383
# -*- coding: utf-8 -*- # This file is part of Hopsworks # Copyright (C) 2019, Logical Clocks AB. All rights reserved # Hopsworks 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 th...
gpl-3.0
4,277,755,935,822,757,000
43.12963
123
0.598405
false
Intel-Corporation/tensorflow
tensorflow/python/platform/app.py
32
1436
# 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
2,620,317,866,694,249,500
34.9
80
0.701253
false
oshepherd/eforge
eforge/bugs/models.py
1
9133
# -*- coding: utf-8 -*- # EForge project management system, Copyright © 2010, Element43 # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWA...
isc
-5,572,373,331,587,627,000
29.039474
101
0.615309
false
stamhe/bitcoin
test/functional/p2p_node_network_limited.py
8
4993
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests NODE_NETWORK_LIMITED. Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMITED corre...
mit
-572,976,092,451,093,400
40.957983
166
0.666533
false
saurabhjn76/sympy
sympy/simplify/radsimp.py
46
35730
from __future__ import print_function, division from collections import defaultdict from sympy import SYMPY_DEBUG from sympy.core.evaluate import global_evaluate from sympy.core.compatibility import iterable, ordered, as_int, default_sort_key from sympy.core import expand_power_base, sympify, Add, S, Mul, Derivative...
bsd-3-clause
8,404,757,451,436,556,000
32.330224
100
0.521215
false
marivipelaez/bicingbot
tests/test_groups.py
1
16480
# -*- coding: utf-8 -*- u""" Copyright 2016 Marivi Pelaez Alonso. This file is part of BicingBot. 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 U...
apache-2.0
2,873,989,933,453,724,700
42.141361
118
0.709709
false
rbbratta/virt-test
qemu/tests/check_unhalt_vcpu.py
2
1186
import logging, time from autotest.client.shared import error from autotest.client import utils def run_check_unhalt_vcpu(test, params, env): """ Check unhalt vcpu of guest. 1) Use qemu-img create any image which can not boot. 2) Start vm with the image created by step 1 3) Use ps get qemu-kvm proc...
gpl-2.0
9,104,607,708,743,783,000
31.944444
78
0.639966
false
levkar/odoo-addons
adhoc_base_setup/__openerp__.py
2
1495
# -*- coding: utf-8 -*- { 'name': 'ADHOC Modules Configuration', 'version': '1.0', 'category': 'ADHOC Modules', 'summary': 'extra, addons, modules', 'description': """ ADHOC Modules Configuration =============================================================================== Here, you can configure ...
agpl-3.0
2,399,476,708,183,574,000
32.977273
265
0.626087
false
hryamzik/ansible
lib/ansible/modules/cloud/misc/helm.py
25
5009
#!/usr/bin/python # (c) 2016, Flavio Percoco <flavio@redhat.com> # # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'sta...
gpl-3.0
-710,268,326,820,829,000
25.363158
92
0.603913
false
demonchild2112/travis-test
grr/server/grr_response_server/threadpool_test.py
2
13125
#!/usr/bin/env python """Tests for the ThreadPool class.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import logging import threading import time from absl import app from future.builtins import range import queue from grr_response_core.lib import ...
apache-2.0
7,651,877,454,231,066,000
30.25
80
0.6608
false
qsantos/crpyt
digests/sha1.py
1
1741
# crpyt: toy cryptographic python library # Copyright (C) 2014 Quentin SANTOS # # 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 v...
gpl-3.0
-936,268,773,884,999,400
33.137255
72
0.628949
false
ezequielpereira/Time-Line
timelinelib/wxgui/frames/helpbrowserframe/helpbrowserframe.py
2
8163
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Rickard Lindberg, Roger Lindberg # # This file is part of Timeline. # # Timeline 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 th...
gpl-3.0
-174,582,379,653,521,440
36.791667
94
0.569521
false
nylar/fora
threads/tests/test_views.py
1
2074
from django.core.urlresolvers import reverse from django.test import RequestFactory from fora.tests.base import BaseTestCase from forums.models import Forum from threads.models import Thread from threads.views import NewThreadView, ShowThreadView class NewThreadViewTestCase(BaseTestCase): def setUp(self): ...
cc0-1.0
2,857,833,093,021,781,500
29.955224
70
0.624879
false
matthewalbani/scipy
scipy/sparse/linalg/dsolve/linsolve.py
8
12675
from __future__ import division, print_function, absolute_import from warnings import warn import numpy as np from numpy import asarray, empty, ravel, nonzero from scipy.sparse import (isspmatrix_csc, isspmatrix_csr, isspmatrix, SparseEfficiencyWarning, csc_matrix) from . import _superlu n...
bsd-3-clause
2,024,622,048,438,784,300
32.355263
80
0.591479
false
esteinig/netviewP
program/win/0.7.1/netview.py
1
37628
#!/usr/bin/env python # NetView P v.0.7.1 - Windows # Dependencies: PLINK # Eike Steinig # Zenger Lab, JCU # https://github.com/esteinig/netview import os import time import json import shutil import argparse import subprocess import numpy as np import multiprocessing as mp import scipy.sparse.csgraph as csg import sc...
gpl-2.0
5,925,608,658,848,145,000
41.613817
128
0.49208
false
BorgERP/borg-erp-6of3
addons/purchase/wizard/purchase_line_invoice.py
1
5929
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
8,235,681,912,279,776,000
42.595588
115
0.524709
false
w1ll1am23/home-assistant
tests/components/hassio/test_ingress.py
3
9117
"""The tests for the hassio component.""" from aiohttp.hdrs import X_FORWARDED_FOR, X_FORWARDED_HOST, X_FORWARDED_PROTO import pytest @pytest.mark.parametrize( "build_type", [ ("a3_vl", "test/beer/ping?index=1"), ("core", "index.html"), ("local", "panel/config"), ("jk_921", "e...
apache-2.0
6,364,350,009,245,811,000
31.913357
83
0.596578
false
soldag/home-assistant
tests/components/twilio/test_init.py
13
1278
"""Test the init file of Twilio.""" from homeassistant import data_entry_flow from homeassistant.components import twilio from homeassistant.core import callback from tests.async_mock import patch async def test_config_flow_registers_webhook(hass, aiohttp_client): """Test setting up Twilio and sending webhook.""...
apache-2.0
-5,765,775,747,421,542,000
35.514286
82
0.683099
false
timjr/tomograph
tests/bench.py
1
1208
#!/usr/bin/env python # Copyright (c) 2012 Yahoo! Inc. 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 # ...
apache-2.0
-218,663,055,776,483,400
29.974359
70
0.721854
false
xpansa/sale-workflow
sale_pricelist_discount/model/pricelist.py
16
1350
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 credativ ltd (<http://www.credativ.co.uk>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
-2,206,992,317,077,799,700
38.705882
78
0.62
false
chb/indivo_server
indivo/migrations/0013_auto__add_field_documentschema_internal_p.py
4
52098
# 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 field 'DocumentSchema.internal_p' db.add_column('indivo_documentschema', 'internal_p', self.gf('d...
gpl-3.0
-2,168,674,084,025,847,300
92.701439
181
0.553918
false
albertjan/pypyjs
website/js/pypy.js-0.2.0/lib/modules/test/test_extcall.py
12
8156
# -*- coding: utf-8 -*- """Doctest for method/function calls. We're going the use these types for extra testing >>> from UserList import UserList >>> from UserDict import UserDict We're defining four helper functions >>> def e(a,b): ... print a, b >>> def f(*a, **k): ... print a, t...
mit
-3,258,538,110,946,822,000
24.725552
77
0.478112
false
pizzathief/scipy
scipy/stats/tests/test_contingency.py
9
5982
import numpy as np from numpy.testing import (assert_equal, assert_array_equal, assert_array_almost_equal, assert_approx_equal, assert_allclose) from pytest import raises as assert_raises from scipy.special import xlogy from scipy.stats.contingency import margins, expected_freq, chi2_contingency def test_ma...
bsd-3-clause
5,548,173,873,699,641,000
29.212121
82
0.53661
false