repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
tinloaf/home-assistant
homeassistant/components/microsoft_face.py
4
10344
""" Support for Microsoft face recognition. For more details about this component, please refer to the documentation at https://home-assistant.io/components/microsoft_face/ """ import asyncio import json import logging import aiohttp from aiohttp.hdrs import CONTENT_TYPE import async_timeout import voluptuous as vol ...
apache-2.0
FNCS/ns-3.26
examples/wireless/mixed-wireless.py
59
17198
# /* # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation; # * # * This program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRANTY; without even the ...
gpl-2.0
Monika319/EWEF-1
Cw2Rezonans/Karolina/Oscyloskop/OscyloskopZ5W2.py
1
1312
# -*- coding: utf-8 -*- """ Plot oscilloscope files from MultiSim """ import numpy as np import matplotlib.pyplot as plt import sys import os from matplotlib import rc rc('font',family="Consolas") files=["real_zad5_05f_p2.txt"] for NazwaPliku in files: print NazwaPliku Plik=open(NazwaPliku) #print DeltaT ...
gpl-2.0
seanyoncraic/linuxRetroPie
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
catapult-project/catapult
telemetry/telemetry/internal/backends/chrome_inspector/devtools_client_backend.py
3
21781
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import absolute_import import logging import re import socket import sys import six from py_utils import exc_util from py_utils import retry...
bsd-3-clause
v-zhongz/azure-linux-extensions
VMBackup/main/Utils/WAAgentUtil.py
11
2528
# Wrapper module for waagent # # waagent is not written as a module. This wrapper module is created # to use the waagent code as a module. # # Copyright 2014 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Y...
apache-2.0
ibinti/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/geos/prototypes/topology.py
311
2226
""" This module houses the GEOS ctypes prototype functions for the topological operations on geometries. """ __all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull', 'geos_difference', 'geos_envelope', 'geos_intersection', 'geos_linemerge', 'geos_pointonsurface', 'geos_pre...
apache-2.0
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Endika/django
django/middleware/clickjacking.py
284
1989
""" Clickjacking Protection Middleware. This module provides a middleware that implements protection against a malicious site loading resources from your site in a hidden frame. """ from django.conf import settings class XFrameOptionsMiddleware(object): """ Middleware that sets the X-Frame-Options HTTP head...
bsd-3-clause
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
caspartse/QQ-Groups-Spider
vendor/idna/uts46data.py
143
184931
# This file is automatically generated by tools/build-uts46data.py # vim: set fileencoding=utf-8 : """IDNA Mapping Table from UTS46.""" def _seg_0(): return [ (0x0, '3'), (0x1, '3'), (0x2, '3'), (0x3, '3'), (0x4, '3'), (0x5, '3'), (0x6, '3'), (0x7, '3'), (0x8, '3'), (0x9, ...
mit
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
shinfan/api-client-staging
generated/python/proto-google-cloud-vision-v1/google/cloud/proto/vision/v1/text_annotation_pb2.py
8
24454
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/proto/vision/v1/text_annotation.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google...
bsd-3-clause
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
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
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
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
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
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
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
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
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
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
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
Free AI Image Generator No sign-up. Instant results. Open Now