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
stscieisenhamer/glue
glue/plugins/tools/spectrum_tool/qt/profile_viewer.py
4
13923
from __future__ import absolute_import, division, print_function import numpy as np from matplotlib.transforms import blended_transform_factory from glue.core.callback_property import CallbackProperty, add_callback PICK_THRESH = 30 # pixel distance threshold for picking class Grip(object): def __init__(self...
bsd-3-clause
-7,501,474,625,993,291,000
27.241379
76
0.549307
false
ento/elm-doc
src/elm_doc/tasks/assets.py
1
6493
from pathlib import Path import re import gzip import tarfile from elm_doc.run_config import Build from elm_doc.utils import Namespace tarball = Path(__file__).parent.parent / 'assets' / 'assets.tar.gz' bundled_helps = [ 'assets/help/documentation-format.md', 'assets/help/design-guidelines.md', ] bundled_ass...
bsd-3-clause
-6,099,394,522,406,015,000
49.726563
82
0.752965
false
uclouvain/osis_louvain
base/migrations/0301_auto_20180703_1611.py
1
6243
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2018-07-03 14:11 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('base', '0300_auto_20180703_0941'), ] operations = ...
agpl-3.0
-1,847,866,179,042,772,500
45.244444
223
0.598751
false
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/distutils/tests/test_sysconfig.py
38
5594
"""Tests for distutils.sysconfig.""" import os import test import unittest import shutil import subprocess import sys import textwrap from distutils import sysconfig from distutils.tests import support from test.test_support import TESTFN class SysconfigTestCase(support.EnvironGuard, unittest....
mit
-1,853,703,589,348,661,200
41.378788
107
0.631212
false
KyoheiG3/grpc
src/python/src/grpc/framework/base/interfaces_test_case.py
15
11724
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
-3,233,323,665,578,954,000
37.188925
80
0.708205
false
qwefi/nova
nova/cmd/baremetal_manage.py
4
7164
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (t...
apache-2.0
-3,501,961,833,968,209,000
33.946341
79
0.653266
false
horance-liu/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_test.py
21
53471
# 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
6,196,967,607,854,061,000
38.288024
88
0.657684
false
annarev/tensorflow
tensorflow/python/keras/combinations_test.py
11
5741
# 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
-4,545,371,327,651,694,000
31.252809
80
0.647797
false
kalahbrown/HueBigSQL
desktop/core/ext-py/Django-1.6.10/tests/urlpatterns_reverse/views.py
64
1511
from functools import partial, update_wrapper from django.http import HttpResponse from django.views.generic import RedirectView from django.core.urlresolvers import reverse_lazy from django.contrib.auth.decorators import user_passes_test def empty_view(request, *args, **kwargs): return HttpResponse('') def kwa...
apache-2.0
1,384,393,102,973,570,800
25.508772
92
0.727995
false
bwrsandman/OpenUpgrade
addons/purchase/res_config.py
357
6198
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
2,998,068,421,088,638,500
60.98
163
0.669248
false
dato-code/tutorials
strata-sj-2016/time-series/interactive_plot.py
2
2657
import matplotlib.pyplot as _plt from matplotlib.widgets import Button _plt.style.use('ggplot') ## Plot an interactive version. class LineDrawer(object): def __init__(self, scores, guide_lines, threshold_lines): self.guide_lines = guide_lines self.threshold_lines = threshold_lines self.fi...
apache-2.0
1,605,668,654,279,854,600
35.902778
80
0.540083
false
mathjazz/pontoon
pontoon/base/tests/models/test_locale.py
3
6906
from unittest.mock import patch import pytest from pontoon.base.models import ProjectLocale from pontoon.test.factories import ( EntityFactory, LocaleFactory, ResourceFactory, SubpageFactory, TranslatedResourceFactory, ) @pytest.fixture def locale_c(): return LocaleFactory(code="nv", name="N...
bsd-3-clause
4,084,916,861,781,445,000
36.129032
79
0.698089
false
infobloxopen/neutron
neutron/tests/functional/agent/test_ovs_flows.py
2
4774
# Copyright (c) 2015 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
8,857,768,372,986,592,000
44.466667
78
0.629032
false
apikler/VideoStore
site/userprofile/common.py
1
10437
import os import tempfile import Image import subprocess from django.shortcuts import render, redirect from django.forms.formsets import formset_factory from django.template import RequestContext, loader from django.template.loader import render_to_string from django.contrib import messages from django.contrib.auth im...
bsd-2-clause
-157,301,131,694,813,400
24.706897
184
0.701926
false
OmniLayer/omnicore
test/functional/test_framework/script_util.py
12
1326
#!/usr/bin/env python3 # Copyright (c) 2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Useful Script constants and utils.""" from test_framework.script import CScript # To prevent a "tx-size-sma...
mit
-434,623,154,712,178,000
52.04
84
0.731523
false
be-cloud-be/horizon-addons
partner-contact/base_location/__init__.py
30
1135
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com> # Ignacio Ibeas <ignacio@acysos.com> # Alejandro Santana <ale...
agpl-3.0
5,023,255,471,085,001,000
46.291667
78
0.608811
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.6.0/Lib/runpy.py
21
11959
"""runpy.py - locating and running Python code using the module namespace Provides support for locating and running Python scripts using the Python module namespace instead of the native filesystem. This allows Python code to play nicely with non-filesystem based PEP 302 importers when locating support scripts as wel...
mit
-2,175,712,459,323,784,200
39.676871
81
0.600719
false
kartoza/geonode
geonode/qgis_server/tests/test_views.py
2
27300
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
-3,551,380,619,422,303,700
35.99187
78
0.577656
false
jmr0/servo
tests/wpt/web-platform-tests/tools/py/testing/path/test_svnurl.py
218
3524
import py from py._path.svnurl import InfoSvnCommand import datetime import time from svntestbase import CommonSvnTests def pytest_funcarg__path1(request): repo, repourl, wc = request.getfuncargvalue("repowc1") return py.path.svnurl(repourl) class TestSvnURLCommandPath(CommonSvnTests): @py.test.mark.xfail...
mpl-2.0
-6,891,895,847,232,829,000
36.094737
79
0.624574
false
abzaloid/maps
django-project/lib/python2.7/site-packages/django/core/files/uploadhandler.py
102
6899
""" Base file upload handler classes, and the built-in concrete subclasses """ from __future__ import unicode_literals from io import BytesIO from django.conf import settings from django.core.files.uploadedfile import ( InMemoryUploadedFile, TemporaryUploadedFile, ) from django.utils.encoding import python_2_uni...
mit
-7,002,197,274,975,035,000
30.502283
118
0.626902
false
hal0x2328/neo-python
neo/bin/prompt.py
1
15089
#!/usr/bin/env python3 import argparse import datetime import os import traceback import asyncio import termios import sys from prompt_toolkit.completion import WordCompleter from prompt_toolkit.history import FileHistory from prompt_toolkit.shortcuts import print_formatted_text, PromptSession from prompt_toolkit.form...
mit
-4,111,835,484,799,686,700
35.892421
142
0.592087
false
laszlocsomor/tensorflow
tensorflow/contrib/keras/api/keras/callbacks/__init__.py
73
1815
# 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
-8,793,149,785,032,066,000
48.054054
80
0.779614
false
grimfang/panda3d
direct/src/stdpy/threading2.py
3
26986
""" This module reimplements Python's native threading module using Panda threading constructs. It's designed as a drop-in replacement for the threading module for code that works with Panda; it is necessary because in some compilation models, Panda's threading constructs are incompatible with the OS-provided threads ...
bsd-3-clause
-1,945,087,880,918,779,000
32.0306
85
0.534685
false
vyscond/cocos
test/test_schedule.py
6
1347
from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, t 2, s, t 4, s, q" tags = "schedule, position" import cocos from cocos.dir...
bsd-3-clause
-2,003,755,865,015,834,600
25.94
79
0.622866
false
pombredanne/MOG
nova/tests/virt/libvirt/test_fakelibvirt.py
7
15519
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2010 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/LICE...
apache-2.0
4,666,094,092,157,056,000
39.204663
78
0.567498
false
phobson/statsmodels
statsmodels/discrete/tests/results/results_poisson_constrained.py
34
28325
import numpy as np class Bunch(dict): def __init__(self, **kw): dict.__init__(self, kw) self.__dict__ = self for i,att in enumerate(['params', 'bse', 'tvalues', 'pvalues']): self[att] = self.params_table[:,i] est = dict( rank = 7, N = 10, ic ...
bsd-3-clause
8,596,017,345,289,272,000
42.644068
101
0.544748
false
moutai/scikit-learn
sklearn/cluster/tests/test_k_means.py
10
29147
"""Testing for K-means""" import sys import numpy as np from scipy import sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import SkipTest from sklearn.utils.testing i...
bsd-3-clause
-672,754,721,768,084,200
36.657623
91
0.632312
false
zhushun0008/sms-tools
software/transformations/stochasticTransformations.py
26
1259
# functions that implement transformations using the hpsModel import numpy as np from scipy.interpolate import interp1d def stochasticTimeScale(stocEnv, timeScaling): """ Time scaling of the stochastic representation of a sound stocEnv: stochastic envelope timeScaling: scaling factors, in time-value pairs retur...
agpl-3.0
-2,836,550,541,465,613,300
49.36
103
0.660048
false
tedlaz/pyted
pykoinoxrista/koinoxrista/greek_str.py
1
2056
import decimal def isNum(value): # Einai to value arithmos, i den einai ? """ use: Returns False if value is not a number , True otherwise input parameters: 1.value : the value to check against. output: True or False """ if not value: return False try: float(value)...
gpl-3.0
8,615,744,082,731,995,000
23.188235
77
0.558852
false
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons/report/controllers/main.py
40
6657
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-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
-284,516,999,371,489,700
45.229167
124
0.577738
false
numerigraphe/odoo
openerp/report/interface.py
380
9868
# -*- 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
7,192,387,343,151,106,000
35.958801
123
0.571443
false
jkburges/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/qt_unittest.py
113
6923
# 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 f...
bsd-3-clause
7,525,668,137,855,541,000
53.944444
230
0.672685
false
leppa/home-assistant
tests/components/heos/test_config_flow.py
3
4330
"""Tests for the Heos config flow module.""" from urllib.parse import urlparse from pyheos import HeosError from homeassistant import data_entry_flow from homeassistant.components import ssdp from homeassistant.components.heos.config_flow import HeosFlowHandler from homeassistant.components.heos.const import DATA_DIS...
apache-2.0
624,693,232,496,408,400
39.092593
82
0.687298
false
Imaginashion/cloud-vision
.fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/requests/packages/chardet/__init__.py
1778
1295
######################## BEGIN LICENSE BLOCK ######################## # This library 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 2.1 of the License, or (at your option) any later ve...
mit
-7,489,871,650,313,577,000
39.46875
73
0.667181
false
pgleeson/TempRepo3
lib/jython/Lib/site-packages/xlrd/__init__.py
64
72055
# -*- coding: cp1252 -*- __VERSION__ = "0.7.1" # 2009-05-31 # <p>Copyright © 2005-2009 Stephen John Machin, Lingfo Pty Ltd</p> # <p>This module is part of the xlrd package, which is released under a # BSD-style licence.</p> import licences ## # <p><b>A Python module for extracting data from MS Excel ™ spreadsheet f...
gpl-2.0
-2,741,359,548,285,179,400
40.892442
157
0.589897
false
sryza/spark
python/examples/kmeans.py
10
2247
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
-2,995,156,688,774,171,600
31.1
79
0.6413
false
dongjoon-hyun/spark
python/pyspark/serializers.py
13
20602
# # 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
-633,983,042,711,036,500
30.79321
100
0.625667
false
wscullin/spack
var/spack/repos/builtin/packages/py-appdirs/package.py
3
2067
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
6,587,899,065,484,724,000
42.978723
79
0.683116
false
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/urllib.py
2
61452
"""Open an arbitrary URL. See the following document for more info on URLs: "Names and Addresses, URIs, URLs, URNs, URCs", at http://www.w3.org/pub/WWW/Addressing/Overview.html See also the HTTP spec (from which the error codes are derived): "HTTP - Hypertext Transfer Protocol", at http://www.w3.org/pub/WWW/Protocols...
gpl-3.0
-2,271,987,227,058,528,000
35.042229
107
0.543302
false
cnbeining/you-get
src/you_get/extractors/kugou.py
9
1998
#!/usr/bin/env python __all__ = ['kugou_download'] from ..common import * from json import loads from base64 import b64decode import re import hashlib def kugou_download(url, output_dir=".", merge=True, info_only=False, **kwargs): if url.lower().find("5sing")!=-1: #for 5sing.kugou.com html=get_ht...
mit
5,077,234,643,733,261,000
36.698113
105
0.641642
false
Katsutami7moto/study
pl_compiler/stage one.py
1
10038
# coding=utf-8 # Пример # def parse(): # global regexp, current # terms = [] # term = [] # while current < len(regexp) and regexp[current] != ')': # if regexp[current] == '(': # current += 1 # term.append(parse()) # elif regexp[current] == '|': # te...
mit
74,953,715,402,594,640
18.956967
115
0.521101
false
cee1/cerbero-mac
cerbero/commands/bootstrap.py
4
1367
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
5,946,643,303,743,515,000
35.945946
74
0.741039
false
SebDieBln/QGIS
python/plugins/processing/algs/lidar/lastools/las2dem.py
12
3590
# -*- coding: utf-8 -*- """ *************************************************************************** las2dem.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com --------------------- D...
gpl-2.0
6,027,119,606,293,939,000
43.875
111
0.568245
false
jruiperezv/ANALYSE
common/djangoapps/status/tests.py
6
2852
from django.conf import settings from django.test import TestCase import os from django.test.utils import override_settings from tempfile import NamedTemporaryFile from .status import get_site_status_msg # Get a name where we can put test files TMP_FILE = NamedTemporaryFile(delete=False) TMP_NAME = TMP_FILE.name # Cl...
agpl-3.0
457,556,958,267,255,360
31.044944
88
0.601332
false
Azure/azure-sdk-for-python
sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2020_11_01/aio/operations/_operations.py
1
4689
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-2,218,498,226,340,827,600
43.657143
133
0.641715
false
alash3al/rethinkdb
test/common/scenario_common.py
50
1947
# Copyright 2010-2014 RethinkDB, all rights reserved. import random, shlex import driver, utils, vcoptparse, workload_runner def prepare_option_parser_mode_flags(opt_parser): opt_parser["valgrind"] = vcoptparse.BoolFlag("--valgrind") opt_parser["valgrind-options"] = vcoptparse.StringFlag("--valgrind-options"...
agpl-3.0
6,464,661,190,218,568,000
38.734694
151
0.671803
false
hospace/ToughRADIUS
toughradius/tools/shell.py
6
3848
#!/usr/bin/env python #coding:utf-8 import sys import os import subprocess import time class ToughError(Exception): def __init__(self, message): self.message = message class ToughShell(object): def __init__(self,logfile=None,debug=False): self.logfile = logfile self.is_debug = deb...
agpl-3.0
-8,184,662,693,676,585,000
33.675676
94
0.508316
false
GJL/flink
flink-python/pyflink/datastream/tests/test_state_backend.py
1
9033
################################################################################ # 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
3,194,973,776,516,376,600
40.43578
97
0.649065
false
kmod/icbd
icbd/type_analyzer/tests/classes.py
1
6603
def f1(): class A(object): k = 2 def __init__(self, x): # 12 (<A|B>,int) -> None self.x = x self.m = 1 pass def bar(self): # 12 (<A|B>) -> int self.y = 2 return self.x def baz(self): # 16 A self.z = 1 ...
mit
8,258,202,235,073,864,000
17.495798
194
0.412237
false
tima/ansible
lib/ansible/modules/cloud/ovirt/ovirt_storage_connections.py
43
9748
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 Red Hat, Inc. # # 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
4,091,728,455,563,522,000
33.690391
136
0.604534
false
nitin-cherian/LifeLongLearning
Web_Development_Python/RealPython/flask-blog/env/flask-blog/lib/python3.5/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/requests/exceptions.py
362
2860
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request. ...
mit
-2,393,943,168,980,255,000
24.087719
84
0.70035
false
rwl/PyCIM
CIM14/ENTSOE/Dynamics/IEC61968/__init__.py
1
1228
# Copyright (C) 2010-2011 Richard Lincoln # # 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
-5,307,840,132,877,287,000
48.12
99
0.775244
false
bitifirefly/edx-platform
common/djangoapps/course_modes/migrations/0002_auto__add_field_coursemode_currency.py
114
1475
# -*- 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 'CourseMode.currency' db.add_column('course_modes_coursemode', 'currency', ...
agpl-3.0
-1,882,720,135,958,550,300
41.142857
147
0.581017
false
bobthekingofegypt/servo
tests/unit/stylo/check_bindings.py
35
1339
#!/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 os import re ROOT_PATH = os.path.join("..", "..", "..") INPUT_FILE = os.path.join(ROOT_PA...
mpl-2.0
-6,485,445,471,453,988,000
35.189189
92
0.639283
false
CMLL/wesnoth
utils/pofix.py
15
9455
#!/usr/bin/env python # -*- coding: utf-8 -*- # pofix - perform string fixups on incoming .po files. # # The purpose of this script is to save translators from having to # apply various string fixes needed before stable release by hand. It is # intended to be run on each incoming .po file as the Lord of # Translation...
gpl-2.0
5,515,926,354,949,532,000
41.29148
197
0.663768
false
jimcunderwood/MissionPlanner
Lib/lib2to3/fixes/fix_imports.py
61
5838
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', ...
gpl-3.0
-8,746,520,179,512,759,000
38.262069
80
0.539568
false
stewnorriss/letsencrypt
letsencrypt/client.py
13
20023
"""Let's Encrypt client API.""" import logging import os from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa import OpenSSL import zope.component from acme import client as acme_client from acme import jose from acme import messages from letsencrypt impo...
apache-2.0
-3,688,053,185,251,712,500
37.139048
80
0.644359
false
petemounce/ansible
lib/ansible/modules/web_infrastructure/deploy_helper.py
41
20164
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Jasper N. Brouwer <jasper@nerdsweide.nl> # (c) 2014, Ramon de la Fuente <ramon@delafuente.nl> # # 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
-265,335,672,866,344,350
36.619403
131
0.653243
false
Jollytown/Garuda
server/garuda/lib/python2.7/site-packages/setuptools/tests/test_egg_info.py
148
2744
import os import stat import pytest from . import environment from .textwrap import DALS from . import contexts class TestEggInfo: setup_script = DALS(""" from setuptools import setup setup( name='foo', py_modules=['hello'], entry_points={'console_scripts': ...
mit
-2,741,805,509,482,054,000
27
72
0.48105
false
dvitme/odoo-addons
partner_internal_code/res_partner.py
5
1356
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, models, api class pa...
agpl-3.0
-1,614,908,072,889,298,700
31.285714
78
0.487463
false
fw1121/danmaku-project
server-data/web2py/applications/wanketv/controllers/live.py
16
15346
import json import time dal = DAL('sqlite://wanke.sqlite3.sqlite') """ 获取推荐页顶部互动的广告信息 http://54.64.105.44/wanketv/live/ads """ def ads(): parseRequest() db = DAL('sqlite://wanke.sqlite3.sqlite') allAds = db.executesql("select * from ads order by _id") result = {} result["error"] = 0 jsonAds =...
apache-2.0
44,439,669,435,772,780
24.462898
121
0.546558
false
vortex-ape/scikit-learn
benchmarks/bench_covertype.py
4
7382
""" =========================== Covertype dataset benchmark =========================== Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART (decision tree), RandomForest and Extra-Trees on the forest covertype dataset of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ...
bsd-3-clause
5,807,163,333,158,137,000
37.852632
78
0.587646
false
gaocegege/treadmill
treadmill/vipfile.py
3
4114
"""Manage Treadmill vIPs allocations""" import errno import glob import logging import os from . import fs _LOGGER = logging.getLogger(__name__) class VipMgr(object): """VIP allocation manager. :param basepath: Base directory that will contain all the allocated VIPs. :type basepath: ...
apache-2.0
1,556,603,606,972,230,000
29.029197
77
0.491492
false
jakspacek/tableHIFU
Hardware/InstrumentManager.py
1
8563
from __future__ import print_function, absolute_import import time import logging from threading import Thread from Queue import Queue, Empty logger = logging.getLogger(__name__) import Hardware.ampfunctions as AmpLib import Hardware.fcgenfunctions as FCGenLib import Hardware.powermeterfunctions as PMeterLib #import ...
gpl-3.0
3,559,682,829,867,925,000
37.746606
106
0.615906
false
jskDr/jamespy_py3
wireless/nb_polar_r12.py
1
20207
import numpy as np import numba as nb import matplotlib.pyplot as plt def calc_ber(e_array): return np.mean(np.abs(e_array)) # Imitate static variable for a python function using decorate and setattr def static_vars(**kwargs): ''' @static_vars(counter=0) def foo(): foo.counter += 1 pri...
mit
2,886,068,895,712,898,000
28.324074
108
0.541445
false
sekikn/incubator-airflow
tests/providers/google/cloud/hooks/test_functions.py
7
15650
# # 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
-8,869,149,320,746,860,000
48.840764
110
0.665623
false
fedorpatlin/ansible
lib/ansible/modules/network/nxos/nxos_nxapi.py
53
9907
#!/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...
gpl-3.0
1,326,776,087,438,941,700
31.804636
90
0.643283
false
CiscoUcs/Ironic
ironic/tests/conductor/test_conductor_utils.py
8
15831
# 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,280,651,297,302,504,000
46.256716
78
0.566673
false
minhphung171093/GreenERP_V7
openerp/addons/event_sale/event_sale.py
23
4880
# -*- 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,011,088,025,276,147,000
50.914894
310
0.573361
false
gicsi/aap
src/machine_learning/nltk-trainer-master/analyze_tagged_corpus.py
6
3565
#!/usr/bin/env python import argparse import collections import nltk.corpus from nltk.corpus.util import LazyCorpusLoader from nltk_trainer import basestring, load_corpus_reader, simplify_wsj_tag ######################################## ## command options & argument parsing ## ######################################## ...
gpl-3.0
4,151,185,799,629,449,000
31.418182
95
0.681066
false
wwright2/dcim3-angstrom1
sources/openembedded-core/meta/lib/oe/distro_check.py
8
15275
def get_links_from_url(url): "Return all the href links found on the web location" import urllib, sgmllib class LinksParser(sgmllib.SGMLParser): def parse(self, s): "Parse the given string 's'." self.feed(s) self.close() def __init__(self, verbo...
mit
8,795,246,239,017,021,000
38.882507
184
0.623502
false
michaelhabeck/isdhic
tests/test_hmc_chromosome.py
1
2824
import isdhic import numpy as np from isdhic import utils from isdhic.core import take_time from scipy import optimize class HamiltonianMonteCarlo(isdhic.HamiltonianMonteCarlo): stepsizes = [] @property def stepsize(self): return self.leapfrog.stepsize @stepsize.setter def stepsize(sel...
mit
5,042,867,344,772,792,000
23.344828
83
0.640227
false
adaxi/couchpotato
libs/pyutil/repeatable_random.py
106
3622
""" If you execute force_repeatability() then the following things are changed in the runtime: 1. random.random() and its sibling functions, and random.Random.seed() in the random module are seeded with a known seed so that they will return the same sequence on each run. 2. os.urandom() is replaced by a fake urandom...
gpl-3.0
-3,054,577,997,904,269,000
39.244444
304
0.674213
false
cldershem/osf.io
website/addons/figshare/views/auth.py
12
4131
# -*- coding: utf-8 -*- import os import httplib as http from flask import request from framework.flask import redirect # VOL-aware redirect from framework.exceptions import HTTPError from framework.auth.decorators import collect_auth from framework.auth.decorators import must_be_logged_in from website import mode...
apache-2.0
-3,146,401,059,241,300,500
26.54
88
0.670056
false
willkg/socorro-collector
collector/webapi/servers.py
1
3568
# 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 web import os from collector.webapi.class_partial import class_with_partial_init from configman import Namespac...
mpl-2.0
1,540,605,195,098,741,800
34.326733
79
0.452635
false
nugget/home-assistant
homeassistant/components/sensor/serial.py
7
3672
""" Support for reading data from a serial port. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.serial/ """ import logging import json import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.se...
apache-2.0
8,942,784,000,809,482,000
29.6
76
0.628813
false
ms-iot/python
cpython/Lib/idlelib/idle_test/test_parenmatch.py
79
3538
"""Test idlelib.ParenMatch.""" # This must currently be a gui test because ParenMatch methods use # several text methods not defined on idlelib.idle_test.mock_tk.Text. import unittest from unittest.mock import Mock from test.support import requires from tkinter import Tk, Text from idlelib.ParenMatch import ParenMatch...
bsd-3-clause
7,297,047,729,287,208,000
31.458716
75
0.59186
false
pombredanne/docpipe
docpipe/cli.py
1
2485
import logging import yaml import click from barn import open_collection from docpipe.exc import DocpipeException from docpipe.pipeline import Pipeline log = logging.getLogger(__name__) def execute_pipeline(ctx, fh, operation): try: config = yaml.load(fh.read()) fh.close() except Exception...
mit
2,299,889,476,837,245,200
28.583333
69
0.648692
false
mattgiguere/scikit-learn
sklearn/linear_model/tests/test_passive_aggressive.py
121
6117
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.base import ClassifierMixin from skle...
bsd-3-clause
-270,977,840,050,357,950
32.983333
79
0.512506
false
Petraea/jsonbot
jsb/contrib/sleekxmpp/plugins/xep_0128/static.py
4
1950
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz, Lance J.T. Stout This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import logging import sleekxmpp from sleekxmpp.plugins.xep_0030 import StaticDisco log = logging.getLogger(__name__) class...
mit
-807,422,531,879,439,000
26.083333
73
0.606154
false
HaloExchange/HaloBitcoin
qa/rpc-tests/getchaintips.py
1
2125
#!/usr/bin/env python2 # Copyright (c) 2014 The Halo Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the getchaintips API. We introduce a network split, work # on chains of different lengths, an...
mit
3,980,634,759,244,629,500
35.016949
70
0.624
false
sunshinelover/chanlun
vn.lts/vnltsmd/test/mdtest.py
23
4229
# encoding: UTF-8 # 内置模块 import sys from time import sleep # 测试模块 from vnltsmd import * #---------------------------------------------------------------------- def print_dict(d): """按照键值打印一个字典""" for key,value in d.items(): print key + ':' + str(value) #-----------------------------...
mit
-6,358,548,406,891,238,000
25.51049
75
0.365603
false
ykpoh/NLP
src/bigram.py
1
3414
def printTextfile(fdist, fileName): """This function will print the given frequency distribution to text file with the given filename""" #Create the file with the given filename. file = open(fileName, "w+") #Write each bigram with its frequency into the file. for k,v in fdist.items(): ...
mit
1,072,844,773,424,167,300
45.780822
95
0.691857
false
twstrike/le_for_patching
letsencrypt/tests/test_util.py
24
2267
"""Test utilities. .. warning:: This module is not part of the public API. """ import os import pkg_resources from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization import OpenSSL from acme import jose def vector_path(*names): """Path to a test vector...
apache-2.0
3,484,155,650,573,624,000
29.226667
79
0.681076
false
alberthdev/pyradmon
docs/sphinxcontrib/napoleon/pavertasks.py
4
3636
# -*- coding: utf-8 -*- # Copyright 2014 Rob Ruana # Licensed under the BSD License, see LICENSE file for details. """Sphinx related paver tasks. Methods ------- apidoc Derive reStructuredText API doc files from python source code. This task is essentially a wrapper around the `sphinx-apidoc`_ script. Th...
apache-2.0
2,424,676,892,181,413,400
27.629921
77
0.640539
false
DalikarFT/CFVOP
venv/Lib/site-packages/pip/_vendor/distlib/version.py
335
23711
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2016 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. """ import logging import re from .compat import string_types ...
gpl-3.0
924,931,884,976,719,600
30.955526
78
0.520644
false
demharters/git_scripts
dist_4gbx_stsamc.py
2
1658
#! /usr/bin/env python from MDAnalysis import * #from MDAnalysis.analysis.align import * import numpy import math u = Universe("init.pdb","temp.pos.pdb") v = Universe("init.pdb") # residues a1 = u.selectAtoms("segid A and resid 46") b1 = u.selectAtoms("segid B and resid 90") a2 = u.selectAtoms("segid A and resid 69"...
apache-2.0
8,635,367,274,372,251,000
30.283019
127
0.659228
false
chirilo/kuma
kuma/demos/admin.py
22
6195
from django.contrib import admin from django.contrib.admin import helpers from django.contrib.admin.utils import model_ngettext, get_deleted_objects from django.db import router from django.core.exceptions import PermissionDenied from django.template.response import TemplateResponse from django.utils.encoding import fo...
mpl-2.0
517,415,409,910,280,450
35.017442
96
0.63519
false
Fl0rianFischer/sme_odoo
openerp/tools/parse_version.py
70
3507
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. ## this functions are taken from the setuptools package (version 0.6c8) ## http://peak.telecommunity.com/DevCenter/PkgResources#parsing-utilities import re component_re = re.compile(r'(\d+ | [a-z]+ | \.| -)', re.VERBOS...
gpl-3.0
-6,152,132,593,776,229,000
41.253012
121
0.60422
false
masterpowers/angular-laravel
node_modules/laravel-elixir/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
446
43487
# Copyright (c) 2012 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. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
mit
-175,578,053,911,896,300
39.680075
80
0.641755
false
iptvgratis/TUPLAY
resources/tools/server_rtmp.py
4
20015
# -*- coding: utf-8 -*- #------------------------------------------------------------ # Analizador de RTMPs by Juarrox (juarrox@gmail.com) # Version 0.3.4 (28.04.2015) #------------------------------------------------------------ # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) #-------------------------------...
gpl-3.0
373,591,976,582,110,400
34.063158
142
0.532623
false
hand-iemura/lightpng
boost_1_53_0/tools/build/v2/test/custom_generator.py
42
1608
#!/usr/bin/python # Copyright 2003, 2004, 2005 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Attempt to declare a generator for creating OBJ from RC files. That generator # should be considered together...
mit
-7,359,393,553,493,846,000
23.363636
82
0.69092
false
diofeher/django-nfa
tests/regressiontests/defaultfilters/tests.py
2
12592
# -*- coding: utf-8 -*- r""" >>> floatformat(7.7) u'7.7' >>> floatformat(7.0) u'7' >>> floatformat(0.7) u'0.7' >>> floatformat(0.07) u'0.1' >>> floatformat(0.007) u'0.0' >>> floatformat(0.0) u'0' >>> floatformat(7.7,3) u'7.700' >>> floatformat(6.000000,3) u'6.000' >>> floatformat(6.200000, 3) u'6.200' >>> floatformat(...
bsd-3-clause
-4,391,585,468,734,383,600
22.223247
182
0.601255
false
mnahm5/django-estore
Lib/site-packages/werkzeug/contrib/lint.py
131
12490
# -*- coding: utf-8 -*- """ werkzeug.contrib.lint ~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module provides a middleware that performs sanity checks of the WSGI application. It checks that :pep:`333` is properly implemented and warns on some common HTTP errors such as non-empty respons...
mit
8,925,295,537,364,371,000
35.843658
84
0.553082
false
boompieman/iim_project
project_python2/lib/python2.7/site-packages/IPython/lib/tests/test_deepreload.py
9
2144
# -*- coding: utf-8 -*- """Test suite for the deepreload module.""" #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- import os import nose.tools as nt from IPython.testing import decorators as dec ...
gpl-3.0
5,706,289,884,470,291,000
35.338983
78
0.529851
false
Gustry/QGIS
python/plugins/db_manager/dlg_field_properties.py
30
3597
# -*- coding: utf-8 -*- """ *************************************************************************** dlg_field_properties.py --------------------- Date : April 2012 Copyright : (C) 2012 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com ******...
gpl-2.0
3,194,887,819,760,960,500
37.677419
103
0.545455
false
flexiant/xen
tools/python/xen/xend/server/DevController.py
42
24407
#============================================================================ # 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
5,495,116,025,184,440,000
35.051699
93
0.574425
false
frishberg/django
django/contrib/postgres/fields/hstore.py
5
3326
import json from django.contrib.postgres import forms, lookups from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, TextField, Transform from django.utils import six from django.utils.encoding import force_text from django.utils.translation ...
bsd-3-clause
6,056,621,997,065,417,000
28.696429
69
0.629284
false
Tom-Trumper/selenium
py/selenium/webdriver/common/service.py
20
5855
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-5,124,399,825,616,132,000
31.893258
95
0.547566
false
augmify/omim
tools/python/stylesheet/drules_to_mapcss.py
53
19179
#!/usr/bin/env python # -*- coding: utf-8 -*- import csv import os import drules_struct_pb2 from webcolors.webcolors import hex_to_color_name from operator import * from copy import * import sys reload(sys) sys.setdefaultencoding("utf-8") DATADIR = "../../../data" files = { "mapcss_mapping": os.path.join(DATADIR...
apache-2.0
-4,734,682,854,622,492,000
41.714922
145
0.454143
false