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
googlecartographer/cartographer
docs/source/conf.py
5
9092
# -*- coding: utf-8 -*- # Copyright 2016 The Cartographer Authors # # 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
7,089,863,709,540,181,000
32.061818
79
0.711835
false
partofthething/home-assistant
tests/components/apple_tv/conftest.py
8
3388
"""Fixtures for component.""" from unittest.mock import patch from pyatv import conf, net import pytest from .common import MockPairingHandler, create_conf @pytest.fixture(autouse=True, name="mock_scan") def mock_scan_fixture(): """Mock pyatv.scan.""" with patch("homeassistant.components.apple_tv.config_fl...
mit
8,095,179,028,966,757,000
24.862595
86
0.597107
false
fentas/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py
118
7503
# Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and t...
bsd-3-clause
7,573,119,017,516,415,000
54.577778
197
0.698121
false
valkjsaaa/sl4a
python/src/Lib/contextlib.py
62
4136
"""Utilities for with-statement contexts. See PEP 343.""" import sys from functools import wraps __all__ = ["contextmanager", "nested", "closing"] class GeneratorContextManager(object): """Helper for @contextmanager decorator.""" def __init__(self, gen): self.gen = gen def __enter__(self): ...
apache-2.0
-6,676,445,754,616,710,000
26.03268
78
0.508946
false
AbrahmAB/sugar
src/jarabe/controlpanel/gui.py
2
21394
# Copyright (C) 2008 One Laptop Per Child # # 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 distribu...
gpl-3.0
-4,915,852,698,902,648,000
36.271777
79
0.558708
false
pegasus-isi/pegasus
test/core/010-runtime-clustering/cluster.py
1
8643
#!/usr/bin/env python3 import os import argparse import configparser import logging import sys import logging import subprocess from datetime import datetime from pathlib import Path from Pegasus.api import * logging.basicConfig(level=logging.DEBUG) def parse_args(args=sys.argv[1:]): parser = argparse.ArgumentPa...
apache-2.0
-8,122,236,989,658,102,000
31.011111
88
0.548652
false
bramd/django-phonenumber-field
setup.py
1
1568
from setuptools import setup, find_packages from phonenumber_field import __version__ setup( name="django-phonenumber-field", version=__version__, url='http://github.com/stefanfoulis/django-phonenumber-field', license='BSD', platforms=['OS Independent'], description="An international phone num...
mit
-4,853,339,113,309,659,000
33.086957
73
0.604592
false
quang-ha/lammps
tools/moltemplate/moltemplate/remove_duplicate_atoms.py
11
1467
#!/usr/bin/env python """ Get rid of lines containing duplicate copies of the same atom in the "Atoms" section of a LAMMPS data file. Duplicate lines which occur later are preserved and the earlier lines are erased. The file is read from sys.stdin. This program does not parse the entire data file. Th...
gpl-2.0
-9,153,415,108,029,633,000
23.45
82
0.558964
false
hydroshare/hydroshare_temp
hs_party/models/group_association.py
1
2255
from django.contrib.contenttypes import generic from django.contrib.auth.models import User, Group from django.db import models from mezzanine.pages.models import Page, RichText,Displayable from mezzanine.core.fields import FileField, RichTextField from mezzanine.core.models import Ownable from mezzanine.generic.models...
bsd-3-clause
-6,585,716,426,862,214,000
40.777778
163
0.734368
false
stewartsmith/bzr
bzrlib/index.py
2
80106
# Copyright (C) 2007-2011 Canonical Ltd # # 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. # # This program is distribute...
gpl-2.0
-1,710,965,484,435,133,000
41.883298
92
0.56449
false
scalable-networks/ext
gnuradio-3.7.0.1/gr-trellis/examples/python/test_turbo_equalization1.py
13
5480
#!/usr/bin/env python from gnuradio import gr from gnuradio import trellis, digital, filter, blocks from gnuradio import eng_notation import math import sys import random import fsm_utils try: from gnuradio import analog except ImportError: sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit...
gpl-2.0
-7,890,500,674,692,229,000
35.052632
206
0.644708
false
astagi/django-cms
cms/test_utils/project/placeholderapp/migrations_django/0001_initial.py
66
4526
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import cms.models.fields import cms.test_utils.project.placeholderapp.models class Migration(migrations.Migration): dependencies = [ ('cms', '0002_auto_20140816_1918'), ] operations = [ ...
bsd-3-clause
-2,308,999,552,748,953,000
50.431818
225
0.58418
false
lhupfeldt/multiconf
test/invalid_values_test.py
1
19200
# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT # All rights reserved. This work is under a BSD license, see LICENSE.TXT. import sys import os.path from pytest import raises from multiconf import mc_config, ConfigItem, ConfigException, MC_REQUIRED from multiconf.envs import EnvFactory from .utils.utils impo...
bsd-3-clause
-5,479,040,787,900,449,000
32.217993
146
0.60651
false
mshafiq9/django
tests/gis_tests/geos_tests/test_mutable_list.py
173
14846
# Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com # All rights reserved. # # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. import unittest from django.contrib.gis.geos.mutable_list import ListMixin from django.utils import six class Use...
bsd-3-clause
1,729,381,976,463,640,800
34.180095
93
0.488819
false
theheros/kbengine
kbe/src/lib/python/Lib/test/test_raise.py
54
10232
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Tests for the raise statement.""" from test import support import sys import types import unittest def get_tb(): try: raise OSError() except: return sys.exc_info()[2] class Context: d...
lgpl-3.0
-2,281,057,731,552,523,800
25.715405
78
0.495993
false
embeddedarm/android_external_chromium_org
build/android/tombstones.py
28
5953
#!/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. # # Find the most recent tombstone file(s) on all connected devices # and prints their stacks. # # Assumes tombstone file was created ...
bsd-3-clause
-4,382,173,006,879,530,000
29.528205
80
0.645389
false
datalogics-robb/scons
src/engine/SCons/Tool/tar.py
2
2320
"""SCons.Tool.tar Tool-specific initialization for tar. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of...
mit
3,870,170,223,994,117,000
33.626866
78
0.676293
false
GoogleCloudPlatform/DataflowTemplates
v2/common/src/test/resources/PythonTextTransformerTest/transform.py
1
2207
""" Copyright (C) 2020 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 agreed to in writing, software di...
apache-2.0
-6,333,046,332,267,350,000
29.232877
77
0.608065
false
zifeishan/deepdive
examples/tutorial_example/step3-more-data/experiment-reports/v00001/code/udf/ext_has_spouse_features.py
60
1304
#! /usr/bin/env python import sys import ddlib # DeepDive python utility ARR_DELIM = '~^~' # For each input tuple for row in sys.stdin: parts = row.strip().split('\t') if len(parts) != 6: print >>sys.stderr, 'Failed to parse row:', row continue # Get all fields from a row words = parts[0].split(...
apache-2.0
-7,309,405,940,012,458,000
30.047619
72
0.682515
false
JT5D/Alfred-Popclip-Sublime
Sublime Text 2/Python PEP8 Autoformat/libs/lib2to3/fixes/fix_intern.py
7
1362
# Copyright 2006 Georg Brandl. # Licensed to PSF under a Contributor Agreement. """Fixer for intern(). intern(s) -> sys.intern(s)""" # Local imports from .. import pytree from .. import fixer_base from ..fixer_util import Name, Attr, touch_import class FixIntern(fixer_base.BaseFix): PATTERN = """ power< '...
gpl-2.0
8,113,873,073,803,947,000
29.954545
75
0.483113
false
mrjefftang/psutil
docs/conf.py
16
7822
# -*- coding: utf-8 -*- # # psutil documentation build configuration file, created by # sphinx-quickstart. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have ...
bsd-3-clause
4,158,857,220,753,709,600
30.540323
79
0.685758
false
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/contrib/auth/management/__init__.py
126
2854
""" Creates permissions for all installed apps that need permissions. """ from django.contrib.auth import models as auth_app from django.db.models import get_models, signals def _get_permission_codename(action, opts): return u'%s_%s' % (action, opts.object_name.lower()) def _get_all_permissions(opts): "Retu...
bsd-3-clause
759,113,971,445,881,100
36.552632
110
0.644008
false
gimite/personfinder
app/vendors/xlrd/compdoc.py
27
21226
# -*- coding: cp1252 -*- ## # Implements the minimal functionality required # to extract a "Workbook" or "Book" stream (as one big string) # from an OLE2 Compound Document file. # <p>Copyright � 2005-2012 Stephen John Machin, Lingfo Pty Ltd</p> # <p>This module is part of the xlrd package, which is released under a BS...
apache-2.0
-1,583,750,774,636,250,000
43.871036
159
0.53317
false
CallaJun/hackprince
indico/numpy/distutils/tests/test_misc_util.py
69
3104
#!/usr/bin/env python from __future__ import division, absolute_import, print_function from numpy.testing import * from numpy.distutils.misc_util import appendpath, minrelpath, \ gpaths, get_shared_lib_extension from os.path import join, sep, dirname ajoin = lambda *paths: join(*((sep,)+paths)) class TestAppendp...
lgpl-3.0
8,675,482,400,004,908,000
40.386667
77
0.569265
false
loco-odoo/localizacion_co
openerp/addons/email_template/wizard/__init__.py
446
1130
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
5,215,239,164,660,881,000
42.461538
78
0.625664
false
Distrotech/pycairo
examples/cairo_snippets/snippets_pdf.py
9
1523
#!/usr/bin/env python """Python version of cairo-demo/cairo_snippets/cairo_snippets_pdf.c create a file for each example rather than one large file for all examples """ from __future__ import division from math import pi as M_PI # used by many snippets import sys import cairo if not cairo.HAS_PDF_SURFACE: raise Sy...
gpl-3.0
1,881,779,671,919,894,300
25.258621
79
0.665135
false
cosmoharrigan/pylearn2
pylearn2/costs/gated_autoencoder.py
39
5793
""" Definitions of the cost for the gated-autoencoder. """ from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin from pylearn2.space import VectorSpace class SymmetricCost(DefaultDataSpecsMixin, Cost): """ Summary (Class representing the symmetric cost). Subclasses can define the type of data they...
bsd-3-clause
-8,314,601,974,106,115,000
32.293103
78
0.599862
false
jaysonsantos/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_server.py
299
1320
import os import unittest import urllib2 import json import wptserve from base import TestUsingServer, doc_root class TestFileHandler(TestUsingServer): def test_not_handled(self): with self.assertRaises(urllib2.HTTPError) as cm: resp = self.request("/not_existing") self.assertEquals(c...
mpl-2.0
4,185,770,732,488,002,000
29.697674
72
0.656061
false
Rudloff/youtube-dl
youtube_dl/extractor/expotv.py
4
2907
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, ) class ExpoTVIE(InfoExtractor): _VALID_URL = r'https?://www\.expotv\.com/videos/[^?#]*/(?P<id>[0-9]+)($|[?#])' _TEST = { 'url': 'http://www.expotv.com/videos/reviews/...
unlicense
6,269,134,595,314,035,000
36.753247
93
0.506364
false
thinksabin/lazy-devops
S3 bucket Maker/IdentityAccessManagement.py
1
2418
__author__ = 'gambit' import boto from boto.iam.connection import IAMConnection from boto.s3.key import Key import datetime import time import smtplib import os class IdentityAccessManagement(): admin_access_key = "XXXXXXXXXXXXXXXXXXXXXXX" admin_secret_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" def create_u...
apache-2.0
1,952,461,174,675,023,600
31.675676
120
0.535567
false
mahak/cinder
cinder/tests/unit/volume/drivers/test_kioxia.py
2
40143
# 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 # d...
apache-2.0
-6,538,985,573,473,255,000
51.269531
79
0.628702
false
c-o-m-m-a-n-d-e-r/CouchPotatoServer
libs/caper/result.py
81
5904
# 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
-1,945,484,610,735,691,800
26.723005
98
0.598747
false
ToBeReplaced/ansible-modules-extras
notification/hall.py
142
3619
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Billy Kimble <basslines@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 Li...
gpl-3.0
-5,157,466,764,462,421,000
36.309278
216
0.685548
false
misdoro/python-ase
ase/calculators/jacapo/utils/bader.py
2
6745
from __future__ import print_function import os, string, tempfile, shutil from subprocess import Popen from ase.io import write from ase.units import Bohr class Bader: '''class for running bader analysis and extracting data from it. The class runs bader, extracts the charge density and outputs it to a cu...
gpl-2.0
-2,498,351,350,100,636,700
30.966825
70
0.577613
false
playm2mboy/edx-platform
lms/djangoapps/open_ended_grading/staff_grading_service.py
64
16269
""" This module provides views that proxy to the staff grading backend service. """ import json import logging from django.conf import settings from django.http import HttpResponse, Http404 from django.utils.translation import ugettext as _ from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.o...
agpl-3.0
-2,235,410,977,889,313,800
35.559551
123
0.595427
false
batxes/4c2vhic
Six_zebra_models/Six_zebra_models_final_output_0.1_-0.1_13000/Six_zebra_models29901.py
2
13923
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
-4,076,574,980,432,056,300
45.721477
75
0.699777
false
aostapenko/manila
manila/scheduler/chance.py
2
2704
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 OpenStack, LLC. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
apache-2.0
1,732,781,051,139,034,600
35.540541
78
0.644601
false
wujuguang/sentry
src/sentry/migrations/0098_auto__add_user__chg_field_team_owner__chg_field_activity_user__chg_fie.py
36
28778
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models, connections class Migration(SchemaMigration): def forwards(self, orm): if 'auth_user' in connections['default'].introspection.table_names(): return self.c...
bsd-3-clause
3,045,616,489,184,792,600
82.414493
225
0.563764
false
vanhonit/xmario_center
softwarecenter/ui/gtk3/widgets/description.py
4
47888
# Copyright (C) 2010 Matthew McGowan # # Authors: # Matthew McGowan # # 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. ...
gpl-3.0
-5,847,206,272,166,974,000
32.071823
79
0.571584
false
teddym6/qualitybots
src/appengine/handlers/machine_pool.py
26
5651
#!/usr/bin/python2.4 # # Copyright 2011 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...
apache-2.0
5,529,648,068,327,806,000
32.636905
80
0.682357
false
aspiers/pacemaker
cts/CM_ais.py
15
5946
'''CTS: Cluster Testing System: AIS dependent modules... ''' __copyright__ = ''' Copyright (C) 2007 Andrew Beekhof <andrew@suse.de> ''' # # 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; eithe...
gpl-2.0
2,421,423,930,139,020,000
37.61039
110
0.61554
false
jlguardi/yowsup
yowsup/layers/protocol_media/protocolentities/builder_message_media_downloadable.py
17
1886
# from yowsup.layers.protocol_media import mediacipher import tempfile import os class DownloadableMediaMessageBuilder(object): def __init__(self, downloadbleMediaMessageClass, jid, filepath): self.jid = jid self.filepath = filepath self.encryptedFilepath = None self.cls = downloadbl...
gpl-3.0
8,093,133,399,139,990,000
29.918033
109
0.627253
false
damorim/compilers-cin
2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNDeserializer.py
9
22186
# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. #/ from uuid import UUID from io import StringIO from typing import Callable from antlr4.Token import Token from antlr4.atn.ATN im...
mit
-1,459,583,157,344,531,000
41.018939
134
0.594204
false
ppiotr/Invenio
modules/miscutil/lib/upgrades/invenio_2012_11_27_new_selfcite_tables.py
24
1666
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2012 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
241,791,155,171,128,740
31.038462
75
0.671068
false
dvliman/jaikuengine
.google_appengine/lib/django-0.96/django/newforms/extras/widgets.py
32
2008
""" Extra HTML Widget classes """ from django.newforms.widgets import Widget, Select from django.utils.dates import MONTHS import datetime __all__ = ('SelectDateWidget',) class SelectDateWidget(Widget): """ A Widget that splits date input into three <select> boxes. This also serves as an example of a Wi...
apache-2.0
8,298,886,374,793,652,000
33.033898
118
0.609562
false
alextruberg/custom_django
django/contrib/gis/db/backends/mysql/introspection.py
624
1426
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. d...
bsd-3-clause
-8,190,172,623,721,746,000
43.5625
81
0.620617
false
desarrollosimagos/svidb
administrativo/perfil/models.py
1
12346
#!/usr/bin/python -u # -*- coding: utf-8 -*- from django.db import models from datetime import datetime from django.contrib.auth.models import User from mapas.models import * from actores.models import * class PerfilPublico(models.Model): user = models.OneToOneField(User,verbose_name='Usuario') per...
gpl-3.0
7,892,154,210,437,557,000
52.074561
368
0.693649
false
ocefpaf/compliance-checker
compliance_checker/tests/test_cf.py
2
105222
#!/usr/bin/env python # -*- coding: utf-8 -*- import copy import os import sqlite3 from itertools import chain from tempfile import gettempdir import numpy as np import pytest from netCDF4 import Dataset from compliance_checker import cfutil from compliance_checker.cf import ( CF1_6Check, CF1_7Check, d...
apache-2.0
-7,127,888,017,928,970,000
38.029314
181
0.592837
false
zjuchenyuan/BioWeb
Lib/requests/packages/__init__.py
61
1494
''' Debian and other distributions "unbundle" requests' vendored dependencies, and rewrite all imports to use the global versions of ``urllib3`` and ``chardet``. The problem with this is that not only requests itself imports those dependencies, but third-party code outside of the distros' control too. In reaction to t...
mit
-3,740,854,245,673,782,000
34.571429
78
0.754351
false
pschmitt/home-assistant
tests/components/local_file/test_camera.py
21
5287
"""The tests for local file camera component.""" from unittest import mock from homeassistant.components.local_file.const import DOMAIN, SERVICE_UPDATE_FILE_PATH from homeassistant.setup import async_setup_component from tests.common import mock_registry async def test_loading_file(hass, hass_client): """Test t...
apache-2.0
7,287,199,300,171,845,000
30.849398
87
0.584642
false
emrah-b/oclapi
django-nonrel/ocl/integration_tests/tests/bulk_import_validation.py
4
13005
from django.contrib.auth.models import User from concepts.importer import ConceptsImporter, ValidationLogger from concepts.validation_messages import OPENMRS_NAMES_EXCEPT_SHORT_MUST_BE_UNIQUE, OPENMRS_MUST_HAVE_EXACTLY_ONE_PREFERRED_NAME, \ OPENMRS_SHORT_NAME_CANNOT_BE_PREFERRED, OPENMRS_PREFERRED_NAME_UNIQUE_PER_...
mpl-2.0
-2,314,512,562,089,775,000
52.085714
169
0.690734
false
IllusionRom-deprecated/android_platform_external_chromium_org_tools_grit
grit/node/misc_unittest.py
7
15597
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Unit tests for misc.GritNode''' import os import sys if __name__ == '__main__': sys.path.append(os.path.join(os.path.dirname...
bsd-2-clause
-8,368,932,426,749,408,000
36.224344
113
0.563634
false
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_2/tests/regressiontests/m2m_regress/tests.py
39
3145
from django.core.exceptions import FieldError from django.test import TestCase from models import (SelfRefer, Tag, TagCollection, Entry, SelfReferChild, SelfReferChildSibling, Worksheet) class M2MRegressionTests(TestCase): def assertRaisesErrorWithMessage(self, error, message, callable, *args, **kwargs): ...
apache-2.0
-9,105,192,795,230,684,000
37.353659
143
0.646423
false
Stanford-Online/edx-platform
lms/djangoapps/courseware/tests/test_middleware.py
19
1491
""" Tests for courseware middleware """ from django.http import Http404 from django.test.client import RequestFactory from nose.plugins.attrib import attr from lms.djangoapps.courseware.exceptions import Redirect from lms.djangoapps.courseware.middleware import RedirectMiddleware from xmodule.modulestore.tests.django...
agpl-3.0
-1,999,649,033,062,407,700
32.886364
76
0.701543
false
ecino/compassion-modules
partner_communication/models/email.py
4
2485
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
agpl-3.0
5,994,771,333,309,306,000
44.181818
79
0.444668
false
lscheinkman/nupic
src/nupic/data/dict_utils.py
49
5295
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
-6,650,219,823,586,886,000
29.606936
81
0.62474
false
GIC-de/ncclient
test/unit/devices/test_junos.py
2
2800
import unittest from ncclient.devices.junos import * import ncclient.transport from mock import patch import paramiko import sys xml = '''<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="no"/> <xsl:template match="/|comment()|processing-i...
apache-2.0
7,348,896,880,066,941,000
30.818182
88
0.604286
false
mfherbst/spack
var/spack/repos/builtin/packages/sw4lite/package.py
2
3776
############################################################################## # Copyright (c) 2017, Los Alamos National Security, LLC # Produced at the Los Alamos National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # # For details, ...
lgpl-2.1
-5,484,572,795,504,979,000
37.530612
79
0.620233
false
servo-automation/highfive
tests/api_provider_tests.py
2
7671
from highfive.runner import Configuration, Response from highfive.api_provider.interface import APIProvider, CONTRIBUTORS_STORE_KEY, DEFAULTS from handler_tests import TestStore from datetime import datetime from dateutil.parser import parse as datetime_parse from unittest import TestCase def create_config(): co...
mpl-2.0
4,291,612,290,385,657,300
35.014085
98
0.551688
false
djeraseit/PredictionIO
examples/experimental/scala-local-friend-recommendation/file_random.py
48
4883
import sys import random read_file = open("data/user_profile.txt", 'r') write_file = open("data/mini_user_profile.txt", 'w') number_of_lines = int(sys.argv[1]) number_of_items = int(sys.argv[2]) #record number of lines count = 0 random_num_list = [] # loop through the file to get number of lines in the file for line ...
apache-2.0
-7,507,922,459,721,964,000
24.7
80
0.618063
false
Softmotions/edx-platform
common/test/acceptance/pages/lms/discussion.py
36
25473
from contextlib import contextmanager from bok_choy.javascript import wait_for_js from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise, Promise from .course_page import CoursePage class DiscussionPageMixin(object): def is_ajax_finished(self): return self.browser.execute...
agpl-3.0
1,997,688,661,498,393,600
38.129032
128
0.620147
false
Balannen/LSMASOMM
atom3/Kernel/ColoredText/configHandler.py
1
27398
"""Provides access to stored IDLE configuration information. Refer to the comments at the beginning of config-main.def for a description of the available configuration files and the design implemented to update user configuration information. In particular, user configuration choices which duplicate the defaults...
gpl-3.0
1,339,416,341,385,229,300
39.829008
86
0.563764
false
0sc0d3r/enigma2
lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py
52
3783
from Plugins.Extensions.CutListEditor.plugin import CutListEditor from Components.ServiceEventTracker import ServiceEventTracker from enigma import iPlayableService, iServiceInformation from Tools.Directories import fileExists class TitleCutter(CutListEditor): def __init__(self, session, t): CutListEditor.__init__(...
gpl-2.0
8,703,329,266,913,214,000
38.40625
119
0.720856
false
nddsg/TreeDecomps
xplodnTree/tdec/b2CliqueTreeRules.py
1
3569
#!/usr/bin/env python __author__ = 'saguinag' + '@' + 'nd.edu' __version__ = "0.1.0" ## ## fname "b2CliqueTreeRules.py" ## ## TODO: some todo list ## VersionLog: import net_metrics as metrics import pandas as pd import argparse, traceback import os, sys import networkx as nx import re from collections import deque,...
mit
1,961,374,472,834,969,000
26.037879
112
0.612496
false
ar4s/django
django/db/models/sql/expressions.py
3
4373
import copy from django.core.exceptions import FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.fields import FieldDoesNotExist class SQLEvaluator(object): def __init__(self, expression, query, allow_joins=True, reuse=None): self.expression = expression self.opts...
bsd-3-clause
-2,947,435,316,157,446,000
36.376068
96
0.52504
false
hynnet/openwrt-mt7620
staging_dir/host/lib/python2.7/ctypes/test/test_struct_fields.py
264
1503
import unittest from ctypes import * class StructFieldsTestCase(unittest.TestCase): # Structure/Union classes must get 'finalized' sooner or # later, when one of these things happen: # # 1. _fields_ is set. # 2. An instance is created. # 3. The type is used as field of another Structure/Union. ...
gpl-2.0
-1,112,820,804,364,292,400
29.06
71
0.566866
false
iodoom-gitorious/enhanced-iodoom3
neo/sys/linux/runner/runner_lib.py
61
6759
# run doom process on a series of maps # can be used for regression testing, or to fetch media # keeps a log of each run ( see getLogfile ) # currently uses a basic stdout activity timeout to decide when to move on # using a periodic check of /proc/<pid>/status SleepAVG # when the sleep average is reaching 0, issue a ...
gpl-3.0
291,736,784,438,179,700
31.339713
163
0.669182
false
igel-kun/pyload
module/plugins/hooks/CloudFlareDdos.py
1
11909
# -*- coding: utf-8 -*- import inspect import re import urlparse from module.network.HTTPRequest import BadHeader from ..captcha.ReCaptcha import ReCaptcha from ..internal.Addon import Addon from ..internal.misc import parse_html_header def plugin_id(plugin): return ("<%(plugintype)s %(pluginname)s%(id)s>" % ...
gpl-3.0
-8,680,382,063,904,714,000
37.665584
128
0.546393
false
chrisndodge/edx-platform
lms/djangoapps/student_profile/test/test_views.py
113
3370
# -*- coding: utf-8 -*- """ Tests for student profile views. """ from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from util.testing import UrlResetMixin from student.tests.factories import UserFactory from stu...
agpl-3.0
4,813,397,828,913,565,000
31.718447
99
0.622255
false
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KShortcutWidget.py
1
1269
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg cl...
gpl-2.0
8,233,919,471,791,282,000
26.586957
82
0.677699
false
Stavitsky/nova
nova/tests/unit/scheduler/test_scheduler_utils.py
10
15657
# Copyright (c) 2013 Rackspace Hosting # 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 req...
apache-2.0
3,205,757,569,836,244,000
43.104225
78
0.548445
false
einaru/luma
luma/plugins/browser/AddAttributeWizard.py
3
8525
# -*- coding: utf-8 -*- # # Copyright (c) 2011 # Per Ove Ringdal # # Copyright (C) 2004 # Wido Depping, <widod@users.sourceforge.net> # # 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, ei...
gpl-2.0
-6,101,912,037,820,293,000
36.888889
113
0.637654
false
SyndicateLtd/SyndicateQT
test/functional/wallet_zapwallettxes.py
3
2839
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the zapwallettxes functionality. - start two bitcoind nodes - create two transactions on node 0 -...
mit
8,850,313,853,761,733,000
39.557143
112
0.697076
false
ema/conpaas
conpaas-services/src/conpaas/services/htc/manager/get_run_time.py
2
6391
#import os import sys import time import xmltodict import pprint pp = pprint.PrettyPrinter(indent=4,stream=sys.stderr) testing = False # def poll_condor(jonbr, bagnr): def poll_condor(filename): # filename = "hist-%d-%d.xml" % ( jobnr, bagnr ) # command = "condor_history -constraint 'HtcJob == %d && HtcBag ...
bsd-3-clause
-5,384,936,284,092,089,000
35.942197
116
0.434517
false
leiferikb/bitpop
depot_tools/third_party/boto/mashups/interactive.py
119
2737
# Copyright (C) 2003-2007 Robey Pointer <robey@lag.net> # # This file is part of paramiko. # # Paramiko 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 op...
gpl-3.0
4,704,446,714,513,671,000
27.216495
93
0.565583
false
eeshangarg/zulip
zilencer/management/commands/add_new_realm.py
6
1137
from typing import Any from zerver.lib.actions import bulk_add_subscriptions, do_create_realm, do_create_user from zerver.lib.management import ZulipBaseCommand from zerver.lib.onboarding import send_initial_realm_messages from zerver.models import Realm, UserProfile class Command(ZulipBaseCommand): help = """Ad...
apache-2.0
8,829,127,599,415,805,000
39.607143
100
0.671944
false
jbzdak/edx-platform
lms/djangoapps/shoppingcart/processors/tests/test_CyberSource2.py
164
18446
# -*- coding: utf-8 -*- """ Tests for the newer CyberSource API implementation. """ from mock import patch from django.test import TestCase from django.conf import settings import ddt from student.tests.factories import UserFactory from shoppingcart.models import Order, OrderItem from shoppingcart.processors.CyberSour...
agpl-3.0
8,347,593,669,894,794,000
40.804989
130
0.599371
false
SOKP/kernel_motorola_msm8226
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
-7,861,997,407,647,542,000
28.407609
158
0.679357
false
vponomaryov/rally
rally/plugins/openstack/context/existing_users.py
1
2614
# 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 agreed to in writing, software #...
apache-2.0
-8,003,209,098,813,009,000
36.342857
79
0.65264
false
robwebset/screensaver.weather
resources/lib/settings.py
1
1308
# -*- coding: utf-8 -*- import xbmc import xbmcaddon ADDON = xbmcaddon.Addon(id='screensaver.weather') ADDON_ID = ADDON.getAddonInfo('id') # Common logging module def log(txt, loglevel=xbmc.LOGDEBUG): if (ADDON.getSetting("logEnabled") == "true") or (loglevel != xbmc.LOGDEBUG): if isinstance(txt, str): ...
gpl-2.0
-4,987,328,565,707,168,000
25.693878
81
0.542049
false
niekas/dakis
dakis/website/migrations/openid/0001_initial.py
5
1240
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='OpenIDNonce', fields=[ ('id', models.AutoField(...
agpl-3.0
-1,867,539,125,413,394,700
34.428571
114
0.533871
false
Jonbean/DSSM
classification/utils.py
8
5542
''' Author: Jon Tsai Created: May 29 2016 ''' import numpy as np import theano from time import sleep import sys def progress_bar(percent, speed): i = int(percent)/2 sys.stdout.write('\r') # the exact output you're looking for: sys.stdout.write("[%-50s] %d%% %f instances/s" % ('='*i, percent, spe...
gpl-3.0
-28,399,149,772,886,012
26.305419
104
0.544388
false
Treeki/NewerSMBW
Koopatlas/src/editorui/objects.py
1
4434
from common import * from editorcommon import * import weakref class KPEditorObject(KPEditorItem): SNAP_TO = (24,24) def __init__(self, obj, layer): KPEditorItem.__init__(self) obj.qtItem = self self._objRef = weakref.ref(obj) self._layerRef = weakref.ref(layer) self._updatePosition() self._updateSize()...
mit
-8,735,065,201,513,281,000
22.967568
75
0.662382
false
eestay/edx-ora2
scripts/render_templates.py
7
3912
#!/usr/bin/env python """ Render Django templates. Useful for generating fixtures for the JavaScript unit test suite. Usage: python render_templates.py path/to/templates.json where "templates.json" is a JSON file of the form: [ { "template": "openassessmentblock/oa_base.html", ...
agpl-3.0
2,144,937,601,752,186,000
28.413534
98
0.629601
false
scalient/ebsmount
cmd_manual.py
2
2801
#!/usr/bin/python # Copyright (c) 2010 Alon Swartz <alon@turnkeylinux.org> # # 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 ver...
gpl-2.0
4,128,131,317,433,193,500
26.732673
79
0.625848
false
vicky2135/lucious
lucious/lib/python2.7/site-packages/pip/_vendor/progress/__init__.py
916
3023
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE A...
bsd-3-clause
8,970,014,737,514,017,000
23.577236
74
0.600397
false
johndpope/tensorflow
tensorflow/tensorboard/backend/application.py
24
26886
# 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
-6,497,820,005,484,346,000
35.931319
80
0.673734
false
slandis/InkCutter
inkcutter/app/bin/device.py
1
3171
#!/usr/bin/env python # InkCutter, Plot HPGL directly from Inkscape. # device.py # # Copyright 2010 Jairus Martin <frmdstryr@gmail.com> # Copyright 2013 Shaun Landis <slandis@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
gpl-3.0
8,242,678,511,675,439,000
26.336207
107
0.674866
false
ecederstrand/django
tests/generic_relations_regress/tests.py
300
11453
from django.db.models import Q, Sum from django.db.models.deletion import ProtectedError from django.db.utils import IntegrityError from django.forms.models import modelform_factory from django.test import TestCase, skipIfDBFeature from .models import ( A, B, C, D, Address, Board, CharLink, Company, Contact, Conte...
bsd-3-clause
1,001,468,639,439,804,000
39.758007
92
0.615647
false
HackerTool/vivisect
vstruct/defs/pcap.py
2
16024
import vstruct import vstruct.defs.inet as vs_inet from vstruct.primitives import * PCAP_LINKTYPE_ETHER = 1 PCAP_LINKTYPE_RAW = 101 PCAPNG_BOM = 0x1A2B3C4D OPT_ENDOFOPT = 0 OPT_COMMENT = 1 #PCAPNG_BLOCKTYPE_SECTION_HEADER options OPT_SHB_HARDWARE = 2 OPT_SHB_OS ...
apache-2.0
-2,379,434,446,897,924,000
31.503043
113
0.569958
false
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/ZopeInterface/zope/interface/tests/test_element.py
79
1320
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
gpl-3.0
-6,502,980,762,974,214,000
31.195122
78
0.605303
false
nemobis/BEIC
METS_fileSec_validator.py
1
1331
#!/usr/bin/python # -*- coding: utf-8 -*- """ Extractor to validate a METS file and check the existence and content of the files linked from each fileSec/fileGrp/file/FLocat tag, assumed to contain an MD5 checksum. The "md5sum" utility is required. """ # # (C) Federico Leva and Fondazione BEIC, 2018 # # Distr...
mit
3,287,267,885,847,843,000
31.463415
93
0.670173
false
PlotWatt/sql_query_dict
test.py
1
2835
import pytest import sql_query_dict def test_escape_string_with_single_quote(): assert sql_query_dict.quote_string("'a") == '"\'a"' def test_escape_string_with_double_quote(): assert sql_query_dict.quote_string('"a') == "'\"a'" def test_escape_string_with_single_and_double_quote(): assert sql_query_d...
apache-2.0
1,021,588,993,969,977,700
24.772727
73
0.53933
false
wizzomafizzo/flairbot
flairbot.py
1
5950
#!/usr/bin/env python3 """Reddit bot for updating user flairs via PM requests""" import sys import re import os import time import logging import logging.handlers import praw import OAuth2Util from config import cfg def setup_logging(): """Configure logging module for rotating logs and console output""" r...
mit
-8,983,526,375,439,880,000
28.455446
77
0.534118
false
apark263/tensorflow
tensorflow/contrib/linear_optimizer/python/ops/sparse_feature_column_test.py
14
2330
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-5,754,288,891,042,353,000
41.363636
100
0.709013
false
chubbymaggie/angr
tests/test_rol.py
5
1328
import nose import angr from angr.calling_conventions import SimCCSystemVAMD64 import logging l = logging.getLogger("angr.tests.test_rol") import os test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests')) def test_rol_x86_64(): binary_path = test_location + "/x86_64...
bsd-2-clause
-8,403,633,985,396,608,000
26.102041
102
0.676205
false
dllsf/odootest
addons/auth_signup/controllers/main.py
165
6011
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
-4,256,783,637,298,582,000
46.330709
126
0.622359
false
pkexcellent/luigi
examples/elasticsearch_index.py
57
3399
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
-6,298,217,546,386,609,000
28.556522
105
0.639894
false
Bismarrck/tensorflow
tensorflow/tools/dist_test/scripts_allreduce/k8s_generate_yaml.py
11
2997
#!/usr/bin/python # 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 r...
apache-2.0
-8,413,327,926,837,628,000
31.225806
80
0.674007
false
therealfakemoot/collections2
collections2/dicts.py
2
2578
from collections import MutableMapping class OrderedDict(MutableMapping): '''OrderedDict is a mapping object that allows for ordered access and insertion of keys. With the exception of the key_index, insert, and reorder_keys methods behavior is identical to stock dictionary objects.''' def __init__(s...
mit
-4,717,889,050,585,243,000
30.439024
110
0.576804
false