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
matthiasdiener/spack
lib/spack/spack/test/cmd/list.py
3
2522
############################################################################## # 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
-6,654,112,589,072,553,000
30.525
78
0.664155
false
dmlc/tvm
python/tvm/topi/arm_cpu/depthwise_conv2d.py
1
24416
# 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,259,450,551,458,108,000
33.830243
102
0.553981
false
PaulKinlan/cli-caniuse
site/app/scripts/bower_components/jsrepl-build/extern/python/unclosured/lib/python2.7/msilib/__init__.py
43
17579
# -*- coding: iso-8859-1 -*- # Copyright (C) 2005 Martin v. Löwis # Licensed to PSF under a Contributor Agreement. from _msi import * import os, string, re, sys AMD64 = "AMD64" in sys.version Itanium = "Itanium" in sys.version Win64 = AMD64 or Itanium # Partially taken from Wine datasizemask= 0x00ff type_valid= ...
apache-2.0
8,855,166,320,949,250,000
36.008421
105
0.550771
false
wuga214/Django-Wuga
env/lib/python2.7/site-packages/django/template/__init__.py
165
1889
""" Django's support for templates. The django.template namespace contains two independent subsystems: 1. Multiple Template Engines: support for pluggable template backends, built-in backends and backend-independent APIs 2. Django Template Language: Django's own template engine, including its built-in loaders, ...
apache-2.0
4,751,144,151,942,030,000
26.376812
89
0.715723
false
binhqnguyen/lena
src/lte/test/examples-to-run.py
151
3664
#! /usr/bin/env python # -*- coding: utf-8 -*- ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). # ...
gpl-2.0
-218,724,546,961,001,060
68.132075
293
0.659662
false
andela-earinde/bellatrix-py
app/js/lib/lib/modules/pyrepl/pygame_console.py
13
11980
# Copyright 2000-2004 Michael Hudson-Doyle <micahel@gmail.com> # # All Rights Reserved # # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose is hereby granted without fee, # provided that the above copyright notice appear in all copies and #...
mit
2,514,440,179,459,600,000
32.937677
84
0.541653
false
ROMFactory/android_external_chromium_org
build/android/symbolize.py
97
2639
#!/usr/bin/env python # # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Symbolizes stack traces generated by Chromium for Android. Sample usage: adb logcat chromium:V | symbolize.py """ import os im...
bsd-3-clause
-1,194,287,657,845,490,700
28.988636
80
0.64532
false
dietrichc/streamline-ppc-reports
examples/dfp/v201411/custom_targeting_service/update_custom_targeting_keys.py
4
2407
#!/usr/bin/python # # Copyright 2014 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 b...
apache-2.0
-7,608,391,753,555,470,000
32.430556
80
0.677607
false
ioam/holoviews
holoviews/tests/core/testcollation.py
2
3718
""" Test cases for Collator """ import itertools import numpy as np from holoviews.core import Collator, HoloMap, NdOverlay, Overlay, GridSpace from holoviews.element import Curve from holoviews.element.comparison import ComparisonTestCase class TestCollation(ComparisonTestCase): def setUp(self): alphas,...
bsd-3-clause
-3,597,647,010,628,444,000
46.063291
98
0.650888
false
abreen/socrates.py
blessed/tests/test_core.py
1
14455
# -*- coding: utf-8 -*- "Core blessed Terminal() tests." # std try: from StringIO import StringIO except ImportError: from io import StringIO import collections import warnings import platform import locale import sys import imp import os # local from .accessories import ( as_subprocess, TestTerminal,...
gpl-2.0
-4,714,773,379,512,285,000
29.820896
79
0.60166
false
IRI-Research/django
tests/managers_regress/tests.py
62
8228
from __future__ import unicode_literals from django.apps import apps from django.db import models from django.template import Context, Template from django.test import TestCase, override_settings from django.utils.encoding import force_text from .models import ( Child1, Child2, Child3, Child4, Chi...
bsd-3-clause
3,979,251,184,667,779,000
39.53202
130
0.616796
false
zhoulingjun/zipline
zipline/utils/security_list.py
18
4472
from datetime import datetime from os import listdir import os.path import pandas as pd import pytz import zipline from zipline.finance.trading import with_environment DATE_FORMAT = "%Y%m%d" zipline_dir = os.path.dirname(zipline.__file__) SECURITY_LISTS_DIR = os.path.join(zipline_dir, 'resources', 'security_lists') ...
apache-2.0
-428,562,606,813,553,800
31.172662
77
0.581172
false
AOSPU/external_chromium_org
build/android/gyp/finalize_apk.py
9
1864
#!/usr/bin/env python # # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Signs and zipaligns APK. """ import optparse import shutil import sys import tempfile from util import build_utils def SignApk(...
bsd-3-clause
6,539,404,240,537,068,000
26.411765
78
0.67382
false
lamby/django-cache-toolbox
cache_toolbox/templatetags/cache_toolbox.py
1
2014
from django import template from django.core.cache import cache from django.template import Node, TemplateSyntaxError, Variable register = template.Library() class CacheNode(Node): def __init__(self, nodelist, expire_time, key): self.nodelist = nodelist self.expire_time = Variable(expire_time) ...
bsd-3-clause
-3,891,380,380,396,165,600
26.972222
80
0.642502
false
anant-dev/django
tests/forms_tests/models.py
261
3805
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import itertools import tempfile from django.core.files.storage import FileSystemStorage from django.db import models from django.utils.encoding import python_2_unicode_compatible callable_default_counter = itertools.count() def callab...
bsd-3-clause
3,677,169,001,037,952,500
24.198675
93
0.656767
false
joedeller/pymine
helloworld.py
1
3234
#! /usr/bin/python # Joe Deller 2014 # Our first Minecraft program written in the Python language # Level : Beginner # Uses : Libraries # When learning any programming language there is a tradition of writing # your first program to simply say "Hello World!" # The very first line of this program tells the Raspberr...
mit
-442,942,174,478,550,900
41.012987
95
0.767471
false
devendermishrajio/nova_test_latest
nova/tests/unit/volume/test_cinder.py
43
16898
# Copyright 2013 Mirantis, Inc. # Copyright 2013 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 # # Un...
apache-2.0
-7,361,225,462,233,326,000
42.217391
79
0.586519
false
ktsamis/repose
repose/command/install.py
2
1838
import concurrent.futures from . import Command from itertools import chain import logging from ..utils import blue logger = logging.getLogger("repose.command.install") class Install(Command): command = True def _run(self, repoq, target): repositories = {} for repa in self.repa: ...
gpl-3.0
3,607,189,841,088,285,000
31.821429
88
0.550598
false
Kazade/NeHe-Website
google_appengine/lib/protorpc/protorpc/webapp/service_handlers.py
2
28703
#!/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...
bsd-3-clause
5,336,288,615,576,117,000
33.876063
80
0.682716
false
dvliman/jaikuengine
.google_appengine/lib/django-1.4/tests/regressiontests/localflavor/se/tests.py
33
6441
# -*- coding: utf-8 -*- from django.contrib.localflavor.se.forms import (SECountySelect, SEOrganisationNumberField, SEPersonalIdentityNumberField, SEPostalCodeField) import datetime from django.test import SimpleTestCase class SELocalFlavorTests(SimpleTestCase): def setUp(self): # Mocking dateti...
apache-2.0
-89,901,335,741,456,060
38.262195
81
0.59854
false
scripni/rethinkdb
test/rql_test/connections/http_support/flask/debughelpers.py
777
3508
# -*- coding: utf-8 -*- """ flask.debughelpers ~~~~~~~~~~~~~~~~~~ Various helpers to make the development experience better. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from ._compat import implements_to_string class UnexpectedUnicodeError(AssertionEr...
agpl-3.0
5,927,279,497,085,097,000
39.321839
81
0.602052
false
odicraig/kodi2odi
addons/plugin.program.super.favourites/selector.py
2
2421
# # Copyright (C) 2014-2015 # Sean Poyser (seanpoyser@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 2, or (at your option) # any later versio...
gpl-3.0
759,642,096,171,010,400
22.72449
83
0.585295
false
kumajaya/android_kernel_samsung_universal5422
tools/perf/tests/attr.py
3174
9441
#! /usr/bin/python import os import sys import glob import optparse import tempfile import logging import shutil import ConfigParser class Fail(Exception): def __init__(self, test, msg): self.msg = msg self.test = test def getMsg(self): return '\'%s\' - %s' % (self.test.path, self.msg)...
gpl-2.0
-4,005,801,298,288,467,000
27.436747
79
0.51234
false
jelugbo/hebs_master
common/djangoapps/student/tests/test_create_account.py
15
5962
"Tests for account creation" import ddt import unittest from django.contrib.auth.models import User from django.test.client import RequestFactory from django.conf import settings from django.core.urlresolvers import reverse from django.contrib.auth.models import AnonymousUser from django.utils.importlib import import_...
agpl-3.0
1,326,592,727,946,035,200
41.892086
124
0.668064
false
Iconoclasteinc/tgit
test/test_announcer.py
1
1124
import pytest from flexmock import flexmock from tgit.announcer import Announcer pytestmark = pytest.mark.unit class Listener(object): def event_occurred(self, event): pass @pytest.fixture def announcer(): return Announcer() @pytest.fixture def event(): return "event" def test_announces_to...
gpl-3.0
-6,832,353,462,879,023,000
22.416667
70
0.738434
false
kamyu104/django
tests/auth_tests/test_decorators.py
279
4124
from django.conf import settings from django.contrib.auth import models from django.contrib.auth.decorators import login_required, permission_required from django.core.exceptions import PermissionDenied from django.http import HttpResponse from django.test import TestCase, override_settings from django.test.client impo...
bsd-3-clause
7,135,900,376,741,808,000
33.949153
106
0.645247
false
renyi533/tensorflow
tensorflow/python/data/util/options.py
22
4914
# Copyright 2018 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
-3,389,251,721,259,265,000
33.125
93
0.661579
false
ksmaheshkumar/grr
parsers/ie_history.py
8
5599
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. """Parser for IE index.dat files. Note that this is a very naive and incomplete implementation and should be replaced with a more intelligent one. Do not implement anything based on this code, it is a placeholder for something real. For anyone w...
apache-2.0
-2,989,703,434,446,507,500
31.364162
80
0.636721
false
KNMI/VERCE
verce-hpc-pe/src/networkx/generators/tests/test_degree_seq.py
61
5734
#!/usr/bin/env python from nose.tools import * import networkx from networkx import * from networkx.generators.degree_seq import * from networkx.utils import uniform_sequence,powerlaw_sequence def test_configuration_model_empty(): # empty graph has empty degree sequence deg_seq=[] G=configuration_model(deg...
mit
5,886,845,972,845,971,000
32.928994
66
0.627834
false
lewixliu/git-repo
subcmds/upload.py
4
21890
# -*- coding:utf-8 -*- # # Copyright (C) 2008 The Android Open Source Project # # 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 re...
apache-2.0
2,546,965,587,339,811,300
34.885246
100
0.598904
false
TeradataCenterForHadoop/ambari-presto-service
tests/test_worker.py
2
5422
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
-2,642,991,648,735,018,000
38.007194
101
0.681483
false
adsabs/ADSPipelineMsg
adsmsg/protobuf/status_pb2.py
1
2108
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: status.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection fr...
agpl-3.0
-6,500,477,714,159,251,000
28.277778
206
0.722011
false
edx/edx-ora
peer_grading/migrations/0007_auto__add_unique_calibrationhistory_student_id_location.py
1
5423
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding unique constraint on 'CalibrationHistory', fields ['student_id', 'location'] db.create_unique('peer...
agpl-3.0
7,517,790,753,235,718,000
72.297297
137
0.570533
false
rohitwaghchaure/erpnext_develop
erpnext/healthcare/doctype/physician/test_physician.py
5
1077
# -*- coding: utf-8 -*- # Copyright (c) 2015, ESS LLP and Contributors # See license.txt from __future__ import unicode_literals import unittest import frappe test_dependencies = ['Physician Schedule'] class TestPhysician(unittest.TestCase): def tearDown(self): frappe.delete_doc_if_exists('Physician', '_Testdocto...
gpl-3.0
-6,522,493,021,094,342,000
28.108108
95
0.747447
false
mads-bertelsen/McCode
meta-pkgs/windows/Support/gnuplot-py-1.8/__init__.py
4
6268
#! /usr/bin/env python # $Id: __init__.py 306 2008-05-02 01:09:02Z alford $ # Copyright (C) 1998-2003 Michael Haggerty <mhagger@alum.mit.edu> # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """Gnuplot -- A pipe-based interface to the gnuplot plotting progr...
gpl-2.0
-2,172,466,027,556,622,000
35.022989
71
0.713625
false
joshuahoman/vivisect
vivisect/parsers/blob.py
4
1764
import envi import vivisect import vivisect.parsers as v_parsers from vivisect.const import * def parseFd(vw, fd, filename=None): fd.seek(0) arch = vw.config.viv.parsers.blob.arch bigend = vw.config.viv.parsers.blob.bigend baseaddr = vw.config.viv.parsers.blob.baseaddr try: envi.getArchModu...
apache-2.0
3,921,233,198,066,294,300
29.947368
101
0.670068
false
tjma12/pycbc
pycbc/fft/backend_support.py
1
3120
# Copyright (C) 2012 Josh Willis, Andrew Miller # # 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 d...
gpl-3.0
-1,651,903,887,496,366,000
36.590361
93
0.665705
false
cernops/neutron
neutron/api/api_common.py
17
10729
# Copyright 2011 Citrix System. # 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 b...
apache-2.0
-4,326,613,014,784,045,600
31.810398
79
0.595582
false
davehorton/drachtio-server
deps/boost_1_69_0/tools/build/test/build_file.py
7
5123
#!/usr/bin/python # Copyright (C) 2006. Vladimir Prus # Copyright (C) 2008. Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Tests that we explicitly request a file (not target) to be built by #...
mit
6,968,420,967,926,862,000
29.135294
79
0.496194
false
SmartCash/smartcash
qa/rpc-tests/test_framework/blockstore.py
97
5416
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # BlockStore: a helper class that keeps a map of blocks and implements # helper functions for ...
mit
6,879,593,141,829,968,000
32.02439
77
0.57884
false
nmayorov/scipy
scipy/stats/tests/test_rank.py
4
8291
import numpy as np from numpy.testing import assert_equal, assert_array_equal from scipy.stats import rankdata, tiecorrect import pytest class TestTieCorrect(object): def test_empty(self): """An empty array requires no correction, should return 1.0.""" ranks = np.array([], dtype=np.float64) ...
bsd-3-clause
5,119,763,102,343,465,000
33.40249
77
0.503317
false
enStratus/unix-agent
src/dcm/agent/messaging/reply.py
3
40292
# # Copyright (C) 2014 Dell, 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 wri...
apache-2.0
-9,064,698,894,957,441,000
42.891068
112
0.538519
false
enikesha/ga-bitbot
libs/call_metrics.py
18
2700
""" call_metrics v0.01 a class function decorator which collects metrics (number of calls and total execution time) Copyright 2012 Brian Monkaba This file is part of ga-bitbot. ga-bitbot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publishe...
gpl-3.0
8,546,333,074,817,464,000
26.835052
92
0.61037
false
nyddle/toster
core/views.py
1
3655
from django.shortcuts import render, redirect, HttpResponse, get_object_or_404 from django.http import Http404 from django.http import HttpResponseNotFound from django.views.generic import View from django.views.generic import ListView from django.views.generic.edit import FormView, ProcessFormView, CreateView from ...
mit
-893,408,532,948,083,800
25.875
89
0.691382
false
BIDS-collaborative/cega-trace
webscrap/crossref JSON/doi/doi_to_JSON.py
2
1389
import re import urllib import urllib.request import json import sys import codecs def search_doi(s): url = "http://api.crossref.org/works/" + s with urllib.request.urlopen(url) as htmlfile: htmltext = htmlfile.read().decode('utf-8') curdata = json.loads(htmltext) print(htmltext) return cur...
bsd-2-clause
-6,835,219,122,280,337,000
29.195652
86
0.541397
false
bbuckingham/katello
scripts/reindent.py
69
10490
#! /usr/bin/env python # Released to the public domain, by Tim Peters, 03 October 2000. """reindent [-d][-r][-v] [ path ... ] -d (--dryrun) Dry run. Analyze, but don't make any changes to, files. -r (--recurse) Recurse. Search for all .py files in subdirectories too. -n (--nobackup) No backup. Does not make a...
gpl-2.0
2,023,852,739,583,287,800
33.506579
77
0.525071
false
nicholasserra/sentry
src/sentry/services/smtp.py
36
3120
""" sentry.services.smtp ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import asyncore import email import logging from smtpd import SMTPServer, SMTPChannel from ...
bsd-3-clause
5,984,335,884,088,202,000
30.515152
83
0.626282
false
seem-sky/kbengine
kbe/res/scripts/common/Lib/lib2to3/pgen2/tokenize.py
80
19321
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. # All rights reserved. """Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line o...
lgpl-3.0
2,248,472,229,958,328,800
37.488048
87
0.522696
false
luoyetx/mxnet
example/ssd/data/demo/download_demo_images.py
24
1663
#!/usr/bin/env python3 # -*- 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 Licen...
apache-2.0
556,270,573,290,808,640
42.763158
82
0.721587
false
CARocha/addac_fadcanic
encuesta/migrations/0005_auto__add_cultivosanuales__add_productoanimal__add_productoprocesado__.py
2
26202
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CultivosAnuales' db.create_table(u'encuesta_cultivosanual...
gpl-3.0
4,813,808,884,950,550,000
68.320106
184
0.576292
false
bopo/django-userena
userena/utils.py
4
6483
from django.conf import settings from django.utils.encoding import smart_bytes from django.utils.functional import allow_lazy from django.utils.http import urlencode from django.utils.six import text_type from django.utils.text import Truncator from userena import settings as userena_settings from userena.compat impor...
bsd-3-clause
1,513,311,831,981,949,700
32.076531
90
0.658954
false
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/django/contrib/sessions/middleware.py
129
3423
import time from importlib import import_module from django.conf import settings from django.contrib.sessions.backends.base import UpdateError from django.core.exceptions import SuspiciousOperation from django.utils.cache import patch_vary_headers from django.utils.deprecation import MiddlewareMixin from django.utils....
mit
714,480,233,634,399,700
45.890411
83
0.557698
false
douglaskastle/mutagen
tests/test_trueaudio.py
1
1544
# -*- coding: utf-8 -*- import os import shutil from mutagen.trueaudio import TrueAudio, delete from mutagen.id3 import TIT1 from tests import TestCase, DATA_DIR from tempfile import mkstemp class TTrueAudio(TestCase): def setUp(self): self.audio = TrueAudio(os.path.join(DATA_DIR, "empty.tta")) def...
gpl-2.0
-1,446,213,023,081,084,700
27.592593
67
0.624352
false
astropy/astropy
astropy/units/misc.py
8
3393
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines miscellaneous units. They are also available in the `astropy.units` namespace. """ from . import si from astropy.constants import si as _si from .core import (UnitBase, def_unit, si_prefixes, binary_prefi...
bsd-3-clause
1,712,555,838,471,403,500
32.89
79
0.518442
false
mdaniel/intellij-community
python/helpers/third_party/thriftpy/_shaded_ply/yacc.py
99
135805
# ----------------------------------------------------------------------------- # ply: yacc.py # # Copyright (C) 2001-2015, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
apache-2.0
-3,906,361,159,611,087,000
38.125612
119
0.467509
false
eonum/medword
model_validation.py
1
11972
import numpy as np import preprocess as pp import os from random import randint from sklearn.decomposition import PCA import matplotlib.pyplot as plt import csv def validate_model(embedding, emb_model_dir, emb_model_fn): print("Start validation. Loading model. \n") # load config config = embedding.confi...
mit
407,590,782,591,609,300
33.501441
193
0.634648
false
bimbam23/tools-iuc
datatypes/snpsift_dbnsfp_datatypes/snpsift_dbnsfp.py
9
3924
""" SnpSift dbNSFP datatypes """ import gzip import logging import os import os.path import sys import traceback from galaxy.datatypes.data import Text from galaxy.datatypes.metadata import MetadataElement log = logging.getLogger(__name__) class SnpSiftDbNSFP( Text ): """Class describing a dbNSFP database prepa...
mit
6,438,121,658,966,277,000
40.744681
153
0.590214
false
shail2810/nova
nova/tests/functional/api_sample_tests/test_quota_sets.py
2
4070
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM 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...
apache-2.0
8,666,084,188,728,911,000
43.23913
78
0.597789
false
mihaic/brainiak
brainiak/utils/utils.py
1
36227
# Copyright 2016 Intel Corporation, Princeton University # # 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
5,286,036,411,698,096,000
35.445674
79
0.60143
false
beiko-lab/gengis
bin/Lib/site-packages/scipy/interpolate/__init__.py
1
3385
""" ======================================== Interpolation (:mod:`scipy.interpolate`) ======================================== .. currentmodule:: scipy.interpolate Sub-package for objects used in interpolation. As listed below, this sub-package contains spline functions and classes, one-dimensional and mul...
gpl-3.0
5,469,905,734,267,368,000
17.795322
72
0.672083
false
pyfisch/servo
tests/wpt/web-platform-tests/tools/third_party/py/py/_io/saferepr.py
273
2483
import py import sys builtin_repr = repr reprlib = py.builtin._tryimport('repr', 'reprlib') class SafeRepr(reprlib.Repr): """ subclass of repr.Repr that limits the resulting size of repr() and includes information on exceptions raised during the call. """ def repr(self, x): return self._c...
mpl-2.0
-220,596,362,994,338,340
33.971831
76
0.531615
false
azoft-dev-team/imagrium
env/Lib/test/test_format.py
12
10507
from test.test_support import verbose, have_unicode, TestFailed, is_jython 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...
mit
1,345,069,855,313,016,800
40.529644
149
0.685733
false
vlinhd11/vlinhd11-android-scripting
python/src/Tools/modulator/ScrolledListbox.py
37
1477
# A ScrolledList widget feels like a list widget but also has a # vertical scroll bar on its right. (Later, options may be added to # add a horizontal bar as well, to make the bars disappear # automatically when not needed, to move them to the other side of the # window, etc.) # # Configuration options are passed to t...
apache-2.0
-4,334,048,460,384,505,300
38.918919
70
0.595125
false
mhum/ynab-enhanced
src/common/res/features/l10n/init.py
1
3511
#!/usr/bin/env python """Prepare and download l10ns.""" import urllib, urllib2 import shutil import os import zipfile import json import sys import math if len(sys.argv) != 2: print '' print 'ERROR:' print '' print 'Please supply a crowd in API key, obtained on this page:' print 'http://translate.t...
mit
-3,303,568,522,253,198,000
34.11
100
0.578183
false
sssstest/GameEditor
GameTrigger.py
1
1438
#!/usr/bin/env python #@section License # #Copyright (C) 2013 ssss #This file is a part of the GameEditor. # #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 #(a...
gpl-3.0
5,770,379,173,756,206,000
30.955556
99
0.751739
false
lmorchard/django-allauth
allauth/socialaccount/south_migrations/0011_auto__chg_field_socialtoken_token.py
77
6468
# -*- 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): # Changing field 'SocialToken.token' db.alter_column('socialaccount_socialtoken', 'token', self.gf('django....
mit
8,510,599,914,403,886,000
67.819149
182
0.55334
false
partofthething/home-assistant
tests/components/ruckus_unleashed/test_init.py
3
3616
"""Test the Ruckus Unleashed config flow.""" from unittest.mock import patch from pyruckus.exceptions import AuthenticationError from homeassistant.components.ruckus_unleashed import ( API_AP, API_DEVICE_NAME, API_ID, API_MAC, API_MODEL, API_SYSTEM_OVERVIEW, API_VERSION, DOMAIN, MA...
mit
3,719,311,980,649,539,000
30.443478
108
0.694414
false
wzbozon/statsmodels
statsmodels/tools/print_version.py
23
7951
#!/usr/bin/env python from __future__ import print_function from statsmodels.compat.python import reduce import sys from os.path import dirname def safe_version(module, attr='__version__'): if not isinstance(attr, list): attr = [attr] try: return reduce(getattr, [module] + attr) except Att...
bsd-3-clause
-70,192,191,835,726,800
28.66791
78
0.521695
false
cjhak/b2share
invenio/modules/uploader/uploader_tasks.py
13
13474
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 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...
gpl-2.0
-1,170,732,406,976,718,300
37.062147
79
0.562936
false
PongPi/isl-odoo
openerp/addons/base/__openerp__.py
336
3703
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
-8,989,697,298,476,351,000
35.663366
79
0.569808
false
mafiya69/sympy
sympy/vector/tests/test_dyadic.py
94
4076
from sympy import sin, cos, symbols, pi, ImmutableMatrix as Matrix, \ simplify from sympy.vector import (CoordSysCartesian, Vector, Dyadic, DyadicAdd, DyadicMul, DyadicZero, BaseDyadic, express) A = CoordSysCartesian('A') def test_dyadic(): a, b = symbols...
bsd-3-clause
-360,962,418,185,004,100
36.054545
80
0.467615
false
mkheirkhah/mptcp
src/config-store/bindings/modulegen__gcc_ILP32.py
36
68421
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
-7,992,585,036,314,678,000
66.945382
383
0.641747
false
cisc474/board_game_app
api/fetch_desc_bs4.py
2
3669
#importing the libraries I want, an sqlite interface, a url requester, and an XML parsing library import sqlite3, urllib2, bs4 as BeautifulSoup #sudo apt-get install python-bs4 #That's how I was able to install the latest beautiful soup #this bit I have to google search everytime. con = sqlite3.connect('bgg.sqlite') ...
mit
-3,468,314,654,871,151,600
42.678571
204
0.724721
false
dfm/arxiv2speech
arxiv2speech.py
1
3104
#!/usr/bin/env python from __future__ import print_function, absolute_import, unicode_literals __all__ = ["run"] __version__ = "0.0.4" __author__ = "Dan Foreman-Mackey (danfm@nyu.edu)" __copyright__ = "Copyright 2013 Daniel Foreman-Mackey" __contributors__ = [] import os import re import json import shutil import s...
bsd-2-clause
1,793,591,172,441,115,100
27.218182
79
0.58183
false
valentin-krasontovitsch/ansible
test/units/parsing/test_metadata.py
125
10000
# coding: utf-8 # (c) 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 License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
gpl-3.0
-5,016,550,505,235,944,000
40.841004
152
0.6579
false
bitkeeper/python-opcua
opcua/server/binary_server_asyncio.py
1
4546
""" Socket server forwarding request to internal server """ import logging try: # we prefer to use bundles asyncio version, otherwise fallback to trollius import asyncio except ImportError: import trollius as asyncio from opcua import ua from opcua.server.uaprocessor import UaProcessor logger = logging.g...
lgpl-3.0
-1,068,711,869,721,022,200
38.877193
111
0.544655
false
Duoxilian/home-assistant
homeassistant/const.py
3
12028
# coding: utf-8 """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 39 PATCH_VERSION = '0.dev0' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 4, 2) REQUIRED_PYTHON_VER_WIN = (3, 5...
mit
8,477,853,142,511,983,000
28.47549
79
0.708216
false
lgscofield/odoo
addons/survey/wizard/__init__.py
385
1026
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
7,533,629,147,491,453,000
45.636364
78
0.611111
false
marcel-dancak/QGIS
tests/src/python/test_qgsrasterbandcombobox.py
23
3809
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsRasterBandComboBox. .. 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 option) any later version....
gpl-2.0
-3,210,299,619,995,867,600
31.279661
78
0.640326
false
MartyParty21/AwakenDreamsClient
mcp/runtime/startserver.py
3
1524
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Apr 8 16:54:36 2011 @author: ProfMobius @version: v1.0 """ import sys import logging import json from optparse import OptionParser from commands import Commands, SERVER def main(): parser = OptionParser(version='MCP %s' % Commands.fullversion()...
gpl-3.0
3,415,083,498,612,544,500
29.48
131
0.649606
false
jinnykoo/wuyisj
tests/unit/core/customisation_tests.py
5
3068
import os import tempfile from django.test import TestCase from django.conf import settings from oscar.core import customisation VALID_FOLDER_PATH = 'tests/_site/apps' class TestUtilities(TestCase): def test_subfolder_extraction(self): folders = list(customisation.subfolders('/var/www/eggs')) ...
bsd-3-clause
772,085,229,619,327,900
39.368421
79
0.64309
false
nex3/pygments
pygments/styles/vim.py
75
1976
# -*- coding: utf-8 -*- """ pygments.styles.vim ~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by vim. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keywor...
bsd-2-clause
-260,744,558,528,395,100
30.365079
70
0.448887
false
babelphish/fridge-cop
fridge_language.py
1
1219
import random def get_fridge_language(language): if (language == "EN"): return EnglishFridgeLanguage() class FridgeLanguage: def _init_(self): random.seed() def get_random_letter(self): value = random.random() * 100 total = 0 for letter_frequency i...
agpl-3.0
2,068,443,251,326,739,200
22.901961
50
0.376538
false
yaojingwu1992/XlsxWriter
xlsxwriter/test/comparison/test_cond_format07.py
8
2470
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
4,847,854,250,150,649,000
32.835616
88
0.444534
false
duointeractive/media-nommer
media_nommer/ec2nommerd/node_state.py
1
7367
""" Contains the :py:class:`NodeStateManager` class, which is an abstraction layer for storing and communicating the status of EC2_ nodes. """ import urllib2 import datetime import boto from twisted.internet import reactor from media_nommer.conf import settings from media_nommer.utils import logger from media_nommer.ut...
bsd-3-clause
859,487,332,232,769,000
37.773684
88
0.606217
false
javierTerry/odoo
addons/point_of_sale/__openerp__.py
261
3612
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
8,499,701,014,386,350,000
35.12
106
0.616002
false
ssh1/stbgui
lib/python/Components/Converter/PliExtraInfo.py
4
12709
# shamelessly copied from pliExpertInfo (Vali, Mirakels, Littlesat) from enigma import iServiceInformation, iPlayableService from Components.Converter.Converter import Converter from Components.Element import cached from Components.config import config from Tools.Transponder import ConvertToHumanReadable, getChannelNu...
gpl-2.0
-7,293,005,866,189,446,000
31.755155
178
0.680305
false
pschmitt/home-assistant
homeassistant/components/supla/cover.py
6
2904
"""Support for Supla cover - curtains, rollershutters, entry gate etc.""" import logging from pprint import pformat from homeassistant.components.cover import ( ATTR_POSITION, DEVICE_CLASS_GARAGE, CoverEntity, ) from homeassistant.components.supla import SuplaChannel _LOGGER = logging.getLogger(__name__) ...
apache-2.0
-6,450,520,718,000,023,000
27.470588
77
0.61157
false
h2oai/h2o
py/testdir_single_jvm/test_KMeans_twit_fvec.py
9
2516
import unittest, time, sys sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_kmeans, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): h2o.init(1, java_heap_GB=14) @...
apache-2.0
2,227,448,377,894,596,000
37.707692
122
0.575914
false
bestwpw/mysql-5.6
xtrabackup/test/python/subunit/tests/test_subunit_filter.py
50
8259
# # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2005 Robert Collins <robertc@robertcollins.net> # # Licensed under either the Apache License, Version 2.0 or the BSD 3-clause # license at the users choice. A copy of both licenses are available in the # project sour...
gpl-2.0
3,714,596,544,201,391,600
38.706731
80
0.652379
false
ayoubg/gem5-graphics
Mesa-7.11.2_GPGPU-Sim/src/gallium/drivers/i965/brw_structs_dump.py
34
8917
#!/usr/bin/env python ''' Generates dumpers for the i965 state strucutures using pygccxml. Run as PYTHONPATH=/path/to/pygccxml-1.0.0 python brw_structs_dump.py Jose Fonseca <jfonseca@vmware.com> ''' copyright = ''' /************************************************************************** * * Copyright 2009 V...
bsd-3-clause
-7,219,475,154,285,351,000
29.642612
125
0.60222
false
Beauhurst/django
tests/auth_tests/test_basic.py
31
5389
from django.contrib.auth import get_user, get_user_model from django.contrib.auth.models import AnonymousUser, User from django.core.exceptions import ImproperlyConfigured from django.db import IntegrityError from django.http import HttpRequest from django.test import TestCase, override_settings from django.utils impor...
bsd-3-clause
-1,623,448,651,716,338,700
39.126866
89
0.666543
false
unho/pootle
pootle/apps/pootle_store/migrations/0025_unit_on_delete_user.py
7
1163
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-02 14:03 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import pootle.core.user class Migration(migrations.Migration): dependencies = [ ('pootle_store', '0024_set_store_bas...
gpl-3.0
-3,931,261,806,396,813,000
34.242424
158
0.637145
false
ajaybhat/scikit-image
skimage/measure/tests/test_fit.py
6
10401
import numpy as np from numpy.testing import assert_equal, assert_raises, assert_almost_equal from skimage.measure import LineModelND, CircleModel, EllipseModel, ransac from skimage.transform import AffineTransform from skimage.measure.fit import _dynamic_max_trials from skimage._shared._warnings import expected_warnin...
bsd-3-clause
-8,422,721,417,998,824,000
33.213816
77
0.630997
false
GotlingSystem/apnea
src/apps/dive_log/models.py
1
2496
# coding=utf-8 from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext as _ from discipline.models import Discipline class Session(models.Model): #pool = models.ForeignKey(Pool) user = models.ForeignKey(User) date = models.DateField(verbose_na...
mit
8,125,022,391,499,963,000
39.934426
123
0.663061
false
ThiagoGarciaAlves/intellij-community
python/lib/Lib/site-packages/django/conf/locale/ka/formats.py
329
1888
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'l, j F, Y' TIME_FORMAT = 'h:i:s a' DATETIME_FORMAT = 'j F, Y h:i:s a' YEA...
apache-2.0
2,978,498,176,289,796,600
39.170213
93
0.474047
false
openstack/heat
heat/tests/engine/test_engine_worker.py
1
12872
# Copyright (c) 2014 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.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-4,283,856,035,645,248,000
45.807273
78
0.565336
false
cvra/can-bootloader
client/tests/test_config_read_tool.py
1
2204
import unittest try: from unittest.mock import * except ImportError: from mock import * from msgpack import * from cvra_bootloader.read_config import main from cvra_bootloader.commands import * import sys import json class ReadConfigToolTestCase(unittest.TestCase): @patch('cvra_bootloader.utils.write_c...
bsd-2-clause
8,157,435,816,643,125,000
31.895522
78
0.578947
false
pang-w/pyspider
pyspider/webui/app.py
4
3259
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-22 23:17:13 import os import sys import logging logger = logging.getLogger("webui") from six import reraise from six.moves import builtins from si...
apache-2.0
7,733,720,780,302,100,000
29.745283
88
0.594354
false
diagramsoftware/odoomrp-utils
purchase_pricelist_partnerinfo/__openerp__.py
12
1572
# -*- encoding: utf-8 -*- ############################################################################## # # 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...
agpl-3.0
-4,453,190,833,650,290,700
36.428571
78
0.57888
false