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
hergin/DelTa
mt/ptcal/pytcore/rules/srule.py
1
5367
'''***************************************************************************** AToMPM - A Tool for Multi-Paradigm Modelling Copyright (c) 2011 Eugene Syriani This file is part of AToMPM. AToMPM is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as pu...
gpl-3.0
-5,260,839,774,734,648,000
38.755556
127
0.576486
false
sandeepgupta2k4/tensorflow
tensorflow/python/training/device_setter.py
32
8296
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
5,622,596,231,032,949,000
37.948357
80
0.675627
false
zengenti/ansible
lib/ansible/modules/cloud/univention/udm_dns_zone.py
21
7623
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # # 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 Fr...
gpl-3.0
2,868,997,216,483,941,000
30.114286
120
0.513315
false
ping/youtube-dl
youtube_dl/extractor/canvas.py
9
12184
from __future__ import unicode_literals import re import json from .common import InfoExtractor from .gigya import GigyaBaseIE from ..compat import compat_HTTPError from ..utils import ( ExtractorError, strip_or_none, float_or_none, int_or_none, merge_dicts, parse_iso8601, ) class CanvasIE(I...
unlicense
1,405,010,471,767,004,200
37.679365
118
0.520847
false
staciecampbell/allsun
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
1843
1786
#!/usr/bin/env python # 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. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
gpl-2.0
-2,756,080,926,911,991,000
37
76
0.647256
false
girving/tensorflow
tensorflow/contrib/distributions/python/ops/shape.py
32
20029
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
5,866,464,123,214,200,000
38.583004
80
0.621748
false
miipl-naveen/optibizz
addons/hr_holidays/hr_holidays.py
6
33614
# -*- coding: utf-8 -*- ################################################################################## # # Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com) # and 2004-2010 Tiny SPRL (<http://tiny.be>). # # $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $ # # This program is free software: you can redistri...
agpl-3.0
-2,731,755,803,338,566,000
56.955172
564
0.59502
false
kartoza/geonode
geonode/base/management/commands/restore.py
2
21256
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2018 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
-7,496,640,449,182,138,000
43.655462
190
0.534155
false
CityOfNewYork/NYCOpenRecords
app/lib/onelogin/saml2/logout_request.py
1
13394
# -*- coding: utf-8 -*- """ OneLogin_Saml2_Logout_Request class Copyright (c) 2010-2018 OneLogin, Inc. MIT License Logout Request class of OneLogin's Python Toolkit. """ from app.lib.onelogin.saml2 import compat from app.lib.onelogin.saml2.constants import OneLogin_Saml2_Constants from app.lib.onelogin.saml2.utils...
apache-2.0
-1,289,190,007,981,190,400
36.729577
126
0.56152
false
tux-00/ansible
lib/ansible/modules/cloud/vmware/vmware_vmkernel_ip_config.py
70
3992
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
717,456,148,041,968,900
30.1875
95
0.658317
false
Einsteinish/PyTune3
vendor/feedvalidator/author.py
16
1386
"""$Id: author.py 699 2006-09-25 02:01:18Z rubys $""" __author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>" __version__ = "$Revision: 699 $" __date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $" __copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim" from b...
mit
-925,066,896,212,175,900
25.150943
94
0.663059
false
xmaruto/mcord
xos/synchronizers/ec2/deleters/slice_deployment_deleter.py
4
1652
from core.models import Slice, SliceDeployments, User from synchronizers.base.deleter import Deleter from openstack.driver import OpenStackDriver class SliceDeploymentsDeleter(Deleter): model='SliceDeployments' def call(self, pk): slice_deployment = SliceDeployments.objects.get(pk=pk) user = U...
apache-2.0
984,522,428,685,271,900
47.588235
105
0.653148
false
majek/ziutek
ziutek/lrucache.py
1
1553
class LRUCache: ''' >>> l = LRUCache(maxsize=3) >>> l.add('a') >>> l.add('b') >>> l.add('c') >>> l.add('d') >>> l.to_list() ['b', 'c', 'd'] >>> l.add('b') >>> l.to_list() ['c', 'b', 'd'] >>> l.add('b') >>> l.to_list() ['c', 'd', 'b'] >>> l.add('b') >>> l...
bsd-3-clause
5,942,521,269,947,437,000
21.185714
79
0.367675
false
seanlong/crosswalk
tools/increment-version.py
9
2640
#!/usr/bin/env python # Copyright (c) 2013 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ increment-version.py -- Bump Beta or Canary version number across all required files. Crosswalk's versioning schema is "MAJOR.MI...
bsd-3-clause
-2,381,173,362,934,743,600
30.807229
79
0.688636
false
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/celery/exceptions.py
1
7700
# -*- coding: utf-8 -*- """Celery error types. Error Hierarchy =============== - :exc:`Exception` - :exc:`celery.exceptions.CeleryError` - :exc:`~celery.exceptions.ImproperlyConfigured` - :exc:`~celery.exceptions.SecurityError` - :exc:`~celery.exceptions.TaskPredicate` - :exc:`...
apache-2.0
-3,292,472,742,301,129,000
28.615385
76
0.66
false
racker/omnibus
source/db-5.0.26.NC/dist/winmsi/genWix.py
2
10906
# # # genWix.py is used to generate a WiX .wxs format file that # can be compiled by the candle.exe WiX compiler. # # Usage: python genWix.py <output_file> # # The current directory is expected to be the top of a tree # of built programs, libraries, documentation and files. # # The list of directories traversed is at ...
apache-2.0
-4,009,565,195,000,121,000
33.512658
210
0.639556
false
liorvh/golismero
thirdparty_libs/nltk/corpus/reader/util.py
12
31147
# Natural Language Toolkit: Corpus Reader Utilities # # Copyright (C) 2001-2012 NLTK Project # Author: Steven Bird <sb@ldc.upenn.edu> # Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT import os import sys import bisect import re import temp...
gpl-2.0
-1,112,846,481,142,122,600
37.596035
84
0.584519
false
mohrtw/algorithms
algorithms/tests/test_deque.py
1
3879
import unittest from unittest import TestCase from algorithms.dataStructures.Deque import Deque class deque_Test(TestCase): def setUp(self): self.d = Deque() def test_create_deque(self): self.assertIsInstance(self.d, Deque) def test_push_to_empty_deque(self): self.d.push(1) ...
mit
-7,203,530,874,428,742,000
24.025806
60
0.569477
false
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/third_party/pyasn1-modules/pyasn1_modules/rfc5208.py
6
1426
# # This file is part of pyasn1-modules software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pyasn1.sf.net/license.html # # PKCS#8 syntax # # ASN.1 source from: # http://tools.ietf.org/html/rfc5208 # # Sample captures could be obtained with "openssl pkcs8 -topk8" command # from pyas...
bsd-3-clause
6,654,340,617,797,369,000
24.464286
83
0.72791
false
ychen820/microblog
y/google-cloud-sdk/lib/googlecloudsdk/compute/lib/ssh_utils.py
4
13028
# Copyright 2014 Google Inc. All Rights Reserved. """Utilities for subcommands that need to SSH into virtual machine guests.""" import logging import os import subprocess from googlecloudsdk.calliope import exceptions from googlecloudsdk.compute.lib import base_classes from googlecloudsdk.compute.lib import constants...
bsd-3-clause
-3,638,689,154,086,975,500
34.210811
80
0.66004
false
zouyapeng/horizon-newtouch
openstack_dashboard/dashboards/project/volumes/urls.py
6
1689
# 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 License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
1,903,256,296,357,518,300
43.447368
78
0.720545
false
wesm/arrow
dev/archery/archery/integration/tester.py
6
1993
# 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,019,423,584,959,197,000
31.145161
71
0.699448
false
DoubleNegativeVisualEffects/cortex
test/IECore/PointsMotionOpTest.py
12
7993
########################################################################## # # Copyright (c) 2010, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
4,242,870,249,806,768,600
40.414508
161
0.660578
false
ericlink/adms-server
playframework-dist/1.1-src/python/Lib/stringprep.py
30
13794
# This file is generated by mkstringprep.py. DO NOT EDIT. """Library that exposes various tables found in the StringPrep RFC 3454. There are two kinds of tables: sets, for which a member test is provided, and mappings, for which a mapping function is provided. """ from unicodedata import ucd_3_2_0 as unicodeda...
mit
-8,692,602,956,048,998,000
48.713235
151
0.651008
false
xiaolonginfo/decode-Django
Django-1.5.1/tests/modeltests/custom_managers/tests.py
41
2797
from __future__ import absolute_import from django.test import TestCase from django.utils import six from .models import (ObjectQuerySet, RelatedObject, Person, Book, Car, PersonManager, PublishedBookManager) class CustomManagerTests(TestCase): def test_manager(self): p1 = Person.objects.create(firs...
gpl-2.0
-8,404,481,013,992,304,000
31.905882
85
0.578834
false
patochectp/navitia
source/navitiacommon/navitiacommon/default_values.py
1
4496
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public t...
agpl-3.0
8,316,200,098,162,739,000
30.440559
119
0.725311
false
kk9599/pupy
pupy/packages/windows/x86/psutil/_pswindows.py
66
19166
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Windows platform implementation.""" import errno import functools import os import sys from collections import namedtuple from ...
bsd-3-clause
1,749,877,215,819,025,400
31.818493
79
0.591516
false
erjohnso/ansible
lib/ansible/modules/network/panos/panos_object.py
42
16678
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
-3,538,454,161,654,451,700
35.021598
120
0.596474
false
HrWangChengdu/CS231n
assignment3/cs231n/image_utils.py
16
2342
import urllib2, os, tempfile import numpy as np from scipy.misc import imread from cs231n.fast_layers import conv_forward_fast """ Utility functions used for viewing and processing images. """ def blur_image(X): """ A very gentle image blurring operation, to be used as a regularizer for image generation. ...
mit
-914,720,909,318,233,600
22.897959
84
0.606319
false
smarter/aom
test/android/get_files.py
9
3344
# # Copyright (c) 2016, Alliance for Open Media. All rights reserved # # This source code is subject to the terms of the BSD 2 Clause License and # the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License # was not distributed with this source code in the LICENSE file, you can # obtain it at www.aome...
bsd-2-clause
-4,361,514,701,509,023,000
26.866667
77
0.674342
false
mwmuni/LIGGGHTS_GUI
OpenGL/GL/NV/parameter_buffer_object.py
9
2582
'''OpenGL extension NV.parameter_buffer_object This module customises the behaviour of the OpenGL.raw.GL.NV.parameter_buffer_object to provide a more Python-friendly API Overview (from the spec) This extension, in conjunction with NV_gpu_program4, provides a new type of program parameter than can be used as a c...
gpl-3.0
1,708,349,591,179,191,300
45.125
99
0.807901
false
GiovanniConserva/TestDeploy
venv/Lib/site-packages/django/templatetags/i18n.py
219
19311
from __future__ import unicode_literals import sys from django.conf import settings from django.template import Library, Node, TemplateSyntaxError, Variable from django.template.base import TOKEN_TEXT, TOKEN_VAR, render_value_in_context from django.template.defaulttags import token_kwargs from django.utils import six...
bsd-3-clause
-1,889,645,973,052,012,000
33.732014
117
0.602144
false
withanage/meTypeset
bin/interactive.py
2
15252
#!/usr/bin/env python from __future__ import print_function __author__ = "Martin Paul Eve" __email__ = "martin@martineve.com" """ A class to handle an interactive prompt. Portions of this file are Copyright 2014, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of thi...
gpl-2.0
1,961,570,037,563,200,800
37.910714
89
0.546289
false
neurodebian/htcondor
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/bg.py
10
18721
apiAttachAvailable = u'\u0414\u043e\u0441\u0442\u044a\u043f\u0435\u043d \u0447\u0440\u0435\u0437 API' apiAttachNotAvailable = u'\u041d\u0435\u0434\u043e\u0441\u0442\u044a\u043f\u0435\u043d' apiAttachPendingAuthorization = u'\u0427\u0430\u043a\u0430 \u0441\u0435 \u043e\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u...
apache-2.0
7,167,740,046,204,979,000
98.112299
267
0.793921
false
Jumpscale/ays9
JumpScale9AYS/clients/sync_client/client_support.py
3
6067
""" support methods for python clients """ import json import collections from datetime import datetime from uuid import UUID from enum import Enum from dateutil import parser # python2/3 compatible basestring, for use in to_dict try: basestring except NameError: basestring = str def timestamp_from_datetim...
apache-2.0
6,479,835,669,971,763,000
26.457014
124
0.607549
false
tparks5/tor-stem
test/unit/util/str_tools.py
1
6327
""" Unit tests for the stem.util.str_tools functions. """ import datetime import unittest from stem.util import str_tools class TestStrTools(unittest.TestCase): def test_to_int(self): """ Checks the _to_int() function. """ test_inputs = { '': 0, 'h': 104, 'hi': 26729, 'hel...
lgpl-3.0
-3,940,376,416,910,309,000
34.745763
91
0.662399
false
schaubl/libcloud
libcloud/storage/drivers/local.py
37
19092
# 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 use ...
apache-2.0
4,497,933,280,168,147,000
31.195616
79
0.585743
false
kuiwei/edx-platform
common/djangoapps/user_api/tests/test_account_api.py
8
13151
# -*- coding: utf-8 -*- """ Tests for the account API. """ import re from unittest import skipUnless from nose.tools import raises from mock import patch import ddt from dateutil.parser import parse as parse_datetime from django.core import mail from django.test import TestCase from django.conf import settings from ...
agpl-3.0
-8,331,784,540,750,311,000
40.650794
110
0.677439
false
josecolella/PLD
bin/osx/treasurehunters.app/Contents/Resources/lib/python3.4/numpy/oldnumeric/ufuncs.py
13
1297
from __future__ import division, absolute_import, print_function __all__ = ['less', 'cosh', 'arcsinh', 'add', 'ceil', 'arctan2', 'floor_divide', 'fmod', 'hypot', 'logical_and', 'power', 'sinh', 'remainder', 'cos', 'equal', 'arccos', 'less_equal', 'divide', 'bitwise_or', 'bitwise_and', ...
mit
-3,400,910,232,539,069,000
60.761905
79
0.600617
false
springmeyer/gyp
test/errors/gyptest-errors.py
54
1921
#!/usr/bin/env python # 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. """ Test that two targets with the same name generates an error. """ import os import sys import TestGyp import TestCmd # TODO(sbc): Remo...
bsd-3-clause
2,944,932,295,724,232,000
33.927273
77
0.683498
false
Kazade/NeHe-Website
google_appengine/lib/django-1.2/django/templatetags/cache.py
309
2406
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist from django.template import resolve_variable from django.core.cache import cache from django.utils.encoding import force_unicode from django.utils.http import urlquote from django.utils.hashcompat import md5_constructor regi...
bsd-3-clause
-2,346,300,456,304,198,700
37.190476
109
0.646717
false
florentx/OpenUpgrade
addons/hr_payroll/wizard/__init__.py
442
1159
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # 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 ...
agpl-3.0
3,872,307,333,727,401,500
43.576923
80
0.631579
false
byterom/android_external_chromium_org
chrome/browser/resources/chromeos/chromevox/PRESUBMIT.py
86
1391
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Presubmit script for ChromeVox.""" def CheckChangeOnUpload(input_api, output_api): paths = input_api.AbsoluteLocalPaths() def ShouldCheckFile(path):...
bsd-3-clause
-8,830,414,673,527,346,000
31.348837
72
0.696621
false
mantidproject/mantid
Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/IndirectILLEnergyTransferTest.py
3
6789
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
gpl-3.0
-4,004,591,522,791,349,000
36.927374
102
0.611578
false
open-synergy/hr
hr_employee_benefit/models/hr_contract.py
15
1171
# -*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2015 Savoir-faire Linux. All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as publish...
agpl-3.0
-5,831,023,601,476,525,000
35.59375
78
0.601196
false
cloudfoundry/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/test/test_nis.py
91
1344
from test import test_support import unittest nis = test_support.import_module('nis') class NisTests(unittest.TestCase): def test_maps(self): try: maps = nis.maps() except nis.error, msg: # NIS is probably not active, so this test isn't useful if test_support.ve...
mit
-6,696,740,170,272,454,000
29.545455
88
0.49628
false
steventimberman/masterDebater
env/lib/python2.7/site-packages/django/core/mail/message.py
36
19471
from __future__ import unicode_literals import mimetypes import os import random import time from email import ( charset as Charset, encoders as Encoders, generator, message_from_string, ) from email.header import Header from email.message import Message from email.mime.base import MIMEBase from email.mime.message...
mit
-3,423,570,578,218,983,000
37.029297
107
0.618407
false
pytest-dev/pytest-services
tests/test_plugin.py
1
1365
"""Tests for pytest-services plugin.""" import os.path import socket import pylibmc import MySQLdb def test_memcached(request, memcached, memcached_socket): """Test memcached service.""" mc = pylibmc.Client([memcached_socket]) mc.set('some', 1) assert mc.get('some') == 1 # check memcached cleane...
mit
7,101,956,717,587,963,000
23.818182
65
0.664469
false
anryko/ansible
test/units/modules/network/onyx/test_onyx_snmp_users.py
9
4077
# # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.onyx impor...
gpl-3.0
-7,282,861,327,615,890,000
41.915789
92
0.600687
false
fbradyirl/home-assistant
homeassistant/components/joaoapps_join/notify.py
4
2731
"""Support for Join notifications.""" import logging import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService, ) from homeassistant.const import CONF_API_KEY import homeassistant.helpers.config_validati...
apache-2.0
-2,635,116,388,487,366,700
31.903614
80
0.623215
false
sbellem/django-rest-framework
rest_framework/reverse.py
56
2304
""" Provide urlresolver functions that return fully qualified URLs or view names """ from __future__ import unicode_literals from django.core.urlresolvers import reverse as django_reverse from django.core.urlresolvers import NoReverseMatch from django.utils import six from django.utils.functional import lazy from res...
bsd-2-clause
1,179,033,760,166,129,400
31.914286
83
0.682292
false
qusp/orange3
Orange/canvas/gui/dropshadow.py
16
13298
""" ================= Drop Shadow Frame ================= A widget providing a drop shadow (gaussian blur effect) around another widget. """ from PyQt4.QtGui import ( QWidget, QPainter, QPixmap, QGraphicsScene, QGraphicsRectItem, QGraphicsDropShadowEffect, QColor, QPen, QPalette, QStyleOption, QAbstractS...
bsd-2-clause
-3,500,997,095,689,370,000
33.811518
79
0.561588
false
yk5/incubator-airflow
tests/operators/python_operator.py
6
9948
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
-1,112,217,064,730,615,300
35.844444
82
0.573181
false
neumerance/deploy
openstack_dashboard/dashboards/admin/domains/tests.py
12
16094
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache....
apache-2.0
-5,160,003,395,969,339,000
39.33584
78
0.558034
false
avances123/huertos-api
farms/tests.py
1
5079
from rest_framework import status from rest_framework.test import APITestCase from django.urls import reverse from faker import Factory from django.contrib.auth.models import User from farms.models import Farm,Zone from farms.serializers import FarmSerializer from collections import OrderedDict ###### Module configs ...
gpl-2.0
-5,423,404,430,748,623,000
40.292683
179
0.610159
false
dstroppa/openstack-smartos-nova-grizzly
nova/tests/api/openstack/compute/contrib/test_flavorextradata.py
7
3554
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
1,197,702,995,307,130,400
31.309091
78
0.552898
false
vmthunder/nova
nova/virt/libvirt/vif.py
9
27229
# Copyright (C) 2011 Midokura KK # Copyright (C) 2011 Nicira, Inc # 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 # # ...
apache-2.0
2,515,571,950,426,932,000
38.519594
79
0.538764
false
victorbriz/rethinkdb
test/rql_test/connections/http_support/flask/globals.py
783
1137
# -*- coding: utf-8 -*- """ flask.globals ~~~~~~~~~~~~~ Defines all the global objects that are proxies to the current active context. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import partial from werkzeug.local import LocalStack, ...
agpl-3.0
779,828,725,911,328,100
24.840909
68
0.680739
false
Kazade/NeHe-Website
google_appengine/lib/django-1.4/tests/modeltests/delete/models.py
44
3200
from django.db import models class R(models.Model): is_default = models.BooleanField(default=False) def __str__(self): return "%s" % self.pk get_default_r = lambda: R.objects.get_or_create(is_default=True)[0] class S(models.Model): r = models.ForeignKey(R) class T(models.Model): s = mod...
bsd-3-clause
-5,243,795,004,420,124,000
29.188679
83
0.671875
false
sudheesh001/oh-mainline
vendor/packages/Pygments/pygments/lexers/templates.py
72
55945
# -*- coding: utf-8 -*- """ pygments.lexers.templates ~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for various template engines' markup. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexers.web import \ PhpLexer, H...
agpl-3.0
8,458,491,593,740,089,000
31.115385
84
0.492269
false
mensler/ansible
lib/ansible/plugins/connection/ssh.py
25
40554
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com> # Copyright 2017 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 Lice...
gpl-3.0
-7,708,597,573,467,107,000
43.860619
157
0.575529
false
AladdinSonni/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/systemhost.py
129
2196
# Copyright (c) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
570,196,462,724,034,240
44.75
111
0.760929
false
msegado/edx-platform
common/djangoapps/terrain/stubs/youtube.py
88
6138
""" Stub implementation of YouTube for acceptance tests. To start this stub server on its own from Vagrant: 1.) Locally, modify your Vagrantfile so that it contains: config.vm.network :forwarded_port, guest: 8031, host: 8031 2.) From within Vagrant dev environment do: cd common/djangoapps/terrain pyth...
agpl-3.0
-5,961,272,833,927,882,000
35.535714
108
0.564027
false
fpsw/Servo
servo/tasks.py
1
5336
# -*- coding: utf-8 -*- from email.parser import BytesParser from django.core.cache import cache from servo.lib.utils import empty from servo.exceptions import ConfigurationError from servo.models import Configuration, User, Order, Note, Template def get_rules(): """ Get the rules from the JSON file and cac...
bsd-2-clause
6,117,913,166,527,306,000
27.688172
78
0.520802
false
sestrella/ansible
lib/ansible/modules/cloud/lxd/lxd_container.py
15
22900
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Hiroaki Nakamura <hnakamur@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_vers...
gpl-3.0
-2,570,535,612,640,956,400
34.122699
132
0.578559
false
atlefren/beerdatabase
alembic/versions/2b35f2f2adcb_add_geoloc_tables.py
1
1700
"""add geoloc tables Revision ID: 2b35f2f2adcb Revises: 29474f196c96 Create Date: 2015-11-09 00:12:02.604229 """ # revision identifiers, used by Alembic. revision = '2b35f2f2adcb' down_revision = '29474f196c96' branch_labels = None depends_on = None import os import json from alembic import op import sqlalchemy as...
mit
-3,715,522,950,239,192,000
27.813559
88
0.664118
false
hectord/lettuce
tests/integration/lib/Django-1.2.5/django/utils/cache.py
44
9146
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
gpl-3.0
-4,803,555,412,522,549,000
39.114035
81
0.671222
false
apark263/tensorflow
tensorflow/contrib/learn/python/learn/estimators/tensor_signature_test.py
137
8063
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
5,137,289,756,666,747,000
45.074286
80
0.70408
false
listamilton/supermilton.repository
plugin.video.efilmes/bs4/tests/test_builder_registry.py
485
5374
"""Tests of the builder registry.""" import unittest from bs4 import BeautifulSoup from bs4.builder import ( builder_registry as registry, HTMLParserTreeBuilder, TreeBuilderRegistry, ) try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError: HTML5LIB_PRESENT =...
gpl-2.0
-2,330,789,550,016,918,000
37.113475
82
0.621697
false
shubhamdhama/zulip
zerver/lib/bugdown/fenced_code.py
2
14935
""" Fenced Code Extension for Python Markdown ========================================= This extension adds Fenced Code Blocks to Python-Markdown. >>> import markdown >>> text = ''' ... A paragraph before a fenced code block: ... ... ~~~ ... Fenced code block ... ~~~ ... ''' >>> ht...
apache-2.0
3,060,542,232,484,765,000
32.337054
105
0.579243
false
liberation/sesql
sesql/daemon/sesql-update.py
1
4201
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) Pilot Systems and Libération, 2010-2011 # This file is part of SeSQL. # SeSQL is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of th...
gpl-2.0
-2,061,131,810,803,564,300
30.578947
84
0.566429
false
jfwood/barbican-1
barbican/openstack/common/rpc/matchmaker_redis.py
1
4862
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Cloudscaling Group, 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/LI...
apache-2.0
-7,778,046,077,309,267,000
32.531034
79
0.61991
false
kratorius/ads
python/sorting/merge_sort.py
1
1064
import unittest def merge_sort(array): if len(array) <= 1: return array mid = len(array) / 2 merge1, merge2 = merge_sort(array[:mid]), merge_sort(array[mid:]) def merge(left, right): l, r = 0, 0 while l < len(left) and r < len(right): if left[l] < right[r]: ...
mit
-2,223,728,459,928,238,800
26.307692
72
0.488722
false
a40223217/2015cdb_g6team3
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/version.py
607
1334
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## 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; either ## version 2 of the License, or (...
gpl-3.0
-6,073,983,877,398,243,000
42.032258
79
0.731634
false
Nowheresly/odoo
openerp/addons/base/tests/test_api.py
56
17851
from openerp import models from openerp.tools import mute_logger from openerp.osv.orm import except_orm from openerp.tests import common class TestAPI(common.TransactionCase): """ test the new API of the ORM """ def assertIsRecordset(self, value, model): self.assertIsInstance(value, models.BaseModel...
agpl-3.0
4,058,272,731,998,224,400
38.580931
91
0.607473
false
denovator/myfriki
lib/jinja2/jinja2/parser.py
637
35186
# -*- coding: utf-8 -*- """ jinja2.parser ~~~~~~~~~~~~~ Implements the template parser. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2 import nodes from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError from jinja2.lexer impo...
apache-2.0
-5,253,595,781,405,852,000
38.313966
82
0.545757
false
nesdis/djongo
tests/django_tests/tests/v22/tests/validation/test_unique.py
86
6715
import datetime import unittest from django.apps.registry import Apps from django.core.exceptions import ValidationError from django.db import models from django.test import TestCase from .models import ( CustomPKModel, FlexibleDatePost, ModelToValidate, Post, UniqueErrorsModel, UniqueFieldsModel, UniqueForDa...
agpl-3.0
-125,102,106,434,619,420
38.040698
112
0.577364
false
f3zz3h/Embedded-Systems-Development
Client/Python-RTSP/keypad.py
1
6324
__author__ = "Luke Hart" __copyright__ = "Copyright 2014, The Jeff Museum" __credits__ = ["Luke Hart","Joe Ellis", "Chris Sewell", "Matt Ribbins", "Sebastian Beaven", "Joshua Webb", "Andrew Bremmer"] __license__ = "GPL" __version__ = "0.9" __maintainer__ = "Luke Hart" __email__ = "luke2.hart@live.uwe.ac....
gpl-3.0
3,759,628,298,369,687,000
29.408654
98
0.472328
false
beni55/olympia
apps/search/views.py
13
23178
from django import http from django.conf import settings from django.db.models import Q from django.shortcuts import render from django.utils import translation from django.utils.encoding import smart_str from django.views.decorators.vary import vary_on_headers import commonware.log from mobility.decorators import mob...
bsd-3-clause
639,967,960,610,519,600
34.934884
79
0.565752
false
sogelink/ansible
lib/ansible/modules/cloud/profitbricks/profitbricks_volume_attachments.py
26
7794
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
-3,680,453,229,548,305,400
28.862069
128
0.620734
false
cccfran/sympy
sympy/liealgebras/tests/test_weyl_group.py
22
1587
from sympy.liealgebras.weyl_group import WeylGroup from sympy.liealgebras.type_a import TypeA from sympy.liealgebras.type_b import TypeB from sympy.matrices import Matrix def test_weyl_group(): c = WeylGroup("A3") assert c.matrix_form('r1*r2') == Matrix([[0, 0, 1, 0], [1, 0, 0, 0], [0, 1, 0, 0], [0, 0,...
bsd-3-clause
7,686,073,626,323,654,000
41.891892
84
0.535602
false
mozilla/build-relengapi
relengapi/blueprints/badpenny/__init__.py
3
4007
# 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/. from __future__ import absolute_import import structlog from flask import Blueprint from flask import current_app from ...
mpl-2.0
-8,223,196,937,417,017,000
30.801587
77
0.690791
false
mitodl/open-discussions
channels/serializers/comments.py
1
10793
"""Serializers for commment REST APIs""" from datetime import datetime, timezone from django.contrib.auth import get_user_model from praw.models import Comment, MoreComments from praw.models.reddit.submission import Submission from rest_framework import serializers from rest_framework.exceptions import ValidationError...
bsd-3-clause
-8,160,271,689,392,207,000
36.089347
100
0.656815
false
abstract-open-solutions/OCB
openerp/report/custom.py
338
25091
# -*- 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...
agpl-3.0
-4,246,529,144,833,775,600
39.08147
211
0.469212
false
dbrattli/aioreactive
test/test_flat_map.py
1
2446
import aioreactive as rx import pytest from aioreactive.notification import OnCompleted, OnNext from aioreactive.testing import AsyncTestObserver, VirtualTimeEventLoop from aioreactive.types import AsyncObservable from expression.core import pipe @pytest.yield_fixture() # type: ignore def event_loop(): loop = Vi...
mit
-4,567,833,416,800,162,000
22.295238
77
0.623876
false
pbrady/sympy
sympy/vector/scalar.py
42
1640
from sympy.core.symbol import Symbol from sympy.core.compatibility import u, range from sympy.printing.pretty.stringpict import prettyForm class BaseScalar(Symbol): """ A coordinate symbol/base scalar. Ideally, users should not instantiate this class. """ def __new__(cls, name, index, system, p...
bsd-3-clause
554,288,494,022,912,640
27.275862
67
0.605488
false
mmilidoni/system-utility
vim-config/.vim/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py
41
2656
""" Implementation of the command-line I{pyflakes} tool. """ import sys import os import _ast checker = __import__('pyflakes.checker').checker def check(codeString, filename): """ Check the Python source given by C{codeString} for flakes. @param codeString: The Python source to check. @type codeStr...
gpl-2.0
-3,564,712,379,471,150,600
28.511111
82
0.570407
false
lunyang/pylearn2
pylearn2/training_algorithms/tests/test_sgd.py
32
61311
from __future__ import print_function import numpy as np from theano.compat.six.moves import cStringIO, xrange import theano.tensor as T from theano.tests import disturb_mem from theano.tests.record import Record, RecordMode from pylearn2.compat import first_key from pylearn2.costs.cost import Cost, SumOfCosts, Defau...
bsd-3-clause
-9,170,291,611,205,827,000
29.732331
79
0.562085
false
ehashman/oh-mainline
vendor/packages/PyYaml/lib/yaml/serializer.py
560
4171
__all__ = ['Serializer', 'SerializerError'] from error import YAMLError from events import * from nodes import * class SerializerError(YAMLError): pass class Serializer(object): ANCHOR_TEMPLATE = u'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=No...
agpl-3.0
-1,717,988,015,721,316,000
36.576577
82
0.566771
false
epyatopal/geocoder-1
geocoder/here_reverse.py
3
1251
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.base import Base from geocoder.keys import app_id, app_code from geocoder.location import Location from geocoder.here import Here class HereReverse(Here, Base): """ HERE Geocoding REST API ======================= Se...
mit
3,430,495,584,355,430,000
27.431818
85
0.601918
false
etherkit/OpenBeacon2
macos/venv/lib/python3.8/site-packages/pip/_vendor/msgpack/fallback.py
21
37133
"""Fallback pure Python implementation of msgpack""" from datetime import datetime as _DateTime import sys import struct PY2 = sys.version_info[0] == 2 if PY2: int_types = (int, long) def dict_iteritems(d): return d.iteritems() else: int_types = int unicode = str xrange = range de...
gpl-3.0
-5,298,354,446,533,280,000
33.932267
94
0.520777
false
edisongustavo/Syrupy
setup.py
1
2177
#! /usr/bin/env python ############################################################################ ## setup.py ## ## Copyright 2008 Jeet Sukumaran. ## ## 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 Softwa...
gpl-3.0
-5,373,880,606,096,004,000
30.550725
86
0.587965
false
evensonbryan/yocto-autobuilder
lib/python2.7/site-packages/SQLAlchemy-0.8.0b2-py2.7-linux-x86_64.egg/sqlalchemy/util/_collections.py
6
24911
# util/_collections.py # Copyright (C) 2005-2012 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 """Collection classes and helpers.""" import sys import itertools import weakref...
gpl-2.0
-3,958,512,163,258,472,400
26.077174
84
0.57027
false
newsteinking/docker
tests/unit/test_unit_outdated.py
8
4870
import sys import datetime import os from contextlib import contextmanager import freezegun import pytest import pretend import pip from pip._vendor import lockfile from pip.utils import outdated @pytest.mark.parametrize( ['stored_time', 'newver', 'check', 'warn'], [ ('1970-01-01T10:00:00Z', '2.0', ...
mit
425,698,863,670,011,900
30.019108
77
0.62423
false
sharkykh/SickRage
lib/subliminal/providers/subscenter.py
25
9252
# -*- coding: utf-8 -*- import bisect from collections import defaultdict import io import json import logging import zipfile from babelfish import Language from guessit import guessit from requests import Session from . import ParserBeautifulSoup, Provider from .. import __short_version__ from ..cache import SHOW_EX...
gpl-3.0
-5,991,595,712,920,979,000
38.370213
120
0.58463
false
citrix-openstack-build/swift3
swift3/test/unit/test_swift3.py
2
32421
# Copyright (c) 2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
2,544,981,258,859,996,000
45.315714
81
0.554425
false
nickpandolfi/linereader
linereader/__init__.py
2
1727
__author__ = 'Nicholas C Pandolfi' #The MIT License (MIT) # #Copyright (c) 2014 Nicholas C Pandolfi # #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 lim...
mit
6,572,024,080,143,800,000
39.162791
88
0.788651
false
otheng03/nbase-arc
redis-3.2.9/tests/nbase-arc/redis.py
3
3992
# # Copyright 2015 Naver Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
-5,090,559,400,846,140,000
29.473282
83
0.532315
false
dellysunnymtech/sakoman-oe
contrib/sakoman/build/extras/autobuilder/ipkg-utils/arfile.py
2
3493
""" arfile - A module to parse GNU ar archives. Copyright (c) 2006-7 Paul Sokolovsky This file is released under the terms of GNU General Public License v2 or later. """ import sys import os import tarfile class FileSection: "A class which allows to treat portion of file as separate file object." def __in...
mit
4,818,944,288,219,445,000
26.722222
96
0.516461
false
twobob/buildroot-kindle
output/build/host-python-2.7.2/Lib/distutils/version.py
259
11433
# # distutils/version.py # # Implements multiple version numbering conventions for the # Python Module Distribution Utilities. # # $Id$ # """Provides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion and LooseVe...
gpl-2.0
-2,791,272,119,327,181,000
37.237458
79
0.65276
false