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
Mirantis/tempest
tempest/services/volume/json/extensions_client.py
1
1222
# 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
3,228,853,723,345,535,000
29.55
78
0.707038
false
windyuuy/opera
chromium/src/tools/gyp/test/win/gyptest-cl-debug-format.py
344
1270
#!/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. """ Make sure debug format settings are extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.Te...
bsd-3-clause
-1,697,100,033,135,747,800
28.534884
79
0.702362
false
pratikmallya/heat
heat/engine/resources/openstack/nova/nova_floatingip.py
2
5929
# # 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
-2,702,641,938,226,258,000
32.6875
78
0.593692
false
xlk521/cloudguantou
django/contrib/admin/validation.py
153
19088
from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.fields import FieldDoesNotExist from django.forms.models import (BaseModelForm, BaseModelFormSet, fields_for_model, _get_foreign_key) from django.contrib.admin.util import get_fields_from_path, NotRelationFiel...
bsd-3-clause
-8,956,839,423,084,246,000
47.693878
146
0.560247
false
alextruberg/custom_django
django/conf/locale/sl/formats.py
200
2120
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd. F Y' TIME_FORMAT = 'H:i:s' DAT...
bsd-3-clause
-7,780,621,253,737,699,000
41.4
77
0.446698
false
tudyzhb/yichui
djangoappengine/main/__init__.py
53
2627
import os import sys # Add parent folder to sys.path, so we can import boot. # App Engine causes main.py to be reloaded if an exception gets raised # on the first request of a main.py instance, so don't add project_dir # multiple times. project_dir = os.path.abspath( os.path.dirname(os.path.dirname(os.path.dirnam...
bsd-3-clause
-7,423,426,893,848,497,000
29.905882
78
0.704225
false
Shougo/python-client
pynvim/api/window.py
2
1983
"""API for working with Nvim windows.""" from pynvim.api.common import Remote __all__ = ('Window') class Window(Remote): """A remote Nvim window.""" _api_prefix = "nvim_win_" @property def buffer(self): """Get the `Buffer` currently being displayed by the window.""" return self.re...
apache-2.0
2,994,518,641,458,490,400
26.541667
73
0.605144
false
gkotton/neutron
neutron/tests/unit/test_extension_ext_net.py
10
7932
# Copyright (c) 2013 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
-8,265,392,828,111,680,000
42.582418
79
0.589007
false
thresholdsoftware/asylum
openerp/addons/account/wizard/account_report_aged_partner_balance.py
48
4072
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-5,177,979,873,463,518,000
43.747253
156
0.548379
false
smallswan267/octoplus
selenium/webdriver/ie/service.py
16
3920
#!/usr/bin/python # # Copyright 2012 Webdriver_name committers # Copyright 2012 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 ...
mit
-1,784,321,021,903,954,000
34.636364
110
0.585459
false
rbalda/neural_ocr
env/lib/python2.7/site-packages/django/core/handlers/base.py
77
13346
from __future__ import unicode_literals import logging import sys import types import warnings from django import http from django.conf import settings from django.core import signals, urlresolvers from django.core.exceptions import ( MiddlewareNotUsed, PermissionDenied, SuspiciousOperation, ) from django.db impo...
mit
8,393,591,986,125,178,000
42.614379
113
0.589915
false
romanz/trezor-mcu
gen/bitmaps/generate.py
3
1293
#!/usr/bin/env python from __future__ import print_function import glob import os from PIL import Image hdrs = [] data = [] imgs = [] def encode_pixels(img): r = '' img = [ (x[0] + x[1] + x[2] > 384 and '1' or '0') for x in img] for i in range(len(img) // 8): c = ''.join(img[i * 8 : i * 8 + 8]) r += '0x%02x, '...
lgpl-3.0
-3,484,364,789,941,692,000
20.915254
83
0.580046
false
elazarg/pythia
type_analysis/test_type_safety.py
1
3619
import type_analysis def all_tests(): basic_tests() def basic_tests(): # basic addition with variables assert type_analysis.analyze_type_safety("x = 1; y = 1; z = x + y") == True assert type_analysis.analyze_type_safety("x = 'r'; y = 'r'; z = x + y") == True assert type_analysis.analyze_type_safet...
mit
3,815,128,506,876,524,000
20.420118
108
0.572258
false
PXke/invenio
invenio/legacy/bibdocfile/icon_migration_kit.py
4
6992
## This file is part of Invenio. ## Copyright (C) 2010, 2011 CERN. ## ## Invenio 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 option) any later version. ## ...
gpl-2.0
-7,512,618,171,159,816,000
41.375758
247
0.638301
false
openfun/edx-platform
common/djangoapps/student/migrations/0009_auto__del_courseregistration__add_courseenrollment.py
188
10452
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'CourseRegistration' db.delete_table('student_courseregistration') # Adding model ...
agpl-3.0
1,153,759,648,450,444,500
73.12766
182
0.558458
false
pydoit/doit
doc/tutorial/tuto_1_1.py
2
1314
import pathlib import pygraphviz def task_imports(): """find imports from a python module""" return { 'file_dep': ['projects/requests/requests/models.py'], 'targets': ['requests.models.deps'], 'actions': ['python -m import_deps %(dependencies)s > %(targets)s'], 'clean': True, ...
mit
1,861,178,005,698,844,200
28.2
76
0.56621
false
mgit-at/ansible
lib/ansible/modules/identity/keycloak/keycloak_clienttemplate.py
5
15142
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017, Eike Frost <ei@kefro.st> # 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...
gpl-3.0
-6,987,445,466,537,747,000
36.203931
114
0.607582
false
rubenvb/skia
infra/bots/recipe_modules/flavor/android.py
1
21248
# Copyright 2016 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. from recipe_engine import recipe_api from . import default import subprocess # TODO(borenet): No! Remove this. """Android flavor, used for running code ...
bsd-3-clause
4,104,147,220,258,688,500
36.082024
82
0.610175
false
jtolds/pants-lang
src/ir/types.py
1
13255
#!/usr/bin/env python # # Copyright (c) 2012, JT Olds <hello@jtolds.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 rights # to us...
mit
-7,754,668,009,689,264,000
35.515152
80
0.643606
false
zzcclp/spark
python/pyspark/pandas/plot/core.py
11
41921
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
2,907,998,814,751,494,700
35.642483
100
0.509626
false
hammerlab/varcode
test/benchmark_vcf_load.py
1
1220
""" Time how long it takes to open a VCF. Run as: python -m profile -s cumtime %(prog)s to get profiling output. """ import argparse import time import varcode parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( "path", help="Path or URL to VCF") parser.add_argument( "--profile...
apache-2.0
-4,622,638,911,327,152,000
19
53
0.596721
false
binux/pyspider
tests/data_test_webpage.py
8
1727
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<roy@binux.me> # http://binux.me # Created on 2015-01-24 13:44:10 from httpbin import app @app.route('/pyspider/test.html') def test_page(): return ''' <a href="/404">404 <a href="/links/10/0">0...
apache-2.0
4,830,305,021,757,623,000
24.397059
75
0.636364
false
webmakin/scrapy
scrapy/exporters.py
118
9277
""" Item Exporters are used to export/serialize items into different formats. """ import csv import sys import pprint import marshal import six from six.moves import cPickle as pickle from xml.sax.saxutils import XMLGenerator from scrapy.utils.serialize import ScrapyJSONEncoder from scrapy.item import BaseItem __all...
bsd-3-clause
-2,255,383,788,010,012,400
34.544061
88
0.624879
false
pombredanne/package-verify
test/test_validator_devspec.py
2
2566
# Copyright (C) 2014 Steve Milner # # 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 distributed in t...
gpl-3.0
5,214,459,336,751,297,000
27.831461
75
0.620421
false
windyuuy/opera
chromium/src/third_party/trace-viewer/third_party/pywebsocket/src/example/echo_client.py
30
38662
#!/usr/bin/env python # # Copyright 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...
bsd-3-clause
-1,092,281,750,765,232,100
37.739479
79
0.583364
false
salimfadhley/jenkinsapi
jenkinsapi_tests/systests/test_nodes.py
3
5746
""" System tests for `jenkinsapi.jenkins` module. """ import logging import pytest from jenkinsapi.node import Node from jenkinsapi.credential import SSHKeyCredential from jenkinsapi_tests.test_utils.random_strings import random_string log = logging.getLogger(__name__) def test_online_offline(jenkins): """ C...
mit
-7,309,451,289,891,004,000
26.103774
89
0.599722
false
dbaxa/django
tests/utils_tests/test_decorators.py
319
4870
from django.http import HttpResponse from django.template import engines from django.template.response import TemplateResponse from django.test import RequestFactory, SimpleTestCase from django.utils.decorators import classproperty, decorator_from_middleware class ProcessViewMiddleware(object): def process_view(s...
bsd-3-clause
7,254,597,897,976,802,000
32.129252
86
0.651129
false
raamana/pyradigm
pyradigm/_version.py
1
18454
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
mit
837,955,013,480,759,900
34.488462
79
0.575268
false
XVPCoin/vaporcoin
qa/rpc-tests/util.py
115
5260
# Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression testing # # Add python-bitcoinrpc to module search path: import os import sys sys.path.append...
mit
2,194,635,847,109,980,200
33.605263
94
0.599049
false
degoldschmidt/pytrack-analysis
gui/videoplayer.py
1
2535
import numpy as np import cv2 import tkinter as tk from PIL import Image, ImageTk import os.path as op VIDEODIR = '/media/degoldschmidt/DATA_DENNIS_002/working_data/0007_KPEG' VIDEOFILE = op.join(VIDEODIR, 'cam01_2018-04-18T15_39_08.avi') START_FRAME = 4000 #Set up GUI window = tk.Tk() #Makes main window window.wm_...
gpl-3.0
3,456,846,930,223,821,300
34.208333
104
0.662722
false
malaterre/ITK
Modules/Filtering/ImageFeature/wrapping/test/HoughTransform2DLinesImageFilterTest.py
2
1337
#========================================================================== # # Copyright NumFOCUS # # 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/l...
apache-2.0
-6,751,209,153,586,154,000
30.833333
77
0.655946
false
SecurityFTW/cs-suite
tools/G-Scout/G-Scout-master/categories/instance_groups.py
2
1836
from googleapiclient import discovery from tinydb import TinyDB from core.utility import get_gcloud_creds db = TinyDB('entities.json') group_table = db.table('Instance Groups') template_table = db.table('Instance Templates') credentials = GoogleCredentials.get_application_default() from oauth2client.file import Stora...
gpl-3.0
2,672,970,985,170,340,000
33.641509
104
0.678649
false
nre-aachen/GeMpy
gempy/GemPy_f.py
1
13575
""" Module with classes and methods to perform implicit regional modelling based on the potential field method. Tested on Ubuntu 14 Created on 10/10 /2016 @author: Miguel de la Varga """ from __future__ import division import os from os import path import sys # This is for sphenix to find the packages sys.path.appe...
mit
3,733,507,209,703,237,600
33.280303
122
0.644199
false
joone/chromium-crosswalk
tools/telemetry/third_party/webpagereplay/rules/log_url.py
30
2237
#!/usr/bin/env python # 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...
bsd-3-clause
6,504,584,119,405,626,000
30.507042
74
0.642825
false
madan96/sympy
sympy/solvers/ode.py
7
330554
r""" This module contains :py:meth:`~sympy.solvers.ode.dsolve` and different helper functions that it uses. :py:meth:`~sympy.solvers.ode.dsolve` solves ordinary differential equations. See the docstring on the various functions for their uses. Note that partial differential equations support is in ``pde.py``. Note t...
bsd-3-clause
4,886,063,881,917,780,000
38.811393
279
0.530782
false
jackxiang/google-app-engine-django
appengine_django/management/commands/rollback.py
60
1645
#!/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 or...
apache-2.0
-2,768,232,037,895,152,600
30.634615
76
0.733131
false
sebrandon1/nova
nova/tests/unit/api/openstack/compute/test_extended_server_attributes.py
3
10156
# 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/LICENSE-2.0 # # Unless requ...
apache-2.0
5,125,625,704,921,532,000
40.284553
79
0.552087
false
bsmr-docker/compose
tests/integration/resilience_test.py
29
1545
from __future__ import unicode_literals from __future__ import absolute_import import mock from compose.project import Project from .testcases import DockerClientTestCase class ResilienceTest(DockerClientTestCase): def setUp(self): self.db = self.create_service('db', volumes=['/var/db'], command='top') ...
apache-2.0
-1,202,901,221,971,210,200
31.1875
79
0.653722
false
tonyli71/nuage-openstack-neutron
nuage_neutron/plugins/nuage/nuagedb.py
1
11936
# Copyright 2014 Alcatel-Lucent USA 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 l...
apache-2.0
-707,815,946,445,766,300
34.20944
78
0.625586
false
chriscoyfish/coala-bears
bears/c_languages/ClangComplexityBear.py
4
4936
from clang.cindex import Index, CursorKind from coalib.bears.LocalBear import LocalBear from coalib.results.Result import Result from coalib.results.SourceRange import SourceRange from coalib.bearlib import deprecate_settings from bears.c_languages.ClangBear import clang_available, ClangBear class ClangComplexityBea...
agpl-3.0
-1,738,686,194,901,357,000
40.830508
78
0.574554
false
Voluntarynet/BitmessageKit
BitmessageKit/Vendor/static-python/Lib/test/test_compile.py
45
18749
import unittest import sys import _ast from test import test_support import textwrap class TestSpecifics(unittest.TestCase): def test_no_ending_newline(self): compile("hi", "<test>", "exec") compile("hi\r", "<test>", "exec") def test_empty(self): compile("", "<test>", "exec") def...
mit
-5,820,660,071,232,493,000
34.644487
95
0.516828
false
michaelforfxhelp/fxhelprepo
third_party/chromium/testing/gtest/test/gtest_xml_output_unittest.py
5
11521
#!/usr/bin/env python # # Copyright 2006, 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,...
mpl-2.0
3,315,242,025,141,497,000
45.607438
188
0.66496
false
TomasTomecek/compose
tests/unit/interpolation_test.py
38
1676
import unittest from compose.config.interpolation import BlankDefaultDict as bddict from compose.config.interpolation import interpolate from compose.config.interpolation import InvalidInterpolation class InterpolationTest(unittest.TestCase): def test_valid_interpolations(self): self.assertEqual(interpol...
apache-2.0
6,926,486,893,829,527,000
49.787879
95
0.681981
false
elventear/ansible-modules-core
network/openswitch/_ops_template.py
23
7218
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
-1,601,545,775,722,494,000
30.938053
80
0.637434
false
pratikmallya/hue
desktop/core/ext-py/boto-2.38.0/boto/sqs/message.py
135
9892
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
apache-2.0
-7,204,968,170,575,255,000
35.501845
116
0.667408
false
mcardillo55/django
django/contrib/admindocs/utils.py
411
4187
"Misc. utility functions/classes for admin documentation generator." import re from email.errors import HeaderParseError from email.parser import HeaderParser from django.core.urlresolvers import reverse from django.utils.encoding import force_bytes from django.utils.safestring import mark_safe try: import docut...
bsd-3-clause
7,851,047,264,465,775,000
28.485915
94
0.607356
false
caidongyun/pylearn2
pylearn2/models/mlp.py
12
165807
""" Multilayer Perceptron """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2012-2013, Universite de Montreal" __credits__ = ["Ian Goodfellow", "David Warde-Farley"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" import logging import math import operator import sys import warnings import numpy ...
bsd-3-clause
-8,145,180,516,870,538,000
33.731253
79
0.556092
false
radicalbit/ambari
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py
2
9988
#!/usr/bin/env python """ 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")...
apache-2.0
6,034,240,482,770,320,000
35.188406
101
0.714858
false
quamilek/django
django/conf/locale/de/formats.py
504
1100
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
bsd-3-clause
-8,159,230,122,315,731,000
34.483871
77
0.604545
false
Br3nda/calcalcal
pylib/cherrypy/tutorial/tut05_derived_objects.py
36
2291
""" Tutorial - Object inheritance You are free to derive your request handler classes from any base class you wish. In most real-world applications, you will probably want to create a central base class used for all your pages, which takes care of things like printing a common page header and footer. """ import cherr...
mit
6,978,967,751,883,307,000
26.60241
74
0.590135
false
jyogi/purvar-agent
checks.d/network.py
5
26830
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) """ Collects network metrics. """ # stdlib import re import socket from collections import defaultdict # project from checks import AgentCheck from utils.platform import Platform from utils.subprocess_output impo...
bsd-3-clause
-1,882,921,427,615,122,400
43.941374
136
0.505553
false
tanmaythakur/django
tests/admin_docs/models.py
83
1625
""" Models for testing various aspects of the djang.contrib.admindocs app """ from django.db import models class Company(models.Model): name = models.CharField(max_length=200) class Group(models.Model): name = models.CharField(max_length=200) class Family(models.Model): last_name = models.CharField(m...
bsd-3-clause
-1,246,409,662,232,292,900
22.214286
86
0.638154
false
gurneyalex/account-invoicing
account_invoice_force_number/__init__.py
34
1047
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) # Copyright (C) 2011-2013 Agile Business Group sagl # (<http://www.agilebg.com>) # # This program is free software: you can redistribute it a...
agpl-3.0
-8,176,943,763,265,854,000
46.590909
78
0.602674
false
romankagan/DDBWorkbench
python/lib/Lib/site-packages/django/contrib/gis/maps/google/__init__.py
603
2648
""" This module houses the GoogleMap object, used for generating the needed javascript to embed Google Maps in a Web page. Google(R) is a registered trademark of Google, Inc. of Mountain View, California. Example: * In the view: return render_to_response('template.html', {'google' : GoogleMap(key="...
apache-2.0
1,346,229,408,400,267,000
42.409836
126
0.672205
false
ndawe/goodruns
goodruns/sorteddict.py
1
3468
""" Copied from: https://code.djangoproject.com/browser/django/ trunk/django/utils/datastructures.py#L99 BSD license """ import copy from types import GeneratorType import bisect class SortedDict(dict): """ A dictionary that keeps its keys in the order in which they're inserted. """ def _...
gpl-3.0
-3,858,595,720,821,222,400
28.389831
79
0.555652
false
GoogleDeveloperExperts/experts-app-backend
models/activity_record.py
1
9785
from google.appengine.ext import ndb from endpoints_proto_datastore.ndb import EndpointsModel from endpoints_proto_datastore.ndb import EndpointsAliasProperty from endpoints_proto_datastore.ndb import EndpointsVariantIntegerProperty from endpoints_proto_datastore.ndb import EndpointsComputedProperty from datetime impor...
apache-2.0
-5,558,038,267,511,269,000
34.452899
105
0.634645
false
openthread/silk
silk/device/netns_base.py
1
8483
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-940,219,289,186,690,000
36.535398
111
0.636096
false
takeshineshiro/swift
test/unit/common/middleware/test_healthcheck.py
35
2901
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
-6,456,072,012,414,182,000
35.2625
78
0.662875
false
huaweiswitch/neutron
neutron/plugins/vmware/plugins/service.py
7
80699
# Copyright 2013 VMware, 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 a...
apache-2.0
2,147,157,921,240,154,000
43.242873
79
0.575497
false
cpennington/edx-platform
lms/djangoapps/courseware/tests/test_credit_requirements.py
4
6551
""" Tests for credit requirement display on the progress page. """ import ddt import six from django.conf import settings from django.urls import reverse from mock import patch from course_modes.models import CourseMode from openedx.core.djangoapps.credit import api as credit_api from openedx.core.djangoapps.credit....
agpl-3.0
-2,621,575,370,546,647,600
36.649425
106
0.63288
false
hardanimal/UFT_UPGEM
src/UFT/backend/configuration.py
1
3635
#!/usr/bin/env python # encoding: utf-8 """PGEM test configuration model. Default connect to configuration.db which save the test items settings. """ __version__ = "0.1" __author__ = "@fanmuzhi, @boqiling" __all__ = ["PGEMConfig", "TestItem"] from sqlalchemy.ext.declarative import declarative_base from sqlalchemy imp...
gpl-3.0
-104,495,011,252,198,960
29.291667
79
0.615406
false
CouchPotato/CouchPotatoServer
libs/synchronousdeluge/client.py
151
5078
import os import platform from collections import defaultdict from itertools import imap from synchronousdeluge.exceptions import DelugeRPCError from synchronousdeluge.protocol import DelugeRPCRequest, DelugeRPCResponse from synchronousdeluge.transfer import DelugeTransfer __all__ = ["DelugeClient"] RPC_RESPONSE =...
gpl-3.0
-1,608,558,754,728,724,200
30.345679
138
0.557897
false
cloudera/recordservice
tests/hs2/test_fetch.py
16
11507
# Copyright (c) 2012 Cloudera, 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 o...
apache-2.0
-2,594,755,651,986,785,300
48.175214
96
0.722343
false
rbarlow/pulp
server/test/unit/server/managers/schedule/test_consumer.py
15
7585
import unittest import mock from pulp.server.db.model.consumer import Consumer from pulp.server.db.model.dispatch import ScheduledCall from pulp.server.exceptions import MissingResource, MissingValue, InvalidValue from pulp.server.managers.factory import initialize from pulp.server.managers.schedule.consumer import (...
gpl-2.0
-351,826,182,027,735,900
40.906077
100
0.678312
false
guewen/OpenUpgrade
addons/stock_account/wizard/stock_change_standard_price.py
61
3467
# -*- 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
-1,072,709,459,867,669,600
44.618421
126
0.628209
false
zachcp/qiime
scripts/blast_wrapper.py
15
2554
#!/usr/bin/env python # File created on 20 Dec 2009. from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Greg Caporaso", "Jesse Stombaugh"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = "gregcapora...
gpl-2.0
2,059,730,107,011,280,400
40.868852
395
0.670321
false
Shrhawk/edx-platform
lms/djangoapps/courseware/model_data.py
9
35754
""" Classes to provide the LMS runtime data storage to XBlocks. :class:`DjangoKeyValueStore`: An XBlock :class:`~KeyValueStore` which stores a subset of xblocks scopes as Django ORM objects. It wraps :class:`~FieldDataCache` to provide an XBlock-friendly interface. :class:`FieldDataCache`: A object which pro...
agpl-3.0
-4,033,854,770,671,205,400
34.540755
108
0.618588
false
oandrew/home-assistant
tests/components/media_player/test_cast.py
22
1338
"""The tests for the Cast Media player platform.""" # pylint: disable=protected-access import unittest from unittest.mock import patch from homeassistant.components.media_player import cast class FakeChromeCast(object): """A fake Chrome Cast.""" def __init__(self, host, port): """Initialize the fake...
mit
4,694,727,162,907,600,000
30.857143
74
0.630045
false
gonboy/sl4a
python/src/Lib/test/test_time.py
58
9341
from test import test_support import time import unittest class TimeTestCase(unittest.TestCase): def setUp(self): self.t = time.time() def test_data_attributes(self): time.altzone time.daylight time.timezone time.tzname def test_clock(self): time.clock() ...
apache-2.0
270,704,498,208,635,300
40.331858
80
0.528316
false
wmjac/pygtsa
calc_energies.py
1
3664
# Copyright (C) 2014 William M. Jacobs # 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 distributed i...
gpl-3.0
-7,527,889,056,837,796,000
45.974359
104
0.659934
false
Achint08/open-event-orga-server
migrations/versions/9913b58c2640_.py
10
1112
"""empty message Revision ID: 9913b58c2640 Revises: ddc941500bd2 Create Date: 2016-07-29 23:23:27.324000 """ # revision identifiers, used by Alembic. revision = '9913b58c2640' down_revision = 'ddc941500bd2' from alembic import op import sqlalchemy as sa import sqlalchemy_utils def upgrade(): ### commands auto...
gpl-3.0
839,297,361,700,917,000
30.771429
82
0.67446
false
cnweibo/bootstrapgrunt
node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
294
21436
# Copyright (c) 2014 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. """ This script is intended for use as a GYP_GENERATOR. It takes as input (by way of the generator flag config_path) the path of a json file that dictates the file...
mit
1,508,230,652,371,285,800
36.673111
80
0.688841
false
AnishShah/tensorflow
tensorflow/contrib/model_pruning/python/layers/layers.py
27
15357
# 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
-9,100,372,137,729,035,000
41.305785
80
0.670574
false
riklaunim/django-custom-multisite
django/dispatch/saferef.py
86
10503
""" "Safe weakrefs", originally from pyDispatcher. Provides a way to safely weakref any function, including bound methods (which aren't handled by the core weakref module). """ import traceback import weakref def safeRef(target, onDelete = None): """Return a *safe* weak reference to a callable target target...
bsd-3-clause
7,670,465,193,926,899,000
40.844622
145
0.621346
false
scott1028/pyfpdf
tests/cover/test_simple.py
18
1080
# -*- coding: utf-8 -*- "Basic example to test PyFPDF" #PyFPDF-cover-test:format=PDF #PyFPDF-cover-test:fn=simple.pdf #PyFPDF-cover-test:hash=1fd821a42cb5029a51727a6107b623ec #PyFPDF-cover-test:pil=yes #PyFPDF-cover-test:res=../tutorial/logo.png #PyFPDF-cover-test:res=flower2.jpg #PyFPDF-cover-test:res=lena.gif impo...
lgpl-3.0
-2,192,639,881,194,476,800
24.714286
75
0.662037
false
mikebenfield/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
86
1234
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
-7,190,859,379,340,485,000
28.380952
69
0.577796
false
OSVR/UIforETW
bin/StripChromeSymbols.py
3
9618
# 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 ...
apache-2.0
8,227,813,062,352,095,000
41.718182
130
0.658869
false
Tesora/tesora-horizon
openstack_dashboard/dashboards/project/firewalls/workflows.py
2
15955
# Copyright 2013, Big Switch Networks, 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 applic...
apache-2.0
8,726,147,246,848,451,000
39.08794
79
0.570542
false
tanmaykm/edx-platform
lms/djangoapps/support/tests/test_views.py
17
15131
# coding: UTF-8 """ Tests for support views. """ from datetime import datetime, timedelta import itertools import json import re import ddt from django.core.urlresolvers import reverse from nose.plugins.attrib import attr from pytz import UTC from course_modes.models import CourseMode from course_modes.tests.factori...
agpl-3.0
-6,263,265,895,100,285,000
39.231383
135
0.635618
false
salamer/jolla
example/app.py
1
1317
#!/usr/bin/env python # -*- coding: utf-8 -*- from jolla import server from jolla import plugins from jolla import session from jolla import HTTP404Error from jolla import SessionError session = session() def index(request): return plugins.render('index.html') def chinese(request): try: if reques...
apache-2.0
-5,764,203,949,060,674,000
18.279412
71
0.562929
false
dou800/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/sqlite3/dbapi2.py
55
2644
# -*- coding: iso-8859-1 -*- # pysqlite2/dbapi2.py: the DB-API 2.0 interface # # Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # ari...
mit
3,415,416,752,827,565,000
29.045455
88
0.696672
false
speksofdust/BeyondDreams
beyonddreams/screens/screen.py
1
6125
# ---------------------------------------------------------------------------- # # # # 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 ...
gpl-3.0
-9,182,541,815,632,071,000
33.027778
80
0.516571
false
edensparkles/FIRSTAID
FIRST_AID/venv/Lib/site-packages/pip/utils/appdirs.py
174
7896
""" This code was taken from https://github.com/ActiveState/appdirs and modified to suit our purposes. """ from __future__ import absolute_import import os import sys from pip.compat import WINDOWS, expanduser def user_cache_dir(appname): r""" Return full path to the user-specific cache dir for this applica...
mit
7,536,067,731,866,715,000
34.25
79
0.605243
false
cnsoft/kbengine-cocos2dx
kbe/res/scripts/common/Lib/importlib/test/abc.py
86
2471
import abc import unittest class FinderTests(unittest.TestCase, metaclass=abc.ABCMeta): """Basic tests for a finder to pass.""" @abc.abstractmethod def test_module(self): # Test importing a top-level module. pass @abc.abstractmethod def test_package(self): # Test importi...
lgpl-3.0
-6,450,259,265,032,425,000
23.959596
79
0.592068
false
jicruz/heroku-bot
lib/youtube_dl/extractor/spike.py
34
2296
from __future__ import unicode_literals import re from .mtv import MTVServicesInfoExtractor class SpikeIE(MTVServicesInfoExtractor): _VALID_URL = r'https?://(?:[^/]+\.)?spike\.com/[^/]+/[\da-z]{6}(?:[/?#&]|$)' _TESTS = [{ 'url': 'http://www.spike.com/video-clips/lhtu8m/auction-hunters-can-allen-ride...
gpl-3.0
5,346,482,475,416,701,000
41.518519
118
0.591028
false
bslatkin/8-bits
appengine-mapreduce/python/test/mapreduce/handlers_test.py
1
68704
#!/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...
apache-2.0
2,637,520,201,994,799,600
33.215139
80
0.669743
false
xcbat/vnpy
vnpy/api/sgit/pyscript/generate_struct.py
15
1494
# encoding: UTF-8 __author__ = 'CHENXY' from sgit_data_type import * def main(): """主函数""" fcpp = open('SgitFtdcUserApiStruct.h', 'r') fpy = open('sgit_struct.py', 'w') fpy.write('# encoding: UTF-8\n') fpy.write('\n') fpy.write('structDict = {}\n') fpy.write('\n') for no, line in en...
mit
3,407,573,698,281,004,500
22.6
67
0.437147
false
hamogu/marxs
marxs/simulator/tests/test_simulator.py
1
2812
import numpy as np from astropy.table import Table import pytest from ..simulator import KeepCol, Sequence, BaseContainer from ...optics import FlatDetector f1 = FlatDetector() f2 = FlatDetector() f3 = FlatDetector() s_l2 = Sequence(elements=[f2, f3]) mission = Sequence(elements=[f1, s_l2]) def test_seach_all(): ...
gpl-3.0
-5,463,284,590,807,406,000
35.519481
84
0.58606
false
kirmani/hlpr_cadence
third_party/hlpr_manipulation/hlpr_manipulation_utils/src/hlpr_manipulation_utils/manipulator.py
1
17522
import roslib; roslib.load_manifest('hlpr_manipulation_utils') from sensor_msgs.msg import JointState from vector_msgs.msg import JacoCartesianVelocityCmd, LinearActuatorCmd, GripperCmd, GripperStat from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint from wpi_jaco_msgs.msg import AngularCommand, Carte...
mit
5,785,290,438,129,072,000
33.222656
154
0.655519
false
sahiljain/catapult
third_party/mox3/mox3/tests/test_mox.py
26
84855
# Unit tests for Mox. # # 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 ...
bsd-3-clause
-503,091,593,706,217,700
34.238787
79
0.626245
false
miguelparaiso/OdooAccessible
addons/stock/wizard/__init__.py
323
1149
# -*- 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
2,947,655,277,451,158,500
41.555556
78
0.637076
false
nckx/dstat
plugins/dstat_disk_svctm.py
4
2496
### Author: David Nicklay <david-d$nicklay,com> ### Modified from disk-util: Dag Wieers <dag$wieers,com> class dstat_plugin(dstat): """ The average service time (in milliseconds) for I/O requests that were issued to the device. Warning! Do not trust this field any more. """ def __init__(self)...
gpl-2.0
1,129,535,403,174,979,600
31.842105
113
0.499199
false
lampeh/FooPing
server/FooPingReceiver.py
1
3008
## # FooPing Demo Receiver # Copyright 2014 Hauke Lampe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Thi...
agpl-3.0
2,108,998,497,848,737,800
26.345455
117
0.697806
false
52ai/django-ccsds
tests/m2m_through/tests.py
1
15770
from __future__ import unicode_literals from datetime import datetime from operator import attrgetter from django.test import TestCase from .models import ( CustomMembership, Employee, Event, Friendship, Group, Ingredient, Invitation, Membership, Person, PersonSelfRefM2M, Recipe, RecipeIngredient, Relati...
bsd-3-clause
-8,918,560,951,255,217,000
33.432314
94
0.615346
false
nokute78/fluent-bit
plugins/out_kafka/librdkafka-1.6.0/tests/performance_plot.py
3
2902
#!/usr/bin/env python3 # import sys, json import numpy as np import matplotlib.pyplot as plt from collections import defaultdict def semver2int (semver): if semver == 'trunk': semver = '0.10.0.0' vi = 0 i = 0 for v in reversed(semver.split('.')): vi += int(v) * (i * 10) i += 1...
apache-2.0
-3,825,649,538,874,842,600
25.381818
90
0.560992
false
toshywoshy/ansible
test/units/utils/test_shlex.py
197
1290
# (c) 2015, Marius Gedminas <marius@gedmin.as> # # 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 vers...
gpl-3.0
1,545,187,428,780,935,200
32.947368
81
0.686822
false
godfather1103/WeiboRobot
python27/1.0/lib/site-packages/pip/commands/list.py
269
7251
from __future__ import absolute_import import logging from pip._vendor import pkg_resources from pip.basecommand import Command from pip.exceptions import DistributionNotFound from pip.index import FormatControl, fmt_ctl_formats, PackageFinder, Search from pip.req import InstallRequirement from pip.utils import get_...
gpl-3.0
3,721,753,113,028,710,000
34.89604
78
0.547097
false
MoisesTedeschi/python
Scripts-Python/Modulos-Diversos/python-com-scrapy/Lib/tokenize.py
9
27030
"""Tokenization help for Python programs. tokenize(readline) is a generator that breaks a stream of bytes into Python tokens. It decodes the bytes according to PEP-0263 for determining source file encoding. It accepts a readline-like method which is called repeatedly to get the next line of input (or b"" for EOF). ...
gpl-3.0
5,834,064,603,778,708,000
35.725543
100
0.529708
false
sdmathis/LitecoinNEW
contrib/spendfrom/spendfrom.py
792
10053
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
mit
8,396,163,798,173,546,000
36.651685
111
0.619815
false
danielfrg/jupyterhub-kubernetes_spawner
kubernetes_spawner/kube.py
1
6588
import os from . import swagger_client as swagger from .swagger_client.models.v1_pod import V1Pod from .swagger_client.models.v1_pod_spec import V1PodSpec from .swagger_client.models.v1_object_meta import V1ObjectMeta from .swagger_client.models.v1_container import V1Container from .swagger_client.models.v1_container...
apache-2.0
7,025,206,937,972,352,000
34.804348
111
0.650273
false