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
halfcrazy/sqlalchemy
test/orm/inheritance/test_basic.py
20
85967
import warnings from sqlalchemy.testing import eq_, assert_raises, assert_raises_message from sqlalchemy import * from sqlalchemy import exc as sa_exc, util, event from sqlalchemy.orm import * from sqlalchemy.orm.util import instance_str from sqlalchemy.orm import exc as orm_exc, attributes from sqlalchemy.testing.asse...
mit
-7,046,855,701,815,503,000
32.051519
108
0.523782
false
albertomurillo/ansible
test/units/modules/network/netact/test_netact_cm_command.py
45
6140
""" netact_cm_command unit tests """ # -*- coding: utf-8 -*- # (c) 2017, Nokia # 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 ...
gpl-3.0
-8,699,252,866,255,818,000
33.886364
109
0.613518
false
google-research/google-research
widget_caption/widget_caption_input.py
1
12750
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
-1,863,721,539,412,627,700
38.351852
80
0.626824
false
jbedorf/tensorflow
tensorflow/python/platform/gfile.py
16
3104
# 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
-9,055,754,543,865,819,000
41.520548
84
0.736469
false
dhenyjarasandy/scrapy
scrapy/settings/__init__.py
124
6388
import six import json import copy import warnings from collections import MutableMapping from importlib import import_module from scrapy.utils.deprecate import create_deprecated_class from scrapy.exceptions import ScrapyDeprecationWarning from . import default_settings SETTINGS_PRIORITIES = { 'default': 0, ...
bsd-3-clause
-3,847,352,507,335,712,000
29.274882
80
0.605823
false
richardcs/ansible
lib/ansible/utils/listify.py
100
1497
# (c) 2014 Michael DeHaan, <michael@ansible.com> # # 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 ve...
gpl-3.0
-1,302,617,522,038,712,000
36.425
111
0.744823
false
bmya/odoo_addons
smile_account_voucher_group/models/__init__.py
3
1087
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
-8,591,281,851,842,109,000
40.846154
78
0.624655
false
kvar/ansible
contrib/inventory/vmware.py
37
18538
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' VMware Inventory Script ======================= Retrieve information about virtual machines from a vCenter server or standalone ESX host. When `group_by=false` (in the INI file), host systems are also returned in addition to VMs. This script will attempt to read conf...
gpl-3.0
320,618,237,562,737,800
38.275424
109
0.552379
false
trondeau/gnuradio-old
gr-filter/python/filter/design/fir_design.py
11
15888
# Copyright 2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # # G...
gpl-3.0
7,824,394,102,915,052,000
37.563107
85
0.52291
false
wimmuskee/mangrove
mangrove_libs/common.py
1
3122
# -*- coding: utf-8 -*- """ This module contains common functions for the mangrove crawler. Wim Muskee, 2013-2018 wimmuskee@gmail.com License: GPL-3 """ def getConfig(configfile,section): import json with open(configfile, "r") as f: configdata = json.loads(f.read()) config = {} config.update(configdata["commo...
gpl-3.0
-1,825,093,449,538,365,000
23.582677
113
0.704676
false
akd001/RPi
testRainbow.py
1
1361
import os, sys, subprocess, time from rainbowhatwrapper.handlers import * #CONSTANTS BUTTON_A_STATE = False BUTTON_B_STATE = False BUTTON_C_STATE = False def showUptime(): while True: test = subprocess.Popen(["uptime"], stdout=subprocess.PIPE) output = test.communicate()[0].split()[0].split(':') ...
mit
5,096,596,720,794,866,000
27.354167
67
0.613519
false
IntelLabs/numba
numba/tests/test_sort.py
7
33874
import copy import itertools import math import random import sys import numpy as np from numba.core.compiler import compile_isolated, Flags from numba import jit, njit from numba.core import types, utils, errors import unittest from numba import testing from numba.tests.support import TestCase, MemoryLeakMixin, tag ...
bsd-2-clause
8,587,712,500,323,978,000
30.540037
84
0.537551
false
FireballDWF/cloud-custodian
tools/c7n_salactus/setup.py
5
1310
# Copyright 2015-2017 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
-8,154,533,179,692,813,000
32.589744
74
0.69313
false
trungnt13/scikit-learn
sklearn/decomposition/tests/test_dict_learning.py
47
8095
import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises ...
bsd-3-clause
992,158,262,290,243,100
36.304147
79
0.633354
false
SaschaMester/delicium
third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_dart_generator.py
1
17908
# Copyright 2014 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. """Generates dart source files from a mojom.Module.""" import os import re import shutil import sys import mojom.generate.constant_resolver as resolver imp...
bsd-3-clause
-3,463,575,132,767,874,000
36.230769
79
0.651385
false
thinkopensolutions/odoo-saas-tools
saas_server_backup_ftp/models/saas_server.py
1
2303
# -*- coding: utf-8 -*- import tempfile from odoo import api, models import logging _logger = logging.getLogger(__name__) try: import pysftp except ImportError: _logger.debug('saas_server_backup_ftp requires the python library pysftp which is not found on your installation') class SaasServerClient(models.Mode...
lgpl-3.0
-2,214,371,601,603,189,500
38.033898
118
0.577073
false
uclouvain/osis
base/tests/utils/test_operator.py
1
2143
# ############################################################################ # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business i...
agpl-3.0
-7,646,645,716,573,557,000
39.415094
85
0.654062
false
NewpTone/stacklab-nova
debian/tmp/usr/lib/python2.7/dist-packages/nova/tests/test_configdrive2.py
7
3462
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Michael Still and Canonical 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:...
apache-2.0
231,965,157,446,457,250
32.941176
78
0.586944
false
colognecoin/colognecoin
contrib/bitrpc/bitrpc.py
239
7836
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") else: access = Ser...
mit
-956,826,790,930,642,200
23.185185
79
0.66169
false
tortib/nzbToMedia
libs/requests/models.py
16
26200
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
gpl-3.0
-4,308,682,372,408,899,000
31.790989
114
0.564046
false
j-carl/ansible
hacking/build_library/build_ansible/command_plugins/release_announcement.py
55
2905
# coding: utf-8 # Copyright: (c) 2019, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import sys from collections import UserString from...
gpl-3.0
-639,490,687,652,711,700
36.24359
118
0.651635
false
eugena/django
django/contrib/sessions/backends/signed_cookies.py
383
2895
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase from django.core import signing class SessionStore(SessionBase): def load(self): """ We load the data from the key itself instead of fetching from some external data store. Opposite of _get_sess...
bsd-3-clause
-5,067,759,374,344,561,000
34.304878
78
0.611054
false
fubecka/f5-dashboard
flask/lib/python2.6/site-packages/dns/rdtypes/txtbase.py
100
2994
# Copyright (C) 2006, 2007, 2009-2011 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
4,395,238,382,831,395,000
33.413793
79
0.604208
false
guschmue/tensorflow
tensorflow/python/kernel_tests/concatenate_dataset_op_test.py
42
5552
# Copyright 2017 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
-780,461,672,860,085,100
40.432836
80
0.626261
false
eneldoserrata/marcos_openerp
addons/product_container/product_container.py
1
1581
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
8,024,555,889,463,130,000
39.564103
136
0.617963
false
bioinformatics-ua/montra
emif/questionnaire/migrations/0006_auto__chg_field_choice_value__chg_field_choice_text_en__chg_field_ques.py
2
12721
# -*- coding: utf-8 -*- # Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/ # # 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 vers...
gpl-3.0
-1,646,891,356,422,549,800
68.513661
182
0.574955
false
cmdunkers/DeeperMind
PythonEnv/lib/python2.7/site-packages/scipy/weave/examples/fibonacci.py
100
3980
# Typical run: # C:\home\eric\wrk\scipy\weave\examples>python fibonacci.py # Recursively computing the first 30 fibonacci numbers: # speed in python: 4.31599998474 # speed in c: 0.0499999523163 # speed up: 86.32 # Looping to compute the first 30 fibonacci numbers: # speed in python: 0.000520999908447 # speed in c:...
bsd-3-clause
-4,900,537,793,102,703,000
25.711409
70
0.489698
false
SGenheden/lammps
tools/moltemplate/src/postprocess_input_script.py
19
5958
#!/usr/bin/env python """ Reorder the integer arguments to the commands in a LAMMPS input file if these arguments violate LAMMPS order requirements. We have to do this because the moltemplate.sh script will automatically assign these integers in a way which may violate these restrictions and the user ...
gpl-2.0
5,572,488,333,122,137,000
39.530612
106
0.521652
false
marionleborgne/cloudbrain-websocket-server
src/cbws/server.py
2
12783
import pika import json import logging from collections import defaultdict from sockjs.tornado.conn import SockJSConnection from sockjs.tornado import SockJSRouter from tornado.ioloop import IOLoop from tornado.web import Application from uuid import uuid4 from cloudbrain.core.auth import CloudbrainAuth _LOGGER = l...
agpl-3.0
2,093,842,810,976,430,600
38.946875
80
0.565751
false
andrewyoung1991/scons
test/option/h.py
5
2083
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, modify, merge, publish, ...
mit
1,557,185,321,229,121,500
32.063492
73
0.707633
false
larsbutler/coveragepy
tests/helpers.py
2
1599
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Helpers for coverage.py tests.""" import subprocess def run_command(cmd): """Run a command in a sub-process. Returns the exit status code and the com...
apache-2.0
-779,119,421,239,343,000
29.75
79
0.636648
false
wskplho/sl4a
python/python-twitter/simplejson/decoder.py
135
12032
"""Implementation of JSONDecoder """ import re import sys import struct from simplejson.scanner import make_scanner try: from simplejson._speedups import scanstring as c_scanstring except ImportError: c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconst...
apache-2.0
-7,300,721,329,885,309,000
33.574713
108
0.523188
false
BhallaLab/moose-examples
traub_2005/py/fig_a3.py
1
3700
# fig_a3.py --- # # Filename: fig_a3.py # Description: # Author: # Maintainer: # Created: Wed Jun 26 17:07:59 2013 (+0530) # Version: # Last-Updated: Sun Jun 25 15:09:46 2017 (-0400) # By: subha # Update #: 162 # URL: # Keywords: # Compatibility: # # # Commentary: # # # # # Change log: #...
gpl-2.0
8,776,512,083,494,052,000
28.83871
110
0.622703
false
alsrgv/tensorflow
tensorflow/contrib/periodic_resample/__init__.py
56
1176
# ============================================================================= # 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 #...
apache-2.0
3,581,821,861,418,024,400
42.555556
98
0.668367
false
vanda/DigitalLabels
labels/management/commands/build.py
1
2432
import codecs import os from distutils.dir_util import copy_tree from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand from django.test.client import Client from django.template.defaultfilters import slugify from labels.models import DigitalLabel, Portal ...
bsd-3-clause
-2,034,072,627,371,936,000
34.246377
89
0.580592
false
kpingul/shoppingWidget
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/ninja.py
372
89149
# Copyright (c) 2013 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. import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp import gyp.common impo...
mit
-4,818,809,088,044,118,000
40.464651
80
0.623731
false
finfish/scrapy
scrapy/spidermiddlewares/offsite.py
7
2563
""" Offsite Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import re import logging import warnings from scrapy import signals from scrapy.http import Request from scrapy.utils.httpobj import urlparse_cached logger = logging.getLogger(__name__) class OffsiteMiddleware(object): de...
bsd-3-clause
2,582,497,211,499,517,400
34.597222
87
0.587202
false
Theer108/invenio
invenio/utils/remote_debugger/__init__.py
5
10582
# This file is part of Invenio. # Copyright (C) 2011, 2013, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # ...
gpl-2.0
4,239,405,827,464,427,000
34.993197
104
0.63419
false
rodrigods/keystone
keystone/catalog/backends/sql.py
1
12218
# Copyright 2012 OpenStack Foundation # Copyright 2012 Canonical Ltd. # # 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 b...
apache-2.0
2,021,438,495,803,324,000
38.540453
78
0.600589
false
GeorgePlukov/FloodWatch
XBee-2.2.3/xbee/tests/test_zigbee.py
27
9957
""" test_zigbee.py By Paul Malmsten, 2010 pmalmsten@gmail.com Tests the XBee ZB (ZigBee) implementation class for API compliance """ import unittest from xbee.zigbee import ZigBee class TestZigBee(unittest.TestCase): """ Tests ZigBee-specific features """ def setUp(self): self.zigbee = ZigBe...
mit
7,955,033,661,075,280,000
39.149194
157
0.487998
false
megamanfx/grit-i18n
grit/format/policy_templates/writers/android_policy_writer.py
17
3492
#!/usr/bin/env python # Copyright (c) 2015 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. from grit.format.policy_templates.writers import xml_formatted_writer from xml.dom import minidom from xml.sax import saxutils as ...
bsd-2-clause
4,386,340,638,288,412,000
33.92
78
0.712199
false
lduarte1991/edx-platform
common/djangoapps/terrain/stubs/tests/test_youtube_stub.py
172
2639
""" Unit test for stub YouTube implementation. """ import unittest import requests from ..youtube import StubYouTubeService class StubYouTubeServiceTest(unittest.TestCase): def setUp(self): super(StubYouTubeServiceTest, self).setUp() self.server = StubYouTubeService() self.url = "http://...
agpl-3.0
-6,676,355,011,518,009,000
32.833333
106
0.598712
false
gregoil/rotest
src/rotest/management/common/messages.py
1
6686
"""Holds the common resource management messages.""" from __future__ import absolute_import from abc import ABCMeta from basicstruct import BasicStruct import six def slots_extender(new_slots): """Extender decorator to add new slots to the wrapped class. Arguments: new_slots (tuple): new slots names...
mit
-3,526,486,222,228,703,700
23.490842
79
0.664523
false
totalspectrum/binutils-propeller
gdb/testsuite/gdb.perf/lib/perftest/reporter.py
7
2912
# Copyright (C) 2013-2017 Free Software Foundation, 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 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
-8,975,248,715,284,600,000
33.258824
73
0.644231
false
nitzmahone/ansible
lib/ansible/module_utils/aws/waf.py
71
7415
# Copyright (c) 2017 Will Thames # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign the...
gpl-3.0
-1,828,308,143,459,802,600
36.831633
120
0.685233
false
werbk/task-6.19
conftest.py
1
2403
import pytest import logging import json import jsonpickle import os.path import importlib from fixture.TestBase import BaseClass from fixture.variables import UserLogin fixture = None target = None @pytest.fixture def app(request): global fixture global target browser = request.config.getoption('--bro...
apache-2.0
-698,316,811,076,072,600
32.375
116
0.685393
false
gerrive/horizon
openstack_dashboard/test/test_data/heat_data.py
6
15719
# 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 # d...
apache-2.0
8,522,080,738,482,221,000
25.732993
79
0.535976
false
Jumpscale/jumpscale6_core
apps/portalbase/wiki/Help/.macros/wiki/menuadmin_jdoc/1_menuadmin.py
2
1685
def main(j, args, params, tags, tasklet): params.merge(args) doc = params.doc tags = params.tags params.result = "" # spaces = sorted(j.core.portal.active.getSpaces()) # spacestxt="" # for item in spaces: # if item[0] != "_" and item.strip() != "" and item.find("space_system")==...
bsd-2-clause
6,718,596,536,480,113,000
31.403846
333
0.652819
false
anthonypdawson/LazyLibrarian
lazylibrarian/providers.py
1
4430
import time, threading, urllib, urllib2, re from xml.etree import ElementTree import lazylibrarian from lazylibrarian import logger, SimpleCache def NewzNab(book=None): HOST = lazylibrarian.NEWZNAB_HOST results = [] logger.info('Searching for %s.' % book['searchterm']) if lazylibrarian.EBOOK_TYP...
gpl-3.0
2,962,947,908,830,664,000
32.308271
116
0.531603
false
geodrinx/gearthview
ext-libs/twisted/internet/_utilspy3.py
4
1916
# -*- test-case-name: twisted.internet.test.test_utilspy3 -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Utility methods, ported to Python 3. """ from __future__ import division, absolute_import import sys, warnings from functools import wraps from twisted.python.compat import rerai...
gpl-3.0
-5,045,512,847,922,240,000
31.474576
77
0.680585
false
maestro-hybrid-cloud/horizon
openstack_dashboard/dashboards/identity/domains/views.py
55
3604
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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
-4,943,588,318,440,621,000
38.604396
79
0.61737
false
abhattad4/Digi-Menu
digimenu2/tests/foreign_object/tests.py
113
18071
import datetime from operator import attrgetter from django import forms from django.core.exceptions import FieldError from django.test import TestCase, skipUnlessDBFeature from django.utils import translation from .models import ( Article, ArticleIdea, ArticleTag, ArticleTranslation, Country, Friendship, Gro...
bsd-3-clause
740,984,528,308,543,400
42.649758
100
0.629462
false
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/v8/tools/testrunner/objects/testcase.py
5
4522
# Copyright 2012 the V8 project authors. 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 conditi...
gpl-3.0
6,685,673,053,489,947,000
39.017699
76
0.693498
false
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/_pytest/helpconfig.py
180
5120
""" version info, help messages, tracing configuration. """ import py import pytest import os, sys def pytest_addoption(parser): group = parser.getgroup('debugconfig') group.addoption('--version', action="store_true", help="display pytest lib version and import information.") group._addoption(...
mit
8,628,898,305,592,721,000
35.834532
85
0.588281
false
anu7495/airmozilla
airmozilla/manage/tests/test_helpers.py
5
2690
import datetime import time import jinja2 from nose.tools import ok_, eq_ from django.test import TestCase from airmozilla.main.models import Event from airmozilla.manage.helpers import ( almost_equal, event_status_to_css_label, format_message, formatduration, ) class TestAlmostEqual(TestCase): ...
bsd-3-clause
3,100,442,478,348,697,000
28.888889
67
0.597398
false
DigiThinkIT/stem
stem/response/authchallenge.py
5
1910
# Copyright 2012-2014, Damian Johnson and The Tor Project # See LICENSE for licensing information import binascii import stem.response import stem.socket import stem.util.str_tools import stem.util.tor_tools class AuthChallengeResponse(stem.response.ControlMessage): """ AUTHCHALLENGE query response. :var str...
lgpl-3.0
5,278,053,603,694,529,000
33.107143
178
0.71466
false
w1ll1am23/home-assistant
homeassistant/components/vesync/switch.py
5
3299
"""Support for VeSync switches.""" import logging from homeassistant.components.switch import SwitchEntity from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from .common import VeSyncDevice from .const import DOMAIN, VS_DISCOVERY, VS_DISPATCHERS, VS_SWITCHES...
apache-2.0
-5,434,911,877,750,015,000
29.546296
81
0.639285
false
pgmillon/ansible
lib/ansible/modules/crypto/acme/acme_inspect.py
20
12317
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018 Felix Fontein (@felixfontein) # 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,306,604,026,821,203,000
36.666667
144
0.642039
false
antamb/google-personal-assistant
src/actionbase.py
2
2216
# Copyright 2017 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
5,235,013,703,083,971,000
28.546667
80
0.66065
false
mffrench/fabric
bddtests/steps/docgen.py
5
13747
# Copyright IBM Corp. 2016 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
-36,151,572,556,608,720
48.992727
246
0.669673
false
martynovp/edx-platform
common/test/acceptance/tests/studio/test_studio_acid_xblock.py
130
6909
""" Acceptance tests for Studio related to the acid xblock. """ from bok_choy.web_app_test import WebAppTest from ...pages.studio.auto_auth import AutoAuthPage from ...pages.studio.overview import CourseOutlinePage from ...pages.xblock.acid import AcidView from ...fixtures.course import CourseFixture, XBlockFixtureDes...
agpl-3.0
7,982,573,496,535,149,000
32.538835
104
0.590389
false
rasata/ansible
lib/ansible/plugins/filter/core.py
10
9635
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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
8,999,721,198,015,210,000
28.829721
147
0.601661
false
apark263/tensorflow
tensorflow/python/keras/optimizer_v2/ftrl_test.py
13
17873
# 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
-4,569,386,590,583,247,000
39.345372
118
0.625133
false
muffinresearch/olympia
scripts/siege.py
24
2862
""" A script for generating siege files with a bunch of URL variations. """ import re import sys part_re = re.compile(r'\{([-\w]+)\}') AMO_LANGUAGES = ( 'af', 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-US', 'es', 'eu', 'fa', 'fi', 'fr', 'ga-IE', 'he', 'hu', 'id', 'it', 'ja', 'ko', 'mn', 'nl', 'pl', 'pt-BR', ...
bsd-3-clause
2,501,134,686,683,015,700
28.505155
78
0.566038
false
fredericgermain/linux-sunxi
tools/perf/util/setup.py
989
1543
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
-3,433,588,358,836,454,000
31.145833
82
0.666883
false
ritchiewilson/majormajor
tests/majormajor_tests/test_majormajor_helpers.py
1
1120
# MajorMajor - Collaborative Document Editing Library # Copyright (C) 2013 Ritchie Wilson # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option)...
gpl-3.0
-2,733,914,405,155,297,000
34
71
0.733929
false
yilei0620/3D_Conditional_Gan
lib/data_utils.py
1
1596
import numpy as np from sklearn import utils as skutils from rng import np_rng, py_rng def center_crop(x, ph, pw=None): if pw is None: pw = ph h, w = x.shape[:2] j = int(round((h - ph)/2.)) i = int(round((w - pw)/2.)) return x[j:j+ph, i:i+pw] def patch(x, ph, pw=None): if pw is None: ...
mit
2,082,431,232,394,358,500
23.553846
61
0.536341
false
Changaco/oh-mainline
vendor/packages/scrapy/scrapy/utils/project.py
19
1474
from os.path import join, dirname, abspath, isabs, exists from os import makedirs, environ import warnings from scrapy.utils.conf import closest_scrapy_cfg, get_config from scrapy.utils.python import is_writable from scrapy.exceptions import NotConfigured DATADIR_CFG_SECTION = 'datadir' def inside_project(): scr...
agpl-3.0
1,417,129,636,767,579,000
34.095238
91
0.672999
false
Worldify/Worldify
worldify/config.py
1
1709
import os from ConfigParser import ConfigParser from .exceptions import WorldifyConfigException class WorldifyConfig(object): def __init__(self): self._config_path = os.path.expanduser("~/.worldify") self.conf = ConfigParser() self.conf.read(self._config_path) self._check_config_...
gpl-3.0
-342,856,834,993,548,000
42.820513
98
0.587478
false
agrista/odoo-saas
addons/base_geolocalize/models/res_partner.py
239
3743
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013_Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
-636,352,200,834,316,500
41.534091
145
0.555971
false
sogis/Quantum-GIS
python/ext-libs/pygments/lexers/_clbuiltins.py
370
14015
# -*- coding: utf-8 -*- """ pygments.lexers._clbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ANSI Common Lisp builtins. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ BUILTIN_FUNCTIONS = [ # 638 functions '<', '<=', '=', '>', '>=', '-', '...
gpl-2.0
3,619,368,868,533,806,600
59.409483
80
0.629825
false
Softmotions/edx-platform
lms/djangoapps/survey/models.py
89
8631
""" Models to support Course Surveys feature """ import logging from lxml import etree from collections import OrderedDict from django.db import models from student.models import User from django.core.exceptions import ValidationError from model_utils.models import TimeStampedModel from survey.exceptions import Surv...
agpl-3.0
-1,312,584,718,714,951,400
32.714844
106
0.610358
false
ebrelsford/v2v
vacant_to_vibrant/steward/migrations/0007_auto__add_field_stewardproject_external_id.py
1
10857
# -*- 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): # Adding field 'StewardProject.external_id' db.add_column(u'steward_stewardproject', 'external_id', ...
gpl-3.0
5,375,956,182,319,262,000
76.557143
205
0.556231
false
win0x86/Lab
mitm/libmproxy/proxy.py
1
24823
import sys, os, string, socket, time import shutil, tempfile, threading import SocketServer from OpenSSL import SSL from netlib import odict, tcp, http, wsgi, certutils, http_status, http_auth import utils, flow, version, platform, controller KILL = 0 class ProxyError(Exception): def __init__(self, code, msg, h...
gpl-3.0
-6,472,913,926,707,689,000
38.52707
187
0.551303
false
yesbox/ansible
lib/ansible/cli/playbook.py
21
9325
#!/usr/bin/env python # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # 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 # (...
gpl-3.0
-8,271,853,953,624,678,000
41.97235
166
0.560107
false
dimagi/rapidsms-contrib-apps-dev
handlers/tests.py
1
1655
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from nose.tools import assert_equal from rapidsms.conf import settings from .utils import get_handlers def test_get_handlers(): # store current settings. _settings = ( settings.INSTALLED_APPS, settings.INSTALLED_HANDLERS, settings.E...
bsd-3-clause
-7,531,617,202,543,421,000
31.45098
73
0.711178
false
martatolos/DemandAnalysis
visualizations.py
1
5518
# Plots import matplotlib.pyplot as plt import matplotlib import numpy as np import re import random def plot_several_countries(df, ylabel, title, country_list="", save=False, num="", xticks_hourly=False, kind='bar', linestyle='-', color='mbygcr', marker='o', linewidth=4.0, fontsize=16, legend=True): """ This...
gpl-2.0
8,165,022,937,362,936,000
33.49375
200
0.631026
false
MrSenko/Nitrate
tcms/testruns/urls/run_urls.py
1
1045
# -*- coding: utf-8 -*- from django.conf.urls import url, patterns from tcms.testruns.views import TestRunReportView from tcms.testruns.views import AddCasesToRunView urlpatterns = patterns( 'tcms.testruns.views', url(r'^new/$', 'new'), url(r'^(?P<run_id>\d+)/$', 'get'), url(r'^(?P<run_id>\d+)/clone/...
gpl-2.0
-8,638,650,171,695,771,000
33.833333
70
0.562679
false
Shaps/ansible
test/units/module_utils/common/test_collections.py
39
5024
# -*- coding: utf-8 -*- # Copyright (c) 2018–2019, Sviatoslav Sydorenko <webknjaz@redhat.com> # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) """Test low-level utility functions from ``module_utils.common.collections``.""" from __future__ import absolute_impor...
gpl-3.0
-6,191,244,763,495,012,000
29.722222
106
0.667269
false
gqwest-erp/server
openerp/addons/purchase_analytic_plans/__init__.py
441
1220
# -*- 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
-2,668,753,712,663,796,000
42.571429
79
0.553279
false
mxia/engine
build/android/gyp/create_java_binary_script.py
26
2379
#!/usr/bin/env python # # Copyright 2014 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. """Creates a simple script to run a java "binary". This creates a script that sets up the java command line for running a java jar. ...
bsd-3-clause
-5,235,848,678,749,257,000
29.896104
80
0.702816
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.3.0/Lib/test/test_macpath.py
62
4985
import macpath from test import support, test_genericpath import unittest class MacPathTestCase(unittest.TestCase): def test_abspath(self): self.assertEqual(macpath.abspath("xx:yy"), "xx:yy") def test_isabs(self): isabs = macpath.isabs self.assertTrue(isabs("xx:yy")) self.ass...
mit
3,482,159,813,867,012,600
38.251969
73
0.559478
false
apache/allura
ForgeSVN/forgesvn/model/svn.py
2
31204
# 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 (t...
apache-2.0
-9,013,672,863,622,275,000
37.428571
118
0.540251
false
TheMOOCAgency/edx-platform
lms/djangoapps/grades/config/forms.py
16
1207
""" Defines a form for providing validation of subsection grade templates. """ import logging from django import forms from lms.djangoapps.grades.config.models import CoursePersistentGradesFlag from opaque_keys import InvalidKeyError from xmodule.modulestore.django import modulestore from opaque_keys.edx.locator imp...
agpl-3.0
-1,398,700,677,401,873,200
31.621622
111
0.690141
false
mayblue9/scikit-learn
benchmarks/bench_multilabel_metrics.py
276
7138
#!/usr/bin/env python """ A comparison of multilabel target formats and metrics over them """ from __future__ import division from __future__ import print_function from timeit import timeit from functools import partial import itertools import argparse import sys import matplotlib.pyplot as plt import scipy.sparse as...
bsd-3-clause
2,424,201,460,111,960,000
36.568421
79
0.566545
false
nearlyfreeapps/python-googleadwords
examples/adspygoogle/adwords/v201109/basic_operations/get_campaigns.py
1
2192
#!/usr/bin/python # # Copyright 2011 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 b...
apache-2.0
-3,083,286,908,601,078,000
28.226667
77
0.632299
false
klenks/jobsportal
venv/bin/activate_this.py
1076
1137
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
mit
-8,731,092,708,964,023,000
32.441176
113
0.686895
false
40223133/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/xml/dom/minidom.py
727
66854
"""Simple implementation of the Level 1 DOM. Namespaces and other minor Level 2 features are also supported. parse("foo.xml") parseString("<foo><bar/></foo>") Todo: ===== * convenience methods for getting elements and text. * more testing * bring some of the writer and linearizer code into conformance with this ...
gpl-3.0
-4,043,681,963,868,571,000
32.662638
87
0.582164
false
cts2/rf2service
server/Server.py
1
3285
# -*- coding: utf-8 -*- # Copyright (c) 2013, Mayo Clinic # 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...
bsd-3-clause
-5,629,486,767,426,773,000
28.863636
99
0.64414
false
tkaitchuck/nupic
external/darwin64/lib/python2.6/site-packages/numpy/random/setupscons.py
100
1384
import glob from os.path import join, split def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration, get_mathlibs config = Configuration('random',parent_package,top_path) source_files = [join('mtrand', i) for i in ['mtrand.c', ...
gpl-3.0
2,377,368,257,002,301,400
33.6
69
0.438584
false
rodrigob/fuel
fuel/datasets/iris.py
6
1038
from fuel.datasets import H5PYDataset from fuel.utils import find_in_data_path class Iris(H5PYDataset): u"""Iris dataset. Iris [LBBH] is a simple pattern recognition dataset, which consist of 3 classes of 50 examples each having 4 real-valued features each, where each class refers to a type of iris p...
mit
-3,161,591,163,736,271,400
32.483871
75
0.654143
false
vipints/oqtans
oqtans_tools/KIRMES/0.8/src/kmotif.py
2
10908
""" ####################################################################################### # # # kmotif.py is a command-line front-end to the KIRMES pipeline # # BibTeX entries below. Please cite: ...
bsd-3-clause
6,343,213,143,473,994,000
49.734884
194
0.556197
false
f-prettyland/angr
angr/block.py
4
7002
import logging l = logging.getLogger("angr.block") import pyvex from archinfo import ArchARM from .engines import SimEngineVEX DEFAULT_VEX_ENGINE = SimEngineVEX() # this is only used when Block is not initialized with a project class Block(object): BLOCK_MAX_SIZE = 4096 __slots__ = ['_project', '_bytes', ...
bsd-2-clause
-2,851,778,779,293,475,300
29.710526
124
0.531134
false
blazek/QGIS
tests/src/python/test_qgsserver_apicontext.py
25
1835
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServerApiContext class. .. 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 Foundation; either version 2 of the License, or (at your option) any later vers...
gpl-2.0
7,564,155,027,994,930,000
30.637931
93
0.712262
false
stopthatcow/zazu
zazu/style.py
1
6180
# -*- coding: utf-8 -*- """Style functions for zazu.""" import zazu.imports zazu.imports.lazy_import(locals(), [ 'click', 'difflib', 'functools', 'os', 'threading', 'sys', 'zazu.config', 'zazu.git_helper', 'zazu.styler', 'zazu.util' ]) __author__ = 'Nicholas Wiles' __copyright__...
mit
-1,057,187,777,035,833,600
38.870968
134
0.559871
false
Viktor-Evst/fixed-luigi
test/snakebite_test.py
25
3738
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
2,889,323,768,037,426,000
34.6
76
0.67496
false
Wikidata/QueryAnalysis
tools/getSparqlStatistic.py
1
3883
import argparse import os import sys from collections import defaultdict from pprint import pprint import config from postprocess import processdata from utility import utility parser = argparse.ArgumentParser(description="Prints out the SPARQL statistic") parser.add_argument( "--monthsFolder", "-m", defa...
apache-2.0
-3,312,735,612,141,559,000
33.061404
79
0.63044
false
alunarbeach/spark
examples/src/main/python/streaming/recoverable_network_wordcount.py
80
4423
# # 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
-5,087,141,895,871,788,000
39.577982
96
0.699977
false
Zing22/uemscode
tmp_test.py
1
1634
# -*- coding=utf-8 -*- #### for testing steps import numpy as np import matplotlib.pyplot as plt from sklearn import svm from sklearn.externals import joblib from PIL import Image from process import toBin, cropLetters from img2feature import toFeature from main import readAllFiles TEMP_DIR = 'tmp/' def test_onePi...
mit
4,342,402,305,400,115,000
22.028169
70
0.578947
false
hoatle/odoo
addons/hw_proxy/__openerp__.py
313
1675
# -*- 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
6,480,024,799,125,620,000
33.895833
78
0.619701
false