repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
jnewland/home-assistant
homeassistant/components/glances/sensor.py
3
9346
"""Support gathering system information of hosts which are running glances.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_HOST, CONF_NAME, CONF_PORT, CONF_USERNAME, CONF_PASSWORD, CONF_SS...
apache-2.0
SnabbCo/neutron
neutron/db/migration/alembic_migrations/env.py
1
3054
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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
JimCircadian/ansible
lib/ansible/modules/cloud/amazon/redshift.py
50
17408
#!/usr/bin/python # Copyright 2014 Jens Carl, Hothead Games Inc. # 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', 'stat...
gpl-3.0
lehinevych/cfme_tests
cfme/containers/provider.py
2
9691
from cfme.common.provider import BaseProvider from cfme.fixtures import pytest_selenium as sel from cfme.web_ui import ( Quadicon, Form, AngularSelect, form_buttons, Input, toolbar as tb, InfoBlock, Region ) from cfme.web_ui.menu import nav from cfme.web_ui.tabstrip import TabStripForm from utils import deferred_ve...
gpl-2.0
christophersu/sublime-evernote
lib/markdown2.py
5
101145
#!/usr/bin/env python # Copyright (c) 2012 Trent Mick. # Copyright (c) 2007-2008 ActiveState Corp. # License: MIT (http://www.opensource.org/licenses/mit-license.php) from __future__ import generators r"""A fast and complete Python implementation of Markdown. [from http://daringfireball.net/projects/markdown/] > Mar...
mit
robinro/ansible
lib/ansible/modules/remote_management/hpilo/hponcfg.py
66
2841
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Dag Wieers <dag@wieers.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, ...
gpl-3.0
zork9/pygame-pyMM
bombertoad.py
1
3050
# Copyright (c) 2013 Johan Ceuppens. # All rights reserved. # Redistribution and use in source and binary forms are permitted # provided that the above copyright notice and this paragraph are # duplicated in all such forms and that any documentation, # advertising materials, and other materials related to such # dist...
gpl-2.0
djpnewton/bitcoin
contrib/linearize/linearize-hashes.py
14
3041
#!/usr/bin/env python # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ impor...
mit
kustodian/ansible
lib/ansible/module_utils/storage/hpe3par/hpe3par.py
40
2302
# Copyright: (c) 2018, Hewlett Packard Enterprise Development LP # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from ansible.module_utils import basic def convert_to_binary_multiple(size_with_unit): if size_with_unit is None: return -1 valid...
gpl-3.0
MadsJensen/agency_connectivity
make_df_hilbert_data.py
1
1383
import numpy as np import pandas as pd import scipy.io as sio from my_settings import * data = sio.loadmat("/home/mje/Projects/agency_connectivity/Data/data_all.mat")[ "data_all"] column_keys = ["subject", "trial", "condition", "shift"] result_df = pd.DataFrame(columns=column_keys) for k, subject in enumerate(s...
bsd-3-clause
disconnect3d/pwndbg
pwndbg/commands/next.py
2
3320
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Stepping until an event occurs """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import gdb import pwndbg.commands import pwndbg.next @pwndbg.commands.Command @pwn...
mit
bbengfort/TextBlob
textblob/nltk/parse/featurechart.py
2
22190
# -*- coding: utf-8 -*- # Natural Language Toolkit: Chart Parser for Feature-Based Grammars # # Copyright (C) 2001-2013 NLTK Project # Author: Rob Speer <rspeer@mit.edu> # Peter Ljunglöf <peter.ljunglof@heatherleaf.se> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ Extension of ch...
mit
jdf76/plugin.video.youtube
resources/lib/youtube_plugin/kodion/utils/http_server.py
1
21426
# -*- coding: utf-8 -*- """ Copyright (C) 2018-2018 plugin.video.youtube SPDX-License-Identifier: GPL-2.0-only See LICENSES/GPL-2.0-only for more information. """ from six.moves import BaseHTTPServer from six.moves.urllib.parse import parse_qs, urlparse from six.moves import range import json import os ...
gpl-2.0
Denisolt/IEEE-NYIT-MA
local/lib/python2.7/site-packages/django/contrib/gis/forms/fields.py
504
4316
from __future__ import unicode_literals from django import forms from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.utils.translation import ugettext_lazy as _ from .widgets import OpenLayersWidget class GeometryField(forms.Field): """ This is the basic form field for a Geometry. A...
gpl-3.0
AlbertoPeon/invenio
modules/bibfield/lib/functions/get_number_of_comments.py
24
1054
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
gpl-2.0
schodge/python_koans
python3/contemplate_koans.py
95
1286
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Acknowledgment: # # Python Koans is a port of Ruby Koans originally written by Jim Weirich # and Joe O'brien of Edgecase. There are some differences and tweaks specific # to the Python language, but a great deal of it has been copied wholesale. # So thanks guys! # imp...
mit
m0ppers/arangodb
3rdParty/boost/1.61.0/libs/python/pyste/src/Pyste/SingleCodeUnit.py
54
4355
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) from settings import namespaces import settings from utils import remove_duplicated_line...
apache-2.0
kobejean/tensorflow
tensorflow/python/grappler/tf_optimizer.py
43
1840
# 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
BigBrother1984/android_external_chromium_org
chrome/test/functional/perf/endure_server.py
68
2536
#!/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. """Start an HTTP server which serves Chrome Endure graphs. Usage: python endure_server.py [options] To view Chrome Endure gra...
bsd-3-clause
hellsgate1001/bookit
docs/env/Lib/site-packages/cherrypy/test/test_httpauth.py
12
5768
import cherrypy from cherrypy._cpcompat import md5, sha, ntob from cherrypy.lib import httpauth from cherrypy.test import helper class HTTPAuthTest(helper.CPWebCase): def setup_server(): class Root: def index(self): return "This is public." index.exposed = True ...
mit
sounay/flaminggo-test
onadata/apps/logger/migrations/0041_convert_lng_lat_to_points.py
13
12235
# -*- coding: utf-8 -*- from south.v2 import DataMigration from onadata.apps.logger.models.instance import Instance from onadata.libs.utils.model_tools import queryset_iterator class Migration(DataMigration): def forwards(self, orm): "Parse all instance to add geoms." for obj in queryset_iterato...
bsd-2-clause
DreamerKing/LightweightHtmlWidgets
publish-rc/v1.0/files/Ipy.Lib/encodings/iso8859_14.py
593
13908
""" Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.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,input,errors...
gpl-3.0
pyIMS/pyimzML
pyimzml/ImzMLParser.py
2
24463
# -*- coding: utf-8 -*- # Copyright 2015 Dominik Fay # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
josephsuh/extra-specs
nova/scheduler/multi.py
2
3408
# 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
amandersillinois/landlab
landlab/utils/jaggedarray_ma.py
3
9358
"""Store arrays of variable-length arrays implemented with masked arrays. Implements a MaskedJaggedArray class using numpy masked arrays. Examples -------- Create a MaskedJaggedArray that stores link IDs for the links attached to the nodes of a 3x3 grid. >>> from landlab.utils.jaggedarray_ma import MaskedJaggedArra...
mit
Jollytown/Garuda
server/garuda/lib/python2.7/site-packages/django/conf/locale/pl/formats.py
82
1153
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y' TIME_FORMAT = 'H:i:s' DATE...
mit
colbyga/pychess
lib/pychess/gfx/Pieces.py
22
33741
import re import time import math import cairo from gi.repository import Rsvg from pychess.Utils.const import * from pychess.System import conf from pychess.System.prefix import addDataPrefix from pychess.System.cairoextras import create_cairo_font_face_for_file elemExpr = re.compile(r"([a-zA-Z])\s*([0-9\.,\s]*)\s+|...
gpl-3.0
InnovArul/codesmart
Assignments/Jul-Nov-2017/reinforcement_learning_udemy/rl/monte_carlo_soft_epsilon.py
1
3861
from __future__ import print_function import numpy as np from grid import standard_grid, negative_grid from iterative_policy_evaluation import print_values, print_policy import matplotlib.pyplot as plt from monte_carlo_exploring_starts import max_dict EPS = 1e-4 GAMMA = 0.9 ALL_POSSIBLE_ACTIONS = {'U', 'D', 'L', 'R'} ...
gpl-2.0
frederick-masterton/django
tests/file_uploads/views.py
21
4851
from __future__ import unicode_literals import hashlib import json import os from django.core.files.uploadedfile import UploadedFile from django.http import HttpResponse, HttpResponseServerError from django.utils import six from django.utils.encoding import force_bytes, smart_str from .models import FileModel from ....
bsd-3-clause
kdwink/intellij-community
python/lib/Lib/site-packages/django/contrib/messages/tests/base.py
73
17612
import warnings from django import http from django.test import TestCase from django.conf import settings from django.utils.translation import ugettext_lazy from django.utils.unittest import skipIf from django.contrib.messages import constants, utils, get_level, set_level from django.contrib.messages.api import Messag...
apache-2.0
naturalness/sensibility
sensibility/language/java/__init__.py
1
6245
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright 2017 Eddie Antonio Santos <easantos@ualberta.ca> # # 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/licens...
apache-2.0
edisonlz/fruit
web_project/base/site-packages/django/db/models/__init__.py
107
1423
from functools import wraps from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured from django.db.models.loading import get_apps, get_app_paths, get_app, get_models, get_model, register_models, UnavailableApp from django.db.models.query import Q from django.db.models.expressions import F from djan...
apache-2.0
brextonpham/python-Ultron
imdb/_exceptions.py
128
1663
""" _exceptions module (imdb package). This module provides the exception hierarchy used by the imdb package. Copyright 2004-2009 Davide Alberani <da@erlug.linux.it> 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 Soft...
mit
brianwoo/django-tutorial
build/Django/tests/utils_tests/test_module_loading.py
7
11263
import imp import os import sys import unittest import warnings from importlib import import_module from zipimport import zipimporter from django.core.exceptions import ImproperlyConfigured from django.test import SimpleTestCase, ignore_warnings, modify_settings from django.test.utils import extend_sys_path from djang...
gpl-3.0
brenca/electron
script/dump-symbols.py
22
1970
#!/usr/bin/env python import os import sys from lib.config import PLATFORM from lib.util import electron_gyp, execute, rm_rf SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') CHROMIUM_DIR = os.path.j...
mit
okumura/gyp
tools/pretty_gyp.py
2618
4756
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Pretty-prints the contents of a GYP file.""" import sys import re # Regex to remove comments when we're counting braces. COMMENT_RE = ...
bsd-3-clause
Dandandan/wikiprogramming
jsrepl/extern/python/closured/lib/python2.7/shlex.py
306
11137
# -*- coding: iso-8859-1 -*- """A lexical analyzer class for simple shell-like syntaxes.""" # Module and documentation by Eric S. Raymond, 21 Dec 1998 # Input stacking and error message cleanup added by ESR, March 2000 # push_source() and pop_source() made explicit by ESR, January 2001. # Posix compliance, split(), st...
mit
xjnny/NRPhoto
node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
1843
1786
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
gpl-2.0
postlund/pyatv
tests/support/test_dns.py
1
10011
"""Unit tests for pyatv.support.dns""" import io import typing import pytest from pyatv.support import dns @pytest.mark.parametrize( "name,expected", ( ("_http._tcp.local", (None, "_http._tcp", "local")), ("foo._http._tcp.local", ("foo", "_http._tcp", "local")), ("foo.bar._http._tcp....
mit
Ale-/civics
apps/models/migrations/0028_auto_20170924_1153.py
1
1318
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-09-24 11:53 from __future__ import unicode_literals import apps.models.utils from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('models', '0027_auto_20170922_1554'), ] operations = [ ...
gpl-3.0
sajithaliyanage/Travel_SriLanka
node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
1284
100329
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp imp...
apache-2.0
baixuexue123/djmo
utils/csv_response_.py
1
2274
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import csv import codecs import cStringIO from django.http import StreamingHttpResponse from django.views.generic import View """ 流式响应StreamingHttpResponse可以快速,节省内存地产生一个大型文件 """ class Echo(object): """An object that implements jus...
mit
gunan/tensorflow
tensorflow/python/feature_column/feature_column_v2.py
1
192558
# 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
cynicaldevil/servo
tests/wpt/web-platform-tests/tools/webdriver/webdriver/client.py
17
11863
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import urlparse import error import transport element_key = "element-6066-11e4-a52e-4f735466cecf" def command(func)...
mpl-2.0
megaserg/pants
src/python/pants/util/dirutil.py
4
9209
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import atexit import...
apache-2.0
kmspriyatham/symath
scipy/scipy/stats/tests/test_morestats.py
2
20092
# Author: Travis Oliphant, 2002 # # Further enhancements and tests added by numerous SciPy developers. # from __future__ import division, print_function, absolute_import import warnings from numpy.testing import TestCase, run_module_suite, assert_array_equal, \ assert_almost_equal, assert_array_less, assert_arra...
apache-2.0
apinsard/qtile
libqtile/widget/backlight.py
10
3007
# Copyright (c) 2012 Tim Neumann # Copyright (c) 2012, 2014 Tycho Andersen # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2014 Sean Vig # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software wit...
mit
ClockworkOrigins/m2etis
configurator/quicktest/reporting/direct_null_1m_02-09-13.py
1
2085
__author__ = 'amw' from quicktest.Reporting import plot3d, plot2d, create_dataset, create_plot_matrix # Initialise database config db_config = {"hostname": "localhost", "port": "27017", "db_name": "simulations", "collection_name": "02-09-13"} # Create plot tag = "direct_null_1m_020913" x_param = "parameters.numSubs...
apache-2.0
xujun10110/golismero
tools/sqlmap/plugins/dbms/hsqldb/fingerprint.py
7
5038
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re from lib.core.common import Backend from lib.core.common import Format from lib.core.common import unArrayizeValue from lib.core.data import conf from lib.core.data...
gpl-2.0
YaoQ/faceplusplus-demo
hello.py
1
2906
#!/usr/bin/env python2 # Import system libraries and define helper functions import time import sys import os import os.path from pprint import pformat # First import the API class from the SDK from facepp import API from facepp import File def print_result(hint, result): def encode(obj): if type(obj) is ...
gpl-2.0
noskill/virt-manager
virtManager/connect.py
1
15892
# # Copyright (C) 2006, 2013 Red Hat, Inc. # Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (...
gpl-2.0
wesley1001/formulize
libraries/phpopenid/admin/gettlds.py
126
1061
""" Fetch the current TLD list from the IANA Web site, parse it, and print an expression suitable for direct insertion into each library's trust root validation module Usage: python gettlds.py (php|python|ruby) Then cut-n-paste. """ import urllib2 import sys langs = { 'php': (r"'/\.(", "'", "|", ...
gpl-2.0
RPI-OPENEDX/edx-platform
common/test/acceptance/tests/studio/test_studio_container.py
45
53260
""" Acceptance tests for Studio related to the container page. The container page is used both for displaying units, and for displaying containers within units. """ from nose.plugins.attrib import attr from unittest import skip from ...fixtures.course import XBlockFixtureDesc from ...pages.studio.component_editor impo...
agpl-3.0
sravangottapu/Ip_Scanner
ip_scanner.py
1
1187
import threading import time import os import re import shlex import _thread import sys import subprocess alive = True f = open("list.txt","w") class myThread(threading.Thread): def __init__(self,var,ip): threading.Thread.__init__(self) self.var = var self.ip = ip def run(self): ...
gpl-3.0
mbj4668/pyang
pyang/plugins/threegpp.py
1
11115
"""3GPP usage guidelines plugin See 3GPP TS 32.160 clause 6.2 Copyright Ericsson 2020 Author balazs.lengyel@ericsson.com Revision 2020-11-25 Checks implemented 6.2.1.2 Module name starts with _3gpp- 6.2.1.3 namespace pattern urn:3gpp:sa5:<module-name> 6.2.1.4-a prefix ends with 3gpp 6.2.1.4-b prefix.lengt...
isc
danfairs/django-modelmerge
testproject/testproject/wsgi.py
6
1144
""" WSGI config for testproject project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATIO...
bsd-3-clause
burzillibus/RobHome
venv/lib/python2.7/site-packages/docutils/utils/math/tex2mathml_extern.py
16
5634
#!/usr/bin/env python # -*- coding: utf-8 -*- # :Id: $Id: tex2mathml_extern.py 7861 2015-04-10 23:48:51Z milde $ # :Copyright: © 2015 Günter Milde. # :License: Released under the terms of the `2-Clause BSD license`_, in short: # # Copying and distribution of this file, with or without modification, # are permitt...
mit
shrimpboyho/git.js
emscript/python/2.7.5.1_32bit/Lib/test/test_plistlib.py
79
7403
# Copyright (C) 2003 Python Software Foundation import unittest import plistlib import os import datetime from test import test_support # This test data was generated through Cocoa's NSDictionary class TESTDATA = """<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" \ "http:/...
gpl-2.0
seibert/numba
numba/core/typeconv/castgraph.py
7
4075
from collections import defaultdict from functools import total_ordering import enum class Conversion(enum.IntEnum): """ A conversion kind from one type to the other. The enum members are ordered from stricter to looser. """ # The two types are identical exact = 1 # The two types are of t...
bsd-2-clause
silvio/elbe
elbepack/xmldefaults.py
1
4019
import random import string import sys armel_defaults = { "arch": "armel", "size": "20G", "mem": "256", "interpreter": "qemu-system-arm", "userinterpr": "qemu-arm-static", "console": "ttyAMA0,115200n1", "machine": "versatile...
gpl-3.0
malayaleecoder/servo
tests/wpt/css-tests/tools/manifest/manifest.py
89
12720
import json import os from collections import defaultdict from item import item_types, ManualTest, WebdriverSpecTest, Stub, RefTest, TestharnessTest from log import get_logger from sourcefile import SourceFile from utils import from_os_path, to_os_path CURRENT_VERSION = 2 class ManifestError(Exception): pass ...
mpl-2.0
FreekingDean/home-assistant
homeassistant/components/switch/hook.py
12
4951
""" Support Hook, available at hooksmarthome.com. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.hook/ """ import logging import asyncio import voluptuous as vol import async_timeout import aiohttp from homeassistant.components.switch import (Sw...
mit
bramalingam/bioformats
components/xsd-fu/python/configobj.py
10
85768
# configobj.py # A config file reader/writer that supports nested sections in config files. # Copyright (C) 2005-2009 Michael Foord, Nicola Larosa # E-mail: fuzzyman AT voidspace DOT org DOT uk # nico AT tekNico DOT net # ConfigObj 4 # http://www.voidspace.org.uk/python/configobj.html # Released subject to th...
gpl-2.0
gotomypc/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Tool/sunc++.py
61
4752
"""SCons.Tool.sunc++ Tool-specific initialization for C++ on SunOS / Solaris. 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 (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The ...
apache-2.0
project-magpie/enigma2-openpli
lib/python/Screens/InstallWizard.py
11
5928
from Screens.Screen import Screen from Components.ConfigList import ConfigListScreen, ConfigList from Components.ActionMap import ActionMap from Components.Sources.StaticText import StaticText from Components.config import config, ConfigSubsection, ConfigBoolean, getConfigListEntry, ConfigSelection, ConfigYesNo, Config...
gpl-2.0
TeamLocker/Server
TeamLocker_Server/protobufs/Libsodium_pb2.py
1
3197
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: protobufs/Libsodium.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.protobuf import reflecti...
gpl-3.0
ghchinoy/tensorflow
tensorflow/contrib/distribute/python/tpu_strategy.py
4
1079
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Zhongqilong/mykbengineer
kbe/res/scripts/common/Lib/multiprocessing/pool.py
79
24643
# # Module providing the `Pool` class for managing a process pool # # multiprocessing/pool.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = ['Pool', 'ThreadPool'] # # Imports # import threading import queue import itertools import collections import os import tim...
lgpl-3.0
ThinkingBridge/platform_external_chromium_org
content/browser/gpu/generate_webgl_conformance_test_list.py
38
3326
#!/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. """Auto-generates the WebGL conformance test list header file. Parses the WebGL conformance test *.txt file, which contains a list...
bsd-3-clause
toanalien/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/__init__.py
129
7351
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
macks22/scikit-learn
sklearn/externals/joblib/_memory_helpers.py
303
3605
try: # Available in Python 3 from tokenize import open as open_py_source except ImportError: # Copied from python3 tokenize from codecs import lookup, BOM_UTF8 import re from io import TextIOWrapper, open cookie_re = re.compile("coding[:=]\s*([-\w.]+)") def _get_normal_name(orig_enc): ...
bsd-3-clause
atsao72/sympy
sympy/ntheory/egyptian_fraction.py
63
6082
from __future__ import print_function, division import sympy.polys from sympy import Integer from sympy.core.compatibility import range from fractions import gcd def egyptian_fraction(r, algorithm="Greedy"): """ Return the list of denominators of an Egyptian fraction expansion [1]_ of the said rational `...
bsd-3-clause
Abi1ity/uniclust2.0
flask/lib/python2.7/site-packages/sqlalchemy/util/queue.py
18
7472
# util/queue.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """An adaptation of Py2.3/2.4's Queue module which supports reentrant behavior, using RL...
bsd-3-clause
NeCTAR-RC/python-neutronclient
neutronclient/neutron/v2_0/subnetpool.py
2
5010
# Copyright 2015 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
nichung/wwwflaskBlogrevA
venv/lib/python2.7/site-packages/flask/testsuite/__init__.py
564
7022
# -*- coding: utf-8 -*- """ flask.testsuite ~~~~~~~~~~~~~~~ Tests Flask itself. The majority of Flask is already tested as part of Werkzeug. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import print_function import os import sys im...
mit
ingokegel/intellij-community
python/helpers/py2only/docutils/writers/manpage.py
113
35660
# -*- coding: utf-8 -*- # $Id: manpage.py 7628 2013-03-09 10:19:35Z grubert $ # Author: Engelbert Gruber <grubert@users.sourceforge.net> # Copyright: This module is put into the public domain. """ Simple man page writer for reStructuredText. Man pages (short for "manual pages") contain system documentation on unix-li...
apache-2.0
farjump/gnu-binutils
gdb/testsuite/gdb.perf/single-step.py
46
1269
# Copyright (C) 2013-2015 Free Software Foundation, 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 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
Hao-Liu/tp-libvirt
libguestfs/tests/guestmount.py
8
2688
import logging import os from autotest.client.shared import error, utils from virttest import data_dir, utils_test def umount_fs(mountpoint): if os.path.ismount(mountpoint): result = utils.run("umount -l %s" % mountpoint, ignore_status=True) if result.exit_status: logging.debug("Umount...
gpl-2.0
JieC/StockCheck
lib/bottle.py
30
149580
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Bottle is a fast and simple micro-framework for small web applications. It offers request dispatching (Routes) with url parameter support, templates, a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and template engines - all in a single file an...
apache-2.0
manipopopo/tensorflow
tensorflow/contrib/autograph/core/naming.py
14
4248
# 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
scs/uclinux
user/python/python-2.4.4/Lib/plat-mac/lib-scriptpackages/_builtinSuites/builtin_Suite.py
8
4589
"""Suite builtin_Suite: Every application supports open, reopen, print, run, and quit Level 1, version 1 """ import aetools import MacOS _code = 'aevt' class builtin_Suite_Events: def open(self, _object, _attributes={}, **_arguments): """open: Open the specified object(s) Required argument: list...
gpl-2.0
dan-zilla/upfirdn
upfirdn/test_upfirdn.py
11
8668
# Copyright (c) 2009, Motorola, Inc # # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions a...
bsd-3-clause
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v2_7_0/device_group_member_broker.py
17
41061
from ..broker import Broker class DeviceGroupMemberBroker(Broker): controller = "device_group_members" def show(self, **kwargs): """Shows the details for the specified device group member. **Inputs** | ``api version min:`` None | ``api version max:`` None ...
apache-2.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/jedi/evaluate/representation.py
3
22114
""" Like described in the :mod:`jedi.parser.tree` module, there's a need for an ast like module to represent the states of parsed modules. But now there are also structures in Python that need a little bit more than that. An ``Instance`` for example is only a ``Class`` before it is instantiated. This class represents ...
gpl-3.0
pwoodworth/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/tests/permissions.py
231
1654
try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.contrib.auth.management import create_permissions from django.contrib.auth import models as auth_models from django.contrib.contenttypes import models as contenttypes_models from django.core.management import call...
apache-2.0
pipsiscool/audacity
lib-src/lv2/sratom/waflib/Tools/compiler_cxx.py
343
1762
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys,imp,types from waflib.Tools import ccroot from waflib import Utils,Configure from waflib.Logs import debug cxx_compiler={'win32':['msvc','g++'],'cygwin':['g++'],...
mit
bobcyw/django
django/db/models/sql/subqueries.py
93
8020
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db import connections from django.db.models.query_utils import Q from django.db.models.sql.constants import ( CURSOR, GET_ITERATOR_CHUNK_SIZE, NO_RESULTS, ) from django...
bsd-3-clause
shaarli/python-shaarli-client
setup.py
1
2012
#!/usr/bin/env python3 """Setup script for shaarli-client""" import codecs import os import re from setuptools import find_packages, setup def get_long_description(): """Reads the main README.rst to get the program's long description""" with codecs.open('README.rst', 'r', 'utf-8') as f_readme: return...
mit
linkedin/indextank-service
storefront/thrift/transport/THttpClient.py
62
3603
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
cnoviello/micropython
tests/bytecode/pylib-tests/tabnanny.py
28
11399
#! /usr/bin/env python3 """The Tab Nanny despises ambiguous indentation. She knows no mercy. tabnanny -- Detection of ambiguous indentation For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function check() described below. Warning: The...
mit
pandeyop/rally
tests/unit/test_osclients.py
2
22887
# Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
LeZuse/psd-tools
tests/test_pixels.py
8
5675
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import pytest from psd_tools import PSDImage, Layer, Group from .utils import full_name PIXEL_COLORS = ( # filename probe point pixel value ('1layer.psd', (5, 5), (0x27, 0xBA, 0x0F)), (...
mit
makielab/django-oscar
sites/demo/apps/bigbang/utils.py
8
3186
from decimal import Decimal as D import datetime from django.db.transaction import commit_on_success from oscar.apps.dashboard.reports.csv_utils import CsvUnicodeReader from oscar.apps.catalogue import models, categories from oscar.apps.partner import models as partner_models class Importer(object): """ Quic...
bsd-3-clause
theguardian/JIRA-APPy
cherrypy/test/modpy.py
28
5021
"""Wrapper for mod_python, for use as a CherryPy HTTP server when testing. To autostart modpython, the "apache" executable or script must be on your system path, or you must override the global APACHE_PATH. On some platforms, "apache" may be called "apachectl" or "apache2ctl"-- create a symlink to them if needed. If ...
gpl-2.0
phoebusliang/parallel-lettuce
tests/integration/lib/Django-1.3/django/dispatch/dispatcher.py
315
9292
import weakref import threading from django.dispatch import saferef WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref) def _make_id(target): if hasattr(target, 'im_func'): return (id(target.im_self), id(target.im_func)) return id(target) class Signal(object): """ Base class ...
gpl-3.0
kritzware/PyBot
modules/timer.py
2
1722
import logging, coloredlogs from threading import Thread import time from random import choice from modules.config import * from modules.commandtext import auto_messages from modules.database import Database from modules.api import API database = Database(db_host, db_user, db_pass, db_name, db_autocommit) database.da...
mit
viralpandey/kivy
examples/settings/main.py
18
3788
""" Config Example ============== This file contains a simple example of how the use the Kivy settings classes in a real app. It allows the user to change the caption and font_size of the label and stores these changes. When the user next runs the programs, their changes are restored. """ from kivy.app import App f...
mit
de-tour/detour
server/handling.py
1
6094
import cherrypy from cherrypy.lib.static import serve_file from cherrypy.process.plugins import SimplePlugin from queue import Queue, Empty from collections import namedtuple from concurrent import Crawler import parsing import json import traceback import random from urllib.parse import unquote from ws4py.websocket i...
gpl-3.0
probablytom/tomwallis.net
venv/lib/python2.7/site-packages/setuptools/command/setopt.py
458
5080
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import distutils import os from setuptools import Command __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename of the distutils, lo...
artistic-2.0
sander76/home-assistant
tests/components/control4/test_config_flow.py
5
6182
"""Test the Control4 config flow.""" import datetime from unittest.mock import AsyncMock, patch from pyControl4.account import C4Account from pyControl4.director import C4Director from pyControl4.error_handling import Unauthorized from homeassistant import config_entries, setup from homeassistant.components.control4....
apache-2.0