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
dhimmel/networkx
examples/basic/properties.py
44
1071
#!/usr/bin/env python """ Compute some network properties for the lollipop graph. """ # Copyright (C) 2004 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. from networkx import * G = lollipop_graph(4,6) pa...
bsd-3-clause
6,065,103,127,244,732,000
21.3125
78
0.633053
false
DMLoy/ECommerceBasic
lib/python2.7/site-packages/django/templatetags/i18n.py
107
16719
from __future__ import unicode_literals import re from django.template import (Node, Variable, TemplateSyntaxError, TokenParser, Library, TOKEN_TEXT, TOKEN_VAR) from django.template.base import _render_value_in_context from django.template.defaulttags import token_kwargs from django.utils import six from django.ut...
mit
651,343,215,640,216,600
33.903967
117
0.598481
false
willhardy/django
django/shortcuts.py
117
5429
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ from django.http import ( Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect, ) from django.template imp...
bsd-3-clause
6,748,301,695,016,451,000
33.579618
96
0.661264
false
hwu25/AppPkg
Applications/Python/Python-2.7.2/Lib/distutils/tests/test_cmd.py
10
4028
"""Tests for distutils.cmd.""" import unittest import os from test.test_support import captured_stdout, run_unittest from distutils.cmd import Command from distutils.dist import Distribution from distutils.errors import DistutilsOptionError from distutils import debug class MyCmd(Command): def initiali...
bsd-2-clause
1,619,681,952,460,738,600
29.716535
79
0.565541
false
Venturi/oldcms
env/lib/python2.7/site-packages/pip/req/req_file.py
239
9670
""" Requirements file parsing """ from __future__ import absolute_import import os import re import shlex import optparse from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves import filterfalse import pip from pip.download import get_file_content from pip.req.req_install import ...
apache-2.0
1,305,056,428,432,109,000
33.29078
80
0.634436
false
ebukoz/thrive
erpnext/patches/v8_0/update_production_orders.py
16
1606
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): # reload schema for doctype in ("Work Order", "Work Order Item", "Work Order Operation", "BOM Item", "BOM Explosio...
gpl-3.0
3,502,029,587,783,164,400
31.795918
90
0.688667
false
tensorflow/tensorflow
tensorflow/python/kernel_tests/conv2d_transpose_test.py
9
12650
# 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
-8,693,253,989,215,439,000
38.779874
80
0.54498
false
tuomassalo/vr-no-flash
parse-coachmap.py
1
2371
#!/usr/bin/env python """ Read coachmap.swf and export all coaches to dist/coaches/*.{svg,js}. """ from swf.movie import SWF from swf.export import SVGExporter, SingleShapeSVGExporterMixin, FrameSVGExporterMixin, NamesSVGExporterMixin from swf.tag import TagPlaceObject, TagDefineShape, TagDefineSprite, TagFrameLabel ...
mit
-4,394,379,593,787,205,600
32.871429
124
0.715732
false
perezg/infoxchange
BASE/lib/python2.7/site-packages/django/contrib/admin/options.py
24
65679
import copy from functools import update_wrapper, partial import warnings from django import forms from django.conf import settings from django.forms.formsets import all_valid from django.forms.models import (modelform_factory, modelformset_factory, inlineformset_factory, BaseInlineFormSet) from django.contrib.con...
apache-2.0
319,985,831,658,819,400
42.096457
167
0.585271
false
malkavi/Flexget
flexget/tests/test_tmdb.py
3
1857
import pytest from flexget.components.tmdb.api_tmdb import TMDBSearchResult from flexget.manager import Session @pytest.mark.online class TestTmdbLookup: config = """ tasks: test: mock: - {title: '[Group] Taken 720p', imdb_url: 'http://www.imdb.com/title/tt0936501/'} ...
mit
-7,753,144,682,439,745,000
32.160714
112
0.568659
false
freelan-developers/chromalog
chromalog/log.py
1
5905
""" Log-related functions and structures. """ from builtins import map import sys import logging from colorama import AnsiToWin32 from functools import partial from contextlib import contextmanager from .colorizer import Colorizer from .mark.objects import Mark from .stream import stream_has_color_support class Co...
mit
-4,329,247,487,721,714,000
31.805556
77
0.56376
false
jody-frankowski/ansible-modules-core
system/mount.py
29
10793
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Red Hat, inc # Written by Seth Vidal # based on the mount modules from salt and puppet # # 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 ...
gpl-3.0
-2,168,464,131,167,124,000
29.925501
146
0.565737
false
red-hood/calendarserver
contrib/performance/report_principals.py
1
2743
## # Copyright (c) 2010-2015 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
9,004,649,367,134,878,000
43.967213
867
0.718556
false
scottw13/BET-1
doc/conf.py
1
8589
# Copyright (C) 2014-2015 The BET Development Team # -*- coding: utf-8 -*- # # BET documentation build configuration file, created by # sphinx-quickstart on Tue Apr 15 14:33:13 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values a...
gpl-3.0
-1,668,943,917,662,008,000
32.550781
119
0.698452
false
Pencroff/ai-hackathon-2017
Backend/venv/lib/python3.6/site-packages/requests/packages/urllib3/packages/backports/makefile.py
339
1461
# -*- coding: utf-8 -*- """ backports.makefile ~~~~~~~~~~~~~~~~~~ Backports the Python 3 ``socket.makefile`` method for use with anything that wants to create a "fake" socket object. """ import io from socket import SocketIO def backport_makefile(self, mode="r", buffering=None, encoding=None, ...
mit
2,553,758,765,635,952,000
26.566038
76
0.589322
false
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/lib2to3/fixes/fix_apply.py
22
2430
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for apply(). This converts apply(func, v, k) into (func)(*v, **k).""" # Local imports from .. import pytree from ..pgen2 import token from .. import fixer_base from ..fixer_util import Call, Comma, parenthesi...
apache-2.0
2,914,399,522,999,780,400
33.714286
71
0.513169
false
MatthewShao/mitmproxy
test/mitmproxy/tools/web/test_static_viewer.py
3
2522
import json from unittest import mock from mitmproxy.test import taddons from mitmproxy.test import tflow from mitmproxy import flowfilter from mitmproxy.tools.web.app import flow_to_json from mitmproxy.tools.web import static_viewer from mitmproxy.addons import save def test_save_static(tmpdir): tmpdir.mkdir(...
mit
-5,271,715,669,864,622,000
35.550725
91
0.67843
false
OmnInfinity/volatility
volatility/plugins/malware/cmdhistory.py
50
34078
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # Authors: # Michael Hale Ligh <michael.ligh@mnin.org> # # Contributors/References: # Richard Stevens and Eoghan Casey # Extracting Windows Cmd Line Details from Physical Memory. # http://ww.dfrws.org/2010/proceedings/stevens.pdf # # This file is part...
gpl-2.0
6,732,861,548,306,022,000
42.802057
131
0.563091
false
superdesk/superdesk-content-api
content_api/packages/service.py
1
2020
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
agpl-3.0
-1,524,865,190,162,674,700
32.666667
79
0.670792
false
PiRSquared17/damnvid
dModules.py
12
5307
# -*- coding: utf-8 -*- from dCore import * from dLog import * from dTubes import * import time import tarfile import shutil class DamnVideoModule: def __init__(self, uri): self.name = 'generic' self.uri = uri self.link = None self.id = None self.valid = None self.title = None self.ticket = None self.t...
gpl-3.0
-1,490,115,046,757,837,300
33.23871
320
0.691163
false
schleichdi2/OPENNFR-6.1-CORE
bitbake/lib/toaster/tests/browser/test_new_project_page.py
4
4101
#! /usr/bin/env python # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Toaster Implementation # # Copyright (C) 2013-2016 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License...
gpl-2.0
546,236,935,221,671,040
35.292035
76
0.609607
false
musicpax/funcy
tests/test_debug.py
2
3333
import re import time from funcy.debug import * from funcy.flow import silent def test_tap(): assert capture(tap, 42) == '42\n' assert capture(tap, 42, label='Life and ...') == 'Life and ...: 42\n' def test_log_calls(): log = [] @log_calls(log.append) def f(x, y): return x + y f(1...
bsd-3-clause
6,313,660,658,922,157,000
20.094937
100
0.549355
false
hobbe/notifry-o
appengine/web/browser.py
103
7679
"""Browser to test web applications. (from web.py) """ from utils import re_compile from net import htmlunquote import httplib, urllib, urllib2 import copy from StringIO import StringIO DEBUG = False __all__ = [ "BrowserError", "Browser", "AppBrowser", "AppHandler" ] class BrowserError(Exception): p...
apache-2.0
-4,644,639,682,185,705,000
31.538136
107
0.580154
false
HuaweiSwitch/ansible
lib/ansible/modules/network/cloudengine/ce_vxlan_vap.py
47
34406
#!/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
2,430,672,250,309,326,300
35.178759
105
0.532087
false
endlessm/chromium-browser
third_party/catapult/tracing/tracing/value/diagnostics/diagnostic.py
4
3699
# Copyright 2017 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 uuid try: from py_utils import slots_metaclass SlotsMetaclass = slots_metaclass.SlotsMetaclass # pylint: disable=invalid-name except ImportError:...
bsd-3-clause
5,034,585,509,640,736,000
27.453846
80
0.689376
false
greggyNapalm/lunaport_client
setup.py
1
1258
import os import re from setuptools import setup, find_packages base_path = os.path.dirname(__file__) # Get the version (borrowed from SQLAlchemy) fp = open(os.path.join(base_path, 'lunaport_client', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(fp.read()).group(1) ...
apache-2.0
-7,610,777,465,155,600,000
30.45
92
0.598569
false
cryptobanana/ansible
lib/ansible/modules/network/cnos/cnos_template.py
35
7351
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2017 Lenovo, 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 Licens...
gpl-3.0
-7,661,824,120,306,726,000
37.689474
140
0.687798
false
louietsai/python-for-android
python3-alpha/extra_modules/atom/mock_http_core.py
46
11993
#!/usr/bin/env python # # Copyright (C) 2009 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 ...
apache-2.0
-7,788,507,898,996,882,000
36.130031
78
0.675728
false
rotofly/odoo
openerp/workflow/workitem.py
294
14389
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General P...
agpl-3.0
7,271,944,439,431,436,000
41.824405
212
0.572451
false
ademmers/ansible
test/lib/ansible_test/_internal/thread.py
68
1866
"""Python threading tools.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import threading import sys try: # noinspection PyPep8Naming import Queue as queue except ImportError: # noinspection PyUnresolvedReferences import queue # pylint: disable=locally-dis...
gpl-3.0
-3,032,938,736,876,445,000
31.736842
113
0.621115
false
geraldinepascal/FROGS
tools/demultiplex/demultiplex.py
1
19651
#!/usr/bin/env python3 # # Copyright (C) 2018 INRA # # 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 program is...
gpl-3.0
-1,470,460,273,042,298,400
47.761787
271
0.579055
false
cosmoharrigan/pylearn2
pylearn2/models/dbm/ising.py
32
54938
""" Implementation of a densely connected Ising model in the pylearn2.models.dbm framework Notes ----- If :math:`h` can be -1 or 1, and .. math:: p(h) = \exp(T\dot z \dot h), then the expected value of :math:`h` is given by .. math:: \\tanh(T \dot z), and the probability that :math:`h` is 1 is given by ...
bsd-3-clause
-2,148,699,887,907,102,700
28.520688
79
0.508428
false
landscapeio/astroid
__pkginfo__.py
2
1746
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid 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 #...
gpl-2.0
-7,218,622,783,339,982,000
35.375
80
0.679267
false
MingwangLin/automatic-colorization-of-sketch
util/helper.py
1
9155
import cv2 import time import string import random from scipy import ndimage import numpy as np from datetime import datetime def get_normal_map(img): img = img.astype(np.float) img = img / 255.0 img = - img + 1 img[img < 0] = 0 img[img > 1] = 1 return img def get_gray_map(img): gray = c...
apache-2.0
6,667,024,794,922,443,000
25.690962
85
0.60284
false
plq/spyne
examples/validation.py
2
2587
#!/usr/bin/env python # encoding: utf8 # # Copyright © Burak Arslan <burak at arskom dot com dot tr>, # Arskom Ltd. http://www.arskom.com.tr # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
lgpl-2.1
3,673,177,584,128,446,000
34.916667
80
0.744393
false
cgundogan/RIOT
tests/gnrc_ipv6_ext_frag/tests-as-root/01-run.py
7
15314
#!/usr/bin/env python3 # Copyright (C) 2019 Freie Universität Berlin # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import re import os import pexpect import socket import sys import subprocess i...
lgpl-2.1
-3,193,832,233,731,199,500
34.28341
80
0.580879
false
chunywang/crosswalk-test-suite
tools/lint/sourcefile.py
12
9976
import os import urlparse from fnmatch import fnmatch try: from xml.etree import cElementTree as ElementTree except ImportError: from xml.etree import ElementTree import html5lib import vcs from item import Stub, ManualTest, WebdriverSpecTest, RefTest, TestharnessTest from utils import rel_path_to_url, Contex...
bsd-3-clause
6,214,471,441,654,570,000
32.589226
100
0.582698
false
noelbk/neutron-juniper
neutron/tests/unit/nec/test_portbindings.py
9
15003
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 NEC 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...
apache-2.0
-5,180,096,135,472,385,000
44.880734
78
0.582484
false
40223211/2015cd_midterm-
wsgi.py
1
27730
#@+leo-ver=5-thin #@+node:2014fall.20141212095015.1775: * @file wsgi.py # coding=utf-8 # 上面的程式內容編碼必須在程式的第一或者第二行才會有作用 ################# (1) 模組導入區 # 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝 #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:2014fall.20141212095015.1776: ** <<declar...
gpl-3.0
-5,308,675,888,771,007,000
29.172237
137
0.555636
false
thaim/ansible
lib/ansible/module_utils/facts/network/base.py
88
2400
# 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 in the hope that ...
mit
6,030,916,577,438,670,000
33.285714
105
0.6425
false
ourbest/sns_app
backend/dates.py
1
1240
from datetime import datetime, timedelta from dj import times def get_date(date=None): if date and isinstance(date, str): return times.localtime(datetime.strptime(date[0:10], '%Y-%m-%d')) if not date: return times.localtime(datetime.now()).replace(hour=0, second=0, minute=0, microsecond=0) ...
lgpl-3.0
-6,006,310,593,614,843,000
23.8
97
0.629839
false
julianwang/cinder
cinder/api/views/backups.py
8
3833
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # 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/LICEN...
apache-2.0
-2,029,803,648,772,279,800
36.213592
78
0.542656
false
rofehr/enigma2
lib/python/Components/Timeshift.py
1
69940
# -*- coding: utf-8 -*- # InfoBarTimeshift requires InfoBarSeek, instantiated BEFORE! # Hrmf. # # Timeshift works the following way: # demux0 demux1 "TimeshiftActions" "TimeshiftActivateActions" "SeekActions" # - normal playback TUNER ...
gpl-2.0
4,560,748,221,963,017,000
44.415584
292
0.713254
false
mhei/openwrt
scripts/json_overview_image_info.py
4
1044
#!/usr/bin/env python3 import json from pathlib import Path from os import getenv from sys import argv if len(argv) != 2: print("JSON info files script requires ouput file as argument") exit(1) output_path = Path(argv[1]) assert getenv("WORK_DIR"), "$WORK_DIR required" work_dir = Path(getenv("WORK_DIR")) ...
gpl-2.0
-1,957,941,507,776,340,700
27.216216
85
0.630268
false
andymckay/django
django/contrib/gis/tests/geoapp/tests.py
91
35402
from __future__ import absolute_import import re from django.db import connection from django.db.utils import DatabaseError from django.contrib.gis import gdal from django.contrib.gis.geos import (fromstr, GEOSGeometry, Point, LineString, LinearRing, Polygon, GeometryCollection) from django.contrib.gis.tests.util...
bsd-3-clause
-2,271,193,727,969,801,700
46.775978
227
0.619513
false
brandonium21/snowflake
snowflakeEnv/lib/python2.7/site-packages/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py
113
17292
# -*- coding: utf-8 -*- # # SelfTest/Cipher/test_pkcs1_oaep.py: Self-test for PKCS#1 OAEP encryption # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone...
bsd-2-clause
-491,177,983,282,112,900
45.483871
85
0.483461
false
ftl-toolbox/lib_openshift
lib_openshift/models/v1_template.py
2
8698
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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,108,243,323,653,314,000
28.993103
279
0.584387
false
beswarm/django-allauth
allauth/socialaccount/providers/xing/views.py
65
1258
import json from allauth.socialaccount.providers.oauth.client import OAuth from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, OAuthLoginView, OAuthCallbackView) from .provider import X...
mit
5,364,593,176,248,116,000
37.121212
75
0.616057
false
caisq/tensorflow
tensorflow/contrib/kafka/python/ops/kafka_dataset_ops.py
19
2777
# 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
-7,196,562,350,843,044,000
36.026667
96
0.661505
false
eramirem/astroML
book_figures/chapter7/fig_spec_reconstruction.py
3
3410
""" PCA Reconstruction of a spectrum -------------------------------- Figure 7.6 The reconstruction of a particular spectrum from its eigenvectors. The input spectrum is shown in gray, and the partial reconstruction for progressively more terms is shown in black. The top panel shows only the mean of the set of spectra...
bsd-2-clause
6,377,893,981,493,716,000
34.894737
79
0.632551
false
mikemccann/stoqs
utils/utils.py
4
13897
# A collection of various utility functions import logging from datetime import datetime logger = logging.getLogger(__name__) # An epoch good for time axis labels - OceanSITES uses 1 Jan 1950 EPOCH_STRING = '1950-01-01' EPOCH_DATETIME = datetime(1950, 1, 1) def round_to_n(x, n): ''' Round to n significant di...
gpl-3.0
3,057,789,953,808,496,600
31.168981
154
0.584515
false
rbtcollins/pip
tests/unit/test_options.py
22
9922
import os import pytest import pip.baseparser from pip import main from pip import cmdoptions from pip.basecommand import Command from pip.commands import commands_dict as commands class FakeCommand(Command): name = 'fake' summary = name def main(self, args): index_opts = cmdoptions.make_option_g...
mit
-1,117,248,195,825,032,300
33.571429
78
0.58204
false
kxliugang/edx-platform
openedx/core/djangoapps/credit/migrations/0005_auto__add_field_creditprovider_provider_url__add_field_creditprovider_.py
84
5535
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'CreditProvider.provider_url' db.add_column('credit_credit...
agpl-3.0
-3,840,229,934,344,925,000
61.202247
152
0.586631
false
beck/django
tests/datetimes/tests.py
345
5922
from __future__ import unicode_literals import datetime from unittest import skipIf from django.test import TestCase, override_settings from django.utils import timezone from .models import Article, Category, Comment try: import pytz except ImportError: pytz = None class DateTimesTests(TestCase): def ...
bsd-3-clause
-6,810,738,170,294,558,000
37.206452
110
0.543398
false
svanschalkwyk/datafari
windows/python/Lib/difflib.py
42
82320
""" Module difflib -- helpers for computing deltas between objects. Function get_close_matches(word, possibilities, n=3, cutoff=0.6): Use SequenceMatcher to return list of the best "good enough" matches. Function context_diff(a, b): For two lists of strings, return a delta in context diff format. Function nd...
apache-2.0
4,716,700,337,671,199,000
39.019446
83
0.565112
false
sorenk/ansible
test/units/plugins/connection/test_ssh.py
21
29848
# -*- coding: utf-8 -*- # (c) 2015, 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 # the Free Software Foundation, either version 3 of the License, or # (a...
gpl-3.0
-7,638,419,630,398,136,000
44.723926
149
0.62817
false
dchilds7/Deysha-Star-Formation
vispy/util/config.py
21
14665
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """Vispy configuration functions """ import os from os import path as op import json import sys import platform import getopt import traceback import tempfile import atexit f...
bsd-3-clause
-6,766,721,133,575,687,000
30.40257
79
0.591135
false
CCI-MOC/nova
nova/api/openstack/compute/fping.py
32
4924
# Copyright 2011 Grid Dynamics # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses...
apache-2.0
-6,545,581,011,529,222,000
31.394737
79
0.581235
false
nonemaw/pynet
learnpy_ecourse/class10/uptime.py
4
2224
import re def find_uptime_field(a_pattern, uptime_str): ''' If there is a match return the match group(1) Else return 0 ''' a_check = re.search(a_pattern, uptime_str) if a_check: return int(a_check.group(1)) else: return 0 class Uptime(object): ''' Create an Upti...
gpl-2.0
483,952,373,671,879,200
23.711111
85
0.51304
false
wimnat/ansible-modules-extras
packaging/os/layman.py
45
7881
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Jakub Jirutka <jakub@jirutka.cz> # # 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 Lice...
gpl-3.0
7,806,964,267,770,016,000
29.195402
103
0.655501
false
sholsapp/cryptography
tests/hazmat/primitives/fixtures_dsa.py
10
7822
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography.hazmat.primitives.asymmetric.dsa import ( DSAParame...
bsd-3-clause
9,021,297,751,296,776,000
50.460526
79
0.715802
false
klusark/android_external_chromium_org
tools/deep_memory_profiler/subcommands/stacktrace.py
59
1156
# Copyright 2013 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 sys from lib.bucket import BUCKET_ID from lib.subcommand import SubCommand class StacktraceCommand(SubCommand): def __init__(self): super(Sta...
bsd-3-clause
-1,146,878,026,180,708,400
27.195122
72
0.646194
false
hgrif/incubator-airflow
tests/contrib/operators/test_mlengine_operator_utils.py
11
7521
# 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
1,929,742,456,348,277,000
40.098361
87
0.58689
false
patsissons/Flexget
flexget/plugins/urlrewrite_deadfrog.py
24
1630
from __future__ import unicode_literals, division, absolute_import import logging import re import urllib2 from flexget import plugin from flexget.event import event from flexget.plugins.plugin_urlrewriting import UrlRewritingError from flexget.utils.tools import urlopener from flexget.utils.soup import get_soup log ...
mit
-4,696,320,152,945,979,000
32.958333
94
0.657669
false
AlexHill/django
django/contrib/gis/tests/layermap/models.py
5
2279
from django.contrib.gis.db import models class State(models.Model): name = models.CharField(max_length=20) objects = models.GeoManager() class County(models.Model): name = models.CharField(max_length=25) state = models.ForeignKey(State) mpoly = models.MultiPolygonField(srid=4269) # Multipolygon...
bsd-3-clause
2,353,808,266,309,294,000
27.848101
134
0.632734
false
NielsZeilemaker/incubator-airflow
airflow/hooks/samba_hook.py
61
1562
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
-6,369,739,817,058,715,000
32.234043
74
0.666453
false
jbedorf/tensorflow
tensorflow/python/keras/utils/data_utils_test.py
15
10290
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-4,584,459,062,675,229,700
32.086817
80
0.658698
false
n3wb13/OpenNfrGui-5.0-1
lib/python/Screens/OScamInfo.py
1
41624
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.ChoiceBox import ChoiceBox from Components.ActionMap import ActionMap, NumberActionMap from Components.Sources.List import List from Components.Sources.StaticText import StaticText from Components.config import config, configfile,...
gpl-2.0
6,538,295,773,082,535,000
34.545687
199
0.616111
false
XXMrHyde/android_external_chromium_org
tools/perf/page_sets/PRESUBMIT.py
23
2163
# Copyright (c) 2013 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 re import sys def _SyncFilesToCloud(input_api, output_api): """Searches for .sha1 files and uploads them to Cloud Storage. It vali...
bsd-3-clause
2,836,275,021,904,774,000
33.333333
78
0.68331
false
anandbhoraskar/Diamond
src/collectors/bind/test/testbind.py
31
7690
#!/usr/bin/python # coding=utf-8 ########################################################################## from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from bind import BindColle...
mit
-1,008,541,386,358,384,100
41.252747
74
0.557997
false
dimagol/trex-core
scripts/external_libs/scapy-2.3.1/python3/scapy/layers/llmnr.py
22
2396
from scapy.fields import * from scapy.packet import * from scapy.layers.inet import UDP from scapy.layers.dns import DNSQRField, DNSRRField, DNSRRCountField """ LLMNR (Link Local Multicast Node Resolution). [RFC 4795] """ ############################################################################# ### ...
apache-2.0
-4,107,582,448,132,558,300
35.861538
77
0.495409
false
awkspace/ansible
lib/ansible/plugins/terminal/cnos.py
86
2824
# (C) 2017 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for ...
gpl-3.0
-2,561,535,815,985,451,000
33.024096
79
0.582861
false
alsoicode/django-filer
filer/utils/filer_easy_thumbnails.py
12
3444
#-*- coding: utf-8 -*- from easy_thumbnails.files import Thumbnailer import os import re from filer import settings as filer_settings # match the source filename using `__` as the seperator. ``opts_and_ext`` is non # greedy so it should match the last occurence of `__`. # in ``ThumbnailerNameMixin.get_thumbnail_name``...
bsd-3-clause
-1,105,483,115,827,908,100
34.142857
86
0.632404
false
harshilasu/LinkurApp
y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/cloudfront/test_invalidation_list.py
22
4037
#!/usr/bin/env python import random import string from tests.unit import unittest import mock import boto RESPONSE_TEMPLATE = r""" <InvalidationList> <Marker/> <NextMarker>%(next_marker)s</NextMarker> <MaxItems>%(max_items)s</MaxItems> <IsTruncated>%(is_truncated)s</IsTruncated> %(inval_summaries)s </...
gpl-3.0
-3,500,756,228,852,672,000
34.725664
75
0.550904
false
jaor/bigmler
bigmler/options/timeseries.py
1
10871
# -*- coding: utf-8 -*- # # Copyright 2017-2020 BigML # # 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
-1,194,031,054,028,868,000
36.878049
79
0.504553
false
VapourApps/va_master
va_master/host_drivers/libvirt_driver.py
1
28404
try: from . import base from .base import Step, StepResult except: import base from base import Step, StepResult from base import int_to_bytes from tornado.httpclient import AsyncHTTPClient, HTTPRequest import tornado.gen import json, yaml import subprocess import libvirt import uuid import os from x...
gpl-3.0
6,098,959,608,350,156,000
35.462131
301
0.564463
false
GdZ/scriptfile
software/googleAppEngine/lib/django_1_3/django/contrib/localflavor/ca/ca_provinces.py
237
1603
""" An alphabetical list of provinces and territories for use as `choices` in a formfield., and a mapping of province misspellings/abbreviations to normalized abbreviations Source: http://www.canada.gc.ca/othergov/prov_e.html This exists in this standalone file so that it's only imported into memory when explici...
mit
-5,369,221,013,887,916,000
22.940299
94
0.538989
false
kmunve/TSanalysis
Plotting/meteo_plots.py
1
1137
#!/usr/bin/env python # -*- coding: utf-8 -*- from matplotlib import pyplot as plt from numpy import arange """ __author__: 'kmunve' """ def _temperature_plot(values, xticks=None, p_title=None, p_xlabel='Time', p_ylabel='Temperature'): """ TODO: add a check if the values are in Kelvin, Fahrenheit, or Celsi...
mit
-8,420,428,209,916,084,000
23.717391
113
0.627968
false
yunify/qingcloud-cli
qingcloud/cli/iaas_client/actions/sg/describe_security_group_rules.py
1
2198
# ========================================================================= # Copyright 2012-present Yunify, Inc. # ------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this work except in compliance with the Licens...
apache-2.0
-6,631,750,517,434,428,000
44.791667
88
0.586897
false
tushevorg/namebench
nb_third_party/dns/tsigkeyring.py
248
1658
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
-7,362,981,853,384,665,000
36.681818
78
0.720748
false
mzdaniel/oh-mainline
vendor/packages/Django/django/db/models/manager.py
306
7872
from django.utils import copycompat as copy from django.conf import settings from django.db import router from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet from django.db.models import signals from django.db.models.fields import FieldDoesNotExist def ensure_default_manager(sender, ...
agpl-3.0
342,964,780,869,665,540
35.444444
125
0.619284
false
meziti/bigbullions-test
p2pool/bitcoin/p2p.py
12
6325
''' Implementation of Bitcoin's p2p protocol ''' import random import sys import time from twisted.internet import protocol import p2pool from . import data as bitcoin_data from p2pool.util import deferral, p2protocol, pack, variable class Protocol(p2protocol.Protocol): def __init__(self, net): p2protoc...
gpl-3.0
6,305,707,010,960,372,000
33.189189
122
0.592569
false
diorcety/intellij-community
python/testData/inspections/PyNumpyType/Dtype.py
79
1189
def maximum_fill_value(obj): """ Return the minimum value that can be represented by the dtype of an object. This function is useful for calculating a fill value suitable for taking the maximum of an array with a given dtype. Parameters ---------- obj : dtype An object that can be ...
apache-2.0
5,187,970,592,499,686,000
26.651163
79
0.619008
false
gilbert-yuan/gooderp_addons
buy/wizard/buy_summary_goods_wizard.py
6
2109
# -*- coding: utf-8 -*- from datetime import date from odoo import models, fields, api from odoo.exceptions import UserError class BuySummaryGoodsWizard(models.TransientModel): _name = 'buy.summary.goods.wizard' _description = u'采购汇总表(按商品)向导' @api.model def _default_date_start(self): return ...
agpl-3.0
-2,669,343,532,551,221,000
34
76
0.545013
false
nwjs/chromium.src
tools/grit/grit/format/gen_predetermined_ids.py
3
4798
#!/usr/bin/env python # Copyright 2017 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 tool to generate a predetermined resource ids file that can be used as an input to grit via the -p option. This is meant to be ru...
bsd-3-clause
1,852,328,329,389,785,900
32.319444
80
0.714673
false
jakevdp/altair
tools/schemapi/codegen.py
1
7382
"""Code generation utilities""" from .utils import SchemaInfo, is_valid_identifier, indent_docstring, indent_arglist import textwrap import re class CodeSnippet(object): """Object whose repr() is a string of code""" def __init__(self, code): self.code = code def __repr__(self): return se...
bsd-3-clause
157,647,612,891,816,500
37.447917
123
0.59618
false
Samweli/inasafe
realtime/earthquake/shake_data.py
4
7459
# coding=utf-8 """ InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - **Getting shake data from local storage** Contact : ole.moller.nielsen@gmail.com .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as pub...
gpl-3.0
2,201,587,435,882,240,000
33.373272
78
0.611744
false
jamalex/kolibri
kolibri/deployment/default/urls.py
2
1495
# -*- coding: utf-8 -*- """kolibri URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home...
mit
-1,389,242,718,716,824,600
39.405405
84
0.692977
false
WSULib/combine
tests/test_forms/test_field_mapper_form.py
1
1300
from django.test import TestCase from core.forms import FieldMapperForm from core.models import get_field_mapper_choices class FieldMapperFormTestCase(TestCase): def test_python_prohibited(self): test_body = { 'name': 'Test Field Mapper', 'field_mapper_type': 'python', } ...
mit
7,456,407,820,288,422,000
32.333333
63
0.563077
false
EvaSDK/sqlalchemy
lib/sqlalchemy/orm/__init__.py
70
7976
# orm/__init__.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Functional constructs for ORM configuration. See the SQLAlchemy object relation...
mit
-5,807,348,502,957,982,000
28.540741
78
0.696464
false
kallewoof/bitcoin
test/functional/p2p_message_capture.py
22
2883
#!/usr/bin/env python3 # Copyright (c) 2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test per-peer message capture capability. Additionally, the output of contrib/message-capture/message-captu...
mit
5,870,381,672,994,414,000
36.934211
106
0.658342
false
yfried/ansible
test/units/compat/unittest.py
156
1302
# (c) 2014, 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 # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
7,956,530,828,043,011,000
33.263158
73
0.735791
false
agaldona/odoomrp-wip-1
product_variants_no_automatic_creation/models/product_configurator.py
8
12757
# -*- coding: utf-8 -*- # © 2015 Oihane Crucelaegui - AvanzOSC # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3 from openerp import api, fields, models, exceptions, _ from openerp.addons import decimal_precision as dp class ProductConfigurator(models.Abstr...
agpl-3.0
284,491,008,140,164,930
43.754386
79
0.585731
false
biorack/metatlas
jaws/jaws_wdls/scripts/mzml_loader_jaws.py
2
6958
#!/usr/bin/env python from __future__ import print_function import argparse import os import pwd import datetime import sys import traceback import tables import warnings warnings.filterwarnings("ignore", module="plotly") # pymzml has plotly in it and if you don't have a setup in your # home directory, you get a w...
bsd-3-clause
-2,275,472,770,425,338,000
30.0625
74
0.596005
false
iDTLabssl/hr
hr_unported/hr_payroll_register_report/report/payroll_register.py
1
9329
# -*- coding:utf-8 -*- # # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com> # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it under...
agpl-3.0
7,901,560,683,449,896,000
32.317857
79
0.513453
false
40223231/2015-cdb-g4-final-test-by-6-22
static/Brython3.1.1-20150328-091302/Lib/sre_parse.py
630
29657
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending ch...
gpl-3.0
5,067,621,511,071,406,000
33.404872
81
0.461813
false
j-faria/OPEN
scons/scons-local-2.3.4/SCons/Tool/MSCommon/netframework.py
9
2754
# # Copyright (c) 2001 - 2014 The SCons Foundation # # 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...
mit
4,123,285,109,621,849,600
32.585366
100
0.681917
false
40223138/2015cd_0505
static/Brython3.1.1-20150328-091302/Lib/collections/__init__.py
625
25849
#__all__ = ['deque', 'defaultdict', 'Counter'] from _collections import deque, defaultdict #from itertools import repeat as _repeat, chain as _chain, starmap as _starmap __all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList', 'UserString', 'Counter', 'OrderedDict'] # For bootstrapping re...
agpl-3.0
-1,269,895,213,329,137,700
34.555708
97
0.53681
false
fccagou/pynotif
usb/_objfinalizer.py
23
5287
# -*- coding: utf-8 -*- # # Copyright (C) 2014 André Erdmann # # The following terms apply to all files associated # with the software unless explicitly disclaimed in individual files. # # The authors hereby grant permission to use, copy, modify, distribute, # and license this software and its documentation for any pur...
gpl-2.0
-8,914,497,454,486,821,000
33.103226
77
0.621831
false
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/names/cache.py
55
2752
# -*- test-case-name: twisted.names.test -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import time from zope.interface import implements from twisted.names import dns from twisted.python import failure, log from twisted.internet import interfaces, defer import common class ...
bsd-3-clause
-9,199,906,065,459,564,000
27.666667
98
0.556686
false