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
diegoguimaraes/django
django/contrib/syndication/views.py
31
8809
from __future__ import unicode_literals from calendar import timegm from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.template import loader,...
bsd-3-clause
951,394,418,455,210,000
39.223744
99
0.581678
false
gregvonkuster/icqsol
shapes/icqShape.py
2
2584
#!/usr/bin/env python """ @brief A base class for constructing shapes @author alexander@gokliya.net """ from __future__ import print_function from csg.core import CSG from csg.geom import Vector import numpy DEFAULTS = dict(origin=[0.0, 0.0, 0.0], lengths=[1.0, 1.0, 1.0], radius=1.0, ...
mit
-911,251,755,296,293,200
27.711111
69
0.561533
false
siliconsmiley/QGIS
python/plugins/processing/algs/gdal/gdal2xyz.py
1
2574
# -*- coding: utf-8 -*- """ *************************************************************************** gdal2xyz.py --------------------- Date : September 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com **************...
gpl-2.0
-1,840,690,094,829,258,800
35.253521
75
0.542735
false
IKholopov/HackUPC2017
hackupc/env/lib/python3.5/site-packages/django/utils/timezone.py
57
11145
""" Timezone-related classes and functions. This module uses pytz when it's available and fallbacks when it isn't. """ import sys import time as _time from datetime import datetime, timedelta, tzinfo from threading import local from django.conf import settings from django.utils import lru_cache, six from django.util...
apache-2.0
-5,144,821,128,250,774,000
27.576923
78
0.644594
false
ssanderson/numpy
numpy/f2py/cb_rules.py
153
22230
#!/usr/bin/env python """ Build call-back mechanism for f2py2e. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 20...
bsd-3-clause
-1,841,184,518,440,323,800
39.126354
230
0.535403
false
alexcuellar/odoo
addons/payment_ogone/tests/test_ogone.py
430
9309
# -*- coding: utf-8 -*- from lxml import objectify import time import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_ogone.controllers.main import OgoneController from openerp.tools i...
agpl-3.0
7,760,184,979,265,681,000
40.373333
170
0.562896
false
dennis-sheil/commandergenius
project/jni/python/src/Lib/test/test_float.py
51
33323
import unittest, struct import os from test import test_support import math from math import isinf, isnan, copysign, ldexp import operator import random, fractions INF = float("inf") NAN = float("nan") class GeneralFloatCases(unittest.TestCase): def test_float(self): self.assertEqual(float(3.14), 3.14) ...
lgpl-2.1
8,380,972,892,409,875,000
43.430667
98
0.586592
false
zstackio/zstack-woodpecker
integrationtest/vm/installation/api_perimission_check/test_zs_upgd_3.5.2_latest_on_cos74_22976.py
1
2730
''' #Cover 22976 based on test_zs_upgd_3.5.2_latest_on_cos74.py Test the upgrade master from 3.5.2.53 & check API permissions @author: Zhaohao ''' import os import tempfile import uuid import time import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_s...
apache-2.0
-5,392,050,688,931,675,000
35.891892
80
0.699634
false
ClusterLabs/pcs
pcs_test/tier0/lib/cib/test_nvpair.py
3
16477
from unittest import TestCase from lxml import etree from pcs_test.tools.assertions import assert_xml_equal from pcs_test.tools.xml import etree_to_str from pcs.lib.cib import nvpair from pcs.lib.cib.tools import IdProvider # pylint: disable=no-self-use, protected-access class AppendNewNvpair(TestCase): def te...
gpl-2.0
7,737,838,643,891,636,000
32.02004
79
0.468532
false
partofthething/home-assistant
homeassistant/components/climate/__init__.py
16
16930
"""Provides functionality to interact with climate devices.""" from abc import abstractmethod from datetime import timedelta import functools as ft import logging from typing import Any, Dict, List, Optional import voluptuous as vol from homeassistant.const import ( ATTR_TEMPERATURE, PRECISION_TENTHS, PRE...
mit
-1,336,920,128,390,001,400
29.44964
87
0.620555
false
undu/irc
botnet/boss.py
1
12237
#!/usr/bin/env python import gevent import logging import os import random import re import sys import time from gevent import socket from gevent.event import Event from gevent.queue import Queue from logging.handlers import RotatingFileHandler from optparse import OptionParser from irc import IRCConnection, IRCBot ...
mit
-2,717,471,571,980,936,000
33.962857
106
0.580534
false
andras-tim/sqlalchemy-migrate
migrate/tests/versioning/test_script.py
63
10322
#!/usr/bin/env python # -*- coding: utf-8 -*- import imp import os import sys import shutil import six from migrate import exceptions from migrate.versioning import version, repository from migrate.versioning.script import * from migrate.versioning.util import * from migrate.tests import fixture from migrate.tests.f...
mit
2,017,535,593,245,108,500
32.842623
92
0.608894
false
petrvanblokland/Xierpa3
xierpa3/sites/examples/helloworldpages/make.py
1
8420
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # -----------------------------------------------------------...
mit
-3,560,916,106,662,295,000
49.722892
116
0.644656
false
anntzer/scikit-learn
sklearn/tests/test_multiclass.py
5
32749
import numpy as np import scipy.sparse as sp import pytest from re import escape from sklearn.utils._testing import assert_array_equal from sklearn.utils._testing import assert_almost_equal from sklearn.utils._testing import ignore_warnings from sklearn.utils._mocking import CheckingClassifier from sklearn.multiclass...
bsd-3-clause
7,494,563,634,628,996,000
36.599311
78
0.605759
false
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/audiodev.py
286
7597
"""Classes for manipulating audio devices (currently only for Sun and SGI)""" from warnings import warnpy3k warnpy3k("the audiodev module has been removed in Python 3.0", stacklevel=2) del warnpy3k __all__ = ["error","AudioDev"] class error(Exception): pass class Play_Audio_sgi: # Private instance variables ...
mit
8,759,556,957,160,831,000
28.219231
85
0.529946
false
Oncilla/scion
acceptance/common/base.py
1
7373
# Copyright 2019 Anapaya Systems # # 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
7,475,001,507,042,508,000
30.241525
90
0.630408
false
unho/pootle
tests/pootle_app/forms.py
5
1571
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import pytest from pootle_app.forms import ...
gpl-3.0
-6,699,444,047,953,784,000
31.061224
78
0.688733
false
glwu/python-for-android
python3-alpha/python3-src/Lib/cgi.py
46
34484
#! /usr/local/bin/python # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is # intentionally NOT "/usr/bin/env python". On many systems # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is # installed, so /usr/bin/env w...
apache-2.0
648,747,184,364,241,300
32.544747
79
0.568757
false
clstl/servo
tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/__init__.py
1229
2323
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
mpl-2.0
131,010,001,121,178,560
39.754386
80
0.63969
false
hurrinico/l10n-italy
l10n_it_ricevute_bancarie/__openerp__.py
1
2257
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012 Andrea Cometa. # Email: info@andreacometa.it # Web site: http://www.andreacometa.it # Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C) 2012 ...
agpl-3.0
-8,221,688,291,268,461,000
35.403226
78
0.57953
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.0/Lib/test/test_errno.py
5
1160
#! /usr/bin/env python """Test the errno module Roger E. Masse """ import errno from test import support import unittest std_c_errors = frozenset(['EDOM', 'ERANGE']) class ErrnoAttributeTests(unittest.TestCase): def test_for_improper_attributes(self): # No unexpected attributes should be on the modul...
mit
-8,687,603,400,186,094,000
28
78
0.630172
false
DarkArtek/FFXIVITAFC
news2/migrations/0001_initial.py
1
1204
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-07-28 08:26 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True depend...
unlicense
7,943,794,929,761,284,000
37.83871
143
0.645349
false
shingonoide/odoo
addons/hr_contract/__openerp__.py
260
1834
# -*- 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
-7,011,756,181,744,282,000
34.269231
78
0.580153
false
sYnfo/samba-1
python/samba/tests/upgradeprovisionneeddc.py
32
7461
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008 # # 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 opti...
gpl-3.0
-8,156,522,751,536,589,000
40.681564
108
0.602332
false
johnraz/django-rest-framework
tests/test_fields.py
1
54851
import datetime import os import uuid from decimal import Decimal import pytest from django.http import QueryDict from django.test import TestCase, override_settings from django.utils import six, timezone import rest_framework from rest_framework import serializers # Tests for field keyword arguments and core funct...
bsd-2-clause
7,313,714,012,877,029,000
30.397252
163
0.583818
false
CarlosMontilla/FxM
scripts/test/check_tests.py
1
4412
#!/usr/bin/env python3 """! @file """ import glob import sys import time # @todo: manage test that have to be checked manually (such as plots) def analyse_log(filename): """! @brief Analyse a test log to find passed and failed tests @param filename Name of the log file @return res @todo doc this ...
gpl-3.0
4,165,981,222,870,648,000
27.282051
88
0.477108
false
Weil0ng/gem5
tests/configs/tsunami-minor.py
13
2346
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
5,583,841,547,507,860,000
53.55814
72
0.770247
false
duramato/SickRage
lib/hachoir_parser/audio/mpeg_audio.py
86
13752
""" MPEG audio file parser. Creation: 12 decembre 2005 Author: Victor Stinner """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, MissingField, ParserError, createOrphanField, Bit, Bits, Enum, PaddingBits, PaddingBytes, RawBytes) from hachoir_parser.audio.id3 import ID3v1, ...
gpl-3.0
-7,043,573,774,525,663,000
32.705882
99
0.534177
false
xcgoner/dist-mxnet
example/reinforcement-learning/dqn/atari_game.py
25
7148
# 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
3,069,754,307,413,965,000
40.55814
100
0.607303
false
LukeMurphey/splunk-network-tools
tests/selenium/webdriver/blackberry/webdriver.py
44
4870
# 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,285,876,427,348,523,000
40.982759
131
0.606982
false
hotdoc/hotdoc
hotdoc/extensions/gi/annotation_parser.py
1
7809
# -*- coding: utf-8 -*- # # Copyright © 2015,2016 Mathieu Duponchelle <mathieu.duponchelle@opencreed.com> # Copyright © 2015,2016 Collabora Ltd # # 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 Found...
lgpl-2.1
-1,495,014,013,697,048,800
34.648402
94
0.636352
false
MER-GROUP/intellij-community
plugins/hg4idea/testData/bin/mercurial/bdiff.py
96
2318
# bdiff.py - Python implementation of bdiff.c # # Copyright 2009 Matt Mackall <mpm@selenic.com> and others # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import struct, difflib, re def splitnewlines(text): '''like str.splitl...
apache-2.0
6,327,118,730,232,321,000
25.643678
73
0.502588
false
nitin-cherian/Webapps
SimpleIsBetterThanComplex.com/myproject/.env/lib/python3.5/site-packages/django/contrib/auth/hashers.py
64
22352
from __future__ import unicode_literals import base64 import binascii import hashlib import importlib import warnings from collections import OrderedDict from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import...
mit
-218,046,103,862,718,460
33.229709
106
0.628624
false
beswarm/django-allauth
allauth/socialaccount/providers/edmodo/views.py
40
1075
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from allauth.socialaccount.providers import registry from .provider import E...
mit
-4,575,838,392,372,738,600
40.346154
77
0.615814
false
rvalyi/OpenUpgrade
addons/survey/controllers/main.py
20
19094
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
395,027,819,287,855,700
49.781915
359
0.585786
false
andrewtholt/My-amforth-6.1
avr8/devices/atmega6490p/device.py
5
6779
# Partname: ATmega6490P # generated automatically, do not edit MCUREGS = { 'ADMUX': '&124', 'ADMUX_REFS': '$C0', 'ADMUX_ADLAR': '$20', 'ADMUX_MUX': '$1F', 'ADCSRA': '&122', 'ADCSRA_ADEN': '$80', 'ADCSRA_ADSC': '$40', 'ADCSRA_ADATE': '$20', 'ADCSRA_ADIF': '$10', 'ADCSRA_ADIE': '$08', 'ADCSR...
gpl-3.0
-9,155,134,705,224,719,000
20.941748
38
0.473816
false
baidu/Paddle
python/paddle/fluid/tests/unittests/test_ir_memory_optimize_nlp.py
5
1878
# Copyright (c) 2019 PaddlePaddle 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 appli...
apache-2.0
-2,888,267,745,529,861,600
33.145455
84
0.675186
false
rtrwalker/geotecha
geotecha/mathematics/quadrature.py
1
74253
# geotecha - A software suite for geotechncial engineering # Copyright (C) 2018 Rohan T. Walker (rtrwalker@gmail.com) # # 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 L...
gpl-3.0
778,866,253,203,743,900
54.247768
131
0.664687
false
soldag/home-assistant
homeassistant/components/nut/const.py
10
7810
"""The nut component.""" from homeassistant.components.sensor import ( DEVICE_CLASS_BATTERY, DEVICE_CLASS_POWER, DEVICE_CLASS_TEMPERATURE, ) from homeassistant.const import ( ELECTRICAL_CURRENT_AMPERE, ELECTRICAL_VOLT_AMPERE, FREQUENCY_HERTZ, PERCENTAGE, POWER_WATT, TEMP_CELSIUS, ...
apache-2.0
-6,297,612,210,622,498,000
31.272727
87
0.590141
false
Sorsly/subtle
google-cloud-sdk/lib/third_party/apitools/base/protorpclite/descriptor.py
6
19700
#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
mit
-7,551,161,985,702,244,000
31.03252
79
0.67802
false
teamacid/android_kernel_teamacid
tools/perf/scripts/python/syscall-counts.py
944
1429
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
-3,290,188,331,221,186,000
23.637931
77
0.611617
false
JiscPER/magnificent-octopus
octopus/modules/swordv2/client_http.py
1
1816
from sword2 import HttpLayer, HttpResponse from octopus.lib import http import json from requests.auth import HTTPBasicAuth class OctopusHttpResponse(HttpResponse): def __init__(self, *args, **kwargs): self.resp = None if len(args) > 0: self.resp = args[0] def __getitem__(self, att...
apache-2.0
6,734,626,440,960,297,000
29.266667
100
0.59967
false
awni/tensorflow
tensorflow/python/training/coordinator_test.py
6
4200
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
5,699,396,441,109,231,000
30.578947
80
0.652143
false
fujunwei/chromium-crosswalk
native_client_sdk/src/tools/decode_dump.py
51
6717
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility to decode a crash dump generated by untrusted_crash_dump.[ch] Currently this produces a simple stack trace. """ import...
bsd-3-clause
-2,393,938,606,953,182,700
31.606796
78
0.630043
false
apollo13/ansible
test/support/integration/plugins/modules/aws_step_functions_state_machine_execution.py
27
6479
#!/usr/bin/python # Copyright (c) 2019, Prasad Katti (@prasadkatti) # 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': ['...
gpl-3.0
3,782,714,493,292,858,400
31.888325
132
0.659361
false
nburn42/tensorflow
tensorflow/python/training/slot_creator.py
16
7900
# 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
653,503,145,435,336,300
40.798942
80
0.702152
false
qma/pants
tests/python/pants_test/java/jar/test_manifest.py
33
1127
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import unittest fro...
apache-2.0
1,113,774,149,357,478,400
29.432432
93
0.701599
false
mylons/kubernetes
cluster/juju/charms/trusty/kubernetes-master/hooks/kubernetes_installer.py
149
4138
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
3,144,394,251,100,722,000
37.672897
78
0.60174
false
ubiar/odoo
addons/stock_landed_costs/stock_landed_costs.py
56
18361
# -*- 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
630,939,832,108,810,600
52.22029
317
0.572137
false
jpshort/odoo
addons/l10n_at/__init__.py
438
1050
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus.at # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
agpl-3.0
-3,500,147,947,048,035,300
42.75
79
0.612381
false
titasakgm/brc-stock
openerp/addons/sale_crm/report/__init__.py
54
1087
# -*- 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
-4,010,211,136,674,821,600
42.48
78
0.619135
false
nathanial/lettuce
tests/integration/lib/Django-1.3/tests/modeltests/get_object_or_404/tests.py
92
2623
from django.http import Http404 from django.shortcuts import get_object_or_404, get_list_or_404 from django.test import TestCase from models import Author, Article class GetObjectOr404Tests(TestCase): def test_get_object_or_404(self): a1 = Author.objects.create(name="Brave Sir Robin") a2 = Author...
gpl-3.0
9,134,291,923,948,444,000
31.7875
79
0.59512
false
VishvajitP/django-extensions
django_extensions/admin/filter.py
16
1997
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.admin import FieldListFilter try: from django.contrib.admin.utils import prepare_lookup_value except ImportError: # django < 1.7 from django.contrib.admin.util import prepare_lookup_value from django.utils.translation impor...
mit
5,439,272,784,419,594,000
32.847458
105
0.585879
false
Zac-HD/home-assistant
homeassistant/components/media_player/apple_tv.py
3
9307
""" Support for Apple TV. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.apple_tv/ """ import asyncio import logging import hashlib import aiohttp import voluptuous as vol from homeassistant.core import callback from homeassistant.componen...
apache-2.0
-5,281,340,171,427,332,000
32.003546
78
0.611368
false
thrive-refugee/thrive-refugee
donors/migrations/0005_auto_20141108_1219.py
1
1067
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('donors', '0004_auto_20141108_1110'), ] operations = [ migrations.CreateModel( name='Donation', ...
mit
4,993,764,627,107,552,000
28.638889
114
0.535145
false
davidvon/pipa-pay-server
site-packages/jinja2/visitor.py
1401
3316
# -*- coding: utf-8 -*- """ jinja2.visitor ~~~~~~~~~~~~~~ This module implements a visitor for the nodes. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from jinja2.nodes import Node class NodeVisitor(object): """Walks the abstract syntax tree and call visitor functions for every...
apache-2.0
4,152,995,269,863,771,000
37.114943
76
0.584741
false
isaac-philip/loolu
common/django/core/servers/basehttp.py
9
25759
""" BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21). Adapted from wsgiref.simple_server: http://svn.eby-sarna.com/wsgiref/ This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. Don't use it for production use. """ from BaseHTTPSe...
mit
5,280,051,249,911,472,000
35.904011
94
0.595015
false
ccowmu/whatistheplan.com
tests/test_routes.py
1
1776
from django.contrib.auth.models import User from django.test import Client, TestCase from django.core.urlresolvers import reverse class RoutesTest(TestCase): def setUp(self): self.client = Client() self.logged_in_client = Client() self.user = User.objects.create_user("testuser", "test@email...
mit
-7,607,565,814,630,485,000
36
91
0.646959
false
bblais/plasticity
plasticity/dialogs/waxy/textbox.py
1
4652
# textbox.py import waxyobject import wx import core import styles class TextBox(wx.TextCtrl, waxyobject.WaxyObject): __events__ = { 'Char': wx.EVT_CHAR, # do all controls have this? 'MaxLength': wx.EVT_TEXT_MAXLEN, # alias for TextMaxLen 'Text': wx.EVT_TEXT, 'Tex...
mit
-8,663,121,945,709,910,000
34.34375
84
0.565993
false
wcevans/grpc
src/python/grpcio_tests/tests/qps/benchmark_client.py
23
7701
# Copyright 2016, 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,927,491,750,135,370,000
35.15493
80
0.65446
false
joaormatos/anaconda
Chowdren/chowdren/writers/extensions/EasyScrollbar.py
1
1944
from chowdren.writers.objects import ObjectWriter from chowdren.common import get_animation_name, to_c, make_color from chowdren.writers.events import (ComparisonWriter, ActionMethodWriter, ConditionMethodWriter, ExpressionMethodWriter, make_table) from mmfparser.bitdict import BitDict from mmfparser.data.font i...
gpl-3.0
-8,162,581,802,974,518,000
28.907692
79
0.622942
false
0k/OpenUpgrade
addons/sale_stock/res_config.py
331
5235
# -*- 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
4,673,494,245,140,591,000
55.902174
200
0.65043
false
MiniSEC/GRR_clone
parsers/osx_quarantine.py
6
2638
#!/usr/bin/env python # # Copyright 2012 Google Inc. All Rights Reserved. """Parser for OSX quarantine sqlite files.""" __program__ = "osx_quarantine.py" import datetime import glob import locale import sys from grr.parsers import sqlite_file class OSXQuarantineEvents(sqlite_file.SQLiteFile): """Class for han...
apache-2.0
2,962,586,625,934,899,700
30.404762
80
0.645944
false
rbrito/pkg-youtube-dl
docs/conf.py
39
2276
# coding: utf-8 # # youtube-dl documentation build configuration file, created by # sphinx-quickstart on Fri Mar 14 21:05:43 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
unlicense
6,791,673,059,441,473,000
31.056338
79
0.714411
false
Southpaw-TACTIC/TACTIC
src/pyasm/security/security_test.py
1
30165
#!/usr/bin/env python ########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way...
epl-1.0
-1,314,311,670,555,871,200
34.698225
157
0.592408
false
xbmc/atv2
xbmc/lib/libPython/Python/Lib/test/test_format.py
8
10198
from test.test_support import verbose, have_unicode, TestFailed import sys # test string formatting operator (I am not sure if this is being tested # elsewhere but, surely, some of the given cases are *not* tested because # they crash python) # test on unicode strings as well overflowok = 1 def testformat(formatstr,...
gpl-2.0
2,739,807,393,355,433,500
40.120968
149
0.68533
false
BuildingLink/sentry
tests/sentry/models/test_project.py
8
1099
# -*- coding: utf-8 -*- from __future__ import absolute_import from sentry.models import OrganizationMember, OrganizationMemberTeam from sentry.testutils import TestCase class ProjectTest(TestCase): def test_member_set_simple(self): user = self.create_user() org = self.create_organization(owner=...
bsd-3-clause
-2,431,338,429,692,419,600
29.527778
68
0.626934
false
shiney-wh/phpsploit
src/api/plugin.py
2
1672
import re from core import plugins class Plugin: """Triggering plugin attributes. Get attributes of the currently running plugin. This object is generally imported like this: >>> from api import plugin The following attributes descriptions include some examples, based on an imaginative plug...
gpl-3.0
-5,773,520,445,400,197,000
25.967742
75
0.596292
false
cynngah/uofthacksIV
generate-jobs/lib/python2.7/site-packages/pip/commands/check.py
336
1382
import logging from pip.basecommand import Command from pip.operations.check import check_requirements from pip.utils import get_installed_distributions logger = logging.getLogger(__name__) class CheckCommand(Command): """Verify installed packages have compatible dependencies.""" name = 'check' usage =...
mit
-1,317,605,868,300,513,500
34.435897
78
0.61288
false
paran0ids0ul/infernal-twin
build/pip/build/lib.linux-i686-2.7/pip/commands/wheel.py
239
7442
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import os import warnings from pip.basecommand import RequirementCommand from pip.index import PackageFinder from pip.exceptions import CommandError, PreviousBuildDirError from pip.req import RequirementSet from pip.utils import import_or_r...
gpl-3.0
8,197,726,181,677,401,000
35.660099
79
0.563558
false
aldarionsevero/datalogger-ROS-rasp
sensors/mq135_sensor.py
1
1548
# Copyright (c) 2015 "aldarionsevero Lucas Severo Alves # <lucassalves65@gmail.com>"" # 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 ri...
mit
3,128,231,726,398,340,000
37.7
79
0.732558
false
cberry777/dd-agent
checks.d/tokumx.py
5
18952
# (C) Datadog, Inc. 2014-2016 # (C) Leif Walsh <leif.walsh@gmail.com> 2014 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import time import types # 3p import bson from pymongo import ( MongoClient, ReadPreference, uri_parser, version as py_version, ) # project f...
bsd-3-clause
8,902,282,012,258,382,000
37.209677
126
0.543267
false
paweljasinski/ironpython3
Src/StdLib/Lib/tkinter/test/test_tkinter/test_loadtk.py
162
1503
import os import sys import unittest import test.support as test_support from tkinter import Tcl, TclError test_support.requires('gui') class TkLoadTest(unittest.TestCase): @unittest.skipIf('DISPLAY' not in os.environ, 'No $DISPLAY set.') def testLoadTk(self): tcl = Tcl() self.assertRaises(Tc...
apache-2.0
-4,996,065,968,263,876,000
31.673913
69
0.582169
false
CS-SI/QGIS
python/plugins/processing/algs/gdal/gdalcalc.py
7
7588
# -*- coding: utf-8 -*- """ *************************************************************************** gdalcalc.py --------------------- Date : Janaury 2015 Copyright : (C) 2015 by Giovanni Manghi Email : giovanni dot manghi at naturalgis dot pt **********...
gpl-2.0
7,289,643,383,815,380,000
44.166667
172
0.56049
false
dorotan/pythontraining
env/Lib/site-packages/selenium/webdriver/common/utils.py
3
4191
# 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
-346,764,154,843,182,900
26.572368
78
0.632307
false
kapari/django-oscar
src/oscar/apps/catalogue/receivers.py
60
1249
# -*- coding: utf-8 -*- from django.conf import settings if settings.OSCAR_DELETE_IMAGE_FILES: from oscar.core.loading import get_model from django.db import models from django.db.models.signals import post_delete from sorl import thumbnail from sorl.thumbnail.helpers import ThumbnailError ...
bsd-3-clause
5,561,713,570,382,437,000
33.694444
73
0.647718
false
willhaines/scikit-rf
skrf/calibration/calibrationSet.py
10
4426
''' .. module:: skrf.calibration.calibrationSet ================================================================ calibrationSet (:mod:`skrf.calibration.calibrationSet`) ================================================================ Contains the CalibrationSet class, and supporting functions CalibrationSet Class ...
bsd-3-clause
6,811,641,914,329,456,000
29.524138
242
0.582241
false
matthiasdiener/spack
var/spack/repos/builtin/packages/nghttp2/package.py
5
2319
############################################################################## # Copyright (c) 2013-2018, 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
2,025,054,012,411,842,300
41.944444
99
0.6395
false
rmboggs/django
django/contrib/contenttypes/fields.py
21
24531
from __future__ import unicode_literals from collections import defaultdict from django.contrib.contenttypes.models import ContentType from django.core import checks from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, models, router, transaction from django...
bsd-3-clause
-623,779,507,485,694,100
38.186901
116
0.56023
false
gameduell/duell
bin/mac/python2.7.9/lib/python2.7/plat-mac/macerrors.py
40
116661
# -coding=latin1- from warnings import warnpy3k warnpy3k("In 3.x, the macerrors module is removed.", stacklevel=2) svTempDisable = -32768 #svTempDisable svDisabled = -32640 #Reserve range -32640 to -32768 for Apple temp disables. fontNotOutlineErr = -32615 #bitmap font passed to routine that does outlin...
bsd-2-clause
-3,738,332,965,554,184,000
61.822294
161
0.751734
false
yashodhank/frappe
frappe/commands/__init__.py
10
1452
# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, absolute_import import sys import click import cProfile import StringIO import pstats import frappe import frappe.utils from functools import wraps click.disable_unicode_lite...
mit
8,636,933,234,607,513,000
23.610169
106
0.730028
false
erwinsanchez/bitcoinwithkeccak
contrib/bitrpc/bitrpc.py
84
9663
from jsonrpc import ServiceProxy import sys import string import getpass # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8332") e...
mit
-2,079,752,377,804,305,700
27.673591
101
0.568457
false
titasakgm/brc-stock
openerp/addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/tests/regressiontests/forms/error_messages.py
13
10396
# -*- coding: utf-8 -*- tests = r""" >>> from django.forms import * >>> from django.core.files.uploadedfile import SimpleUploadedFile # CharField ################################################################### >>> e = {'required': 'REQUIRED'} >>> e['min_length'] = 'LENGTH %(length)s, MIN LENGTH %(min)s' >>> e['ma...
agpl-3.0
9,170,946,586,135,136,000
27.797784
86
0.571951
false
theyaa/Impala
thirdparty/hive-1.1.0-cdh5.7.0-SNAPSHOT/lib/py/thrift/transport/THttpClient.py
71
2916
# # 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
8,663,821,783,919,870,000
28.16
115
0.674897
false
eagleamon/home-assistant
tests/components/sensor/test_random.py
17
1067
"""The test for the random number sensor platform.""" import unittest from homeassistant.bootstrap import setup_component from tests.common import get_test_home_assistant class TestRandomSensor(unittest.TestCase): """Test the Random number sensor.""" def setup_method(self, method): """Set up things...
apache-2.0
-48,266,713,751,136,370
28.638889
78
0.596064
false
analyseuc3m/ANALYSE-v1
lms/djangoapps/course_api/blocks/transformers/navigation.py
35
3103
""" TODO """ from openedx.core.lib.block_structure.transformer import BlockStructureTransformer from .block_depth import BlockDepthTransformer class DescendantList(object): """ Contain """ def __init__(self): self.items = [] class BlockNavigationTransformer(BlockStructureTransformer): ""...
agpl-3.0
-1,662,347,706,085,102,600
32.728261
106
0.557525
false
DVegaCapital/zipline
zipline/data/treasuries_can.py
32
4188
# # Copyright 2013 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
3,969,860,073,118,303,700
32.504
75
0.602197
false
snyderr/robotframework
src/robot/output/librarylogger.py
3
2191
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
3,880,569,546,245,713,000
28.608108
80
0.700593
false
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/zmq/eventloop/minitornado/platform/auto.py
50
1424
#!/usr/bin/env python # # Copyright 2011 Facebook # # 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 a...
apache-2.0
-4,155,557,865,301,299,000
30.644444
80
0.754213
false
candrews/portage
pym/portage/dbapi/_SyncfsProcess.py
8
1169
# Copyright 2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage import os from portage.util._ctypes import find_library, LoadLibrary from portage.util._async.ForkProcess import ForkProcess class SyncfsProcess(ForkProcess): """ Isolate ctypes usage in a subprocess, ...
gpl-2.0
-2,537,455,299,542,058,000
21.056604
66
0.680068
false
MiLk/youtube-dl
youtube_dl/extractor/wimp.py
13
1787
from __future__ import unicode_literals import re from .common import InfoExtractor from .youtube import YoutubeIE class WimpIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?wimp\.com/([^/]+)/' _TESTS = [{ 'url': 'http://www.wimp.com/maruexhausted/', 'md5': 'f1acced123ecb28d9bb79f2479f2b6a...
unlicense
-3,861,804,675,147,954,700
31.490909
77
0.512031
false
benoitsteiner/tensorflow
tensorflow/python/ops/math_grad.py
5
33823
# 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
-7,581,199,566,476,697,000
31.39751
88
0.659551
false
40223249-1/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/_socket.py
742
6431
"""Implementation module for socket operations. See the socket module for documentation.""" AF_APPLETALK = 16 AF_DECnet = 12 AF_INET = 2 AF_INET6 = 23 AF_IPX = 6 AF_IRDA = 26 AF_SNA = 11 AF_UNSPEC = 0 AI_ADDRCONFIG = 1024 AI_ALL = 256 AI_CANONNAME = 2 AI_NUMERICHOST = 4 AI_NUMERICSERV = 8 AI_PASSIVE = 1...
agpl-3.0
1,789,140,905,586,452,700
16.381081
130
0.665837
false
AIFDR/inasafe
test_suite.py
3
3260
# coding=utf-8 """ Test Suite for InaSAFE. Contact : etienne at kartoza dot 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 published by the Free Software Foundation; either version 2 of the License, or (at your ...
gpl-3.0
7,030,695,755,003,612,000
27.849558
78
0.657362
false
Venturi/oldcms
env/lib/python2.7/site-packages/cmsplugin_filer_image/migrations_django/0001_initial.py
8
4643
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import filer.fields.file import filer.fields.image import cms.models.fields class Migration(migrations.Migration): dependencies = [ ('cms', '0003_auto_20140926_2347')...
apache-2.0
2,109,889,139,699,377,700
64.394366
238
0.622012
false
jschueller/numpy
numpy/core/tests/test_records.py
42
11668
from __future__ import division, absolute_import, print_function import sys import collections import pickle from os import path import numpy as np from numpy.compat import asbytes from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_array_equal, assert_array_almost_equal, ass...
bsd-3-clause
-9,075,986,738,709,981,000
38.023411
96
0.517569
false
blarghmatey/pip
pip/_vendor/html5lib/treewalkers/__init__.py
499
5766
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
mit
-6,778,752,260,165,360,000
38.22449
94
0.522546
false
olexiim/edx-platform
lms/djangoapps/instructor/enrollment.py
2
13610
""" Enrollment operations for use by instructor APIs. Does not include any access control, be sure to check access before calling. """ import json from django.contrib.auth.models import User from django.conf import settings from django.core.urlresolvers import reverse from django.core.mail import send_mail from stud...
agpl-3.0
-9,127,313,620,599,277,000
35.293333
112
0.645187
false
akarol/cfme_tests
cfme/tests/distributed/test_appliance_replication.py
1
12939
# -*- coding: utf-8 -*- import pytest from time import sleep from six.moves.urllib.parse import urlparse from cfme.base.ui import ServerView from cfme.common.vm import VM from cfme.infrastructure.provider import wait_for_a_provider from cfme.utils.appliance import provision_appliance from cfme.utils.appliance.impleme...
gpl-2.0
7,100,716,636,166,888,000
37.055882
100
0.681428
false
patrickhartling/protobuf
python/mox.py
603
38237
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-3-clause
5,966,710,906,291,615,000
26.292648
80
0.660277
false