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
intgr/django
tests/admin_utils/test_logentry.py
9
11462
import json from datetime import datetime from django.contrib.admin.models import ADDITION, CHANGE, DELETION, LogEntry from django.contrib.admin.utils import quote from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.test import TestCase, override_settings ...
bsd-3-clause
-1,509,449,593,893,466,600
45.714286
113
0.631018
false
lahwaacz/qutebrowser
qutebrowser/config/configdata.py
1
76011
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
5,243,266,520,370,665,000
40.059427
79
0.52219
false
chandler14362/panda3d
direct/src/p3d/packp3d.py
10
8913
#! /usr/bin/env python usageText = """ This command will pack a Panda application, consisting of a directory tree of .py files and models, into a p3d file for convenient distribution. The resulting p3d file can be run by the Panda3D runtime executable, or by the Panda3D web browser plugin. This command will build p...
bsd-3-clause
1,656,250,894,107,034,400
35.983402
151
0.653203
false
ocefpaf/wicken
wicken/exceptions.py
2
1507
#!/usr/bin/env python ''' COPYRIGHT 2013 RPS ASA This file is part of Wicken. Wicken 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...
apache-2.0
-1,584,580,250,176,985,300
27.433962
93
0.726609
false
ElementsProject/elements
test/functional/feature_block.py
1
67342
#!/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 block processing.""" import copy import struct import time from test_framework.blocktools import ...
mit
7,900,168,660,383,633,000
45.314993
183
0.574693
false
bradleyayers/django-tokenfield
docs/conf.py
1
7072
# -*- coding: utf-8 -*- # # django-tokenfield documentation build configuration file, created by # sphinx-quickstart on Tue Sep 13 13:21:28 2011. # # 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 fil...
bsd-2-clause
3,945,631,780,351,700,500
31.740741
80
0.710124
false
pathumego/nototools
nototools/tool_utils.py
2
7212
# Copyright 2015 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
684,536,509,520,578,000
32.082569
102
0.674432
false
skidzo/sympy
bin/generate_test_list.py
37
1675
""" Execute like this: $ python bin/generate_test_list.py tests = [ 'sympy.concrete.tests', 'sympy.core.tests', 'sympy.functions.combinatorial.tests', 'sympy.functions.elementary.tests', 'sympy.functions.special.tests', 'sympy.geometry.tests', 'sympy.integrals.tests', 'sympy.matrices.te...
bsd-3-clause
4,903,072,874,808,780,000
22.591549
67
0.549254
false
rmnl/htg
htg/migrate/__init__.py
1
1114
import click from ..classes import Config from ..migrate.in2ex import in2ex as in2exfunc from ..utils.aliased_group import AliasedGroup @click.group( 'migrate', cls=AliasedGroup, help="Migration functions to help with upgrades", epilog="Use \"htg utils migrate COMMAND --help\" for help with " ...
mit
-1,996,822,145,365,975,300
27.564103
74
0.693896
false
prakritish/ansible
lib/ansible/modules/cloud/openstack/os_stack.py
16
9224
#!/usr/bin/python #coding: utf-8 -*- # (c) 2016, Mathieu Bultel <mbultel@redhat.com> # (c) 2016, Steve Baker <sbaker@redhat.com> # # This module 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-3.0
-7,856,817,435,298,525,000
32.787546
109
0.588248
false
rven/odoo
addons/mail/models/mail_mail.py
3
21571
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import ast import base64 import datetime import logging import psycopg2 import smtplib import threading import re from collections import defaultdict from odoo import _, api, fields, models from odoo import tools from ...
agpl-3.0
2,610,351,839,287,534,000
49.755294
197
0.563581
false
blowmage/gcloud-python
gcloud/datastore/_testing.py
1
1234
# Copyright 2014 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
-1,639,224,862,537,679,400
36.393939
74
0.753647
false
MaineKuehn/workshop-collaborative_software
gksolite/plain.py
1
1801
class ListGol(object): """ Game of Life implemented via lists :param board: the initial state of the board :type board: :py:class:`gksol.boards.PaddedBoard` or List[List[int]] .. describe:: gol[n] Return the ``n``'th row of the board as a list-like view. """ def __init__(self, boa...
mit
-6,665,646,626,962,620,000
29.016667
76
0.49528
false
ostrokach/biskit
Biskit/ColorSpectrum.py
1
10642
## Automatically adapted for numpy.oldnumeric Mar 26, 2007 by alter_code1.py ## ## Biskit, a toolkit for the manipulation of macromolecular structures ## Copyright (C) 2004-2012 Raik Gruenberg & Johan Leckner ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU Ge...
gpl-3.0
-4,445,687,505,259,121,000
28.479224
953
0.53317
false
trivoldus28/pulsarch-verilog
tools/local/bas-release/bas,3.9-SunOS-i386/lib/python/lib/python2.4/shelve.py
11
7982
"""Manage shelves of pickled objects. A "shelf" is a persistent, dictionary-like object. The difference with dbm databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects -- anything that the "pickle" module can handle. This includes most class instances, recursive data type...
gpl-2.0
8,327,687,535,641,170,000
33.554113
88
0.639815
false
openpermissions/auth-srv
auth/oauth2/scope.py
1
9035
# -*- coding: utf-8 -*- # Copyright 2016 Open Permissions Platform Coalition # 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 appl...
apache-2.0
-4,525,683,355,783,926,300
34.996016
121
0.633868
false
stripe/stripe-datadog-checks
checks.d/sequins.py
2
3341
import requests from checks import AgentCheck class Sequins(AgentCheck): DEFAULT_TIMEOUT = 1 DEFAULT_MAX_DBS = 100 CONNECT_CHECK_NAME = 'sequins.can_connect' def check(self, instance): if 'url' not in instance: self.log.info("Skipping instance, no url found.") return ...
mit
-54,815,468,666,939,336
41.833333
122
0.567794
false
MartialD/hyperspy
hyperspy/tests/io/test_dm_stackbuilder_plugin.py
4
2535
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
6,849,309,042,125,993,000
42.706897
85
0.687968
false
AlanZatarain/visvis.dev
freezeHelp.py
5
2890
# -*- coding: utf-8 -*- # Copyright (C) 2012, Almar Klein # # Visvis is distributed under the terms of the (new) BSD License. # The full license can be found in 'license.txt'. """ Module freezeHelp Helps freezing apps made using visvis. """ import visvis as vv import os, shutil, sys def copyResources(destPath): ...
bsd-3-clause
-5,252,314,897,518,609,000
26.52381
73
0.626298
false
abdoosh00/edx-rtl-final
lms/djangoapps/django_comment_client/base/tests.py
3
16649
import logging from django.test.utils import override_settings from django.test.client import Client from django.contrib.auth.models import User from student.tests.factories import CourseEnrollmentFactory from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import M...
agpl-3.0
-5,509,927,326,649,776,000
48.550595
130
0.418644
false
garnertb/firecares
firecares/celery.py
1
3399
from __future__ import absolute_import import boto import os import mimetypes import requests from celery import Celery from django.conf import settings from firecares.utils.s3put import singlepart_upload from firecares.utils import convert_png_to_jpg from celery.task import current # set the default Django settings ...
mit
994,849,652,240,190,200
38.068966
154
0.610179
false
non-official-SD/base
src/tools/blender/blender-2.6/osg/osgdata.py
3
69729
# -*- python-indent: 4; mode: python -*- # -*- coding: UTF-8 -*- # # Copyright (C) 2008-2012 Cedric Pinson # # 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 #...
gpl-3.0
7,495,812,333,147,195,000
38.982225
227
0.560599
false
tcstewar/boardgame
boardgame/legendary/hero.py
1
40148
import copy import boardgame as bg import action from .core import * from .tags import * class ShieldAgent(Hero): name = 'SHIELD Agent' star = 1 tags = [Shield] grey = True class ShieldTrooper(Hero): name = 'SHIELD Trooper' power = 1 tags = [Shield] grey = True class ShieldOfficer(H...
gpl-2.0
5,499,505,911,280,402,000
30.63751
80
0.564511
false
harayz/raspberry_pwn
src/pentest/sqlmap/thirdparty/chardet/mbcharsetprober.py
20
3155
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
-4,295,514,968,578,284,500
37.47561
108
0.619017
false
robcarver17/pysystemtrade
syscore/interactively_run_functions.py
1
4195
import inspect NO_DEFAULT = object() NO_TYPE_PROVIDED = object() NO_VALID_ARGUMENT_PASSED = object() def parameter_default(parameter_signature): default = parameter_signature.default if default is inspect._empty: default = NO_DEFAULT return default def has_default(parameter_signature): retu...
gpl-3.0
-7,863,437,943,170,438,000
29.620438
115
0.587366
false
wkubiak/grpc
src/python/src/grpc/framework/face/testing/digest.py
17
15849
# Copyright 2015, 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 of conditions and the f...
bsd-3-clause
-3,213,750,168,973,987,000
34.22
99
0.723768
false
zozo123/buildbot
master/buildbot/test/unit/test_status_build.py
1
3276
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-3.0
-514,493,351,206,631,100
35
86
0.674603
false
longman694/youtube-dl
youtube_dl/extractor/aljazeera.py
47
1490
from __future__ import unicode_literals from .common import InfoExtractor class AlJazeeraIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?aljazeera\.com/(?:programmes|video)/.*?/(?P<id>[^/]+)\.html' _TESTS = [{ 'url': 'http://www.aljazeera.com/programmes/the-slum/2014/08/deliverance-201482883754...
unlicense
6,753,880,729,555,490,000
44.151515
145
0.620805
false
jeffwdoak/ElectronicDOS
ElectronicDOS/electronicdos.py
1
29089
#!/usr/bin/env python # electronicdos.py v0.7 03-06-2014 Jeff Doak jeff.w.doak@gmail.com # Changelog: # v0.6 - Added method to write multiple densities of states to the same file. # This method is untested as of 11/5/2013 # v0.5 - Added various l-, m-, and s-summation methods. # - Added non-collinear cal...
mit
-1,919,375,270,554,150,100
42.158754
90
0.47475
false
nocko/cfmi
tests/test_permissions.py
1
1617
from tests import TestCase, dbfixture from fixture import DataTestCase from tests.fixtures import (UserData, ProjectData, SubjectData, SessionData) from cfmi.database.newsite import User, Project, Subject, Session from sqlalchemy import and_ class PermissionsTestCase(TestCase): @dbfixture.with_data(UserData, Proje...
bsd-3-clause
-8,015,727,402,655,858,000
39.425
76
0.654917
false
itabulous/mysql-connector-python
lib/mysql/connector/connection_cext.py
14
20740
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptio...
gpl-2.0
-3,262,062,547,057,617,000
33.974705
79
0.577242
false
voutilad/courtlistener
cl/lib/sunburnt/dates.py
5
3043
from __future__ import absolute_import import datetime, math, re, warnings try: import mx.DateTime except ImportError: warnings.warn( "mx.DateTime not found, retricted to Python datetime objects", ImportWarning) mx = None # mlr: Overrides the import above so that Django templates won't cr...
agpl-3.0
-8,970,570,287,296,813,000
30.697917
85
0.548472
false
cbclab/MDT
mdt/data/components/standard/compartment_models/GDRCylinders.py
1
2785
from mdt import CompartmentTemplate, FreeParameterTemplate from mdt.model_building.parameter_functions.transformations import ScaleTransform __author__ = 'Robbert Harms' __date__ = '2018-09-15' __maintainer__ = 'Robbert Harms' __email__ = 'robbert.harms@maastrichtuniversity.nl' __licence__ = 'LGPL v3' class GDRCylin...
lgpl-3.0
-5,009,310,789,852,433,000
38.785714
99
0.554399
false
Fleurer/flask-oauthlib
example/twitter.py
14
2514
# coding: utf-8 from flask import Flask from flask import g, session, request, url_for, flash from flask import redirect, render_template from flask_oauthlib.client import OAuth app = Flask(__name__) app.debug = True app.secret_key = 'development' oauth = OAuth(app) twitter = oauth.remote_app( 'twitter', c...
bsd-3-clause
6,920,193,633,168,002,000
25.744681
79
0.649165
false
johnctitus/troposphere
examples/ElastiCacheRedis.py
2
21814
#!/usr/bin/env python """ Converted from ElastiCache_Redis.template located at: http://aws.amazon.com/cloudformation/aws-cloudformation-templates/ In addition to troposphere, this script requires awacs (Amazon Web Access Control Subsystem) """ from __future__ import absolute_import, division, print_function import tr...
bsd-2-clause
3,090,292,442,574,632,000
40.392789
79
0.390987
false
HarmonyEnterpriseSolutions/harmony-platform
src/gnue/forms/uidrivers/java/widgets/list_.py
1
1699
from gnue.forms.input.GFKeyMapper import KeyMapper from src.gnue.forms.uidrivers.java.widgets._base import UIWidget from src.gnue.forms.uidrivers.java.widgets._remote import List _all__ = ["UIList"] # ============================================================================= # Interface implementation for a gr...
gpl-2.0
-2,706,123,211,487,668,700
25.546875
79
0.584461
false
MihaiMoldovanu/ansible
lib/ansible/modules/system/openwrt_init.py
26
6453
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Andrew Gaffney <andrew@agaffney.org> # 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', ...
gpl-3.0
-7,408,766,062,804,798,000
30.632353
106
0.562839
false
orbro/eth-enablers
ethereum-datetime-master/tests/datetime/test_second.py
2
1724
import pytest @pytest.mark.parametrize( 'timestamp,second', ( (63071999, 59), (63072000, 0), (63072001, 1), (63072002, 2), (63072003, 3), (63072004, 4), (63072005, 5), (63072006, 6), (63072007, 7), (63072008, 8), (63072009,...
gpl-3.0
3,559,308,486,806,880,000
22.944444
74
0.456497
false
crennui/Cloud-On-Key
DataBaseFiles.py
1
6414
#---------------------------------IMPORTS------------------------------------- import random import sqlite3 from string import letters import os import pythoncom import win32com.client import mammoth #------------------------------CONSTANTS--------------------------------------- FILES_PATH = os.path.dirname(os.path.ab...
mit
5,939,270,535,538,892,000
36.95858
121
0.583567
false
synedra/api-design-with-apiaryio-python-and-flask
app.py
2
2811
#!flask/bin/python from flask import Flask, jsonify, abort, make_response, request app = Flask(__name__) folders = [ { "id": 1, "name": "Health", "description": "This represents projects that are related to health", "parent": 0, "meta": "NULL" }, { "id": 2, ...
mit
-2,258,629,987,339,273,700
31.686047
97
0.595162
false
mardom/GalSim
examples/demo10.py
1
11798
# Copyright 2012, 2013 The GalSim developers: # https://github.com/GalSim-developers # # This file is part of GalSim: The modular galaxy image simulation toolkit. # # GalSim 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...
gpl-3.0
693,719,504,685,542,000
43.353383
100
0.668842
false
zverevalexei/trex-http-proxy
trex_client/external_libs/jsonrpclib-pelix-0.2.5/setup.py
5
2518
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Installation script :authors: Josh Marshall, Thomas Calmant :copyright: Copyright 2015, isandlaTech :license: Apache License 2.0 :version: 0.2.5 .. Copyright 2015 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you may...
mit
7,261,472,671,894,225,000
33.027027
80
0.626291
false
prarthitm/edxplatform
openedx/core/djangoapps/external_auth/tests/test_ssl.py
1
17658
""" Provides unit tests for SSL based authentication portions of the external_auth app. """ # pylint: disable=no-member from contextlib import contextmanager import copy from mock import Mock, patch from django.conf import settings from django.contrib.auth import SESSION_KEY from django.contrib.auth.models import Anon...
agpl-3.0
3,430,336,830,766,060,000
41.244019
118
0.657209
false
KaranToor/MA450
google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/apis/clouduseraccounts/alpha/resources.py
6
1409
# Copyright 2015 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 ag...
apache-2.0
5,275,429,883,453,584,000
28.354167
74
0.680625
false
daveferrara1/linkchecker
linkcheck/mem.py
9
2697
# -*- coding: iso-8859-1 -*- # Copyright: Jean Brouwers # License: # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy,...
gpl-2.0
-8,855,158,881,855,813,000
28.966667
79
0.662217
false
rtmux/rt-thread-lite
tools/tools/clang-analyze.py
19
1998
""" Tool-specific initialization for Clang static analyzer There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ __revision__ = "tools/clang-analyze.py 2013-09-06 grissiom" import os import os.path import SCons.Ac...
gpl-2.0
-5,962,454,063,972,973,000
27.956522
89
0.634134
false
testmana2/test
Plugins/VcsPlugins/vcsMercurial/GpgExtension/HgGpgSignDialog.py
2
5172
# -*- coding: utf-8 -*- # Copyright (c) 2011 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a dialog to enter data for signing a revision. """ from __future__ import unicode_literals from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QDialog, QDialogButtonBox from .Ui_HgGpg...
gpl-3.0
-5,592,240,277,841,571,000
30.925926
78
0.58894
false
unbit/sftpclone
sftpclone/t/stub_sftp.py
1
6952
#!/usr/bin/env python # coding=utf-8 # Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; ei...
mit
6,117,981,290,005,401,000
30.6
88
0.57897
false
kpj/SDEMotif
tests/test_reaction_finder.py
1
12339
from unittest import TestCase, skipIf import io from reaction_finder import * class TestMatcher(TestCase): def test_simple_match(self): cgroups = {'foo': 3, 'bar': 1} rspec = {'foo': 2, 'bar': 1} self.assertTrue(match(cgroups, rspec)) def test_simple_mismatch(self): cgroups...
mit
-444,327,277,526,551,550
31.556728
161
0.426534
false
perlygatekeeper/glowing-robot
Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__init__.py
19
1082
from __future__ import absolute_import # For backwards compatibility, provide imports that used to be here. from .connection import is_connection_dropped from .request import make_headers from .response import is_fp_closed from .ssl_ import ( SSLContext, HAS_SNI, IS_PYOPENSSL, IS_SECURETRANSPORT, as...
artistic-2.0
-796,773,465,658,617,600
18.321429
68
0.625693
false
bchappet/dnfpy
src/dnfpyUtils/cellular/diffusionLinCA.py
1
1759
# -*- coding: utf-8 -*- ''' ''' import numpy as np from dnfpy.cellular.cellularMap import CellularMap import dnfpy.core.utils as utils #python3 main.py --model ModelCellular --params "{'model':'DiffusionLinCA'}" --scenario None class DiffusionLinCA(CellularMap): """ m : state max (when activated) pt ...
gpl-2.0
-6,591,113,280,932,857,000
24.128571
104
0.502558
false
klahnakoski/SpotManager
vendor/mo_json/encoder.py
1
16186
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import, divisi...
mpl-2.0
9,049,147,450,840,627,000
30.551657
150
0.515878
false
zofuthan/edx-platform
common/lib/xmodule/xmodule/modulestore/__init__.py
34
55201
""" This module provides an abstraction for working with XModuleDescriptors that are stored in a database an accessible using their Location as an identifier """ import logging import re import json import datetime from pytz import UTC from collections import defaultdict import collections from contextlib import cont...
agpl-3.0
-5,972,559,246,773,214,000
37.791989
125
0.626547
false
nisse3000/pymatgen
pymatgen/analysis/tests/test_structure_matcher.py
5
31631
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals import unittest import os import json import numpy as np from pymatgen.analysis.structure_matcher import StructureMatcher, \ ElementComparator, FrameworkC...
mit
7,587,811,550,906,117,000
42.871012
105
0.513167
false
chrisrico/python-trezor
trezorlib/protobuf_json.py
7
5081
# JSON serialization support for Google's protobuf Messages # Copyright (c) 2009, Paul Dovbush # All rights reserved. # http://code.google.com/p/protobuf-json/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # *...
lgpl-3.0
-1,736,151,721,899,683,600
34.78169
125
0.660697
false
satdreamgr/enigma2
lib/python/Components/FileList.py
16
14841
import os import re from MenuList import MenuList from Components.Harddisk import harddiskmanager from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename, fileExists from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, \ eServiceReference, eServiceCenter, gFont from Tools.LoadPixmap import LoadPixm...
gpl-2.0
1,395,567,340,161,607,400
32.653061
351
0.688902
false
blockc/fabric
test/feature/steps/config_util.py
12
4171
# Copyright IBM Corp. 2017 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 ag...
apache-2.0
-5,130,327,849,694,396,000
43.849462
97
0.612803
false
jrabbit/compose
tests/acceptance/cli_test.py
1
96756
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import datetime import json import os import os.path import re import signal import subprocess import time from collections import Counter from collections import namedtuple from operator import attrgetter import py...
apache-2.0
-442,494,116,897,954,300
38.168826
105
0.58561
false
gautam1858/tensorflow
tensorflow/lite/tutorials/mnist_tflite.py
13
2850
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
5,664,178,823,510,447,000
31.758621
80
0.680351
false
zephyrdeveloper/zapi-cloud
generator/python/CycleTest.py
1
2143
import json import jwt import time import hashlib import requests def is_json(data): try: json.loads(data) except ValueError: return False return True # ACCOUNT ID ACCOUNT_ID = '123456:1234abcd-1234-abcd-1234-1234abcd1234' # ACCESS KEY from navigation >> Tests >> API Keys ACCESS_KEY = ...
apache-2.0
944,096,804,246,844,400
25.134146
88
0.658889
false
Hearen/OnceServer
pool_management/bn-xend-core/xend/BNHostAPI.py
1
111013
import traceback import inspect import os import Queue import string import sys import time import xmlrpclib import socket import struct import threading import XendDomain, XendDomainInfo, XendNode, XendDmesg, XendConfig import XendLogging, XendTaskManager, XendAPIStore from xen.xend.BNPoolAPI import BNP...
mit
-5,844,853,923,022,985,000
36.333909
127
0.507841
false
Syntox32/LittleMan
asm.py
1
1539
#!/usr/bin/env python3 def runLittleMan(mem): # Initialiser ac = 0 pc = 0 running = True # Kjør instruksjonssyklus while running: # Fetch instr = mem[pc] pc += 1 # Execute if instr // 100 == 1: # ADD ac += mem[instr % 100] elif i...
mit
-3,397,094,038,716,222,000
24.65
73
0.453186
false
cctaylor/googleads-python-lib
googleads/dfa.py
4
7469
# Copyright 2013 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 ...
apache-2.0
-4,060,715,951,778,119,000
38.310526
80
0.676931
false
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/test/test_pickletools.py
20
2428
import struct import pickle import pickletools from test import support from test.pickletester import AbstractPickleTests from test.pickletester import AbstractPickleModuleTests class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests): def dumps(self, arg, proto=None): return pickletools...
apache-2.0
-8,702,992,211,242,311,000
34.705882
75
0.600906
false
ifduyue/sentry
src/sentry/api/bases/user.py
3
1222
from __future__ import absolute_import from sentry.api.base import Endpoint from sentry.api.exceptions import ResourceDoesNotExist from sentry.api.permissions import ScopedPermission from sentry.models import User from sentry.auth.superuser import is_active_superuser class UserPermission(ScopedPermission): def h...
bsd-3-clause
-9,057,488,364,407,186,000
28.095238
62
0.620295
false
sih4sing5hong5/hue7jip8
匯入/management/commands/台語文語料庫蒐集及語料庫為本台語書面語音節詞頻統計.py
1
4491
from csv import DictReader import io from os import walk from os.path import join, basename, dirname from tempfile import TemporaryDirectory from urllib.request import urlopen from zipfile import ZipFile from 臺灣言語工具.解析整理.拆文分析器 import 拆文分析器 from 臺灣言語服務.models import 訓練過渡格式 from 匯入.指令 import 匯入枋模 from 臺灣言語工具.解析整理.解析錯誤 ...
mit
2,468,378,922,569,310,000
31.495495
93
0.411422
false
pspacek/freeipa
ipatests/test_webui/test_automember.py
5
8981
# Authors: # Petr Vobornik <pvoborni@redhat.com> # # Copyright (C) 2013 Red Hat # see file 'COPYING' for use and warranty information # # 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 ...
gpl-3.0
2,198,048,054,454,316,300
32.140221
79
0.566418
false
WinterNis/sqlalchemy
doc/build/conf.py
17
12251
# -*- coding: utf-8 -*- # # SQLAlchemy documentation build configuration file, created by # sphinx-quickstart on Wed Nov 26 19:50:10 2008. # # 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. # # ...
mit
-3,344,454,117,097,351,700
31.239474
93
0.69578
false
wolfgangmauerer/prosoda
prosoda/cluster/PersonInfo.py
1
11196
# This file is part of prosoda. prosoda 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even ...
gpl-2.0
-2,712,697,897,476,194,300
36.196013
91
0.628707
false
SanketDG/networkx
networkx/algorithms/flow/tests/test_mincost.py
48
18133
# -*- coding: utf-8 -*- import networkx as nx from nose.tools import assert_equal, assert_raises import os class TestMinCostFlow: def test_simple_digraph(self): G = nx.DiGraph() G.add_node('a', demand = -5) G.add_node('d', demand = 5) G.add_edge('a', 'b', weight = 3, capacity = 4) ...
bsd-3-clause
5,892,096,361,716,632,000
39.295556
101
0.489108
false
goodwinnk/intellij-community
python/helpers/pydev/_pydev_imps/_pydev_sys_patch.py
28
2241
import sys def patch_sys_module(): def patched_exc_info(fun): def pydev_debugger_exc_info(): type, value, traceback = fun() if type == ImportError: #we should not show frame added by plugin_import call if traceback and hasattr(traceback, "tb_next"):...
apache-2.0
4,061,540,324,933,224,400
28.88
94
0.606872
false
googleads/googleads-python-lib
examples/ad_manager/v202105/live_stream_event_service/update_live_stream_events.py
1
2600
#!/usr/bin/env python # # Copyright 2018 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 requir...
apache-2.0
1,451,714,767,980,867,300
36.681159
79
0.71
false
wolet/deepy
deepy/trainers/cores/rprop.py
8
1040
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import theano.tensor as T import theano def rprop_core(params, gradients, rprop_increase=1.01, rprop_decrease=0.99, rprop_min_step=0, rprop_max_step=100, learning_rate=0.01): """ Rprop optimizer. See http://sci2s.ugr.es/keel/p...
mit
-5,815,403,678,163,274,000
36.142857
113
0.599038
false
chaoli314/openbn
classes/Variable.py
1
1115
# This Python file uses the following encoding: utf-8 """ Subject line. Main text. """ from functools import total_ordering __author__ = 'Chao Li' @total_ordering class Variable(object): def __init__(self, variable_index: int, variable_name, values: list): self._variable_index = variable_index ...
apache-2.0
4,882,317,098,621,766,000
20.037736
73
0.609865
false
SDX2000/scons
engine/SCons/Tool/tlib.py
21
1890
"""SCons.Tool.tlib XXX """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # 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...
mit
5,499,538,396,082,308,000
34.660377
101
0.721693
false
meabsence/python-for-android
python-modules/twisted/twisted/web/_auth/wrapper.py
49
8174
# -*- test-case-name: twisted.web.test.test_httpauth -*- # Copyright (c) 2008-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ A guard implementation which supports HTTP header-based authentication schemes. If no I{Authorization} header is supplied, an anonymous login will be attempted by using a L{An...
apache-2.0
-5,794,425,844,413,194,000
35.654709
88
0.639467
false
konsulko/libsigrokdecode
decoders/ir_rc5/lists.py
13
3251
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2014 Uwe Hermann <uwe@hermann-uwe.de> ## ## 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 Li...
gpl-3.0
-1,176,506,645,864,708,900
33.585106
76
0.541372
false
leviroth/praw
praw/models/subreddits.py
1
4340
"""Provide the Subreddits class.""" from . import Subreddit from .base import PRAWBase from .listing.generator import ListingGenerator from .util import stream_generator from ..const import API_PATH class Subreddits(PRAWBase): """Subreddits is a Listing class that provides various subreddit lists.""" @static...
bsd-2-clause
7,079,015,187,029,998,000
35.166667
80
0.615207
false
natanielruiz/android-yolo
jni-build/jni/include/tensorflow/python/kernel_tests/padding_fifo_queue_test.py
5
53221
# 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,575,144,917,407,246,000
34.790854
80
0.595874
false
adamchainz/django-mysql
src/django_mysql/models/fields/sizes.py
2
2719
from django.core import checks from django.db.models import BinaryField, TextField class SizedBinaryField(BinaryField): def __init__(self, *args, **kwargs): self.size_class = kwargs.pop("size_class", 4) super().__init__(*args, **kwargs) def check(self, **kwargs): errors = super().chec...
bsd-3-clause
-2,181,917,365,051,417,300
30.616279
78
0.525193
false
SepehrMN/nest-simulator
pynest/examples/spatial/conncon_targets.py
20
2449
# -*- coding: utf-8 -*- # # conncon_targets.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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...
gpl-2.0
-6,948,630,001,401,315,000
31.223684
119
0.60392
false
AkaZuko/gstudio
gnowsys-ndf/gnowsys_ndf/ndf/views/imageDashboard.py
2
10598
''' -- imports from installed packages -- ''' from django.http import HttpResponseRedirect from django.http import HttpResponse from django.core.urlresolvers import reverse from django.shortcuts import render_to_response, render from django.template import RequestContext try: from bson import ObjectId except Impor...
agpl-3.0
-8,909,396,364,202,302,000
42.793388
151
0.560294
false
geobricks/geobricks_storage_manager
geobricks_storage_manager/core/storage_manager.py
1
1359
import subprocess from geobricks_common.core.log import logger log = logger(__file__) class StorageManager(): def __init__(self, config): self.config = config["settings"] def publish_raster_to_storage(self, folder_path): self._publish_to_storage(folder_path, "raster") def publish_vecto...
gpl-2.0
2,983,300,947,460,227,000
31.357143
96
0.551876
false
jesusVMayor/account-payment
__unported__/nan_account_bank_statement/__init__.py
15
1387
# -*- encoding: latin-1 -*- ############################################################################## # # Copyright (c) 2009 Àngel Àlvarez - NaN (http://www.nan-tic.com) All Rights Reserved. # # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability...
agpl-3.0
-8,542,480,013,495,619,000
45.233333
88
0.678443
false
umutseven92/GameOfLife
src/cgl.py
1
1972
import pygame import time import sys from grid import grid # Colors used black = (0, 0, 0) white = (255, 255, 255) gray = (192, 192, 192) MARGIN = 5 # Margin between cells WIDTH = 20 # Cell width HEIGHT = 20 # Cell height ROW = 40 # Random row count COL = 40 # Random column count speed_delta = 10 max_speed = 125 ...
mit
4,594,087,182,103,531,000
19.102041
138
0.63198
false
pasv/Empire
lib/stagers/hop_php.py
22
2123
from lib.common import helpers class Stager: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Launcher', 'Author': ['@harmj0y'], 'Description': ('Generates a hop.php redirector for an Empire listener.'), 'Comments': [ '' ...
bsd-3-clause
7,728,688,183,123,161,000
28.901408
86
0.503062
false
FullStackEmbedded/Weather_Shield
02_Code/SensorDrivers/sht21_class.py
2
6157
#!/usr/bin/python ##==============================================================================## ## FULL STACK EMBEDDED 2016 ## ##==============================================================================## ## File : sht21.py ...
gpl-2.0
-4,909,613,834,279,437,000
34.589595
91
0.529479
false
pablolizardo/dotfiles
blender/scripts/dynamictextpanel.py
1
17634
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 ...
gpl-2.0
-5,689,746,719,977,277,000
41.466667
194
0.573052
false
City-of-Bloomington/green-rental
utility/migrations/0011_auto__chg_field_utilitysummary_statement.py
2
25109
# -*- coding: 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): # Changing field 'UtilitySummary.statement' db.alter_column(u'utility_utilitysummary', 'statement_id', self...
agpl-3.0
-962,976,256,291,214,600
84.993151
195
0.54809
false
kmunve/processgpr
test/trace_db.py
1
3048
__author__ = 'kmu' """ Storing GPR traces in an SQLite database. Check out: http://stackoverflow.com/questions/18621513/python-insert-numpy-array-into-sqlite3-database """ import sqlite3 import numpy as np import io # Defining the trace object class TraceDb(): def __init__(self, values, deltaT=0, Nfft=None): ...
gpl-2.0
-6,204,422,218,226,688,000
25.973451
120
0.643045
false
sajeeshcs/nested_projects_keystone
keystone/trust/backends/kvs.py
1
4491
# Copyright 2012 OpenStack 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 agreed to in...
apache-2.0
2,008,816,630,022,249,500
36.115702
76
0.607882
false
SamWitte/Codds_DarkMatter
src/globalfnc.py
1
23236
""" Copyright (c) 2015 Andreea Georgescu Created on Fri Nov 21 02:49:53 2014 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. ...
gpl-2.0
4,614,329,665,938,111,000
34.366819
106
0.548072
false
armab/st2
st2actions/st2actions/runners/pythonrunner.py
1
7435
# 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
-366,287,523,733,597,700
32.795455
96
0.6308
false
arienchen/pytibrv
tests/python/test-events.py
1
1925
import datetime import time from pytibrv.Tibrv import * import unittest class EventTest(unittest.TestCase, TibrvMsgCallback): @classmethod def setUpClass(cls): status = Tibrv.open() if status != TIBRV_OK: raise TibrvError(status) @classmethod def tearDownClass(cls): ...
bsd-3-clause
-2,019,257,972,628,880,000
24.666667
72
0.57974
false
scrollback/kuma
vendor/packages/translate-toolkit/translate/tools/poswap.py
7
3619
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2007 Zuza Software Foundation # # This file is part of translate. # # translate 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...
mpl-2.0
-4,705,156,967,958,186,000
35.555556
106
0.665653
false
chaluemwut/fbserver
venv/lib/python2.7/site-packages/scipy/stats/tests/test_mstats_basic.py
17
42696
""" Tests for the stats.mstats module (support for masked arrays) """ from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy import nan import numpy.ma as ma from numpy.ma import masked, nomask import scipy.stats.mstats as mstats from scipy import stats from nu...
apache-2.0
1,844,709,644,750,876,400
39.470142
90
0.53546
false
wunderlins/learning
python/zodb/lib/osx/persistent/tests/test_mapping.py
2
7118
############################################################################## # # Copyright (c) Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE...
gpl-2.0
-3,446,693,615,814,522,400
29.033755
79
0.519949
false
nbborlongan/geonode
geonode/context_processors.py
5
3018
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
gpl-3.0
7,496,288,331,391,082,000
32.910112
112
0.576541
false
v-iam/azure-sdk-for-python
azure-batch/azure/batch/models/pool_disable_auto_scale_options.py
3
1719
# 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 ...
mit
-1,907,633,428,260,927,500
44.236842
106
0.663758
false
hepix-virtualisation/vmcatcher
vmcatcher/vmcatcher_subscribe/retrieveHttp.py
1
1229
import retrieveBase import logging import httplib import socket import base64 timeout = 60 class retrieve(retrieveBase.retrieve): def __init__(self, *args, **kwargs): retrieveBase.retrieve.__init__(self,args,kwargs) self.port_default = 80 def requestAsString(self): output = {'code' : 0}...
apache-2.0
-3,026,290,837,146,958,300
35.147059
86
0.593979
false