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
nwjs/chromium.src
content/test/gpu/gpu_tests/gpu_integration_test_unittest.py
2
16019
# 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. import json import os import shutil import tempfile import unittest import mock import sys import run_gpu_integration_test import gpu_project_config from gp...
bsd-3-clause
1,460,405,917,800,884,500
39.350126
79
0.678694
false
gino3a/tm-boilerplate
tailbone/turn/__init__.py
34
3644
# Copyright 2013 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
-2,226,313,581,117,824,500
32.740741
124
0.705269
false
markoshorro/gem5
src/arch/x86/isa/insts/simd64/integer/exit_media_state.py
72
2182
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
bsd-3-clause
-8,181,221,059,882,605,000
48.590909
72
0.790559
false
srvg/ansible
lib/ansible/utils/unicode.py
158
1166
# (c) 2012-2014, Toshio Kuratomi <a.badger@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
5,315,954,398,911,828,000
34.333333
75
0.730703
false
rickerc/ceilometer_audit
tests/storage/test_get_engine.py
3
1507
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Author: Doug Hellmann <doug.hellmann@dreamhost.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
apache-2.0
298,780,702,891,013,570
33.227273
75
0.702523
false
tehguy/dndtools
dndtools/dnd/spells/urls.py
3
2039
# -*- coding: utf-8 -*- from django.conf.urls import patterns, url urlpatterns = patterns( 'dnd.spells.views', # spells url( r'^$', 'spell_index', name='spell_index', ), # spells > rulebook url( r'^(?P<rulebook_slug>[^/]+)--(?P<rulebook_id>\d+)/$', 'sp...
mit
-7,851,849,655,267,112,000
23.865854
102
0.501226
false
thecaffiend/jupyternb_to_c_over_websockets
server_side/driverclient/client.py
1
3402
""" Adapted from: https://docs.python.org/3.4/howto/sockets.html TODO: Get this based on tornado TCPClient class instead of this half baked thing TODO: Do co-routines *or* callbacks. This goes for the whole thing, not just this class. """ import socket from tornado import ( gen, ) class DriverClient:...
mit
-4,579,463,662,026,024,400
27.830508
79
0.554968
false
Endi1/Penguin
penguin/tests/tests.py
1
1539
import unittest import os import shutil from penguin.main import newSite, buildSite, publishPosts from penguin.penguin import Penguin class TestContentCreation(unittest.TestCase): def test_build_project(self): newSite('test_site') os.chdir('test_site') site = Penguin() buildSite(s...
mit
-5,073,080,997,238,541,000
29.176471
72
0.604938
false
mrbean-bremen/pyfakefs
pyfakefs/extra_packages.py
1
1253
# 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 # distributed under t...
apache-2.0
7,204,931,398,368,746,000
27.477273
74
0.71269
false
girving/tensorflow
tensorflow/python/keras/optimizer_v2/optimizer_v2.py
1
55544
# 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
-3,316,315,807,232,272,400
39.103971
101
0.677337
false
prasadtalasila/INET-Vagrant-Demos
Nonce_Demo/impacket-0.9.12/impacket/testcases/dot11/test_FrameManagementAssociationResponse.py
6
7476
#!/usr/bin/env python # sorry, this is very ugly, but I'm in python 2.5 import sys sys.path.insert(0,"../..") from dot11 import Dot11, Dot11Types, Dot11ManagementFrame, Dot11ManagementAssociationResponse from ImpactDecoder import RadioTapDecoder from binascii import hexlify import unittest class TestDot11ManagementA...
gpl-2.0
-2,053,607,938,761,711,900
47.545455
313
0.686731
false
bcl/anaconda
tests/glade/check_markup.py
5
5424
#!/usr/bin/python3 # # Copyright (C) 2014 Red Hat, Inc. # # This program 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 Foundation; either version 2.1 of the License, or # (at your option) any later version. # # ...
gpl-2.0
-5,156,641,110,452,370,000
38.304348
120
0.603429
false
J861449197/edx-platform
common/djangoapps/embargo/tests/test_views.py
136
3286
"""Tests for embargo app views. """ import unittest from mock import patch from django.test import TestCase from django.core.urlresolvers import reverse from django.conf import settings from mako.exceptions import TopLevelLookupException import ddt from util.testing import UrlResetMixin from embargo import messages ...
agpl-3.0
8,906,891,392,949,215,000
37.209302
101
0.672246
false
Titan-C/sympy
sympy/concrete/products.py
4
15193
from __future__ import print_function, division from sympy.tensor.indexed import Idx from sympy.core.mul import Mul from sympy.core.singleton import S from sympy.core.symbol import symbols from sympy.concrete.expr_with_intlimits import ExprWithIntLimits from sympy.functions.elementary.exponential import exp, log from ...
bsd-3-clause
-3,797,335,564,918,823,400
28.558366
104
0.519713
false
sentinelleader/limbo
limbo/plugins/emojicodedict.py
14
46328
# # This file is based on emoji (https://github.com/kyokomi/emoji). # # The MIT License (MIT) # # Copyright (c) 2014 kyokomi # # 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 restrict...
mit
-7,657,151,947,005,909,000
50.5902
80
0.372172
false
juneJuly/backfuzz
plugins/imap/imap.py
3
1323
from functions import * """IMAP Fuzzer""" PROPERTY={} PROPERTY['PROTOCOL']="IMAP" PROPERTY['NAME']=": IMAP Fuzzer" PROPERTY['DESC']="Fuzz an IMAP server" PROPERTY['AUTHOR']='localh0t' user_stage = ['. login'] pass_stage = ['. login anonymous@test.com'] stage_1 = ['. list ""','. lsub ""', '. status INBOX','. examine','...
gpl-3.0
-8,654,868,588,709,718,000
32.948718
218
0.666667
false
tempbottle/kbengine
kbe/src/lib/python/Lib/idlelib/Percolator.py
82
3244
from idlelib.WidgetRedirector import WidgetRedirector from idlelib.Delegator import Delegator class Percolator: def __init__(self, text): # XXX would be nice to inherit from Delegator self.text = text self.redir = WidgetRedirector(text) self.top = self.bottom = Delegator(text) ...
lgpl-3.0
8,063,651,408,356,150,000
30.192308
78
0.577682
false
jbobotek/elcano
Vision/OpticalMouse/ADNS3080ImageGrabber.py
4
6354
import serial import string import math import time from Tkinter import * from threading import Timer comPort = '/dev/ttyACM0' #default com port comPortBaud = 38400 class App: grid_size = 15 num_pixels = 30 image_started = FALSE image_current_row = 0; ser = serial.Serial(comPort,...
mit
4,718,260,182,726,765,000
33.104972
155
0.489613
false
remyroy/uwsgi
contrib/runuwsgi.py
17
2577
import django from django.core.management.base import BaseCommand from django.conf import settings import os import sys class Command(BaseCommand): help = "Runs this project as a uWSGI application. Requires the uwsgi binary in system path." http_port = '8000' socket_addr = None def handle(self, *arg...
gpl-2.0
-9,208,600,569,160,983,000
37.462687
143
0.597982
false
SimonSapin/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/testing/test_compat.py
30
2615
from __future__ import absolute_import, division, print_function import sys import pytest from _pytest.compat import is_generator, get_real_func, safe_getattr from _pytest.outcomes import OutcomeException def test_is_generator(): def zap(): yield def foo(): pass assert is_generator(zap...
mpl-2.0
3,648,248,295,932,064,300
22.772727
77
0.604207
false
dvliman/jaikuengine
.google_appengine/lib/django-1.2/django/contrib/gis/sitemaps/views.py
45
4353
from django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import get_current_site from django.core import urlresolvers from django.core.paginator import EmptyPage, PageNotAnInteger from django.contrib.gis.db.models.fields import GeometryField from django.db import...
apache-2.0
-3,984,534,456,684,396,500
38.216216
116
0.648289
false
hrashk/sympy
sympy/assumptions/refine.py
7
6862
from __future__ import print_function, division from sympy.core import S, Add, Expr from sympy.assumptions import Q, ask from sympy.core.logic import fuzzy_not def refine(expr, assumptions=True): """ Simplify an expression using assumptions. Gives the form of expr that would be obtained if symbols i...
bsd-3-clause
5,804,006,793,148,654,000
30.768519
78
0.518071
false
bwrsandman/GitPython
git/test/test_commit.py
12
12863
# -*- coding: utf-8 -*- # test_commit.py # Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php from __future__ import print_function from git.test.lib import ( Tes...
bsd-3-clause
-8,771,092,237,728,249,000
36.24058
110
0.648272
false
shacker/django
tests/template_tests/filter_tests/test_striptags.py
197
1632
from django.template.defaultfilters import striptags from django.test import SimpleTestCase from django.utils.functional import lazystr from django.utils.safestring import mark_safe from ..utils import setup class StriptagsTests(SimpleTestCase): @setup({'striptags01': '{{ a|striptags }} {{ b|striptags }}'}) ...
bsd-3-clause
-5,463,942,984,996,876,000
32.306122
112
0.554534
false
xq262144/hue
desktop/core/ext-py/pysaml2-2.4.0/example/idp2_repoze/modules/login.mako.py
31
2690
# -*- encoding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 6 _modified_time = 1367126126.936375 _template_filename='htdocs/login.mako' _template_uri='login.mako' _template_cache=cache.Cache(__name__, _modified_time)...
apache-2.0
-73,144,192,529,359,500
43.098361
213
0.60223
false
chirilo/mozillians
vendor-local/lib/python/tablib/packages/odf/elementtypes.py
83
10218
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008 Søren Roug, European Environment Agency # # 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 Foundation; either # version 2.1 of the Licens...
bsd-3-clause
-8,691,467,549,983,235,000
30.436923
80
0.632084
false
huichen-cs/learnsorting
quick_sort_unittest.py
1
1092
import unittest from quick_sort_concept import quick_sort class QuickSortTest(unittest.TestCase): def test_quick_sort_random_1(self): data = [4, 1, 10, 4, 4, 3, 9, 4, 1, 9] expected = [1, 1, 3, 4, 4, 4, 4, 9, 9, 10] output = quick_sort(data) self.assertEqual(expected, ...
gpl-3.0
-1,180,622,017,240,610,800
31.151515
51
0.504579
false
OpenTrons/opentrons_sdk
api/src/opentrons/system/wifi.py
3
6702
import hashlib import logging import os import shutil from typing import Generator, Optional, Dict, Any from dataclasses import dataclass from opentrons.config import CONFIG from opentrons.system import nmcli log = logging.getLogger(__name__) class ConfigureArgsError(Exception): pass EAP_CONFIG_SHAPE = { ...
apache-2.0
2,438,871,421,344,143,400
32.5
79
0.588507
false
fitermay/intellij-community
python/lib/Lib/site-packages/django/contrib/syndication/views.py
87
8404
import datetime from django.conf import settings from django.contrib.sites.models import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.template import loader, Template, TemplateDoesNotExist, RequestContext from djan...
apache-2.0
-7,074,891,198,409,065,000
37.728111
167
0.57901
false
alienity/three.js
utils/exporters/blender/addons/io_three/exporter/api/mesh.py
124
23228
""" Blender API for querying mesh data. Animation data is also handled here since Three.js associates the animation (skeletal, morph targets) with the geometry nodes. """ import operator from bpy import data, types, context from . import material, texture, animation from . import object as object_ from .. import const...
mit
5,771,859,406,008,319,000
24.275299
73
0.568107
false
andersonvom/python_koans
python3/koans/about_classes.py
22
4779
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutClasses(Koan): class Dog: "Dogs need regular walkies. Never, ever let them drive." def test_instances_of_classes_can_be_created_adding_parentheses(self): # NOTE: The .__name__ attribute will convert the class ...
mit
-7,448,872,620,996,882,000
27.446429
79
0.521657
false
inspirehep/invenio
modules/bibcheck/lib/plugins/doi.py
6
2215
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013 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) a...
gpl-2.0
-324,546,823,726,813,630
40.018519
122
0.658691
false
otmaneJai/Zipline
zipline/utils/memoize.py
7
2540
""" Tools for memoization of function results. """ from functools import wraps from six import iteritems from weakref import WeakKeyDictionary class lazyval(object): """ Decorator that marks that an attribute should not be computed until needed, and that the value should be memoized. Example ----...
apache-2.0
7,487,738,887,531,389,000
24.148515
79
0.554724
false
amousset/ansible
lib/ansible/template/safe_eval.py
47
4154
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
824,560,155,578,565,800
31.968254
98
0.62181
false
comptech/atrex
Software/gaussfitter.py
1
23761
""" =========== gaussfitter =========== .. codeauthor:: Adam Ginsburg <adam.g.ginsburg@gmail.com> 3/17/08 Latest version available at <http://code.google.com/p/agpy/source/browse/trunk/agpy/gaussfitter.py> """ import numpy from numpy.ma import median from numpy import pi #from scipy import optimize,stats,pi from scip...
lgpl-3.0
-7,847,861,698,600,784,000
41.96745
174
0.608434
false
Mazecreator/tensorflow
tensorflow/contrib/timeseries/examples/predict.py
69
5579
# 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
4,242,549,670,582,883,300
41.265152
80
0.715003
false
krsjoseph/youtube-dl
youtube_dl/extractor/tinypic.py
126
1893
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ExtractorError class TinyPicIE(InfoExtractor): IE_NAME = 'tinypic' IE_DESC = 'tinypic.com videos' _VALID_URL = r'http://(?:.+?\.)?tinypic\.com/player\.php\?v=(?P<id>[^&]+)&s=\d+' _TESTS = [ ...
unlicense
-4,758,051,863,561,678,000
32.803571
104
0.536714
false
qilicun/python
python2/diveintopythonzh-cn-5.4b/soundex/stage1/soundex1d.py
4
2390
"""Soundex algorithm This program is part of "Dive Into Python", a free Python book for experienced programmers. Visit http://diveintopython.org/ for the latest version. """ __author__ = "Mark Pilgrim (mark@diveintopython.org)" __version__ = "$Revision: 1.2 $" __date__ = "$Date: 2004/05/06 21:36:36 $" __copyright__ ...
gpl-3.0
-3,036,519,781,077,432,300
26.471264
66
0.442259
false
kizyle502/collegiatemasters
collegiatemasters/players/models.py
1
1433
from django.db import models from django.core.urlresolvers import reverse from autoslug import AutoSlugField from model_utils.models import TimeStampedModel from django_countries.fields import CountryField class Player(TimeStampedModel): GROUP_UNSPECIFIED = "unspecified" GROUP_FIRST = "first" GROUP_SECOND...
bsd-3-clause
79,830,393,452,765,250
30.844444
98
0.641312
false
Kupoman/thor
src/appdirs.py
1
22475
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2005-2010 ActiveState Software Inc. # Copyright (c) 2013 Eddy Petrișor """Utilities for determining application-specific dirs. See <http://github.com/ActiveState/appdirs> for details and usage. """ # Dev Notes: # - MSDN on where to store app data files: # ...
apache-2.0
-727,148,747,689,605,200
39.348294
122
0.617158
false
Weuxel/cjdns
node_build/dependencies/libuv/build/gyp/test/mac/gyptest-depend-on-bundle.py
303
1186
#!/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. """ Verifies that a dependency on a bundle causes the whole bundle to be built. """ import TestGyp import sys if sys.platform == 'darwin'...
gpl-3.0
7,009,291,564,742,722,000
28.65
77
0.690556
false
jeremiahmarks/sl4a
python/src/Lib/multiprocessing/util.py
59
7839
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt # import itertools import weakref import atexit import threading # we want threading to install it's # cleanup function before mult...
apache-2.0
-8,884,693,694,074,977,000
25.938144
79
0.600587
false
uclaros/QGIS
tests/src/python/test_qgsmapcanvas.py
25
23167
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsMapCanvas .. 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. """ __aut...
gpl-2.0
-773,378,925,655,950,000
39.64386
106
0.633401
false
liqueur/tornado
tornado/test/process_test.py
123
10569
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement import logging import os import signal import subprocess import sys from tornado.httpclient import HTTPClient, HTTPError from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tornado.log i...
apache-2.0
8,805,905,003,651,502,000
42.493827
94
0.564576
false
spbguru/repo1
tests/integration/py2/nupic/engine/network_testnode_interchangeability.py
17
6158
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
-3,814,220,149,359,266,000
31.930481
80
0.594024
false
SergiosKar/Deep-Learning-models
Double_Deep_Q_Netowrk.py
1
4525
import random import gym import numpy as np from collections import deque from tensorflow.contrib.keras.python.keras.models import Sequential from tensorflow.contrib.keras.python.keras.layers import Dense from tensorflow.contrib.keras.python.keras.optimizers import Adam from tensorflow.contrib.keras.python.keras...
mit
4,801,212,506,258,369,000
29.22069
81
0.574144
false
MarcosCommunity/odoo
addons/note/tests/__init__.py
260
1076
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
9,045,515,598,551,703,000
45.782609
78
0.61803
false
mattesno1/CouchPotatoServer
libs/caper/helpers.py
81
2210
# Copyright 2013 Dean Gardiner <gardiner91@gmail.com> # # 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...
gpl-3.0
-7,800,063,707,168,705,000
26.625
81
0.624887
false
nmayorov/scipy
scipy/optimize/_linprog.py
3
23457
""" A top-level linear programming interface. Currently this interface solves linear programming problems via the Simplex and Interior-Point methods. .. versionadded:: 0.15.0 Functions --------- .. autosummary:: :toctree: generated/ linprog linprog_verbose_callback linprog_terse_callback """ import ...
bsd-3-clause
4,203,824,383,983,364,600
39.65338
143
0.624504
false
mdeemer/XlsxWriter
xlsxwriter/test/comparison/test_textbox02.py
8
1108
############################################################################### # # 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
-9,035,809,802,474,116,000
24.767442
79
0.594765
false
cbporch/perceptron
adaline.py
1
1193
import numpy as np from perceptron import Perceptron class Adaline(Perceptron): """ Implementation of an Adaptive Linear Neuron, that can be abstracted to various input sizes or dimensions. Displays using pyplot. """ ETA = 1 def __init__(self, grph, eta, max_t): Perceptron.__init__(se...
mit
-5,888,406,898,526,576,000
29.589744
89
0.521375
false
Jortolsa/l10n-spain
l10n_es_aeat_mod340/models/account_invoice.py
9
1455
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2012 Acysos S.L. (http://acysos.com) # Ignacio Ibeas <ignacio@acysos.com> # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
3,294,555,049,847,596,000
40.571429
78
0.593814
false
bdang2012/taiga-back-casting
taiga/projects/milestones/services.py
1
1452
# Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
2,424,713,738,919,583,000
37.157895
87
0.727586
false
FoxerLee/iOS_sitp
Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/mac/gyptest-xctest.py
221
1196
#!/usr/bin/env python # Copyright (c) 2013 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. """ Verifies that xctest targets are correctly configured. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.Te...
mit
8,804,503,777,923,049,000
30.473684
79
0.650502
false
guillermo-carrasco/bcbio-nextgen
bcbio/structural/__init__.py
1
5772
"""Detect structural variation in genomes using high-throughput sequencing data. """ import collections import copy import operator import toolz as tz from bcbio.pipeline import datadict as dd from bcbio.structural import (battenberg, cn_mops, cnvkit, delly, lumpy, manta, metasv, plot, v...
mit
4,835,140,490,848,871,000
37.48
104
0.584026
false
openmv/openmv
scripts/examples/OpenMV/03-Drawing/text_drawing.py
3
1127
# Text Drawing # # This example shows off drawing text on the OpenMV Cam. import sensor, image, time, pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() while(True): clock.tick() img = ...
mit
-3,380,956,146,827,878,000
33.151515
95
0.578527
false
etingof/pyasn1
tests/type/test_constraint.py
2
11339
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # import sys import unittest from tests.base import BaseTestCase from pyasn1.type import constraint from pyasn1.type import error class SingleValueConstraintTest...
bsd-2-clause
2,848,388,413,799,149,000
25.997619
83
0.600935
false
maartenq/ansible
lib/ansible/modules/packaging/os/package.py
18
1929
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Ansible Project # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
3,288,898,828,686,812,700
31.15
142
0.683256
false
blacklin/kbengine
kbe/src/lib/python/Lib/heapq.py
208
17997
"""Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. Usag...
lgpl-3.0
291,169,621,331,679,600
36.806723
81
0.646477
false
ghickman/django
tests/template_tests/filter_tests/test_wordwrap.py
21
2026
from django.template.defaultfilters import wordwrap from django.test import SimpleTestCase from django.utils.functional import lazystr from django.utils.safestring import mark_safe from ..utils import setup class WordwrapTests(SimpleTestCase): @setup({'wordwrap01': '{% autoescape off %}{{ a|wordwrap:"3"...
bsd-3-clause
-1,968,793,849,047,438,000
37.961538
105
0.621915
false
repotvsupertuga/tvsupertuga.repository
script.module.streamtvsupertuga/lib/resources/lib/modules/pyaes/util.py
124
2032
# The MIT License (MIT) # # Copyright (c) 2014 Richard Moore # # 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, mod...
gpl-2.0
-2,545,621,783,375,186,400
32.866667
79
0.716043
false
cosenal/osf.io
website/addons/badges/model/badges.py
35
5589
# -*- coding: utf-8 -*- import calendar from bson import ObjectId from datetime import datetime from modularodm import fields, Q from framework.mongo import StoredObject from framework.guid.model import GuidStoredObject from website.settings import DOMAIN from website.util import web_url_for, api_url_for from websi...
apache-2.0
-9,024,829,034,988,827,000
27.661538
111
0.58973
false
idea4bsd/idea4bsd
python/helpers/pydev/third_party/pep8/autopep8.py
34
125587
#!/usr/bin/env python # # Copyright (C) 2010-2011 Hideo Hattori # Copyright (C) 2011-2013 Hideo Hattori, Steven Myint # Copyright (C) 2013-2015 Hideo Hattori, Steven Myint, Bill Wendling # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation file...
apache-2.0
5,816,400,508,170,562,000
32.206769
79
0.538248
false
zhangziang/django-allauth
allauth/socialaccount/app_settings.py
61
2394
class AppSettings(object): def __init__(self, prefix): self.prefix = prefix def _setting(self, name, dflt): from django.conf import settings getter = getattr(settings, 'ALLAUTH_SETTING_GETTER', lambda name, dflt: getattr(settings, name,...
mit
-5,549,860,447,565,796,000
30.5
79
0.597744
false
Guneet-Dhillon/mxnet
tests/python/unittest/test_symbol.py
7
9547
# 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
-4,149,492,475,961,347,600
37.035857
108
0.638839
false
kopchik/qtile
libqtile/widget/crashme.py
10
2352
# Copyright (c) 2012 Florian Mounier # Copyright (c) 2012 roger # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2013 Craig Barnes # Copyright (c) 2014 Sean Vig # Copyright (c) 2014 Adi Sieker # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentatio...
mit
-2,854,365,693,650,093,600
36.935484
79
0.670493
false
pquentin/django
django/core/handlers/wsgi.py
82
9759
from __future__ import unicode_literals import cgi import codecs import logging import sys import warnings from io import BytesIO from threading import Lock from django import http from django.conf import settings from django.core import signals from django.core.handlers import base from django.core.urlresolvers impo...
bsd-3-clause
-4,120,595,982,493,286,400
36.106464
102
0.616559
false
otherness-space/myProject002
my_project_002/lib/python2.7/site-packages/django/core/management/commands/diffsettings.py
114
1264
from django.core.management.base import NoArgsCommand def module_to_dict(module, omittable=lambda k: k.startswith('_')): "Converts a module namespace to a Python dictionary. Used by get_settings_diff." return dict([(k, repr(v)) for k, v in module.__dict__.items() if not omittable(k)]) class Command(NoArgsComm...
mit
7,858,627,970,156,690,000
41.133333
87
0.643196
false
parthea/pydatalab
solutionbox/image_classification/mltoolbox/image/classification/task.py
6
2644
# Copyright 2017 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
7,548,480,017,629,927,000
31.641975
84
0.678139
false
pekkosk/hotbit
hotbit/io/__init__.py
1
2274
""" Input module. Contains functions to read element, Slater-Koster and repulsion data. """ def read_element(filename, symbol, format=None): """ Read element data from files. Parameters: ----------- fileobj: filename of file-object to read from symbol: chemical symbol of the element "...
gpl-2.0
-1,284,471,911,798,206,000
24.550562
77
0.635884
false
PatKayongo/patkayongo.github.io
node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_openedgebuiltins.py
370
40661
# -*- coding: utf-8 -*- """ pygments.lexers._openedgebuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Builtin list for the OpenEdgeLexer. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ OPENEDGEKEYWORDS = [ 'ABSOLUTE', 'ABS', 'ABSO', 'A...
mit
-207,581,071,209,386,300
71.350534
80
0.626104
false
ktan2020/legacy-automation
win/Lib/site-packages/requests/packages/charade/latin1prober.py
50
5387
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer....
mit
-4,621,126,835,872,517,000
36.755396
70
0.54483
false
pschmitt/home-assistant
homeassistant/components/water_heater/reproduce_state.py
16
3681
"""Reproduce an Water heater state.""" import asyncio import logging from typing import Any, Dict, Iterable, Optional from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_OFF, STATE_ON, ) from homeassistant.core import Context, State from homeassistant.helpers....
apache-2.0
-6,793,566,889,694,532,000
25.673913
88
0.601195
false
wolfram74/numerical_methods_iserles_notes
venv/lib/python2.7/site-packages/numpy/testing/noseclasses.py
76
14350
# These classes implement a doctest runner plugin for nose, a "known failure" # error class, and a customized TestProgram for NumPy. # Because this module imports nose directly, it should not # be used except by nosetester.py to avoid a general NumPy # dependency on nose. from __future__ import division, absolute_impo...
mit
4,407,569,344,774,178,000
39.651558
87
0.588153
false
darius/mccarthy-to-bryant
problems.py
2
1351
""" Use BDDs to solve SAT problems from DIMACS files. TODO: try the tableau method too """ import bddsat import dimacs import sat # Some problems from http://toughsat.appspot.com/ filenames = ['problems/trivial.dimacs', 'problems/factoring6.dimacs', 'problems/factoring2.dimacs', ...
gpl-3.0
-7,355,265,207,366,471,000
31.166667
204
0.533679
false
Volcanoscar/omim
3party/protobuf/python/google/protobuf/message.py
78
10275
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
apache-2.0
1,216,193,845,680,204,800
35.179577
79
0.726034
false
Darthkpo/xtt
openpyxl/xml/tests/test_incremental_xmlfile.py
1
11428
from __future__ import absolute_import """ Tests for the incremental XML serialisation API. From lxml """ from io import BytesIO import unittest import tempfile, os, sys from .common_imports import etree, HelperTestCase, skipIf from .. import xmlfile as etree import pytest from openpyxl.tests.helper import compar...
mit
7,292,895,480,039,333,000
31.558405
82
0.547077
false
fujunwei/chromium-crosswalk
build/android/pylib/instrumentation/test_package.py
71
1334
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Class representing instrumentation test apk and jar.""" import os from pylib.instrumentation import test_jar from pylib.utils import apk_helper cl...
bsd-3-clause
6,378,936,343,346,833,000
30.761905
72
0.694903
false
ghedsouza/django
tests/forms_tests/field_tests/test_base.py
131
1455
from django.forms import ChoiceField, Field, Form, Select from django.test import SimpleTestCase class BasicFieldsTests(SimpleTestCase): def test_field_sets_widget_is_required(self): self.assertTrue(Field(required=True).widget.is_required) self.assertFalse(Field(required=False).widget.is_required...
bsd-3-clause
-8,400,373,920,952,449,000
33.642857
73
0.610309
false
clione/django-kanban
src/core/userena/tests/commands.py
7
4703
from django.test import TestCase from django.core.management import call_command from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from userena.models import UserenaSignup from userena.managers import ASSIGNED_PERMISSIONS from userena import settings as useren...
mit
350,332,701,186,179,650
37.54918
120
0.612162
false
flh/odoo
addons/hr_holidays/report/__init__.py
442
1129
# -*- 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,111,375,308,332,560,400
42.423077
78
0.629761
false
splav/servo
components/script/dom/bindings/codegen/parser/tests/test_interface_identifier_conflicts_across_members.py
276
1371
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface IdentifierConflictAcrossMembers1 { const byte thing1 = 1; readonly attribute long thing1; }; """) results = parser.finish() except: threw = True...
mpl-2.0
3,129,112,015,806,216,000
21.85
56
0.520058
false
looker/sentry
src/sentry/api/endpoints/broadcast_details.py
2
3477
from __future__ import absolute_import import logging from django.db import IntegrityError, transaction from django.db.models import Q from django.utils import timezone from rest_framework.permissions import IsAuthenticated from sentry.api.base import Endpoint from sentry.api.exceptions import ResourceDoesNotExist f...
bsd-3-clause
-7,549,675,293,973,359,000
36.793478
94
0.626977
false
mssurajkaiga/empathy
tools/glib-gtypes-generator.py
12
12756
#!/usr/bin/python # Generate GLib GInterfaces from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006, 2007 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the...
gpl-2.0
-8,197,877,046,561,582,000
40.960526
92
0.508545
false
readevalprint/mezzanine
mezzanine/utils/docs.py
16
12232
""" Utils called from project_root/docs/conf.py when Sphinx documentation is generated. """ from __future__ import division, print_function, unicode_literals from future.builtins import map, open, str from collections import OrderedDict from datetime import datetime import os.path from shutil import copyfile, move fro...
bsd-2-clause
-5,292,996,621,614,961,000
39.503311
79
0.56671
false
geimer/easybuild-easyconfigs
test/easyconfigs/suite.py
8
2616
#!/usr/bin/python ## # Copyright 2012-2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercul...
gpl-2.0
266,304,011,502,791,780
36.913043
102
0.754969
false
sdrdl/sdipylib
sdipylib/geo.py
1
1843
"""Support functions for geographic operations""" def aspect(df): """Return the aspect ratio of a Geopandas dataset""" tb = df.total_bounds return abs((tb[0] - tb[2]) / (tb[1] - tb[3])) def scale(df, x): """Given an x dimension, return the x and y dimensions to maintain the dataframe aspect ratio"""...
bsd-2-clause
241,327,706,808,510,800
28.253968
100
0.601194
false
samueldotj/TeeRISC-Simulator
util/stats/barchart.py
90
12472
# Copyright (c) 2005-2006 The Regents of The University of Michigan # 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 ...
bsd-3-clause
30,879,693,202,814,600
35.57478
78
0.572563
false
yjxtogo/horizon
openstack_dashboard/dashboards/project/stacks/urls.py
56
1765
# 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 # distributed under th...
apache-2.0
4,274,024,333,208,426,500
43.125
75
0.665722
false
splav/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/tests/browsers/test_sauce.py
11
6268
import sys import mock import pytest from os.path import join, dirname sys.path.insert(0, join(dirname(__file__), "..", "..", "..")) sauce = pytest.importorskip("wptrunner.browsers.sauce") from wptserve.config import ConfigBuilder def test_sauceconnect_success(): with mock.patch.object(sauce.SauceConnect, "u...
mpl-2.0
-4,200,923,071,959,524,000
37.219512
128
0.564295
false
HPENetworking/HPEIMCUtils
PythonUtilities/Gather_IMC_Data/Gather_System_Device_Categories/gather_system_device_categories.py
1
1524
#!/usr/bin/env python3 # author: @netmanchris """ Copyright 2016 Hewlett Packard Enterprise Development LP. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/...
apache-2.0
1,096,317,630,269,541,600
29.48
121
0.744751
false
mhostetter/gnuradio
gr-audio/examples/python/noise.py
58
1968
#!/usr/bin/env python # # Copyright 2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
2,115,864,993,229,418,200
34.142857
83
0.655488
false
trezorg/django
tests/regressiontests/select_related_regress/models.py
92
2390
from django.db import models class Building(models.Model): name = models.CharField(max_length=10) def __unicode__(self): return u"Building: %s" % self.name class Device(models.Model): building = models.ForeignKey('Building') name = models.CharField(max_length=10) def __unicode__(self): ...
bsd-3-clause
2,913,020,079,177,469,400
26.790698
77
0.696234
false
synaptek/libchromiumcontent
tools/generate_filenames_gypi.py
3
2342
#!/usr/bin/env python import glob import os import sys TARGET_PLATFORM = { 'cygwin': 'win32', 'darwin': 'darwin', 'linux2': 'linux', 'win32': 'win32', }[sys.platform] SHARED_LIBRARY_SUFFIX = { 'darwin': 'dylib', 'linux': 'so', 'win32': 'dll', }[TARGET_PLATFORM] STATIC_LIBRARY_SUFFIX = { 'darwin': 'a...
mit
-3,437,688,668,875,663,400
23.914894
70
0.636208
false
boryszef/moltools-python
tests/test_trajectory_xyz.py
1
9849
import unittest import tempfile import random import os import stat import numpy import mdarray as mt # Return random string of spaces and tabs def rndb(): blanks = [' ', '\t'] l = [ random.choice(blanks) for i in range(random.randint(0, 5)) ] random.shuffle(l) return "".join(l) atomicMasses = { '...
gpl-3.0
5,579,460,720,449,596,000
35.343173
100
0.547365
false
inveniosoftware/invenio-upgrader
invenio_upgrader/upgrades/invenio_upgrader_2015_09_23_legacy_removal.py
3
5314
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 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
895,683,516,293,590,400
43.655462
78
0.668988
false
Naeka/vosae-app
www/core/views.py
1
4175
# -*- coding:Utf-8 -*- from django.shortcuts import render_to_response, redirect from django.template import RequestContext, loader from django.views.generic import TemplateView from django.utils.formats import get_format from django.conf import settings from django.http import ( HttpResponseRedirect, HttpRes...
agpl-3.0
1,459,856,867,453,657,900
34.381356
144
0.679042
false
olituks/sentinella
frontend/library/web2py/applications/admin/languages/pt-br.py
17
18517
# -*- coding: utf-8 -*- { '!langcode!': 'pt-br', '!langname!': 'Português Brasileiro', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novo_valor\'". Não é permitido atualizar ou apagar resultados de um...
lgpl-2.1
372,883,085,279,948,800
51.327586
666
0.719001
false
PyEatingContest/crispy-node
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py
426
56534
# 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. import filecmp import gyp.common import gyp.xcodeproj_file import gyp.xcode_ninja import errno import os import sys import posixpath import re import shutil import...
mit
692,755,188,285,611,800
43.939587
80
0.656561
false
teonlamont/mne-python
mne/realtime/tests/test_stim_client_server.py
2
2527
import threading import time import pytest from mne.realtime import StimServer, StimClient from mne.externals.six.moves import queue from mne.utils import requires_good_network, run_tests_if_main _server = None _have_put_in_trigger = False _max_wait = 10. @requires_good_network def test_connection(): """Test T...
bsd-3-clause
-9,078,651,910,061,496,000
29.817073
75
0.672339
false