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
dotKom/onlineweb4
apps/contact/forms.py
1
1535
from captcha.fields import ReCaptchaField from django import forms class ContactForm(forms.Form): mail_choices = (("hovedstyret@online.ntnu.no", "Hovedstyret"), ("dotkom@online.ntnu.no", "Drifts- og utviklingskomiteen") ) contact_receiver = forms.ChoiceField(required=Tr...
mit
-5,438,166,202,593,801,000
55.777778
113
0.58578
false
dmlc/web-data
keras/models/s2s_translate/lstm_seq2seq.py
1
9176
'''Sequence to sequence example in Keras (character-level). This script demonstrates how to implement a basic character-level sequence-to-sequence model. We apply it to translating short English sentences into short French sentences, character-by-character. Note that it is fairly unusual to do character-level machine ...
apache-2.0
-8,431,868,718,273,166,000
38.722944
79
0.705209
false
dims/oslo.messaging
oslo_messaging/tests/notify/test_dispatcher.py
6
10093
# Copyright 2013 eNovance # # 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 t...
apache-2.0
5,007,948,928,413,643,000
38.425781
78
0.551174
false
digistam/recon-ng
modules/recon/domains-hosts/bing_domain_api.py
1
2500
import module # unique to module from urlparse import urlparse import re class Module(module.Module): def __init__(self, params): module.Module.__init__(self, params, query='SELECT DISTINCT domain FROM domains WHERE domain IS NOT NULL ORDER BY domain') self.register_option('limit', 0, True, 'limit...
gpl-3.0
3,351,566,759,329,915,400
41.372881
163
0.4876
false
irinabov/debian-qpid-cpp-1.35.0
management/python/lib/qmf/console.py
2
137167
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-1,822,485,711,944,551,400
32.826634
125
0.600932
false
roijo/C-PAC_complexitytools
doc/sphinxext/numpy_ext/tests/test_docscrape.py
35
15328
# -*- encoding:utf-8 -*- import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from docscrape import NumpyDocString, FunctionDoc, ClassDoc from docscrape_sphinx import SphinxDocString, SphinxClassDoc from nose.tools import * doc_txt = '''\ numpy.multivariate_normal(mean, cov, shape=None, sp...
bsd-3-clause
-8,901,042,149,351,229,000
23.83252
80
0.60241
false
eaplatanios/tensorflow
tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py
9
12310
# Copyright 2016 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
4,957,880,699,038,931,000
36.416413
80
0.677579
false
levinas/assembly
lib/assembly/utils.py
2
2003
import errno import json import os import re class Error(Exception): """Base class for exceptions in this module""" pass class URLError(Error, ValueError): pass def verify_url(url, port=8000): """Returns complete URL with http prefix and port number """ pattern = re.compile( r'^(htt...
mit
-2,175,807,915,604,422,000
28.028986
99
0.568148
false
aio-libs/aiomonitor
examples/web_srv.py
2
1066
import asyncio import aiomonitor import uvloop from aiohttp import web async def simple(request): loop = request.app.loop await asyncio.sleep(10, loop=loop) await asyncio.sleep(10, loop=loop) return web.Response(text='Simple answer') async def hello(request): resp = web.StreamResponse() na...
apache-2.0
4,463,106,482,035,735,600
24.380952
54
0.684803
false
easmetz/inasafe
safe/utilities/analysis_handler.py
2
28522
# coding=utf-8 """ InaSAFE Disaster risk assessment tool by AusAid **GUI InaSAFE Wizard Dialog.** Contact : ole.moller.nielsen@gmail.com .. note:: 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 Found...
gpl-3.0
-4,055,814,745,100,731,400
37.029333
79
0.616997
false
znick/anytask
anytask/mail/views.py
1
10115
# -*- coding: utf-8 -*- import json from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponseForbidden, HttpResponse from django.shortcuts import render from django.utils import timezone from django.utils.translation import ugettext as _ from djang...
mit
-2,002,390,479,573,201,000
33.288136
117
0.606228
false
wikimedia/pywikibot-core
tests/page_tests.py
1
48914
# -*- coding: utf-8 -*- """Tests for the page module.""" # # (C) Pywikibot team, 2008-2020 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, division, unicode_literals import pickle import re import pywikibot import pywikibot.page from pywikibot import config from pywikib...
mit
7,108,309,833,884,328,000
38.609895
79
0.575544
false
vzer/ToughRADIUS
toughradius/console/admin/billing.py
5
3696
#!/usr/bin/env python #coding=utf-8 from bottle import Bottle from bottle import request from bottle import response from bottle import redirect from bottle import run as runserver from bottle import static_file from bottle import abort from hashlib import md5 from tablib import Dataset from toughradius.console.base i...
agpl-3.0
-6,135,470,895,693,383,000
38.3
101
0.60379
false
2015fallproject/2015fallcase1
static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_importlib/import_/test_packages.py
34
4661
from .. import util from . import util as import_util import sys import unittest import importlib from test import support class ParentModuleTests(unittest.TestCase): """Importing a submodule should import the parent modules.""" def test_import_parent(self): with util.mock_modules('pkg.__init__', 'p...
agpl-3.0
-7,042,494,867,377,825,000
40.616071
82
0.549024
false
Metaswitch/horizon
openstack_dashboard/dashboards/identity/users/urls.py
57
1437
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
3,202,109,300,586,223,600
37.837838
78
0.699374
false
Jeff-Tian/mybnb
Python27/Lib/lib-tk/FixTk.py
2
3099
import sys, os # Delay import _tkinter until we have set TCL_LIBRARY, # so that Tcl_FindExecutable has a chance to locate its # encoding directory. # Unfortunately, we cannot know the TCL_LIBRARY directory # if we don't know the tcl version, which we cannot find out # without import Tcl. Fortunately, Tcl will...
apache-2.0
-1,922,404,316,920,299,800
36.259259
68
0.563408
false
sideeffects/stats_core
stats_main/management/commands/cleardatabase.py
1
1319
''' Drop all tables in the database but keep the database itself. ''' import optparse from django.core.management.base import BaseCommand from django.db.utils import IntegrityError from django.db import connections, transaction class Command(BaseCommand): help = "Drop all tables in the database." args = "" ...
mit
-5,727,684,000,737,978,000
27.06383
77
0.557998
false
ThoughtWorksInc/treadmill
treadmill/websocket/api/trace.py
3
1874
"""A WebSocket handler for Treadmill trace. """ import logging from treadmill import apptrace from treadmill import schema from treadmill.websocket import utils from treadmill.apptrace import events as traceevents _LOGGER = logging.getLogger(__name__) class TraceAPI(object): """Handler for /trace topic.""" ...
apache-2.0
-5,940,922,184,473,888,000
27.830769
75
0.540555
false
erdincay/gmvault
src/gmv/cmdline_utils.py
3
7686
''' Gmvault: a tool to backup and restore your gmail account. Copyright (C) <2011> <guillaume Aubert (guillaume dot aubert at gmail do com)> 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 Sof...
agpl-3.0
7,865,789,259,453,203,000
34.915888
130
0.580536
false
willthames/ansible
lib/ansible/modules/cloud/amazon/rds_param_group.py
12
11187
#!/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 distributed...
gpl-3.0
306,011,070,857,280,300
31.054441
154
0.598194
false
odoo-arg/odoo_l10n_ar
l10n_ar_taxes/tests/test_invoice.py
1
6723
# -*- encoding: utf-8 -*- ############################################################################## # # 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 Licen...
agpl-3.0
5,345,874,221,830,802,000
39.017857
105
0.603748
false
TC629/az-libra
App/update.py
1
6069
#!/usr/bin/python # Este programa se corre en el pcDuino antes de que se cree e inicie el # daemon de la aplicacion Libra. # Revisa si existe el archivo "update_pending", el mismo consiste en una # unica linea correspondiente al nombre del "tarball" con la actualizacion. # Por el momento, solo soporta hacer cambios al...
gpl-3.0
2,868,010,817,134,543,000
39.46
104
0.546713
false
byronvhughey/django_local_library
catalog/tests/test_views.py
1
9559
from django.test import TestCase # Create your tests here. from catalog.models import Author from django.core.urlresolvers import reverse class AuthorsListViewTest(TestCase): @classmethod def setUpTestData(cls): # Create 13 authors for pagination test number_of_authors = 13 for author_num in range(number_of...
mit
-6,681,761,472,028,865,000
38.337449
156
0.716707
false
shhui/horizon
openstack_dashboard/dashboards/admin/projects/tables.py
8
6868
# 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 # distributed under t...
apache-2.0
-5,398,345,145,584,611,000
34.770833
79
0.613716
false
jayceyxc/hue
desktop/core/ext-py/rsa-3.4.2/tests/test_load_save_keys.py
9
4814
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Un...
apache-2.0
4,086,994,733,238,675,500
26.66092
83
0.653439
false
Intel-Corporation/tensorflow
tensorflow/contrib/bigtable/__init__.py
29
1329
# 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
-526,737,626,623,297,200
33.076923
80
0.729872
false
JackDandy/SickGear
sickbeard/notifiers/nmjv2.py
2
8166
# Author: Jasper Lanting # Based on nmj.py by Nico Berlee: http://nico.berlee.nl/ # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickGear. # # SickGear 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
-1,808,267,084,548,316,000
41.753927
119
0.585966
false
icomfort/anaconda
dispatch.py
1
8130
# # dispatch.py: install/upgrade master flow control # # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc. # All rights reserved. # # 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; ...
gpl-2.0
5,556,857,877,840,930,000
31.007874
91
0.655105
false
animekita/selvbetjening
selvbetjening/sadmin2/views/users.py
1
3576
""" See events.py for rules regarding sadmin2 views """ import datetime from django.conf import settings from django.contrib.auth.models import Group from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from django.shortcuts import render, get_object_or_404 from selvbet...
mit
-2,890,503,589,466,800,600
29.827586
112
0.649888
false
NCI-GDC/gdcdatamodel
test/test_gdc_postgres_admin.py
1
6451
# -*- coding: utf-8 -*- """ Tests for gdcdatamodel.gdc_postgres_admin module """ import logging import unittest from psqlgraph import ( Edge, Node, PsqlGraphDriver, ) from sqlalchemy.exc import ProgrammingError from gdcdatamodel import gdc_postgres_admin as pgadmin from gdcdatamodel import models loggin...
apache-2.0
199,520,789,973,923,520
29.719048
77
0.563789
false
tensorflow/datasets
tensorflow_datasets/testing/fake_data_generation/open_images.py
1
6353
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # 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
-5,054,665,528,920,862,000
36.591716
80
0.670549
false
ProjectSWGCore/NGECore2
scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_officer_utility_a_01_01.py
2
1231
import sys def setup(core, object): object.setStfFilename('static_item_n') object.setStfName('item_bracelet_r_set_officer_utility_a_01_01') object.setDetailFilename('static_item_d') object.setDetailName('item_bracelet_r_set_officer_utility_a_01_01') object.setStringAttribute('class_required', 'Officer') object.s...
lgpl-3.0
7,855,938,654,871,308,000
63.842105
122
0.77173
false
redhat-cip/horizon
openstack_dashboard/dashboards/project/instances/workflows/update_instance.py
29
5732
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
1,865,101,745,255,435,800
37.469799
78
0.624738
false
RyanSkraba/beam
sdks/python/apache_beam/coders/coders_test.py
1
6343
# # 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 us...
apache-2.0
-2,264,454,649,619,296,000
32.384211
78
0.698408
false
keflavich/pyregion
setup.py
1
4190
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import glob import os import sys import ah_bootstrap from setuptools import setup # A dirty hack to get around some early import/configurations ambiguities if sys.version_info[0] >= 3: import builtins else: import __builtin...
mit
9,046,240,946,080,474,000
30.742424
79
0.702625
false
chokribr/invenioold
modules/miscutil/lib/upgrades/invenio_2012_10_31_WebAuthorProfile_bibformat_dependency_update.py
17
1778
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2012 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) a...
gpl-2.0
7,223,307,451,009,441,000
36.041667
163
0.708099
false
fnp/redakcja
src/catalogue/migrations/0028_auto_20201102_1109.py
1
1140
# Generated by Django 3.0.4 on 2020-11-02 11:09 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('catalogue', '0027_auto_20201027_1501'), ] operations = [ migrations.CreateModel( name='Collecti...
agpl-3.0
1,853,706,410,826,060,300
35.774194
175
0.599123
false
gymnasium/edx-platform
common/djangoapps/student/management/commands/bulk_change_enrollment.py
19
4548
"""Management command to change many user enrollments at once.""" import logging from django.core.management.base import BaseCommand, CommandError from django.db import transaction from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from six import text_type from course_modes.models imp...
agpl-3.0
-649,933,176,231,585,500
38.894737
119
0.624011
false
vjmac15/Lyilis
lib/pymongo/son_manipulator.py
2
6701
# Copyright 2009-2015 MongoDB, 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 writin...
gpl-3.0
-3,053,943,644,362,221,600
33.901042
80
0.659454
false
drufat/sympy
sympy/physics/quantum/tests/test_printing.py
20
29885
# -*- encoding: utf-8 -*- """ TODO: * Address Issue 2251, printing of spin states """ from sympy.physics.quantum.anticommutator import AntiCommutator from sympy.physics.quantum.cg import CG, Wigner3j, Wigner6j, Wigner9j from sympy.physics.quantum.commutator import Commutator from sympy.physics.quantum.constants import ...
bsd-3-clause
-8,748,918,769,740,066,000
31.988726
738
0.522299
false
darkonie/dcos
packages/adminrouter/extra/src/test-harness/modules/mocker/endpoints/reflectors.py
3
3938
# Copyright (C) Mesosphere, Inc. See LICENSE file for details. """All the code relevant for reflecting mocker, both Unix Socket and TCP/IP based""" import logging from cgi import parse_header, parse_multipart from urllib.parse import parse_qs from mocker.endpoints.generic import ( TcpIpHttpEndpoint, UnixSoc...
apache-2.0
-508,390,956,150,563,840
39.183673
84
0.641442
false
tBaxter/python-card-me
card_me/ics_diff.py
4
7838
from __future__ import print_function from optparse import OptionParser from .base import Component, getBehavior, newFromBehavior, readOne """ Compare VTODOs and VEVENTs in two iCalendar sources. """ def getSortKey(component): def getUID(component): return component.getChildValue('uid', '') # it's ...
apache-2.0
3,925,586,777,103,282,000
34.466063
86
0.580378
false
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/structured/labs/serving/application/lib/werkzeug/debug/console.py
9
5469
# -*- coding: utf-8 -*- """ werkzeug.debug.console ~~~~~~~~~~~~~~~~~~~~~~ Interactive console support. :copyright: 2007 Pallets :license: BSD-3-Clause """ import code import sys from types import CodeType from ..local import Local from ..utils import escape from .repr import debug_repr from .repr...
apache-2.0
-4,440,337,404,607,113,700
24.319444
74
0.566831
false
intgr/django
django/contrib/syndication/views.py
17
8664
from calendar import timegm from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import Http404, HttpResponse from django.template import TemplateDoesNotExist, loader from django.utils i...
bsd-3-clause
1,598,434,567,742,761,500
38.743119
95
0.581602
false
gsehub/edx-platform
manage.py
11
4180
#!/usr/bin/env python """ Usage: manage.py {lms|cms} [--settings env] ... Run django management commands. Because edx-platform contains multiple django projects, the first argument specifies which project to run (cms [Studio] or lms [Learning Management System]). By default, those systems run in with a settings file ...
agpl-3.0
-6,994,168,041,202,529,000
33.545455
117
0.661722
false
sajuptpm/neutron-ipam
neutron/db/migration/alembic_migrations/versions/3cabb850f4a5_table_to_track_port_.py
20
1933
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 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...
apache-2.0
1,636,780,627,545,293,800
29.68254
78
0.677703
false
Epat9/YourHomeBudget
node_modules/dmg-builder/vendor/dmgbuild/badge.py
16
6206
# -*- coding: utf-8 -*- from __future__ import unicode_literals from Quartz import * import math _REMOVABLE_DISK_PATH = '/System/Library/Extensions/IOStorageFamily.kext/Contents/Resources/Removable.icns' def badge_disk_icon(badge_file, output_file): # Load the Removable disk icon url = CFURLCreateWithFileSys...
mit
7,316,342,324,815,471,000
42.398601
106
0.557364
false
nishad-jobsglobal/odoo-marriot
openerp/addons/acesmanpower/menu_view.py
1
1680
# -*- coding: utf-8 -*- #/############################################################################# # # Jobs Global # Copyright (C) 2014-TODAY Jobs Global(http://www.jobsglobal.com). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General P...
agpl-3.0
637,585,317,788,356,000
39.97561
141
0.594643
false
santoshsahoo/filesync-server
src/server/integtests/test_udf_sync.py
6
10705
# Copyright 2008-2015 Canonical # # 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 version. # # This program is distributed...
agpl-3.0
-3,288,612,631,682,836,500
36.960993
79
0.598132
false
kazupon/libuv-lua
tools/gyp/test/mac/gyptest-postbuild.py
4
1577
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that postbuild steps work. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(formats=['nin...
apache-2.0
3,928,830,604,829,313,500
29.921569
72
0.598605
false
Senseg/robotframework
src/robot/output/pyloggingconf.py
1
1500
# Copyright 2008-2012 Nokia Siemens Networks Oyj # # 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
6,358,837,911,065,336,000
27.301887
75
0.674
false
Pointedstick/ReplicatorG
skein_engines/skeinforge-44/fabmetheus_utilities/geometry/manipulation_paths/outline.py
1
1465
""" Create outline. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.creation import lineation from fabmetheus_uti...
gpl-2.0
1,325,084,233,107,209,500
34.731707
157
0.786348
false
teepark/datahog
tests/test_name.py
2
32314
# vim: fileencoding=utf8:et:sw=4:ts=8:sts=4 import os import sys import unittest import datahog from datahog import error import fuzzy import psycopg2 sys.path.append(os.path.dirname(os.path.abspath(__file__))) import base from pgmock import * def _dm(full): dm, dmalt = fuzzy.DMetaphone()(full) dm = dm.lj...
bsd-3-clause
4,612,566,825,079,213,000
22.812822
78
0.490995
false
rockychen-dpaw/borgcollector
tablemanager/models.py
1
122687
# coding=utf8 from __future__ import absolute_import, unicode_literals, division import os import re import pytz import logging import tempfile import subprocess import threading import shutil import time import signal import sys import json import StringIO import codecs import traceback import xml.etree.ElementTree a...
bsd-3-clause
-1,017,023,698,118,988,300
41.073731
262
0.587462
false
tboyce021/home-assistant
script/hassfest/__main__.py
6
5278
"""Validate manifests.""" import argparse import pathlib import sys from time import monotonic from . import ( codeowners, config_flow, coverage, dependencies, json, manifest, mqtt, requirements, services, ssdp, translations, zeroconf, ) from .model import Config, Integr...
apache-2.0
-2,689,471,858,138,553,300
26.633508
88
0.612164
false
lorensen/VTKExamples
src/Python/VisualizationAlgorithms/MarchingCases.py
1
19479
#!/usr/bin/env python import vtk def main(): mc_cases, rotation, label = get_program_parameters() if not mc_cases: mc_cases = [7] else: # Ensure that they are unique. mc_cases = list(set(mc_cases)) # Check that they lie in the correct range. badCases = [] f...
apache-2.0
6,219,997,447,713,518,000
33.476106
118
0.633195
false
public-ink/public-ink
server/appengine-staging/lib/graphql/type/schema.py
2
3470
from collections import Iterable from .definition import GraphQLObjectType from .directives import GraphQLDirective, specified_directives from .introspection import IntrospectionSchema from .typemap import GraphQLTypeMap class GraphQLSchema(object): """Schema Definition A Schema is created by supplying the ...
gpl-3.0
7,295,277,902,535,537,000
33.7
124
0.649568
false
CZ-NIC/knot
tests-extra/tests/zone/reload/test.py
1
1592
#!/usr/bin/env python3 '''Test for reload of a changed zone (serial up, nochange, serial down).''' from dnstest.test import Test from dnstest.utils import set_err, detail_log import random t = Test() master = t.server("knot") # Zone setup zone = t.zone("serial.", storage=".") t.link(zone, master, ixfr=True) t.st...
gpl-3.0
-6,542,197,897,110,202,000
27.428571
104
0.646357
false
hkariti/ansible
lib/ansible/modules/packaging/os/apk.py
14
11310
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Kevin Brebanov <https://github.com/kbrebanov> # Based on pacman (Afterburn <http://github.com/afterburn>, Aaron Bull Schaefer <aaron@elasticdog.com>) # and apt (Matthew Williams <matthew@flowroute.com>) modules. # # GNU General Public License v3.0+ (see COPYING or ...
gpl-3.0
602,523,452,841,156,400
31.130682
147
0.62405
false
Cog-Creators/Red-DiscordBot
redbot/cogs/audio/core/cog_utils.py
3
4323
from abc import ABC from typing import Final from base64 import b64decode from io import BytesIO import struct from redbot import VersionInfo from redbot.core import commands from ..converters import get_lazy_converter, get_playlist_converter __version__ = VersionInfo.from_json({"major": 2, "minor": 4, "micro": 0, "...
gpl-3.0
-9,030,245,852,811,552,000
28.013423
117
0.617395
false
rackerlabs/django-DefectDojo
dojo/reports/views.py
2
41612
import logging import mimetypes import os import urllib.parse from datetime import datetime from dateutil.relativedelta import relativedelta from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.core.exceptions import PermissionDeni...
bsd-3-clause
-3,357,059,948,598,063,000
46.340159
152
0.526579
false
envhyf/wrftools
wrftools/fetch.py
1
3678
import os import time import datetime import subprocess import shared def run_gribmaster(config): """Runs the gribmaster programme to download the most recent boundary conditions """ logger = shared.get_logger() gm_dir = config['gm_dir'] gm_transfer = config['gm_transfer'] gm_dataset = ...
gpl-3.0
-8,387,826,132,980,787,000
38.978261
196
0.604133
false
mezz64/home-assistant
homeassistant/components/nad/media_player.py
2
10484
"""Support for interfacing with NAD receivers through RS-232.""" from nad_receiver import NADReceiver, NADReceiverTCP, NADReceiverTelnet import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity from homeassistant.components.media_player.const import ( SUPPORT_SE...
apache-2.0
-8,724,611,313,933,065,000
30.202381
88
0.592617
false
shadda/AutobahnPython
examples/websocket/streaming/frame_based_server.py
15
1958
############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## 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 ## ## ht...
apache-2.0
-8,476,707,464,821,172,000
34.943396
79
0.626149
false
chmberl/django-cms
cms/models/placeholderpluginmodel.py
49
1244
# -*- coding: utf-8 -*- from cms.models import CMSPlugin from cms.models.fields import PlaceholderField from cms.utils.copy_plugins import copy_plugins_to from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class PlaceholderReference(CMSPlugin): ...
bsd-3-clause
-7,869,210,827,518,331,000
33.555556
107
0.691318
false
dimkal/mne-python
examples/inverse/plot_label_source_activations.py
32
2269
""" ==================================================== Extracting the time series of activations in a label ==================================================== We first apply a dSPM inverse operator to get signed activations in a label (with positive and negative values) and we then compare different strategies to ...
bsd-3-clause
-7,708,012,445,618,289,000
34.453125
73
0.681798
false
SebastianBoyd/sebastianboyd.com
tree/stocks/stocks_chart.py
2
2233
import urllib2 import json import time def get_data(tickers): tickers = ','.join(map(str,tickers)) response = urllib2.urlopen("http://www.google.com/finance/info?infotype=infoquoteall&q=" + tickers) string = response.read() string = string.strip('\n//') data = json.loads(string, object_hook=_decode_dict) return d...
lgpl-3.0
4,611,814,163,427,318,000
26.9125
100
0.622481
false
alephu5/Soundbyte
environment/lib/python3.3/site-packages/sympy/printing/tableform.py
5
11745
from __future__ import print_function, division from sympy.core.containers import Tuple from types import FunctionType class TableForm(object): """ Create a nice table representation of data. Example:: >>> from sympy import TableForm >>> t = TableForm([[5, 7], [4, 2], [10, 3]]) >>> print(t...
gpl-3.0
-2,497,701,696,475,045,400
31.266484
79
0.42103
false
jcftang/ansible
lib/ansible/utils/module_docs_fragments/files.py
29
3217
# (c) 2014, Matt Martz <matt@sivel.net> # # 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. # ...
gpl-3.0
5,859,240,094,766,090,000
39.2125
315
0.705316
false
ClearCorp/odoo-clearcorp
TODO-9.0/stock_requisition_group/procurement_order.py
3
2922
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
-6,953,665,887,141,594,000
41.970588
78
0.568789
false
josrolgil/exjobbCalvin
calvin/runtime/south/plugins/async/twistedimpl/serialport.py
4
1874
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson 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 ...
apache-2.0
-7,057,764,002,521,376,000
26.558824
118
0.636073
false
sagge-miky/Super-HUGS-Revolution-98
score.py
2
8127
########################################### # Created on 1-7-2013. Miguel Angel Astor # ########################################### import string import pygame try: import android except ImportError: android = None try: import pygame.mixer as mixer except ImportError: import android.mixer as mixer impo...
bsd-2-clause
-5,601,474,165,439,807,000
43.653846
122
0.574874
false
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sympy/core/compatibility.py
3
5401
""" Reimplementations of constructs introduced in later versions of Python than we support. """ # These are in here because telling if something is an iterable just by calling # hasattr(obj, "__iter__") behaves differently in Python 2 and Python 3. In # particular, hasattr(str, "__iter__") is False in Python 2 and Tr...
agpl-3.0
1,321,565,830,904,298,200
29.342697
84
0.584892
false
pbchou/trafficserver
tests/gold_tests/headers/syntax.test.py
6
4109
''' Test whitespace between field name and colon in the header ''' # 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 yo...
apache-2.0
1,375,132,695,238,180,600
45.693182
242
0.721343
false
amitsela/beam
sdks/python/apache_beam/examples/complete/juliaset/setup.py
18
4322
# # 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 us...
apache-2.0
-1,823,187,815,389,771,500
36.258621
80
0.737621
false
linyehui/migrating-from-wikidot-to-jekyll
wikidot.py
1
4660
#!/usr/bin/env python # -*- encoding: UTF8 -*- # Copyright 2012 Philipp Klaus # Part of https://github.com/vLj2/wikidot-to-markdown import re ## The most important module here! import string ## for string.join() #import markdown import uuid ## to generate random UUIDs using uuid.uuid4() class WikidotToMarkdown(objec...
mit
-4,660,743,538,455,500,000
62.808219
542
0.500644
false
proxysh/Safejumper-for-Desktop
buildmac/Resources/env/lib/python2.7/site-packages/twisted/python/components.py
14
14295
# -*- test-case-name: twisted.python.test.test_components -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Component architecture for Twisted, based on Zope3 components. Using the Zope3 API directly is strongly recommended. Everything you need is in the top-level of the zope.interface ...
gpl-2.0
-8,735,629,557,001,990,000
32.167053
85
0.668346
false
nytlabs/hotpants
hotpants-merge.py
1
5237
# oh boy oh boy! # It's project HOT_PANTS from __future__ import print_function import Adafruit_BBIO.UART as uart from Adafruit_Thermal import * # import TMP102 as tmp import VCNL4000 as vcnl import time from serial import Serial import random import atexit import sentence_generator as sg theObj = 'BLOCKS' v = vcnl.V...
apache-2.0
1,027,970,702,916,533,400
37.514706
365
0.642162
false
varses/awsch
lantz/drivers/tektronix/tds1012.py
3
6856
# -*- coding: utf-8 -*- """ lantz.drivers.tektronix.tds1012 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Implements the drivers to control an oscilloscope. :copyright: 2015 by Lantz Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. Source: Tektronix Manual """ impor...
bsd-3-clause
4,648,393,467,898,027,000
28.424893
92
0.547258
false
unapiedra/BBChop
BBChop/entropy.py
1
1059
# Copyright 2008 Ealdwulf Wuffinga # This file is part of BBChop. # # BBChop 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 ...
gpl-2.0
8,434,994,482,874,837,000
28.416667
73
0.678942
false
gmarkall/numba
numba/tests/test_hashing.py
2
11890
# -*- coding: utf-8 -*- """ Test hashing of various supported types. """ import unittest import sys import subprocess from collections import defaultdict from textwrap import dedent import numpy as np from numba import jit from numba.core import types, utils import unittest from numba.tests.support import TestCase,...
bsd-2-clause
9,025,825,448,722,313,000
32.640227
120
0.543579
false
aparo/pyes
pyes/contrib/mappings.py
6
1433
#!/usr/bin/env python # -*- coding: utf-8 -*- from future import print_function from pyes.es import ES from pyes import mappings def mappings_to_code(obj, doc_count=0): result = [] odict = obj.as_dict() if isinstance(obj, (mappings.DocumentObjectField, mappings.ObjectField, mappings.NestedObject)): ...
bsd-3-clause
-2,986,008,077,885,929,000
38.805556
109
0.508025
false
jjpsos/buddy-books
accounting/apps/books/models.py
2
14831
from decimal import Decimal as D from datetime import date from django.conf import settings from django.db import models from django.core.urlresolvers import reverse from django.core.validators import MaxValueValidator, MinValueValidator from django.contrib.contenttypes.fields import ( GenericForeignKey, Gener...
mit
4,129,681,992,870,755,000
30.82618
95
0.579395
false
7sDream/qqqfome
qqqfome/test/test_db.py
1
3247
import os import unittest import shutil from zhihu import ZhihuClient from .. import db file_dir = os.path.dirname(os.path.abspath(__file__)) test_dir = os.path.join(file_dir, 'test') json_path = os.path.join(file_dir, 'test.json') author = ZhihuClient(json_path).me() db_path = os.path.join(test_dir, db.author_to_d...
mit
2,914,056,600,617,124,000
27.482456
76
0.574684
false
knehez/edx-platform
common/test/acceptance/pages/lms/pay_and_verify.py
28
6439
"""Payment and verification pages""" import re from urllib import urlencode from bok_choy.page_object import PageObject, unguarded from bok_choy.promise import Promise, EmptyPromise from . import BASE_URL from .dashboard import DashboardPage class PaymentAndVerificationFlow(PageObject): """Interact with the spl...
agpl-3.0
-2,131,324,766,209,848,600
38.262195
126
0.633639
false
knowsis/pika
examples/tmp.py
12
14140
# -*- coding: utf-8 -*- import logging import pika import json LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) ' '-35s %(lineno) -5d: %(message)s') LOGGER = logging.getLogger(__name__) class ExamplePublisher(object): """This is an example publisher that will handle unexpected ...
bsd-3-clause
5,614,882,860,885,336,000
37.900826
80
0.629063
false
groschovskiy/lerigos_music
Server/API/lib/protorpc/generate_test.py
26
4728
#!/usr/bin/env python # # Copyright 2010 Google 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 o...
apache-2.0
2,934,610,787,526,945,000
30.105263
74
0.62923
false
overtherain/scriptfile
software/googleAppEngine/google/appengine/ext/go/__init__.py
3
13117
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
mit
405,327,432,642,739,650
22.052724
80
0.613021
false
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/test/test_urllib2_localnet.py
19
26224
import base64 import os import email import urllib.parse import urllib.request import http.server import unittest import hashlib from test import support threading = support.import_module('threading') try: import ssl except ImportError: ssl = None here = os.path.dirname(__file__) # Self-signed cert file for...
gpl-2.0
-3,460,005,752,569,179,000
36.950796
91
0.584045
false
kmike/scikit-learn
examples/decomposition/plot_ica_blind_source_separation.py
4
1512
""" ===================================== Blind source separation using FastICA ===================================== :ref:`ICA` is used to estimate sources given noisy measurements. Imagine 2 instruments playing simultaneously and 2 microphones recording the mixed signals. ICA is used to recover the sources ie. what ...
bsd-3-clause
-8,432,181,432,673,024,000
28.647059
79
0.583995
false
soarpenguin/ansible
lib/ansible/modules/cloud/google/gcpubsub.py
8
11780
#!/usr/bin/python # Copyright 2016 Google Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], ...
gpl-3.0
6,279,037,117,966,139,000
34.059524
157
0.645501
false
partofthething/home-assistant
tests/components/flux/test_switch.py
3
39615
"""The tests for the Flux switch platform.""" from unittest.mock import patch import pytest from homeassistant.components import light, switch from homeassistant.const import ( ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_TURN_ON, STATE_ON, SUN_EVENT_SUNRISE, ) from homeassistant.core import State from ...
mit
2,528,409,233,684,775,400
32.570339
86
0.587534
false
fermiPy/fermipy
fermipy/roi_model.py
1
83464
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function import os import copy import re import collections import numpy as np import xml.etree.cElementTree as ElementTree from astropy import units as u from astropy.coordinates import SkyCoord fro...
bsd-3-clause
-9,097,744,642,414,983,000
35.367756
122
0.527305
false
hugobuddel/orange3
Orange/widgets/utils/scaling.py
2
24980
from datetime import time import random import sys import numpy as np import Orange from Orange.statistics.basic_stats import DomainBasicStats from Orange.widgets.settings import Setting from Orange.widgets.utils.datacaching import getCached, setCached # noinspection PyBroadException def checksum(x): if x is No...
gpl-3.0
5,134,210,712,570,955,000
45.345083
157
0.561489
false
jinyu121/Canteen
CanteenWebsite/views.py
1
2840
# -*- coding: utf-8 -*- from django.shortcuts import get_object_or_404 from django.shortcuts import render from CanteenWebsite.models import Category, Goods from CanteenWebsite.utils.functions import get_goods_list from CanteenWebsite.utils.functions import setting_get, setting_get_json def index(request): index...
gpl-3.0
9,032,665,304,725,189,000
29.945055
88
0.617898
false
rzarzynski/tempest
tempest/thirdparty/boto/test_ec2_volumes.py
1
3038
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
1,652,370,888,184,995,300
38.454545
79
0.685978
false
fdintino/django-templatesadmin
templatesadmin/edithooks/gitcommit.py
10
2041
from django import forms from django.utils.translation import ugettext_lazy as _ from templatesadmin import TemplatesAdminException from templatesadmin.edithooks import TemplatesAdminHook import subprocess import os class GitCommitHook(TemplatesAdminHook): ''' Commit to git after saving ''' @classmet...
bsd-3-clause
7,133,179,707,200,737,000
30.4
110
0.579128
false
liggitt/docker-registry
depends/docker-registry-core/setup.py
5
3191
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014 Docker. # # 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 require...
apache-2.0
-3,957,196,294,774,160,400
35.261364
79
0.621122
false
dutradda/myreco
myreco/users/models.py
1
8064
# MIT License # Copyright (c) 2016 Diogo Dutra <dutradda@gmail.com> # 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, co...
mit
5,895,479,481,810,590,000
36.859155
130
0.611483
false
safwanrahman/standup
standup/main.py
3
3715
from datetime import date, timedelta from types import FunctionType, ModuleType from flask import Flask, redirect, request, session, url_for from flask.ext.funnel import Funnel from flask.ext.markdown import Markdown from flask.ext.seasurf import SeaSurf from standup.apps.status.helpers import get_weeks from standup.a...
bsd-3-clause
-7,101,002,513,292,639,000
28.72
75
0.58681
false