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
mnahm5/django-estore
Lib/site-packages/boto/route53/domains/exceptions.py
151
1482
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
-5,954,419,938,079,533,000
31.217391
77
0.773954
false
OECFHTW/oecluster
ConfigReader.py
1
1281
#!/usr/bin/env python3 # Author: Dennis Strasser mailto:dennis.f.strasser@gmail.com import configparser as cp __version__ = "1.0" class ConfigReader(object): """This class holds information on devices in the network This class holds information about people and their contact information: first- and last na...
gpl-3.0
6,495,406,647,925,238,000
32.736842
98
0.606557
false
YourCyborg/Sun-RPI
contrib/procpools/ampoule/util.py
11
1349
""" some utilities """ import os import sys import __main__ from twisted.python.filepath import FilePath from twisted.python.reflect import namedAny # from twisted.python.modules import theSystemPath def findPackagePath(modulePath): """ Try to find the sys.path entry from a modulePath object, simultaneously ...
bsd-3-clause
7,268,906,786,859,209,000
28.326087
75
0.571534
false
bigdatauniversity/edx-platform
cms/djangoapps/contentstore/tests/test_course_create_rerun.py
56
6545
""" Test view handler for rerun (and eventually create) """ import ddt from mock import patch from django.test.client import RequestFactory from django.core.urlresolvers import reverse from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.module...
agpl-3.0
-7,765,257,264,630,352,000
40.424051
103
0.625668
false
collects/VTK
IO/Parallel/Testing/Python/TestPImageWriter.py
26
1106
#!/usr/bin/env python # Image pipeline image1 = vtk.vtkTIFFReader() image1.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/beach.tif") # "beach.tif" image contains ORIENTATION tag which is # ORIENTATION_TOPLEFT (row 0 top, col 0 lhs) type. The TIFF # reader parses this tag and sets the internal TIFF image # orientation a...
bsd-3-clause
6,494,237,028,686,366,000
33.5625
70
0.72604
false
redhat-openstack/nova
nova/compute/task_states.py
96
3443
# Copyright 2010 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,718,094,032,887,881,000
29.201754
79
0.761255
false
Molecular-Image-Recognition/Molecular-Image-Recognition
code/rmgpy/molecule/inchiparsingTest.py
2
10760
################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu), # Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of cha...
mit
-2,858,925,954,339,895,000
30.008646
110
0.575186
false
s20121035/rk3288_android5.1_repo
external/chromium_org/chrome/common/extensions/docs/server2/github_file_system.py
94
7358
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import logging from StringIO import StringIO import posixpath from appengine_blobstore import AppEngineBlobstore, BLOBSTORE_GITHUB from appe...
gpl-3.0
1,699,410,625,209,069,000
35.068627
79
0.630334
false
matiasbastos/OpenBazaar
db/migrations/migration4.py
13
1172
#!/usr/bin/env python from sqlite3 import dbapi2 from db.migrations import migrations_util from node import constants def upgrade(db_path): with dbapi2.connect(db_path) as con: cur = con.cursor() # Use PRAGMA key to encrypt / decrypt database. cur.execute("PRAGMA key = '%s';" % constants...
mit
-948,316,967,070,537,200
24.478261
68
0.598123
false
ApuliaSoftware/odoo
addons/document/wizard/__init__.py
444
1084
# -*- 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...
agpl-3.0
226,657,315,443,608,860
46.130435
79
0.614391
false
gnieboer/tensorflow
tensorflow/python/kernel_tests/sparse_split_op_test.py
138
13629
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-3,189,077,713,412,103,000
51.419231
80
0.528065
false
giorgiop/scipy
scipy/weave/c_spec.py
69
17274
from __future__ import absolute_import, print_function import types from .base_spec import base_converter from . import base_info #---------------------------------------------------------------------------- # C++ code template for converting code from python objects to C++ objects # # This is silly code. There is a...
bsd-3-clause
7,594,355,164,598,437,000
33.826613
85
0.517772
false
ypwalter/fxos-certsuite
mcts/webapi_tests/runner.py
6
5731
#!/usr/bin/env python # 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/. import argparse import importlib import inspect import os import sys import json from fnmatch im...
mpl-2.0
6,789,878,653,626,368,000
38.524138
118
0.581225
false
papouso/odoo
addons/account_anglo_saxon/purchase.py
427
2043
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
6,522,724,168,079,495,000
50.075
163
0.636809
false
vFense/vFenseAgent-nix
agent/deps/mac/Python-2.7.5/lib/python2.7/encodings/latin_1.py
853
1264
""" Python 'latin-1' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is intended. ...
lgpl-3.0
3,691,114,265,572,473,000
24.28
69
0.714399
false
krasin/distcc
include_server/statistics.py
26
5225
#! /usr/bin/python2.4 # # Copyright 2007 Google Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program...
gpl-2.0
-5,764,029,085,873,324,000
41.827869
76
0.651292
false
EDUlib/edx-platform
lms/djangoapps/course_api/api.py
1
9596
""" Course API """ import logging import search from django.conf import settings from django.contrib.auth.models import AnonymousUser, User # lint-amnesty, pylint: disable=imported-auth-user from django.urls import reverse from edx_django_utils.monitoring import function_trace from edx_when.api import get_dates_for_c...
agpl-3.0
2,450,029,506,603,635,700
34.80597
120
0.661213
false
kxliugang/edx-platform
lms/djangoapps/shoppingcart/admin.py
102
5401
"""Django admin interface for the shopping cart models. """ from ratelimitbackend import admin from shoppingcart.models import ( PaidCourseRegistrationAnnotation, Coupon, DonationConfiguration, Invoice, CourseRegistrationCodeInvoiceItem, InvoiceTransaction ) class SoftDeleteCouponAdmin(admin.M...
agpl-3.0
5,062,077,787,923,228,000
29.173184
117
0.583966
false
Gagaro/django
tests/raw_query/tests.py
119
12624
from __future__ import unicode_literals from datetime import date from django.db.models.query_utils import InvalidQuery from django.test import TestCase, skipUnlessDBFeature from .models import Author, Book, BookFkAsPk, Coffee, FriendlyAuthor, Reviewer class RawQueryTests(TestCase): @classmethod def setUp...
bsd-3-clause
-1,756,418,811,569,301,000
39.987013
114
0.615177
false
Vitallium/qtwebkit
Tools/QueueStatusServer/model/queuepropertymixin.py
143
1888
# Copyright (C) 2010 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 ...
gpl-2.0
3,030,328,257,388,619,000
47.410256
72
0.762182
false
mmardini/django
django/utils/tzinfo.py
97
3923
"Implementation of tzinfo classes for use with datetime.datetime." from __future__ import unicode_literals from datetime import timedelta, tzinfo import time import warnings from django.utils.deprecation import RemovedInDjango19Warning from django.utils.encoding import force_str, force_text, DEFAULT_LOCALE_ENCODING ...
bsd-3-clause
1,605,501,269,668,640,000
32.529915
87
0.609737
false
bobbyluig/Eclipse
src/agility/maestro.py
1
14308
import logging import os import re import time import serial from serial import SerialTimeoutException import struct from threading import Lock from serial.tools import list_ports logger = logging.getLogger('universe') class Maestro: """ Implementation of the controller for Pololu Mini Maestro Controller. ...
mit
-4,576,758,437,617,067,500
28.081301
121
0.518661
false
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/contrib/databrowse/plugins/fieldchoices.py
252
3856
from django import http from django.db import models from django.contrib.databrowse.datastructures import EasyModel from django.contrib.databrowse.sites import DatabrowsePlugin from django.shortcuts import render_to_response from django.utils.text import capfirst from django.utils.encoding import smart_str, force_unico...
bsd-3-clause
6,303,347,376,358,011,000
51.108108
192
0.654824
false
hlzz/dotfiles
graphics/VTK-7.0.0/Examples/VisualizationAlgorithms/Python/officeTubes.py
1
12926
#!/usr/bin/env python # This example demonstrates the use of streamlines generated from seeds, # combined with a tube filter to create several streamtubes. import vtk from vtk.util.misc import vtkGetDataRoot from vtk.util.colors import * VTK_DATA_ROOT = vtkGetDataRoot() # We read a data file the is a CFD a...
bsd-3-clause
441,157,209,520,639,740
39.562701
97
0.805276
false
tangfeixiong/nova
nova/api/metadata/password.py
66
2255
# Copyright 2012 Nebula, 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
3,196,926,884,181,805,600
31.214286
78
0.657206
false
pplatek/odoo
openerp/addons/base/res/res_lang.py
196
12383
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
-558,673,050,745,888,060
40.834459
360
0.582977
false
retorquere/zotero-better-bibtex
util/rebalance.py
1
4472
#!/usr/bin/env python3 import os import sys import json from munch import Munch import re from ortools.algorithms import pywrapknapsack_solver ref, output = sys.argv[1:] if not ref.startswith('refs/heads/'): print(ref, 'is not a branch') sys.exit(0) branch = ref.split('/')[-1] print('rebalance', branch, '=>', ou...
mit
-2,670,604,152,361,744,400
30.055556
132
0.648703
false
cysnake4713/odoo
addons/l10n_ve/__openerp__.py
119
3056
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved ############################################################################## # Modu...
agpl-3.0
851,066,443,238,295,700
38.179487
84
0.628927
false
andela-angene/coursebuilder-core
coursebuilder/modules/gen_sample_data/gen_sample_data.py
3
14095
# Copyright 2016 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,964,948,595,752,979,000
39.156695
80
0.607166
false
dennis-sheil/commandergenius
project/jni/python/src/Lib/unittest.py
55
31107
#!/usr/bin/env python ''' Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's Smalltalk testing framework. This module contains the core framework classes that form the basis of specific test cases and suites (TestCase, TestSuite etc.), and also a text-based utility class for running the tests ...
lgpl-2.1
404,788,717,228,160,200
34.673165
120
0.580866
false
upfluence/thrift
test/py/TestEof.py
99
4327
#!/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 # "L...
apache-2.0
-4,550,086,354,317,055,500
30.816176
103
0.721978
false
cloudbase/maas
src/maas/tests/test_maas.py
1
3335
# Copyright 2012 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Test the maas package.""" from __future__ import ( absolute_import, print_function, unicode_literals, ) str = None __metaclass__ = type __all__ = [] from imp...
agpl-3.0
4,803,542,210,942,573,000
34.478723
75
0.666567
false
awslabs/chalice
chalice/app.py
1
57505
"""Chalice app and routing code.""" # pylint: disable=too-many-lines,ungrouped-imports import re import sys import os import logging import json import traceback import decimal import base64 import copy from collections import defaultdict __version__ = '1.15.1' _PARAMS = re.compile(r'{\w+}') # Implementation note: ...
apache-2.0
-2,183,618,951,717,483,300
34.873362
79
0.585671
false
sameerparekh/pants
tests/python/pants_test/base/test_source_root.py
1
11740
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import uni...
apache-2.0
4,507,649,707,946,665,500
45.587302
93
0.65954
false
mbedmicro/mbed
drivers/tests/TESTS/host_tests/usb_device_hid.py
13
24283
""" mbed SDK Copyright (c) 2019 ARM Limited SPDX-License-Identifier: Apache-2.0 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 ap...
apache-2.0
-441,544,937,942,665,340
41.084922
140
0.609851
false
XiaodunServerGroup/ddyedx
lms/djangoapps/bulk_email/tasks.py
12
33434
""" This module contains celery task functions for handling the sending of bulk email to a course. """ import re import random import json from time import sleep from dogapi import dog_stats_api from smtplib import SMTPServerDisconnected, SMTPDataError, SMTPConnectError, SMTPException from boto.ses.exceptions import (...
agpl-3.0
6,036,617,686,251,705,000
47.880117
143
0.674194
false
ashutrix03/inteygrate_flaskapp-master
google/protobuf/unittest_mset_wire_format_pb2.py
43
3837
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/unittest_mset_wire_format.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.pr...
gpl-3.0
-6,762,427,633,951,140,000
35.198113
369
0.763878
false
sunlianqiang/kbengine
kbe/res/scripts/common/Lib/encodings/cp855.py
272
33850
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
lgpl-3.0
-993,901,629,857,004,900
47.495702
97
0.605495
false
discosultan/quake-console
Samples/Sandbox/Lib/encodings/cp1252.py
594
13767
""" Python Character Mapping Codec cp1252 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
mit
1,227,096,920,908,572,400
43.843648
119
0.541658
false
ofilipowicz/owndb
owndb/settings.py
1
3421
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'templates'), ) SECRET_KEY = 'lv^ce%zv9ppcl(v-mix+-&x2q#1mtq3@qxl==_bvyqy-k9soru' DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = ['127.0.0.1', 'localhost'] CRISPY_TEMPLATE_PACK = 'bootstrap3' INSTALL...
mit
-7,748,935,676,172,451,000
23.775362
115
0.684996
false
PrashantJalan/Mail-Cat
dict_create.py
3
1060
import os from collections import Counter from collections import OrderedDict import nltk from nltk.tokenize import * from nltk.probability import * def main(): ran = range(3) d_file = open('dictionary2').readlines() dict_key = [] dict_occ = [] for line in d_file: tmp = line.strip() tmp = tmp.split() ...
apache-2.0
6,241,925,176,443,010,000
19
81
0.586792
false
fauferoth/assignment
.mywaflib/waflib/extras/c_dumbpreproc.py
5
1647
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ Dumb C/C++ preprocessor for finding dependencies It will look at all include files it can find after removing the comments, so the following will always add the dependency on both "a.h" and "b.h":: #include "a.h" #ifdef B #include "b.h" ...
bsd-3-clause
7,392,263,847,370,452,000
22.197183
91
0.661202
false
tadashi-aikawa/gemini
tests/addons/reqs2reqs/test_add.py
1
3227
#!/usr/bin/env python # -*- coding:utf-8 -*- from jumeaux.addons.reqs2reqs.add import Executor from jumeaux.models import Reqs2ReqsAddOnPayload class TestExec: def test(self): payload: Reqs2ReqsAddOnPayload = Reqs2ReqsAddOnPayload.from_dict( { "requests": [ ...
mit
-3,301,926,311,124,006,400
29.733333
100
0.335916
false
afourmy/pyNMS
pyNMS/views/geographical_view.py
2
7551
# Copyright (C) 2017 Antoine Fourmy <antoine dot fourmy at gmail dot com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # ...
gpl-3.0
3,257,773,493,125,700,000
40.038043
83
0.562442
false
KellyChan/Python
python/pygame/tetris/lib/shape.py
3
8684
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import pygame from pygame.locals import * import util class Tile: def __init__(self, color, image = None): self.color = color self.image = image class Shape(object): SHAPE_WIDTH = 4 SHAPE_HEIGHT = 4 SHAPES = ( ...
mit
5,305,063,147,295,004,000
33.324111
86
0.386343
false
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/atexit.py
336
1705
""" atexit.py - allow programmer to define multiple exit functions to be executed upon normal program termination. One public function, register, is defined. """ __all__ = ["register"] import sys _exithandlers = [] def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in rev...
gpl-2.0
-6,223,354,139,470,551,000
25.230769
77
0.617009
false
badele/home-assistant
homeassistant/components/isy994.py
1
7195
""" homeassistant.components.isy994 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Connects to an ISY-994 controller and loads relevant components to control its devices. Also contains the base classes for ISY Sensors, Lights, and Switches. For configuration details please visit the documentation for this component at https://home-a...
mit
-4,748,543,675,709,230,000
30.012931
79
0.608061
false
DougFirErickson/qgisSpaceSyntaxToolkit
esstoolkit/external/pyqtgraph/graphicsItems/GraphicsWidgetAnchor.py
54
4080
from ..Qt import QtGui, QtCore from ..Point import Point class GraphicsWidgetAnchor(object): """ Class used to allow GraphicsWidgets to anchor to a specific position on their parent. The item will be automatically repositioned if the parent is resized. This is used, for example, to anchor a LegendIte...
gpl-3.0
3,018,526,935,064,687,600
36.1
99
0.574755
false
thjashin/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/bijectors/affine_linear_operator_test.py
22
4097
# 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
5,642,595,157,304,309,000
39.97
118
0.599951
false
os2webscanner/os2webscanner
django-os2webscanner/os2webscanner/migrations/0040_auto_20180711_1457.py
1
1657
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-07-11 12:57 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import django.db.models.deletion import re class Migration(migrations.Migration): dependencies = [ ('os2webscanner', '00...
mpl-2.0
869,600,136,852,760,700
41.461538
232
0.621981
false
ksrajkumar/openerp-6.1
openerp/addons/base_report_designer/base_report_designer.py
9
3544
# -*- 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
-335,838,877,550,070,140
42.219512
122
0.617099
false
aviciimaxwell/odoo
addons/l10n_cr/__openerp__.py
178
3140
# -*- encoding: utf-8 -*- ############################################################################## # # __openerp__.py # l10n_cr_account # First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.) # Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserv...
agpl-3.0
-3,753,455,541,632,647,700
42
97
0.651481
false
Edraak/edraak-platform
lms/djangoapps/courseware/tests/test_date_summary.py
1
39412
# -*- coding: utf-8 -*- """Tests for course home page date summary blocks.""" from datetime import datetime, timedelta from unittest import expectedFailure import ddt import waffle from django.contrib.messages.middleware import MessageMiddleware from django.urls import reverse from django.test import RequestFactory fr...
agpl-3.0
8,317,066,071,711,990,000
46.541616
118
0.660154
false
twalthr/flink
flink-python/pyflink/table/examples/batch/word_count.py
7
2909
################################################################################ # 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...
apache-2.0
5,240,968,080,506,940,000
37.786667
87
0.617394
false
yanheven/nova
nova/api/openstack/compute/image_metadata.py
17
4909
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
-4,642,511,070,057,415,000
38.272
78
0.607048
false
pyblish/pyblish-mindbender
mindbender/vendor/jsonschema/_format.py
7
6861
import datetime import re import socket from .compat import str_types from .exceptions import FormatError class FormatChecker(object): """ A ``format`` property checker. JSON Schema does not mandate that the ``format`` property actually do any validation. If validation is desired however, instances ...
mit
1,373,410,227,191,824,400
27.5875
79
0.623524
false
T3chn3/HFP
webapp/cgi-bin/yate.py
22
1409
from string import Template def start_response(resp="text/html"): return('Content-type: ' + resp + '\n\n') def include_header(the_title): with open('templates/header.html') as headf: head_text = headf.read() header = Template(head_text) return(header.substitute(title=the_title)) def include_...
mit
5,209,247,901,168,296,000
31.022727
97
0.570617
false
metatoaster/mtj.eve.tracker
setup.py
1
1094
from setuptools import setup, find_packages import os version = '0.1' setup(name='mtj.eve.tracker', version=version, description="EVE Online Tracker", long_description=open("README.rst").read() + "\n" + open(os.path.join("docs", "HISTORY.rst")).read(), # Get more strings...
gpl-3.0
-6,037,068,777,053,820,000
28.567568
83
0.542962
false
mavit/ansible
lib/ansible/modules/remote_management/cobbler/cobbler_system.py
30
10729
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (dagwieers) <dag@wieers.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_ver...
gpl-3.0
8,278,635,266,465,479,000
31.122754
143
0.620188
false
xserty/piDS
Desktop/packages/rmutil/UnixDriveDetector.py
2
2004
import threading, sys, os, time, platform, getpass import wx if platform.system() == "Linux": from wx.lib.pubsub import setupkwargs from wx.lib.pubsub import pub as Publisher else: from wx.lib.pubsub import pub as Publisher if platform.system() == "Linux": if 'fedora' in platform.dist(): user =...
apache-2.0
-2,343,967,261,976,050,700
28.910448
105
0.616267
false
funson/rt-xen
tools/python/xen/xend/uuid.py
48
2410
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
4,761,479,265,060,507,000
33.927536
78
0.629046
false
certik/hermes2d
doc/exts/math_dollar.py
29
1813
import re def process_dollars(app, docname, source): r""" Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or ...
gpl-2.0
-5,361,060,455,385,804,000
33.207547
74
0.581908
false
TheNite/namebench
nb_third_party/dns/rdtypes/ANY/SOA.py
246
5180
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 SOFTWARE IS PROVIDED ...
apache-2.0
-7,461,407,450,437,549,000
39.787402
79
0.605019
false
commaai/panda
tests/gmlan_harness_test.py
1
1841
#!/usr/bin/env python3 import os import sys import time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) from panda import Panda # noqa: E402 WHITE_GMLAN_BUS = 3 OTHER_GMLAN_BUS = 1 def set_gmlan(p): if p.is_white(): p.set_gmlan(2) else: p.set_obd(True) def set_speed_kb...
mit
2,550,031,244,564,866,000
21.728395
88
0.573058
false
venthur/wyrm
test/test_variance.py
2
1975
from __future__ import division import unittest import numpy as np from wyrm.types import Data from wyrm.processing import variance from wyrm.processing import swapaxes class TestVariance(unittest.TestCase): def setUp(self): ones = np.ones((10, 5)) # epo with 0, 1, 2 data = np.array([0...
mit
-497,283,744,869,960,400
32.474576
104
0.6
false
jerem/django-rcsfield
rcsfield/backends/base.py
4
2535
""" Base-backends for django-rcsfield. Used to hold common functionality of all backends. Every backend module implementd a very simple API. Three functions are exported: * fetch(key, revision): knows how to fetch a specific revision of the entity referenced by ``key`` * commit(key, data): knows how to com...
bsd-3-clause
3,536,602,350,447,514,600
24.606061
78
0.58146
false
LeoZ123/Machine-Learning-Practice
Neural_Network/NeuralNetwork.py
1
3201
''' Created on Mar 28, 2017 @author: Leo Zhong ''' import numpy as np # for metrics calculation #define functions def tanh(x): return np.tanh(x) def tanh_deriv(x): #derivative for tanh return 1.0 - np.tanh(x)*np.tanh(x) def logistic(x): return 1/(1 + np.exp(-x)) def logistic_derivative(x): #deriv...
mit
-2,607,670,463,344,050,000
36.658824
145
0.531396
false
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/lib2to3/fixes/fix_filter.py
326
2107
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. NOTE: This...
mit
-478,892,793,403,422,900
26.723684
73
0.49122
false
ShinyROM/android_external_chromium_org
third_party/protobuf/python/google/protobuf/internal/test_util.py
210
27885
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
-8,758,407,188,119,171,000
41.834101
78
0.749937
false
olologin/scikit-learn
sklearn/gaussian_process/tests/test_kernels.py
24
11602
"""Testing for kernels for Gaussian processes.""" # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Licence: BSD 3 clause from collections import Hashable from sklearn.externals.funcsigs import signature import numpy as np from sklearn.gaussian_process.kernels import _approx_fprime from sklearn.metrics...
bsd-3-clause
7,330,010,547,592,769,000
39.425087
79
0.580848
false
meln1k/marathon
tests/system/test_marathon_universe.py
2
3834
"""Marathon acceptance tests for DC/OS.""" import common import pytest import retrying import shakedown from datetime import timedelta from dcos import packagemanager, cosmos PACKAGE_NAME = 'marathon' SERVICE_NAME = 'marathon-user' DCOS_SERVICE_URL = shakedown.dcos_service_url(PACKAGE_NAME) WAIT_TIME_IN_SECS = 300 ...
apache-2.0
-3,083,270,734,509,235,700
31.769231
120
0.701095
false
jhawkesworth/ansible
lib/ansible/modules/network/sros/sros_config.py
24
11717
#!/usr/bin/python # # Copyright: Ansible Project # 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', 'status': ['preview'],...
gpl-3.0
-957,531,138,906,939,900
33.461765
98
0.660408
false
theheros/kbengine
kbe/res/scripts/common/Lib/encodings/mac_arabic.py
37
37165
""" Python Character Mapping Codec generated from 'VENDORS/APPLE/ARABIC.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='st...
lgpl-3.0
-2,643,263,345,457,655,300
51.244986
121
0.597067
false
gdrouart/MrMoose
example_6z.py
1
6743
""" Example to generate a .fit, .mod and .dat file to feed in MrMoose for demonstration. The model consists of one single power-laws and two black bodies, with 15 data points. All is a mixture of unresolved and blended/spatially identified components, with the black bodies being at different redshifts (z=2 and z=4)...
gpl-3.0
3,316,391,897,436,469,000
45.503448
116
0.574818
false
sangwonl/audi
audi/external/babel/messages/catalog.py
32
31061
# -*- coding: utf-8 -*- """ babel.messages.catalog ~~~~~~~~~~~~~~~~~~~~~~ Data structures for message catalogs. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ import re import time from cgi import parse_header from datetime import datetime, time as time_...
mit
-8,528,485,071,606,959,000
37.158477
80
0.555649
false
kou/zulip
zerver/webhooks/opsgenie/view.py
2
2877
from typing import Any, Dict from django.http import HttpRequest, HttpResponse from zerver.decorator import webhook_view from zerver.lib.request import REQ, has_request_variables from zerver.lib.response import json_success from zerver.lib.webhooks.common import check_send_webhook_message from zerver.models import Us...
apache-2.0
2,424,016,864,085,093,400
33.25
92
0.58846
false
Southpaw-TACTIC/Team
src/python/Tools/Scripts/xxci.py
12
2914
#! /usr/bin/env python # xxci # # check in files for which rcsdiff returns nonzero exit status import sys import os from stat import * import fnmatch EXECMAGIC = '\001\140\000\010' MAXSIZE = 200*1024 # Files this big must be binaries and are skipped. def getargs(): args = sys.argv[1:] if a...
epl-1.0
-7,736,689,084,330,783,000
23.12069
77
0.519218
false
Turbo87/unp
unp.py
1
14021
import os import re import sys import tempfile import mimetypes import subprocess import click FILENAME = object() OUTPUT_FOLDER = object() unpackers = [] def register_unpacker(cls): unpackers.append(cls) return cls def fnmatch(pattern, filename): filename = os.path.basename(os.path.normcase(filename...
bsd-3-clause
5,356,846,646,418,419,000
28.455882
79
0.573996
false
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/test/test_mmap.py
68
27117
from test.support import (TESTFN, run_unittest, import_module, unlink, requires, _2G, _4G, gc_collect, cpython_only) import unittest import os import re import itertools import socket import sys import weakref # Skip test if we can't import mmap. mmap = import_module('mmap') PAGESIZE = mmap....
gpl-2.0
-3,300,664,779,693,129,700
34.034884
92
0.522255
false
arbn/pysaml2
src/saml2/attribute_converter.py
1
15064
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) s2010-2011 Umeå University # # 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/LICENS...
bsd-2-clause
2,492,450,620,617,873,000
30.578616
79
0.543185
false
francois-berder/PyLetMeCreate
letmecreate/core/led.py
1
4150
#!/usr/bin/env python3 """Python binding of LED wrapper of LetMeCreate library.""" import ctypes _LIB = ctypes.CDLL('libletmecreate_core.so') LED_0 = 0x01 LED_1 = 0x02 LED_2 = 0x04 LED_3 = 0x08 LED_4 = 0x10 LED_5 = 0x20 LED_6 = 0x40 LED_HEARTBEAT = LED_7 = 0x80 ALL_LEDS = 0xFF LED_CNT = 8 ON_OFF_MODE = 0 TIMER_MOD...
bsd-3-clause
-861,305,558,961,742,000
24.617284
80
0.660241
false
hfp/tensorflow-xsmm
tensorflow/contrib/solvers/python/kernel_tests/util_test.py
25
4551
# 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
-11,551,029,243,576,528
37.243697
80
0.59811
false
CloudVLab/professional-services
tools/kunskap/config.py
2
1957
# Copyright 2019 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 or agreed to in writing, ...
apache-2.0
3,037,083,664,925,990,000
46.756098
80
0.737353
false
admetricks/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/networktransaction.py
190
2926
# Copyright (C) 2010 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 ...
bsd-3-clause
-6,303,177,656,916,977,000
42.029412
141
0.698565
false
ulrich3110/mfc
deb-binarys/builds/mfc1_1.0-5/mfc1-1.0/debian/tmp/usr/share/mfc/mfc1/unity.py
8
9734
#!/usr/bin/python # -*- coding: utf-8 -*- # With the MindfulClock you turn your device into a Bell of Mindfulness. # Concept, Design: Marcurs Möller # <marcus.moeller@outlook.com> # <http://apps.microsoft.com/windows/de-de/app/ # mindfulclock/58063160-9cc6-4dee-9d92-...
gpl-3.0
6,150,682,328,313,115,000
31.661074
72
0.548649
false
tanglei528/glance
glance/tests/functional/test_api.py
2
11437
# 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
-4,177,968,227,368,540,700
37.379195
78
0.534406
false
rebost/django
tests/regressiontests/localflavor/cz/tests.py
14
2844
from __future__ import unicode_literals from django.contrib.localflavor.cz.forms import (CZPostalCodeField, CZRegionSelect, CZBirthNumberField, CZICNumberField) from django.core.exceptions import ValidationError from django.test import SimpleTestCase class CZLocalFlavorTests(SimpleTestCase): def test_CZRegi...
bsd-3-clause
-8,273,367,814,531,087,000
34.55
88
0.607243
false
gevero/deap
examples/ga/onemax_multidemic.py
12
3208
# This file is part of DEAP. # # DEAP 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, either version 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
lgpl-3.0
-1,750,802,172,140,172,000
31.40404
85
0.656484
false
kanagasabapathi/python-for-android
python3-alpha/python3-src/Lib/test/test_strlit.py
48
5040
r"""Test correct treatment of various string literals by the parser. There are four types of string literals: 'abc' -- normal str r'abc' -- raw str b'xyz' -- normal bytes br'xyz' -- raw bytes The difference between normal and raw strings is of course that in a raw string, \ escapes (while still u...
apache-2.0
230,466,298,823,862,820
33.054054
75
0.589484
false
jasonzio/azure-linux-extensions
OSPatching/test/handler.py
8
17930
#!/usr/bin/python # # OSPatching extension # # Copyright 2014 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
apache-2.0
-483,410,175,134,930,940
37.893709
144
0.638706
false
eaplatanios/tensorflow
tensorflow/python/ops/variable_scope.py
2
98348
# 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
5,479,059,549,037,443,000
41.890536
109
0.649622
false
bmaluenda/switch
switch_mod/operations/unitcommit/fuel_use.py
1
16280
# Copyright 2015 The Switch Authors. All rights reserved. # Licensed under the Apache License, Version 2, which is in the LICENSE file. """ This module describes fuel use with considerations of unit commitment and incremental heat rates using piecewise linear expressions. If you want to use this module directly in a ...
apache-2.0
4,700,517,471,249,071,000
48.036145
94
0.652764
false
iuliat/nova
nova/tests/functional/libvirt/test_numa_servers.py
45
6782
# Copyright (C) 2015 Red Hat, 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...
apache-2.0
-8,555,739,281,645,790,000
38.894118
78
0.60808
false
dparlevliet/zelenka-report-storage
server-local/twisted/python/test/test_versions.py
33
10680
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.versions}. """ from __future__ import division, absolute_import import sys import operator from io import BytesIO from twisted.python.versions import getVersionString, IncomparableVersions from twisted.python.vers...
lgpl-3.0
4,285,882,465,005,025,300
28.584488
83
0.603745
false
JioCloud/nova
nova/api/openstack/compute/plugins/v3/extended_availability_zone.py
36
2533
# Copyright 2013 Netease, LLC. # 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 appli...
apache-2.0
-6,183,704,412,703,806,000
35.710145
79
0.675484
false
rossgoodwin/drgonzo
en/wordnet/wordnet.py
11
41682
# Module wordnet.py # # Original author: Oliver Steele <steele@osteele.com> # Project Page: http://sourceforge.net/projects/pywordnet # # Copyright (c) 1998-2004 by Oliver Steele. Use is permitted under # the Artistic License # <http://www.opensource.org/licenses/artistic-license.html> """An OO interface to the WordN...
mit
-5,305,606,075,359,963,000
28.394922
348
0.639677
false
onpon4/naev
utils/econsim/datreader/readers.py
20
3932
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=80: import os try: from lxml import etree as ET except ImportError: try: import xml.etree.cElementTree as ET except ImportError: try: import xml.etree.ElementTree as ET except ImportError: print "Failed to ...
gpl-3.0
8,859,553,715,943,292,000
31.495868
80
0.572991
false
robinandeer/chanjo
chanjo/cli/init.py
1
2340
# -*- coding: utf-8 -*- import codecs from distutils.spawn import find_executable import logging import click from path import Path import ruamel.yaml from chanjo.store.api import ChanjoDB from chanjo.init.bootstrap import pull, BED_NAME, DB_NAME from chanjo.init.demo import setup_demo, DEMO_BED_NAME LOG = logging.g...
mit
8,033,946,010,021,633,000
33.925373
83
0.652137
false
rlefevre1/hpp-rbprm-corba
script/scenarios/demos/siggraph_asia/spiderman/spiderman_backJump_interp.py
2
3619
#/usr/bin/env python # author: Mylene Campana (mcampana@laas.fr) # Script which goes with hpp-rbprm-corba package. from hpp.corbaserver.rbprm.rbprmbuilder import Builder from hpp.corbaserver.rbprm.rbprmfullbody import FullBody from hpp.corbaserver.rbprm.problem_solver import ProblemSolver from hpp.gepetto import Viewe...
lgpl-3.0
2,974,597,252,151,675,000
51.449275
655
0.683614
false
stjokro/Project-1
project/target/node-modules/webjars/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py
912
3325
# 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. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
bsd-3-clause
6,552,016,852,190,611,000
37.218391
78
0.741353
false