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
yamahata/neutron
neutron/services/loadbalancer/agent_scheduler.py
13
5191
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 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-2.0
-1,700,716,256,910,853,400
39.24031
79
0.598921
false
mxOBS/deb-pkg_trusty_chromium-browser
ppapi/native_client/tools/browser_tester/browsertester/browserprocess.py
126
2032
#!/usr/bin/python # Copyright (c) 2011 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 os import signal import subprocess import time class BrowserProcessBase(object): def __init__(self, handle): self.handle...
bsd-3-clause
365,494,646,164,394,750
23.780488
79
0.674705
false
houssine78/vertical-travel-porting-v8-wip
__unported__/travel_passport/travel_passenger.py
2
1291
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
agpl-3.0
4,415,058,948,236,603,000
40.645161
78
0.597211
false
mckinsel/FastxIO
tests/test_fastq.py
1
2141
import os import unittest from . import TEST_DATA_DIR from FastxIO import fastx class TestFastq(unittest.TestCase): def setUp(self): self.fastq_file = os.path.join(TEST_DATA_DIR, "test.fastq") self.gz_fastq_file = os.path.join(TEST_DATA_DIR, "test.fastq.gz") self.windows_fastq_file = os.p...
mit
760,412,878,490,211,200
35.288136
97
0.654367
false
galaxy001/libtorrent
BitTorrent-4.4.0/khashmir/util.py
11
2217
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
mit
1,067,179,857,124,519,700
31.130435
99
0.577808
false
ita1024/samba
third_party/waf/wafadmin/3rdparty/batched_cc.py
32
4653
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) """ Batched builds - compile faster instead of compiling object files one by one, c/c++ compilers are often able to compile at once: cc -c ../file1.c ../file2.c ../file3.c Files are output on the directory where the compiler is called, and dependencies...
gpl-3.0
-5,417,617,936,900,398,000
24.565934
101
0.669461
false
TalShafir/ansible
lib/ansible/modules/cloud/google/gcp_container_node_pool.py
8
32420
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
-3,266,544,015,671,431,000
41.268579
149
0.557927
false
remidechazelles/mycroft-core
mycroft/tts/fa_tts.py
7
2194
# Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 versio...
gpl-3.0
-6,229,583,328,824,391,000
30.797101
77
0.620328
false
smallyear/linuxLearn
salt/salt/modules/pecl.py
1
3969
# -*- coding: utf-8 -*- ''' Manage PHP pecl extensions. ''' from __future__ import absolute_import # Import python libs import re import logging try: from shlex import quote as _cmd_quote # pylint: disable=E0611 except ImportError: from pipes import quote as _cmd_quote # Import salt libs import salt.utils ...
apache-2.0
8,795,875,321,584,696,000
23.5
95
0.572688
false
fzimmermann89/pyload
module/lib/beaker/crypto/pbkdf2.py
43
11924
#!/usr/bin/python # -*- coding: ascii -*- ########################################################################### # PBKDF2.py - PKCS#5 v2.0 Password-Based Key Derivation # # Copyright (C) 2007 Dwayne C. Litzenberger <dlitz@dlitz.net> # All rights reserved. # # Permission to use, copy, modify, and distribute this s...
gpl-3.0
-8,044,703,730,353,436,000
33.865497
80
0.613049
false
angelapper/odoo
addons/survey/survey.py
8
58353
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv from openerp.tools.translate import _ from openerp import SUPERUSER_ID from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DF from openerp.addons.website.models.website impor...
agpl-3.0
5,756,210,284,828,540,000
46.713001
184
0.563313
false
erdincay/pyload
module/plugins/accounts/FileserveCom.py
6
1743
# -*- coding: utf-8 -*- import time from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class FileserveCom(Account): __name__ = "FileserveCom" __type__ = "account" __version__ = "0.22" __status__ = "testing" __description__ = """Fileserve.c...
gpl-3.0
-6,963,280,624,396,796,000
33.176471
91
0.499139
false
nishad89/newfies-dialer
newfies/appointment/admin_filters.py
4
1585
# # Newfies-Dialer License # http://www.newfies-dialer.org # # 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/. # # Copyright (C) 2011-2014 Star2Billing S.L. # # The Initia...
mpl-2.0
2,235,279,744,112,923,100
35.022727
129
0.685174
false
nedn/pybitcoin
third_party/python-ecdsa/src/ecdsa/ellipticcurve.py
1
5095
#! /usr/bin/env python # # Implementation of elliptic curves, for cryptographic applications. # # This module doesn't provide any way to choose a random elliptic # curve, nor to verify that an elliptic curve was chosen randomly, # because one can simply use NIST's standard curves. # # Notes from X9.62-1998 (draft): # ...
mit
-8,365,054,030,661,648,000
24.994898
74
0.557802
false
huchoi/edx-platform
cms/djangoapps/course_creators/tests/test_admin.py
82
8130
""" Tests course_creators.admin.py. """ from django.test import TestCase from django.contrib.auth.models import User from django.contrib.admin.sites import AdminSite from django.http import HttpRequest import mock from course_creators.admin import CourseCreatorAdmin from course_creators.models import CourseCreator fr...
agpl-3.0
-5,119,637,270,570,003,000
45.457143
119
0.649938
false
klunwebale/odoo
addons/auth_openid/controllers/main.py
382
10399
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
7,768,432,243,265,110,000
40.265873
137
0.597654
false
drwyrm/Flexget
flexget/plugins/sites/archetorrent.py
1
1084
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging from flexget import plugin from flexget.event import event log = logging.getLogger("archetorrent") class UrlRewriteArchetorrent(object): """Archetorr...
mit
-2,856,559,246,036,666,000
31.848485
94
0.643911
false
cloud9ers/gurumate
environment/lib/python2.7/site-packages/nose/suite.py
23
22234
""" Test Suites ----------- Provides a LazySuite, which is a suite whose test list is a generator function, and ContextSuite,which can run fixtures (setup/teardown functions or methods) for the context that contains its tests. """ from __future__ import generators import logging import sys import unittest from nose....
lgpl-3.0
-2,210,856,791,961,924,600
35.629325
85
0.56634
false
xlsdg/phantomjs-linux-armv7l
src/breakpad/src/tools/gyp/test/library/gyptest-shared.py
430
2230
#!/usr/bin/env python # Copyright (c) 2009 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 simple build of a "Hello, world!" program with shared libraries, including verifying that libraries are rebuilt correctly when ...
bsd-3-clause
-4,556,598,027,607,919,600
25.547619
73
0.695964
false
swdream/neutron
neutron/db/migration/alembic_migrations/versions/35a0f3365720_add_port_security_in_ml2.py
47
2014
# Copyright 2015 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
2,256,445,026,030,066,400
36.296296
78
0.639523
false
havt/odoo
addons/share/wizard/share_wizard.py
182
51223
# -*- 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,140,439,810,133,987,000
54.737758
171
0.575347
false
EnviroCentre/jython-upgrade
jython/lib/test/test_subprocess_jy.py
2
4882
"""Misc subprocess tests""" import unittest import os import sys import signal import time from test import test_support from subprocess import PIPE, Popen, _cmdline2list class TerminationAndSignalTest(unittest.TestCase): def setUp(self): program = ''' import signal, sys def print_signal(signum, frame):...
mit
3,167,476,926,369,539,000
30.294872
83
0.572306
false
open-synergy/server-tools
auth_brute_force/models/res_banned_remote.py
16
2544
# -*- encoding: utf-8 -*- ############################################################################## # # Tracks Authentication Attempts and Prevents Brute-force Attacks module # Copyright (C) 2015-Today GRAP (http://www.grap.coop) # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # # This prog...
agpl-3.0
5,997,125,172,217,766,000
34.830986
78
0.621069
false
farhaanbukhsh/sympy
sympy/core/tests/test_containers.py
49
5736
from sympy import Matrix, Tuple, symbols, sympify, Basic, Dict, S, FiniteSet, Integer from sympy.core.containers import tuple_wrapper from sympy.utilities.pytest import raises from sympy.core.compatibility import is_sequence, iterable, u, range def test_Tuple(): t = (1, 2, 3, 4) st = Tuple(*t) assert set(...
bsd-3-clause
-6,327,573,534,307,283,000
33.554217
85
0.55666
false
neuromancer/ocean
src/Run.py
1
2933
# -- coding: utf-8 -- #from ptrace.debugger.child import createChild from os import system, dup2, close, open as fopen, O_RDONLY from sys import stdin from os import ( fork, execv, execve, getpid, close, dup2, devnull, O_RDONLY) from ptrace.binding import ptrace_traceme from ptrace import PtraceError from re...
gpl-3.0
-4,636,684,819,966,879,000
21.052632
60
0.555063
false
orekyuu/intellij-community
python/helpers/profiler/thrift/transport/TSSLSocket.py
121
7717
# # 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 u...
apache-2.0
-7,866,089,993,897,090,000
35.060748
79
0.634962
false
ericls/niji
niji/urls.py
1
1889
# -*- coding: utf-8 -*- from django.conf.urls import url, include from django.views.decorators.csrf import csrf_exempt from rest_framework import routers from . import api from . import views api_router = routers.DefaultRouter() api_router.register(r'topics', api.TopicApiView) api_router.register(r'post', api.PostApiV...
mit
-1,206,821,230,321,740,000
54.558824
106
0.614082
false
adityacs/ansible
lib/ansible/modules/network/avi/avi_sslkeyandcertificate.py
8
5589
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 16.3.8 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
-3,355,299,287,217,311,000
31.494186
136
0.634818
false
spektom/incubator-airflow
tests/providers/amazon/aws/operators/test_sqs.py
4
2353
# # 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
-7,460,928,628,005,982,000
31.232877
110
0.679983
false
anaselli/dnfdragora
dnfdragora/compsicons.py
1
3731
import os.path class CompsIcons: ''' This class manages the access to group name and icons ''' def __init__(self, rpm_groups, icon_path=None): if icon_path: self.icon_path = icon_path if icon_path.endswith("/") else icon_path + "/" else: self.icon_path = "/usr/s...
gpl-3.0
-7,164,242,863,198,703,000
44.5
124
0.52104
false
ubc/edx-ora2
openassessment/assessment/models/ai.py
5
30773
""" Database models for AI assessment. """ from uuid import uuid4 import json import logging from django.conf import settings from django.core.files.base import ContentFile from django.core.cache import cache, get_cache from django.db import models, transaction, DatabaseError from django.utils.timezone import now from ...
agpl-3.0
7,560,005,941,317,983,000
34.782558
117
0.630358
false
TribeMedia/sky_engine
build/gyp_helper.py
77
2220
# 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. # This file helps gyp_chromium and landmines correctly set up the gyp # environment from chromium.gyp_env on disk import os SCRIPT_DIR = os.path.dirnam...
bsd-3-clause
7,162,328,282,927,955,000
31.647059
75
0.618018
false
olivierdalang/QGIS
python/core/additions/validitycheck.py
51
3120
# -*- coding: utf-8 -*- """ *************************************************************************** validitycheck.py --------------------- Date : January 2019 Copyright : (C) 2019 by Nyall Dawson Email : nyall dot dawson at gmail dot com ***************...
gpl-2.0
-3,508,089,130,551,099,400
31.842105
106
0.540705
false
googleapis/python-asset
scripts/fixup_asset_v1p5beta1_keywords.py
2
6005
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 Google 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 requi...
apache-2.0
-6,105,124,626,724,396,000
33.119318
109
0.618485
false
sgerhart/ansible
lib/ansible/modules/network/nxos/nxos_ntp_auth.py
61
9574
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
mit
7,986,397,327,762,153,000
28.640867
90
0.609045
false
pyblish/pyblish-endpoint
pyblish_endpoint/vendor/werkzeug/contrib/cache.py
146
23519
# -*- coding: utf-8 -*- """ werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ The main problem with dynamic Web sites is, well, they're dynamic. Each time a user requests a page, the webserver executes a lot of code, queries the database, renders templates until the visitor gets the page he sees. ...
lgpl-3.0
-2,770,386,981,534,089,700
33.637703
86
0.579106
false
lzw120/django
django/contrib/sessions/backends/cache.py
89
2261
from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.cache import cache KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ def __init__(self, session_key=None): self._cache = cache s...
bsd-3-clause
-7,412,987,861,168,472,000
33.257576
79
0.585582
false
hetland/xray
xray/test/test_utils.py
2
4438
import numpy as np import pandas as pd from xray.core import ops, utils from xray.core.pycompat import OrderedDict from . import TestCase class TestSafeCastToIndex(TestCase): def test(self): dates = pd.date_range('2000-01-01', periods=10) x = np.arange(5) td = x * np.timedelta64(1, 'D') ...
apache-2.0
6,397,669,072,858,636,000
36.294118
85
0.547995
false
varunarya10/nova_test_latest
nova/api/openstack/compute/schemas/v3/volumes.py
51
2842
# Copyright 2014 IBM Corporation. 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,145,853,109,139,990,000
31.295455
78
0.511612
false
DavidGuben/rcbplayspokemon
app/pywin32-220/com/win32com/storagecon.py
25
3082
"""Constants related to IStorage and related interfaces This file was generated by h2py from d:\msdev\include\objbase.h then hand edited, a few extra constants added, etc. """ STGC_DEFAULT = 0 STGC_OVERWRITE = 1 STGC_ONLYIFCURRENT = 2 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4 STGC_CONSOLIDATE = 8 S...
mit
-7,160,352,020,029,512,000
20.704225
63
0.754056
false
gangadharkadam/letzerp
erpnext/hr/doctype/salary_slip/test_salary_slip.py
3
3968
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import unittest import frappe from frappe.utils import today from erpnext.hr.doctype.employee.employee import make_salary_structure from erpnext.hr.doctype.salary_structure.salary_structure...
agpl-3.0
-338,595,182,994,922,100
36.433962
109
0.715978
false
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/4NodeANDES/cantilever_irregular_element_with_divisions/shape3/NumberOfDivision4/horizontal_load/compare_txt.py
637
2094
#!/usr/bin/python import h5py import sys import numpy as np import os import re import random # find the path to my own python function: cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own function for color and comparat...
cc0-1.0
-3,863,778,557,312,848,000
28.914286
112
0.65234
false
docker-infra/ansible-modules-core
files/template.py
8
2670
# this is a virtual module that is entirely implemented server side DOCUMENTATION = ''' --- module: template version_added: historical short_description: Templates a file out to a remote server. description: - Templates are processed by the Jinja2 templating language (U(http://jinja.pocoo.org/docs/)) - doc...
gpl-3.0
-2,339,319,887,385,520,000
40.076923
105
0.707116
false
kamyu104/django
tests/m2m_signals/tests.py
271
15982
""" Testing signals emitted on changing m2m relations. """ from django.db import models from django.test import TestCase from .models import Car, Part, Person, SportsCar class ManyToManySignalsTest(TestCase): def m2m_changed_signal_receiver(self, signal, sender, **kwargs): message = { 'insta...
bsd-3-clause
-8,974,918,253,501,833,000
33.518359
87
0.51752
false
cobrab11/blacksmith-2
expansions/muc/code.py
3
11539
# coding: utf-8 # BlackSmith mark.2 # exp_name = "muc" # /code.py v.x9 # Id: 05~5c # Code © (2009-2012) by WitcherGeralt [alkorgun@gmail.com] class expansion_temp(expansion): def __init__(self, name): expansion.__init__(self, name) def command_subject(self, stype, source, body, disp): if Chats.has_key(sour...
apache-2.0
-797,631,350,667,405,800
28.968831
144
0.570983
false
DreamLiMu/ML_Python
les5/logRegres.py
1
4070
#-*-coding:utf-8-*- import sys reload(sys) sys.setdefaultencoding('utf-8') from numpy import * def loadDataSet(): dataMat = []; labelMat = [] fr = open('testSet.txt') for line in fr.readlines(): lineArr = line.strip().split() dataMat.append([1.0,float(lineArr[0]),float(lineArr[1])]) ...
gpl-2.0
1,978,604,888,051,685,600
30.714286
100
0.610611
false
patrikpettersson/rest-engine
lib/werkzeug/contrib/fixers.py
87
9071
# -*- coding: utf-8 -*- """ werkzeug.contrib.fixers ~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module includes various helpers that fix bugs in web servers. They may be necessary for some versions of a buggy web server but not others. We try to stay updated with the status of the bug...
mit
-178,130,924,531,290,000
39.495536
82
0.620218
false
sobercoder/gem5
util/style/verifiers.py
10
16542
#!/usr/bin/env python2 # # Copyright (c) 2014, 2016 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implem...
bsd-3-clause
-6,585,580,489,385,422,000
34.121019
79
0.607061
false
glmcdona/meddle
examples/base/Lib/email/mime/message.py
573
1286
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Class representing message/* MIME documents.""" __all__ = ['MIMEMessage'] from email import message from email.mime.nonmultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class...
mit
-1,469,050,723,724,509,000
35.742857
78
0.674961
false
davits/ycmd
ycmd/tests/go/diagnostics_test.py
4
4392
# Copyright (C) 2020 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # # ycmd...
gpl-3.0
-5,353,363,444,130,755,000
34.707317
80
0.591985
false
mheap/ansible
lib/ansible/modules/network/meraki/meraki_organization.py
3
7828
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net> # 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 = { ...
gpl-3.0
4,248,365,912,354,212,400
34.261261
119
0.599004
false
LyonsLab/coge
bin/last_wrapper/Bio/SeqUtils/__init__.py
3
11238
#!/usr/bin/env python # Created: Wed May 29 08:07:18 2002 # thomas@cbs.dtu.dk, Cecilia.Alsmark@ebc.uu.se # Copyright 2001 by Thomas Sicheritz-Ponten and Cecilia Alsmark. # All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have ...
bsd-2-clause
-6,006,230,293,008,604,000
31.386167
96
0.558017
false
polaris-gslb/polaris-core
polaris_common/topology.py
2
2452
# -*- coding: utf-8 -*- import ipaddress __all__ = [ 'config_to_map', 'get_region' ] def config_to_map(topology_config): """ args: topology_config: dict { 'region1': [ '10.1.1.0/24', '10.1.10.0/24', '172.1...
bsd-3-clause
-8,564,393,811,929,327,000
25.085106
74
0.539152
false
fhe-odoo/odoo
addons/l10n_multilang/l10n_multilang.py
378
8428
# -*- 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
-5,126,685,174,740,535,000
54.084967
155
0.615211
false
mitmproxy/mitmproxy
test/mitmproxy/proxy/layers/http/test_http_version_interop.py
2
4584
from typing import Tuple import h2.config import h2.connection import h2.events from mitmproxy.http import HTTPFlow from mitmproxy.proxy.context import Context from mitmproxy.proxy.layers.http import HTTPMode from mitmproxy.proxy.commands import CloseConnection, OpenConnection, SendData from mitmproxy.connection impo...
mit
4,927,120,537,855,636,000
34.261538
114
0.64267
false
boudewijnrempt/breakpad
src/tools/gyp/pylib/gyp/sun_tool.py
314
1569
#!/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. """These functions are executed via gyp-sun-tool when using the Makefile generator.""" import fcntl import os import struct import subproces...
bsd-3-clause
-1,750,653,333,980,435,700
29.764706
79
0.683238
false
wrouesnel/ansible
test/integration/targets/module_precedence/multiple_roles/bar/library/ping.py
160
2146
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016, Toshio Kuratomi <tkuratomi@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...
gpl-3.0
-5,369,543,599,539,757,000
30.101449
96
0.673812
false
poldrack/myconnectome
myconnectome/openfmri/washu_fieldmap.py
2
1085
import json,glob,os import dicom outdir='/scratch/01329/poldrack/selftracking/ds031/sub00001/ses105/fieldmap' washubase='/scratch/01329/poldrack/selftracking/washu' basedirs=['vc39556','vc39556_2'] fmseries=[[5,10,21],[5,17]] ctr=1 for i in range(2): basedir=os.path.join(washubase,basedirs[i]) for j in range(...
mit
-9,121,917,463,474,917,000
30
91
0.567742
false
GenericMappingTools/gmt-python
pygmt/tests/test_rose.py
1
5398
""" Tests for rose. """ import numpy as np import pytest from pygmt import Figure from pygmt.datasets import load_fractures_compilation @pytest.fixture(scope="module", name="data") def fixture_data(): """ Load the sample numpy array data. """ return np.array( [[40, 60], [60, 300], [20, 180], [...
bsd-3-clause
145,683,186,140,060,500
23.536364
83
0.576695
false
ibmsoe/tensorflow
tensorflow/python/saved_model/signature_constants.py
119
2635
# 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
1,820,119,389,012,106,500
30
80
0.636433
false
ennoborg/gramps
gramps/gui/views/treemodels/peoplemodel.py
1
23073
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2009 Gary Burton # Copyright (C) 2009-2010 Nick Hall # Copyright (C) 2009 Benny Malengier # # This program is free software; you can redistribute it and/or modify # it under the terms of the G...
gpl-2.0
3,656,901,964,458,632,700
34.939252
83
0.518658
false
idlead/scikit-learn
sklearn/decomposition/fastica_.py
54
18240
""" Python implementation of the fast ICA algorithms. Reference: Tables 8.3 and 8.4 page 196 in the book: Independent Component Analysis, by Hyvarinen et al. """ # Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux, # Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann # License: BS...
bsd-3-clause
4,964,015,624,201,486,000
30.888112
79
0.584485
false
prune998/ansible
lib/ansible/modules/cloud/softlayer/sl_vm.py
27
12051
#!/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
7,417,962,594,799,285,000
29.431818
158
0.613227
false
petewarden/tensorflow
tensorflow/python/tf_program/mlir_gen.py
9
17226
# Copyright 2020 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
-1,711,220,089,568,462,600
36.776316
99
0.657901
false
dgarnier/pyms
Utils/__init__.py
7
1571
""" Utility functions for PyMS wide use """ ############################################################################# # # # PyMS software for processing of metabolomic mass-spectrometry data # # Copyright (C) 2005-2012 V...
gpl-2.0
6,391,524,186,936,914,000
63.458333
78
0.380649
false
Salat-Cx65/python-for-android
python3-alpha/python3-src/Lib/test/test_tempfile.py
46
35200
# tempfile.py unit tests. import tempfile import os import sys import re import warnings import unittest from test import support if hasattr(os, 'stat'): import stat has_stat = 1 else: has_stat = 0 has_textmode = (tempfile._text_openflags != tempfile._bin_openflags) has_spawnl = hasattr(os, 'spawnl') #...
apache-2.0
3,358,159,271,087,268,400
31.562442
100
0.562301
false
jenalgit/django
tests/foreign_object/models.py
73
5770
import datetime from django.db import models from django.db.models.fields.related import \ ReverseSingleRelatedObjectDescriptor from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import get_language @python_2_unicode_compatible class Country(models.Model): # Table Col...
bsd-3-clause
-2,823,173,580,707,204,600
30.189189
89
0.664471
false
Lekanich/intellij-community
python/helpers/docutils/parsers/rst/languages/fr.py
57
3577
# $Id: fr.py 4564 2006-05-21 20:44:42Z wiemann $ # Authors: David Goodger <goodger@python.org>; William Dode # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must ...
apache-2.0
3,391,575,166,850,062,300
35.131313
77
0.620073
false
ddrmanxbxfr/servo
tests/wpt/css-tests/tools/manifest/utils.py
115
1374
import platform import os from six import BytesIO def rel_path_to_url(rel_path, url_base="/"): assert not os.path.isabs(rel_path) if url_base[0] != "/": url_base = "/" + url_base if url_base[-1] != "/": url_base += "/" return url_base + rel_path.replace(os.sep, "/") def from_os_path(...
mpl-2.0
1,744,809,375,563,772,700
25.941176
82
0.55968
false
atruberg/django-custom
setup.py
48
4563
import os import sys from distutils.core import setup from distutils.sysconfig import get_python_lib # Warn if we are installing over top of an existing installation. This can # cause issues where files that were deleted from a more recent Django are # still present in site-packages. See #18115. overlay_warning = Fal...
bsd-3-clause
-3,209,164,315,207,683,000
32.8
87
0.638834
false
ecular/qemu_seamless
scripts/tracetool/backend/simple.py
57
3099
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Simple built-in backend. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __em...
gpl-2.0
1,663,093,949,768,748,000
27.943925
107
0.432677
false
JTCCOIN/jtccoin
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
5,741,470,328,515,429,000
23.069767
85
0.691787
false
jopham/gothub
web/main.py
2
5461
import web import logging #import model #import markdown import pymongo from pymongo.code import Code import re from pymongo.objectid import ObjectId import json from datetime import datetime from sets import Set from collections import defaultdict logging.basicConfig(level=logging.INFO) conn = pymongo.Connection() db...
mit
8,748,349,663,274,103,000
30.75
117
0.553745
false
mgyenik/micropython
tests/misc/features.py
87
1952
# mad.py # Alf Clement 27-Mar-2014 # zero=0 three=3 print("1") print("2") print(three) print("{}".format(4)) five=25//5 print(int(five)) j=0 for i in range(4): j += i print(j) print(3+4) try: a=4//zero except: print(8) print("xxxxxxxxx".count("x")) def ten(): return 10 print(ten()) a=[] for i in range(13): a.appen...
mit
-5,024,303,888,737,262,000
11.27673
54
0.570184
false
modulexcite/letsencrypt
acme/acme/crypto_util.py
27
7056
"""Crypto utilities.""" import contextlib import logging import socket import sys from six.moves import range # pylint: disable=import-error,redefined-builtin import OpenSSL from acme import errors logger = logging.getLogger(__name__) # DVSNI certificate serving and probing is not affected by SSL # vulnerabiliti...
apache-2.0
-8,611,715,349,312,275,000
34.28
79
0.664966
false
CiscoSystems/neutron
neutron/tests/unit/testlib_plugin.py
8
2641
# Copyright 2014 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 req...
apache-2.0
-1,377,726,582,267,503,400
35.680556
78
0.686861
false
vnsofthe/odoo-dev
openerp/addons/base/tests/test_orm.py
149
18110
from collections import defaultdict from openerp.tools import mute_logger from openerp.tests import common UID = common.ADMIN_USER_ID class TestORM(common.TransactionCase): """ test special behaviors of ORM CRUD functions TODO: use real Exceptions types instead of Exception """ def setUp(self):...
agpl-3.0
2,245,361,529,635,296,800
41.214452
137
0.569685
false
calvingit21/h2o-2
py/testdir_single_jvm/notest_exec2_empty_result.py
9
1382
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i, h2o_cmd initList = [ ('r', 'r=i.hex'), ] exprList = [ "a=c(1,2,3); a = r[r[,1]>2,]", "a=c(1,2,3); a = r[r[,1]>10,]", ] class Basic(unittest.TestCa...
apache-2.0
-5,873,462,245,869,578,000
27.204082
101
0.573082
false
ltilve/ChromiumGStreamerBackend
chrome/tools/build/win/syzygy/instrument.py
28
5680
#!/usr/bin/env python # 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. """A utility script to help building Syzygy-instrumented Chrome binaries.""" import glob import logging import optparse import os ...
bsd-3-clause
5,372,414,382,393,259,000
35.178344
79
0.659507
false
Maccimo/intellij-community
python/testData/inspections/PyDataclassInspection/fieldsOrder.py
15
1775
import dataclasses from typing import ClassVar @dataclasses.dataclass class A1: bar1: int <error descr="Fields with a default value must come after any fields without a default.">baz1</error>: int = 1 foo1: int <error descr="Fields with a default value must come after any fields without a default.">ba...
apache-2.0
1,353,242,781,608,439,800
18.516484
148
0.670986
false
endorphinl/horizon
openstack_dashboard/dashboards/identity/projects/views.py
47
9056
# 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
7,234,102,512,132,398,000
38.203463
79
0.589996
false
Scapogo/zipline
zipline/testing/slippage.py
6
1028
from zipline.assets import Equity from zipline.finance.slippage import SlippageModel from zipline.utils.sentinel import sentinel class TestingSlippage(SlippageModel): """ Slippage model that fills a constant number of shares per tick, for testing purposes. Parameters ---------- filled_per_tic...
apache-2.0
-4,945,366,840,881,897,000
27.555556
71
0.648833
false
chengui/mic
mic/bootstrap.py
2
8915
#!/usr/bin/python -tt # # Copyright (c) 2009, 2010, 2011 Intel, 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; version 2 of the License # # This program is distributed in the hope that i...
gpl-2.0
2,937,204,650,966,083,600
30.501767
85
0.548962
false
tovid-suite/tovid
libtovid/metagui/manpage.py
1
2685
"""This module is for parsing manual pages and extracting necessary information for creating a metaGUI. Needed capabilities: * Retrieve text of a given manpage * Read manpage for a given program and create a list of command-line options, with expected parameters and accompanying paragraph(s) of documentation. """...
gpl-2.0
5,956,676,092,888,003,000
26.96875
79
0.548976
false
NL66278/OCB
addons/l10n_in_hr_payroll/report/report_payslip_details.py
374
1791
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
-4,531,842,256,290,476,000
43.775
86
0.65885
false
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/db/models/fields/__init__.py
24
48391
from __future__ import unicode_literals import copy import datetime import decimal import math import warnings from itertools import tee from django.db import connection from django.db.models.query_utils import QueryWrapper from django.conf import settings from django import forms from django.core import exceptions, ...
bsd-3-clause
-5,051,720,875,433,527,000
36.195234
83
0.592445
false
freakboy3742/django
docs/conf.py
5
13852
# Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't picklable (module imports are okay...
bsd-3-clause
-7,734,092,533,852,879,000
33.287129
105
0.693835
false
ParkJinSang/Logle
sample/common/fileio.py
2
1415
__author__ = 'PARKJINSANG' # def read_file(path): """ Read text from file path :param path: string of path of file to read :return: contents inside the file """ file = open(path, "r", encoding='ISO-8859-1') contents = "" while True: line = file.readline() if not line: ...
mit
8,251,454,989,926,213,000
22.583333
60
0.582332
false
zhuyue1314/archinfo
archinfo/arch_mips32.py
1
7869
import capstone as _capstone from .arch import Arch # FIXME: Tell fish to fix whatever he was storing in info['current_function'] # TODO: Only persist t9 in PIC programs class ArchMIPS32(Arch): def __init__(self, endness="Iend_LE"): super(ArchMIPS32, self).__init__(endness) if endness == 'Iend_BE...
bsd-2-clause
4,313,205,186,791,152,600
26.228374
264
0.382132
false
Fl0rianFischer/sme_odoo
addons/crm/report/crm_activity_report.py
20
2126
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import fields, models from openerp import tools class crm_activity_report(models.Model): """ CRM Lead Analysis """ _name = "crm.activity.report" _auto = False _description = "CRM Activity A...
gpl-3.0
-4,540,011,703,588,008,400
36.298246
83
0.520696
false
samdowd/drumm-farm
drumm_env/lib/python2.7/site-packages/boto/ec2/launchspecification.py
170
3829
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 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 wit...
mit
-8,797,358,690,549,450,000
35.466667
77
0.640637
false
lucafavatella/intellij-community
python/testData/inspections/PyNumpyType/Slogdet.py
79
1052
def slogdet(a): """ Compute the sign and (natural) logarithm of the determinant of an array. If an array has a very small or very large determinant, than a call to `det` may overflow or underflow. This routine is more robust against such issues, because it computes the logarithm of the determinant...
apache-2.0
3,082,917,059,982,321,700
34.1
78
0.640684
false
ScottSteiner/uguubot
plugins/wu.py
1
4455
# weather.py # Rewritten by ScottSteiner to use Weather Underground instead of Yahoo from util import hook, database, http, web base_url = "http://api.wunderground.com/api/{}/{}/q/{}.json" def format_coordinates(latitude, longitude): "Formats coordinates into one string" latitude = round(float(latitude), 2) longi...
gpl-3.0
8,106,364,575,504,851,000
39.135135
118
0.676094
false
zyq001/ryu
ryu/lib/packet/igmp.py
19
19270
# Copyright (C) 2013 Nippon Telegraph and Telephone 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 # # Unless required by appli...
apache-2.0
8,307,516,607,454,218,000
38.650206
76
0.407784
false
debasishm89/burpy
modules/fbxsrf.py
3
1716
from rawweb import * def main(raw_stream,ssl): ''' This Burpy module is specially written to find CSRF vulnerability in Facebook Application. It has already found few minor CSRF vulnerability in FB application. Few them was qualifed for Bug Bounty. It simply checks whether CSRF token validation is present in Server...
gpl-2.0
-9,146,333,168,106,283,000
48.028571
131
0.7331
false
tsl143/zamboni
mkt/account/views.py
1
16495
import hashlib import hmac import json import uuid import urlparse from django import http from django.conf import settings from django.contrib import auth from django.contrib.auth.signals import user_logged_in from django.db import IntegrityError from django.utils.datastructures import MultiValueDictKeyError import ...
bsd-3-clause
4,582,852,137,249,400,000
35.819196
79
0.6291
false
andhit-r/account-financial-tools
currency_rate_update/services/update_service_PL_NBP.py
41
4486
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2009 CamptoCamp. All rights reserved. # @author Nicolas Bessi # # Abstract class to fetch rates from National Bank of Poland # # This program is free software: you can redistribute it and...
agpl-3.0
-1,936,708,765,173,231,400
43.415842
78
0.571556
false
ferrants/ansible
contrib/inventory/vmware.py
59
16907
#!/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
1,071,187,905,968,154,100
38.136574
95
0.54788
false
abhishekarora12/ansible
lib/ansible/module_utils/redhat.py
324
10219
# 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 their own license # to the complete wo...
gpl-3.0
-3,436,703,911,718,895,000
35.496429
93
0.600744
false
datakortet/dkmodelfields
tests/test_durationfield.py
1
3701
# -*- coding: utf-8 -*- import sys from datetime import timedelta, datetime import pytest import ttcal from django.core.exceptions import ValidationError from django.db import connection from django.forms import Form from ttcal import Duration from dkmodelfields import DurationField from dkmodelfields import adminform...
mit
1,337,083,010,218,281,200
33.268519
209
0.672791
false