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
tboyce021/home-assistant
tests/components/openalpr_local/test_image_processing.py
13
5024
"""The tests for the openalpr local platform.""" import homeassistant.components.image_processing as ip from homeassistant.const import ATTR_ENTITY_PICTURE from homeassistant.core import callback from homeassistant.setup import setup_component from tests.async_mock import MagicMock, PropertyMock, patch from tests.comm...
apache-2.0
Kagee/youtube-dl
youtube_dl/extractor/mailru.py
81
3096
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class MailRuIE(InfoExtractor): IE_NAME = 'mailru' IE_DESC = 'Видео@Mail.Ru' _VALID_URL = r'http://(?:www\.)?my\.mail\.ru/(?:video/.*#video=/?(?P<idv1>(?:[^/]+/){3}\d+)|(?:(?P<idv2prefix>(?:[^/]+/){2})vi...
unlicense
zulip/django
django/db/migrations/graph.py
351
10956
from __future__ import unicode_literals import warnings from collections import deque from functools import total_ordering from django.db.migrations.state import ProjectState from django.utils.datastructures import OrderedSet from django.utils.encoding import python_2_unicode_compatible from .exceptions import Circu...
bsd-3-clause
tafaRU/odoo
addons/l10n_co/__openerp__.py
49
1812
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) David Arnold (devCO). # Author David Arnold (devCO), dar@devco.co # Co-Authors Juan Pablo Aries (devCO), jpa@devco.co # Hector Ivan ...
agpl-3.0
anusha-ragunathan/docker
vendor/src/github.com/ugorji/go/codec/test.py
670
3808
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # pip install --user msgpack-python # pip inst...
apache-2.0
fkie-cad/FACT_core
src/test/integration/intercom/test_intercom_common.py
1
1550
import gc import pickle import unittest from tempfile import TemporaryDirectory from intercom.common_mongo_binding import InterComListener from storage.MongoMgr import MongoMgr from test.common_helper import get_config_for_testing TMP_DIR = TemporaryDirectory(prefix='fact_test_') BSON_MAX_FILE_SIZE = 16 * 1024**2 ...
gpl-3.0
conyx/isjtests
datamodel/configuration.py
1
3996
#!/usr/bin/env python3 """ Data model for ISJ tests. Configuration data representation. Author: Tomas Bambas xbamba01@stud.fit.vutbr.cz """ class Configuration: def __init__(self): self.set_mode("web") self.set_verbose(True) self.set_logging(False) self.set_logfile("isjtests.log")...
bsd-3-clause
PingaxAnalytics/koob_beta
signup/migrations/0001_initial.py
1
1445
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-12-01 19:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Stores...
apache-2.0
ThomasCr/smarthome
bin/smarthome.py
2
10866
#!/usr/bin/env python3 # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2011-2014 Marcus Popp marcus@popp.mx # Copyright 2016 Christian Strassburg c.strassburg@gmx.de # ...
gpl-3.0
Akshay0724/scikit-learn
sklearn/ensemble/voting_classifier.py
19
9888
""" Soft Voting/Majority Rule classifier. This module contains a Soft Voting/Majority Rule classifier for classification estimators. """ # Authors: Sebastian Raschka <se.raschka@gmail.com>, # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator f...
bsd-3-clause
tiborsimko/invenio-redirector
invenio_redirector/models.py
3
2489
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2014, 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 optio...
gpl-2.0
Argonne-National-Laboratory/ProMC
protobuf/python/google/protobuf/internal/enum_type_wrapper.py
292
3541
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
lgpl-3.0
jbenden/ansible
lib/ansible/modules/cloud/amazon/sts_assume_role.py
1
5188
#!/usr/bin/python # Copyright: 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.0', 'status': ['stableinterf...
gpl-3.0
cyanut/django-haystack
example_project/settings.py
11
1128
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import os # All the normal settings apply. What's included here are the bits you'll have # to customize. # Add Haystack to INSTALLED_APPS. You can do this by simply placing in your list. INSTALLED_APPS = INSTALLED_A...
bsd-3-clause
ribag/ganeti-experiments
test/py/ganeti.jstore_unittest.py
7
3251
#!/usr/bin/python # # Copyright (C) 2012 Google Inc. # # 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...
gpl-2.0
zahodi/ansible
lib/ansible/modules/network/nxos/nxos_command.py
33
8801
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
manasi24/jiocloud-tempest-qatempest
tempest/api/identity/admin/v3/test_projects_negative.py
11
3532
# Copyright 2013 OpenStack, LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
alejandrogallo/dotfiles
bin/pick.py
1
3226
#! /usr/bin/env python2 # -*- coding: utf-8 -*- import curses import time import os import re import sys import tempfile def terminate(main_screen): """ :returns: TODO """ curses.nocbreak(); main_screen.keypad(0); curses.echo() curses.endwin() def init(): """ :returns: TODO ...
unlicense
massot/odoo
addons/account/wizard/account_report_common_partner.py
385
1999
# -*- 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
AndrewSallans/osf.io
scripts/consistency/fix_tag_guids.py
64
2104
"""Removes legacy Tag objects from the Guid namespace. Tags were once GuidStoredObjects, but are no longer. The Guid table was not cleaned of these references. This caused a specific issue where "project" was a Tag id, and therefore was resolveable to a Guid object, thereby breaking our routing system for URLs beginn...
apache-2.0
gunan/tensorflow
tensorflow/lite/micro/examples/magic_wand/train/data_split_test.py
19
3122
# Lint as: python3 # Copyright 2019 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 ...
apache-2.0
tecwebjoao/TecWeb-TF-2T-B-SI
venv/Lib/encodings/cp1258.py
272
13364
""" Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
apache-2.0
misterdanb/micropython
tests/basics/gen_yield_from_ducktype.py
107
1034
class MyGen: def __init__(self): self.v = 0 def __iter__(self): return self def __next__(self): self.v += 1 if self.v > 5: raise StopIteration return self.v def gen(): yield from MyGen() def gen2(): yield from gen() print(list(gen())) print(l...
mit
RO-ny9/python-for-android
python-build/python-libs/gdata/samples/oauth/oauth_example.py
89
4415
#!/usr/bin/python # # Copyright (C) 2007 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 ...
apache-2.0
Tokyo-Buffalo/tokyosouth
env/lib/python3.6/site-packages/twisted/python/test/test_zipstream.py
1
12160
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.zipstream} """ import random import zipfile from hashlib import md5 from twisted.python import zipstream, filepath from twisted.trial import unittest class FileEntryMixin: """ File entry classes should be...
mit
trondhindenes/ansible
lib/ansible/modules/cloud/vmware/vmware_cluster.py
20
10016
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Joseph Callen <jcallen () csc.com> # 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'...
gpl-3.0
benosteen/mypaint
gui/preferenceswindow.py
1
13712
# This file is part of MyPaint. # Copyright (C) 2008-2009 by Martin Renold <martinxyz@gmx.ch> # # 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 opt...
gpl-2.0
Acidburn0zzz/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_pipes.py
10
9029
import os import unittest import time import json from six.moves import urllib import pytest wptserve = pytest.importorskip("wptserve") from .base import TestUsingServer, doc_root class TestStatus(TestUsingServer): def test_status(self): resp = self.request("/document.txt", query="pipe=status(202)") ...
mpl-2.0
blighj/django
tests/forms_tests/field_tests/test_urlfield.py
23
7737
from django.forms import URLField, ValidationError from django.test import SimpleTestCase from . import FormFieldAssertionsMixin class URLFieldTest(FormFieldAssertionsMixin, SimpleTestCase): def test_urlfield_1(self): f = URLField() self.assertWidgetRendersTo(f, '<input type="url" name="f" id="i...
bsd-3-clause
wreckJ/intellij-community
python/lib/Lib/urllib2.py
82
47582
"""An extensible library for opening URLs using a variety of protocols The simplest way to use this module is to call the urlopen function, which accepts a string containing a URL or a Request object (described below). It opens the URL and returns the results as file-like object; the returned object has some extra me...
apache-2.0
nugget/home-assistant
homeassistant/components/scsgate/__init__.py
7
5410
""" Support for SCSGate components. For more details about this component, please refer to the documentation at https://home-assistant.io/components/scsgate/ """ import logging from threading import Lock import voluptuous as vol from homeassistant.const import (CONF_DEVICE, CONF_NAME) from homeassistant.core import ...
apache-2.0
ftramer/stanford-suns-nips17
untargeted/nets/inception_resnet_v2.py
8
16151
# 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 applicable ...
mit
rspavel/spack
var/spack/repos/builtin/packages/exasp2/package.py
3
3198
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import glob class Exasp2(MakefilePackage): """ExaSP2 is a reference implementation of typical li...
lgpl-2.1
qPCR4vir/orange
Orange/OrangeWidgets/OWReport.py
6
18916
# Widgets cannot be reset to the settings they had at the time of reporting. # The reason lies in the OWGUI callback mechanism: callbacks are triggered only # when the controls are changed by the user. If the related widget's attribute # is changed programmatically, the control is updated but the callback is not # call...
gpl-3.0
kalahbrown/HueBigSQL
desktop/core/ext-py/kazoo-2.0/kazoo/recipe/counter.py
47
2674
"""Zookeeper Counter :Maintainer: None :Status: Unknown """ from kazoo.exceptions import BadVersionError from kazoo.retry import ForceRetryError class Counter(object): """Kazoo Counter A shared counter of either int or float values. Changes to the counter are done atomically. The general retry policy ...
apache-2.0
pombredanne/django-material
material/templatetags/material_form.py
10
5207
import os from collections import defaultdict from django.forms.forms import BoundField from django.template.base import ( TemplateSyntaxError, Library, Node, Variable, token_kwargs) from django.template.loader import get_template from django.template.loader_tags import IncludeNode register = Library() def...
bsd-3-clause
slisson/intellij-community
python/lib/Lib/commands.py
120
2279
"""Execute shell commands via os.popen() and return status, output. Interface summary: import commands outtext = commands.getoutput(cmd) (exitstatus, outtext) = commands.getstatusoutput(cmd) outtext = commands.getstatus(file) # returns output of "ls -ld file" A trailing newline is remov...
apache-2.0
atsolakid/edx-platform
lms/djangoapps/verify_student/migrations/0001_initial.py
114
7568
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'SoftwareSecurePhotoVerification' db.create_table('verify_student_softwaresecurephotoverifica...
agpl-3.0
hatwar/Das_erpnext
erpnext/utilities/doctype/rename_tool/rename_tool.py
46
1709
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class RenameTool(Docu...
agpl-3.0
DebrahR/memory
server/lib/werkzeug/contrib/cache.py
306
23519
# -*- coding: utf-8 -*- """ werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ The main problem with dynamic Web sites is, well, they're dynamic. Each time a user requests a page, the webserver executes a lot of code, queries the database, renders templates until the visitor gets the page he sees. ...
apache-2.0
obestwalter/mau-mau
setup.py
1
1341
import itertools from setuptools import setup, find_packages def generate_extras_require(): extras = { ':sys_platform == "win32"': ["win_unicode_console"], "lint": ["flake8", "black"], "test": ["pytest"], "docs": ["mkdocs", "mkdocs-material"], } extras.update(dict(all=list(...
mit
redhat-openstack/ironic
ironic/tests/drivers/test_pxe.py
2
44100
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
apache-2.0
wanghao-xznu/linux-2.6-imx
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
andrewcmyers/tensorflow
tensorflow/python/layers/pooling.py
31
26540
# 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
lipingxue/docker-volume-vsphere
esx_service/cli/vmdkops_post_update.11.1.py
9
7431
#!/usr/bin/env python # Copyright 2017 VMware, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
areski/django
django/contrib/postgres/fields/jsonb.py
341
2994
import json from psycopg2.extras import Json from django.contrib.postgres import forms, lookups from django.core import exceptions from django.db.models import Field, Transform from django.utils.translation import ugettext_lazy as _ __all__ = ['JSONField'] class JSONField(Field): empty_strings_allowed = False ...
bsd-3-clause
sherazkasi/SabreSoftware
Lib/site-packages/numpy/doc/structured_arrays.py
58
7222
""" ===================================== Structured Arrays (aka Record Arrays) ===================================== Introduction ============ Numpy provides powerful capabilities to create arrays of structs or records. These arrays permit one to manipulate the data by the structs or by fields of the struct. A simpl...
gpl-3.0
UManPychron/pychron
pychron/core/test_helpers.py
2
2382
# =============================================================================== # Copyright 2014 Jake Ross # # 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...
apache-2.0
AaronH92/mProve3.2
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/eclipse.py
1825
17014
# 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. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
apache-2.0
tangfeixiong/nova
nova/tests/unit/api/openstack/compute/contrib/test_flavorextradata.py
63
3996
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
viggates/nova
nova/virt/baremetal/db/sqlalchemy/migration.py
13
2924
# 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 # not use this file except in compliance with the License. You may obtain # a ...
apache-2.0
svost/bitcoin
qa/rpc-tests/assumevalid.py
45
7764
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' assumevalid.py Test logic for skipping signature validation on blocks which we've assumed valid (http...
mit
yfried/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_group.py
27
5624
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # 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
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/docutils/transforms/misc.py
183
4882
# $Id: misc.py 6314 2010-04-26 10:04:17Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Miscellaneous transforms. """ __docformat__ = 'reStructuredText' from docutils import nodes from docutils.transforms import Transform, TransformError clas...
gpl-2.0
Fusion-Devices/android_kernel_motorola_msm8916
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
lmtierney/watir-snake
tests/browser/user_editable_tests.py
1
9594
# -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest from nerodia.exception import UnknownObjectException, ObjectReadOnlyException, Error pytestmark = pytest.mark.page('forms_with_input_elements.html') class TestUserEditableAppend(object): def test_appends_the_text_to_the_text_field(se...
mit
trishnaguha/ansible
lib/ansible/modules/network/aci/aci_domain_to_encap_pool.py
12
11442
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Dag Wieers <dag@wieers.com> # 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
nickpandolfi/Cyther
cyther/project.py
1
2068
""" This module deals with operations regarding individual cyther projects """ import os from .tools import get_input from .pathway import path, ISDIR from .definitions import CACHE_NAME def assure_cache(project_path=None): """ Assure that a project directory has a cache folder. If not, it will create ...
mit
noba3/KoTos
addons/script.module.youtube.dl/lib/youtube_dl/extractor/firstpost.py
124
1785
from __future__ import unicode_literals from .common import InfoExtractor class FirstpostIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?firstpost\.com/[^/]+/.*-(?P<id>[0-9]+)\.html' _TEST = { 'url': 'http://www.firstpost.com/india/india-to-launch-indigenous-aircraft-carrier-monday-1025403.html',...
gpl-2.0
zetaops/ulakbus
ulakbus/services/personel/hitap/hizmet_istisnai_ilgi_ekle.py
1
1237
# -*- coding: utf-8 -*- # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. """HITAP Istisnai Ilgi Ekle Hitap'a personelin Istisnai Ilgi bilgilerinin eklemesini yapar. """ from ulakbus.services.personel.hitap.hitap_service im...
gpl-3.0
cernops/rally
tests/unit/plugins/openstack/scenarios/ec2/test_servers.py
15
1232
# 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
callmeonlyashu/MEANJS
node_modules/accessibility-developer-tools/scripts/parse_aria_schemas.py
381
3069
import json import re import urllib import xml.etree.ElementTree as ET def parse_attributes(): schema = urllib.urlopen('http://www.w3.org/MarkUp/SCHEMA/aria-attributes-1.xsd') tree = ET.parse(schema) for node in tree.iter(): node.tag = re.sub(r'{.*}', r'', node.tag) type_map = { 'stat...
mit
Teagan42/home-assistant
homeassistant/components/modem_callerid/sensor.py
5
3580
"""A sensor for incoming calls using a USB modem that supports caller ID.""" import logging from basicmodem.basicmodem import BasicModem as bm import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_DEVICE, CONF_NAME, EVENT_HOMEASSISTANT_...
apache-2.0
telefonicaid/fiware-sdc
test/acceptance/commons/provisioning_steps.py
2
8547
__author__ = 'jfernandez' from lettuce import step, world from commons.rest_utils import RestUtils from commons.utils import body_model_to_body_request, response_body_to_dict, generate_product_instance_id, \ wait_for_task_finished from commons.constants import * from commons.configuration import CONFIG_VM_HOSTNAME...
apache-2.0
Neurosim-lab/netpyne
doc/source/conf.py
1
8550
# -*- coding: utf-8 -*- # # netpyne_doc documentation build configuration file, created by # sphinx-quickstart on Tue Dec 29 13:37:18 2015. # # 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. #...
mit
saurabhbajaj207/CarpeDiem
venv/Lib/site-packages/pip/_vendor/lockfile/mkdirlockfile.py
536
3096
from __future__ import absolute_import, division import time import os import sys import errno from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class MkdirLockFile(LockBase): """Lock file by creating a directory.""" def __init__(self, path, threaded=True,...
mit
oy-vey/algorithms-and-data-structures
6-GenomeAssemblyProgrammingChallenge/Week2/universal_bstring.py
1
3197
# python3 import queue class Edge: def __init__(self, u, v, value): self.u = u self.v = v self.value = value class Graph: def __init__(self): self.edges = [] #self.incoming_edges = [] self.graph = dict () #[[] for _ in range(n)] # self.incoming_graph =...
mit
Azure/azure-sdk-for-python
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_resource_management_client.py
1
6210
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
jmankoff/data
Assignments/jmankoff-rss/lib/werkzeug/debug/repr.py
254
9354
# -*- coding: utf-8 -*- """ werkzeug.debug.repr ~~~~~~~~~~~~~~~~~~~ This module implements object representations for debugging purposes. Unlike the default repr these reprs expose a lot more information and produce HTML instead of ASCII. Together with the CSS and JavaScript files of the debug...
gpl-3.0
weblabdeusto/weblabdeusto
tools/wcloud/deploy.py
4
3933
import os import argparse import getpass import sqlalchemy from sqlalchemy.orm import sessionmaker from wcloud import db, app def connect_to_database(user, passwd): """ Connects to the MySQL database using the specified username and password. Assumes the DB is in localhost and listening on port 3306. ...
bsd-2-clause
freakboy3742/django
tests/generic_views/urls.py
21
13825
from django.contrib.auth import views as auth_views from django.contrib.auth.decorators import login_required from django.urls import path, re_path from django.views.decorators.cache import cache_page from django.views.generic import TemplateView, dates from . import views from .models import Book urlpatterns = [ ...
bsd-3-clause
hrashk/sympy
sympy/functions/special/tests/test_zeta_functions.py
13
5241
from sympy import (Symbol, zeta, nan, Rational, Float, pi, dirichlet_eta, log, zoo, expand_func, polylog, lerchphi, S, exp, sqrt, I, exp_polar, polar_lift, O) from sympy.utilities.randtest import (test_derivative_numerically as td, random_complex_number as ran...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow_OpenCV_Nightly/source/tensorflow/python/layers/core.py
4
12444
# 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...
mit
Wuguanping/Server_Manage_Plugin
Openstack_Plugin/ironic-plugin-pike/ironic/drivers/modules/ucs/management.py
4
5632
# Copyright 2015, Cisco Systems. # 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 agr...
apache-2.0
apophys/freeipa
ipaclient/remote_plugins/2_114/misc.py
32
2753
# # Copyright (C) 2016 FreeIPA Contributors see COPYING for license # # pylint: disable=unused-import import six from . import Command, Method, Object from ipalib import api, parameters, output from ipalib.parameters import DefaultFrom from ipalib.plugable import Registry from ipalib.text import _ from ipapython.dn ...
gpl-3.0
vfulco/ansible
v1/ansible/runner/__init__.py
77
69625
# (c) 2012-2014, 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) an...
gpl-3.0
chouseknecht/ansible
lib/ansible/modules/network/cloudengine/ce_bfd_view.py
11
20187
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
SteveHNH/ansible
lib/ansible/modules/network/nxos/nxos_aaa_server.py
22
10872
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
wmanley/stb-tester
tests/validate-ocr.py
1
4119
#!/usr/bin/env python u""" validate-ocr.py can be run on a corpus of test images reporting how good a job stbt has done of reading the text. Thus it can be used to measure improvements to the OCR algorithm and, more importantly, detect any regressions introduced. The corpus consists of a set of images with correspon...
lgpl-2.1
Southpaw-TACTIC/TACTIC
src/pyasm/biz/prod_setting.py
1
5114
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
Endika/website
website_slides/controllers/main.py
10
18112
# -*- coding: utf-8 -*- import base64 import logging import werkzeug from openerp.addons.web import http from openerp.exceptions import AccessError from openerp.http import request from openerp.tools.translate import _ _logger = logging.getLogger(__name__) class WebsiteSlides(http.Controller): _slides_per_page ...
agpl-3.0
burzillibus/RobHome
venv/lib/python2.7/site-packages/dns/rdtypes/IN/A.py
8
1853
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 "...
mit
emijrp/youtube-dl
test/test_age_restriction.py
171
1379
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import try_rm from youtube_dl import YoutubeDL def _download_restricted(url, filename, age): ...
unlicense
binken/robotframework-selenium2library
src/Selenium2Library/keywords/_runonfailure.py
72
2833
from robot.libraries import BuiltIn from keywordgroup import KeywordGroup BUILTIN = BuiltIn.BuiltIn() class _RunOnFailureKeywords(KeywordGroup): def __init__(self): self._run_on_failure_keyword = None self._running_on_failure_routine = False # Public def register_keyword_to_run_on_failu...
apache-2.0
israeltobias/DownMedia
youtube-dl/youtube_dl/extractor/comedycentral.py
33
5341
from __future__ import unicode_literals from .mtv import MTVServicesInfoExtractor from .common import InfoExtractor class ComedyCentralIE(MTVServicesInfoExtractor): _VALID_URL = r'''(?x)https?://(?:www\.)?cc\.com/ (video-clips|episodes|cc-studios|video-collections|shows(?=/[^/]+/(?!full-episodes))) ...
gpl-3.0
vipul-sharma20/oh-mainline
vendor/packages/docutils/test/test_parsers/test_rst/test_TableParser.py
18
6100
#! /usr/bin/env python # coding: utf-8 # $Id: test_TableParser.py 7668 2013-06-04 12:46:30Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Tests for states.py. """ from __init__ import DocutilsTestSupport def suite(): s = DocutilsTestSuppo...
agpl-3.0
factorlibre/l10n-spain
l10n_es_aeat/models/aeat_export_configuration.py
11
5175
# -*- encoding: utf-8 -*- ############################################################################## # # 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 Licens...
agpl-3.0
stutivarshney/Bal-Aveksha
WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/templatetags/static.py
91
4391
from django import template from django.apps import apps from django.utils.encoding import iri_to_uri from django.utils.six.moves.urllib.parse import urljoin register = template.Library() class PrefixNode(template.Node): def __repr__(self): return "<PrefixNode for %r>" % self.name def __init__(self...
gpl-3.0
brchiu/tensorflow
tensorflow/contrib/learn/python/learn/metric_spec.py
42
16838
# 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
naresh21/synergetics-edx-platform
common/lib/xmodule/xmodule/video_module/video_module.py
5
43772
# -*- coding: utf-8 -*- """Video is ungraded Xmodule for support video content. It's new improved video module, which support additional feature: - Can play non-YouTube video sources via in-browser HTML5 video player. - YouTube defaults to HTML5 mode from the start. - Speed changes in both YouTube and non-YouTube video...
agpl-3.0
shabab12/edx-platform
common/test/acceptance/pages/studio/overview.py
9
35446
""" Course Outline page in Studio. """ import datetime from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from selenium.webdriver import ActionChains from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys from ..common.utils import click_cs...
agpl-3.0
highweb-project/highweb-webcl-html5spec
build/android/pylib/local/device/local_device_environment.py
4
4412
# 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. import datetime import logging import os import shutil import tempfile import threading from devil.android import device_blacklist from devil.android import...
bsd-3-clause
kntem/webdeposit
modules/webaccess/lib/external_authentication_ldap.py
25
9330
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## Licens...
gpl-2.0
EducationforKids/e4k
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/flock_tool.py
1835
1748
#!/usr/bin/env python # Copyright (c) 2011 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. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" ...
mit
droark/bitcoin
test/functional/wallet_fallbackfee.py
42
1487
#!/usr/bin/env python3 # Copyright (c) 2017-2018 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 wallet replace-by-fee capabilities in conjunction with the fallbackfee.""" from test_framework.tes...
mit
didrocks/quickly
data/templates/ubuntu-application/test.py
1
1301
#!/usr/bin/python # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2011 Tony Byrne # # This file is part of Quickly ubuntu-application template # #This program is free software: you can redistribute it and/or modify it #under the terms of the GNU General Public License version 3, ...
gpl-3.0
noironetworks/nova
nova/tests/unit/api/openstack/compute/test_extensions.py
27
8620
# Copyright 2013 IBM Corp. # Copyright 2014 NEC Corporation. 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-...
apache-2.0
borysiasty/inasafe
safe/gui/widgets/test/test_dock_regressions.py
1
8222
from unittest import TestCase # this import required to enable PyQt API v2 # noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import from qgis.core import QgsMapLayerRegistry from PyQt4 import QtCore from safe.test.utilities import get_qgis_app QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app(...
gpl-3.0
cfg2015/EPT-2015-2
addons/base_import_module/models/ir_module.py
238
4795
import logging import os import sys import zipfile from os.path import join as opj import openerp from openerp.osv import osv from openerp.tools import convert_file from openerp.tools.translate import _ _logger = logging.getLogger(__name__) MAX_FILE_SIZE = 100 * 1024 * 1024 # in megabytes class view(osv.osv): _...
agpl-3.0
aoakeson/home-assistant
homeassistant/components/switch/vera.py
3
2616
""" Support for Vera switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.vera/ """ import logging import homeassistant.util.dt as dt_util from homeassistant.components.switch import SwitchDevice from homeassistant.const import ( ATTR_ARM...
mit