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
BigBrother1984/android_external_chromium_org
tools/telemetry/telemetry/page/page_measurement_unittest.py
29
5887
# 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. import json import os from telemetry.core import wpr_modes from telemetry.page import page_measurement from telemetry.page import page_measurement_unitte...
bsd-3-clause
shootstar/novatest
nova/api/openstack/compute/plugins/v3/services.py
3
7079
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 IBM Corp. # # 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 # # ...
apache-2.0
PaloAltoNetworks/minemeld-core
minemeld/chassis.py
1
6761
# Copyright 2015-2016 Palo Alto Networks, 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...
apache-2.0
diorcety/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/it/util.py
436
1807
from django.utils.encoding import smart_str, smart_unicode def ssn_check_digit(value): "Calculate Italian social security number check digit." ssn_even_chars = { '0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': ...
apache-2.0
millken/kaman
vendor/github.com/ugorji/go/codec/test.py
1138
3876
#!/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: # sudo apt-get install python-dev # sudo apt-g...
mit
apporc/nova
nova/tests/unit/pci/fakes.py
79
1156
# Copyright (c) 2014 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 ...
apache-2.0
myDevicesIoT/Cayenne-Agent
myDevices/devices/digital/__init__.py
1
4181
# Copyright 2012-2013 Eric Ptak - trouch.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 l...
mit
alanjw/GreenOpenERP-Win-X86
python/Lib/site-packages/win32comext/shell/demos/viewstate.py
4
1862
""" Demonstrates how to propagate a folder's view state to all its subfolders The format of the ColInfo stream is apparently undocumented, but it can be read raw from one folder and copied to another's view state. """ from win32com.shell import shell, shellcon import pythoncom import os, sys template_folder...
agpl-3.0
DMLoy/ECommerceBasic
lib/python2.7/site-packages/django/core/management/validation.py
103
23002
import collections import sys from django.conf import settings from django.core.management.color import color_style from django.utils.encoding import force_str from django.utils.itercompat import is_iterable from django.utils import six class ModelErrorCollection: def __init__(self, outfile=sys.stdout): ...
mit
huiren/ece511
src/mem/slicc/ast/StallAndWaitStatementAST.py
26
2362
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # Copyright (c) 2010 Advanced Micro Devices, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following ...
bsd-3-clause
v1bri/gnuradio
gnuradio-runtime/python/gnuradio/gr/qa_flowgraph.py
15
1694
#!/usr/bin/env python # # Copyright 2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
suncycheng/intellij-community
python/lib/Lib/site-packages/django/contrib/flatpages/views.py
295
2613
from django.contrib.flatpages.models import FlatPage from django.template import loader, RequestContext from django.shortcuts import get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.conf import settings from django.core.xheaders import populate_xheaders from django.utils.safestri...
apache-2.0
palful/yambopy
yambopy/dbs/wfdb.py
1
3127
from yambopy import * import numpy as np import shutil import os from netCDF4 import Dataset def abs2(x): return x.real**2 + x.imag**2 class YamboWFDB(): def __init__(self,savedb,path=None,save='SAVE',filename='ns.wf'): """ load wavefunction from yambo """ if path is None: ...
bsd-3-clause
EvgeneOskin/taiga-back
taiga/userstorage/permissions.py
21
1037
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
agpl-3.0
snf/servo
python/toml/toml.py
29
15580
import datetime, decimal, re try: _range = xrange except NameError: unicode = str _range = range basestring = str unichr = chr def load(f): """Returns a dictionary containing the named file parsed as toml.""" if isinstance(f, basestring): with open(f) as ffile: return l...
mpl-2.0
pjg101/SickRage
lib/tvdb_api/tvdb_exceptions.py
61
1382
#!/usr/bin/env python2 #encoding:utf-8 #author:dbr/Ben #project:tvdb_api #repository:http://github.com/dbr/tvdb_api #license:unlicense (http://unlicense.org/) """Custom exceptions used or raised by tvdb_api """ __author__ = "dbr/Ben" __version__ = "1.9" __all__ = ["tvdb_error", "tvdb_userabort", "tvdb_shownotfound",...
gpl-3.0
josdaza/deep-toolbox
PyTorch/Seq2Seq/evaluator.py
1
2200
import torch import torch.nn as nn from torch.autograd import Variable from torch import optim use_cuda = torch.cuda.is_available() def evaluate(config_params, encoder, decoder, sentence): SOS_TOKEN = int(config_params["RNN"]["sos_token"]) EOS_TOKEN = int(config_params["RNN"]["eos_token"]) max_length = int...
mit
apple/llvm-project
lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_static_config/TestSVERegisters.py
7
5527
""" Test the AArch64 SVE registers. """ import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class RegisterCommandsTestCase(TestBase): def check_sve_register_size(self, set, name, expected): reg_value = set.GetChildMemberWithName(n...
apache-2.0
tylerjereddy/scipy
scipy/optimize/_lsq/lsq_linear.py
12
12602
"""Linear least squares with bound constraints on independent variables.""" import numpy as np from numpy.linalg import norm from scipy.sparse import issparse, csr_matrix from scipy.sparse.linalg import LinearOperator, lsmr from scipy.optimize import OptimizeResult from .common import in_bounds, compute_grad from .trf...
bsd-3-clause
grilo/ansible-1
lib/ansible/modules/monitoring/pagerduty.py
29
9095
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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.1', ...
gpl-3.0
kampanita/pelisalacarta
python/main-classic/lib/requests/packages/chardet/constants.py
3008
1335
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
Opentrons/labware
api/src/opentrons/util/vector.py
3
5955
import math import json from builtins import property as _property, tuple as _tuple from operator import itemgetter as _itemgetter from collections import OrderedDict class VectorValue(tuple): """ # from collections import namedtuple # value_type = namedtuple('VectorValue', ['x', 'y', 'z']) """ ...
apache-2.0
evansd/django
django/conf/__init__.py
27
7439
""" Settings and configuration for Django. Read values from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global_settings.py for a list of all possible variables. """ import importlib import os import time import warnings from django.conf ...
bsd-3-clause
gjreda/pelican-plugins
liquid_tags/giphy.py
273
2433
""" Giphy Tag --------- This implements a Liquid-style Giphy tag for Pelican. IMPORTANT: You have to request a production API key from giphy `here <https://api.giphy.com/submit>`. For the first runs you could also use the public beta key you can get `here <https://github.com/giphy/GiphyAPI>`. Syntax ------ {% giphy ...
agpl-3.0
RapidApplicationDevelopment/tensorflow
tensorflow/contrib/rnn/python/ops/rnn_cell.py
3
52538
# 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
rclmenezes/sqlalchemy
lib/sqlalchemy/orm/collections.py
9
54176
# orm/collections.py # Copyright (C) 2005-2013 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 """Support for collections of mapped entities. The collections package supplies th...
mit
miyosuda/intro-to-dl-android
HandWriting/jni-build/jni/include/tensorflow/python/platform/app.py
11
1277
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
doselect/django-tastypie
tests/core/tests/throttle.py
12
6446
import mock import time from django.core.cache import cache from django.test import TestCase from django.utils.encoding import force_text from tastypie.models import ApiAccess from tastypie.throttle import BaseThrottle, CacheThrottle, CacheDBThrottle class NoThrottleTestCase(TestCase): def test_init(self): ...
bsd-3-clause
moble/sympy
sympy/polys/tests/test_groebnertools.py
85
18116
"""Tests for Groebner bases. """ from sympy.polys.groebnertools import ( groebner, sig, sig_key, lbp, lbp_key, critical_pair, cp_key, is_rewritable_or_comparable, Sign, Polyn, Num, s_poly, f5_reduce, groebner_lcm, groebner_gcd, ) from sympy.polys.fglmtools import _representing_matrices from sympy....
bsd-3-clause
Maccimo/intellij-community
python/helpers/py3only/docutils/utils/math/__init__.py
160
1683
# :Id: $Id: __init__.py 7218 2011-11-08 17:42:40Z milde $ # :Author: Guenter 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 permitted in any medium without royalty provided the copyright # noti...
apache-2.0
buntyke/Flask
microblog/flask/lib/python2.7/site-packages/pip/_vendor/html5lib/inputstream.py
435
31665
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from pip._vendor.six.moves import http_client import codecs import re from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase from .constants import encodings, ReparseException from . import util...
mit
fbradyirl/home-assistant
homeassistant/components/zwave/switch.py
4
2065
"""Support for Z-Wave switches.""" import logging import time from homeassistant.core import callback from homeassistant.components.switch import DOMAIN, SwitchDevice from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import ZWaveDeviceEntity, workaround _LOGGER = logging.getLogger(__name__) ...
apache-2.0
fbradyirl/home-assistant
homeassistant/components/rpi_camera/camera.py
4
5173
"""Camera platform that has a Raspberry Pi camera.""" import os import subprocess import logging import shutil from tempfile import NamedTemporaryFile import voluptuous as vol from homeassistant.components.camera import Camera, PLATFORM_SCHEMA from homeassistant.const import CONF_NAME, CONF_FILE_PATH, EVENT_HOMEASSIS...
apache-2.0
cuboxi/android_external_chromium_org
tools/cr/cr/targets/target.py
23
4435
# 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. """Module to hold the Target plugin.""" import operator import re import cr DEFAULT = cr.Config.From( CR_DEFAULT_TARGET='chrome', ) class Target(cr.C...
bsd-3-clause
shsingh/ansible
test/support/integration/plugins/modules/mysql_user.py
24
31504
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Mark Theunissen <mark.theunissen@gmail.com> # Sponsored by Four Kitchens http://fourkitchens.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_functi...
gpl-3.0
naokimiyasaka/sublime-text
Packages/Package Control/package_control/commands/upgrade_package_command.py
9
2594
import threading import sublime import sublime_plugin from ..show_error import show_error from ..thread_progress import ThreadProgress from ..package_installer import PackageInstaller, PackageInstallerThread from ..package_renamer import PackageRenamer class UpgradePackageCommand(sublime_plugin.WindowCommand): ...
mit
ZolaIII/android_kernel_synopsis_nightly
tools/perf/scripts/python/net_dropmonitor.py
4235
1554
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
fffonion/xeHentai
xeHentai/i18n/zh_hans.py
1
7970
# coding:utf-8 from ..const import * err_msg = { ERR_URL_NOT_RECOGNIZED: "网址不够绅士", ERR_CANT_DOWNLOAD_EXH: "需要登录后才能下载里站", ERR_ONLY_VISIBLE_EXH: "这个本子只有里站能看到", ERR_MALFORMED_HATHDL: "hathdl文件有猫饼,解析失败", ERR_GALLERY_REMOVED: "这个本子被移除了,大概里站能看到", ERR_KEY_EXPIRED: "下载链接不太正常", ERR_NO_PAGEURL_FOUND...
gpl-3.0
lisael/pg-django
tests/modeltests/model_package/tests.py
150
2612
from __future__ import absolute_import from django.contrib.sites.models import Site from django.db import models from django.test import TestCase from .models.publication import Publication from .models.article import Article class Advertisment(models.Model): customer = models.CharField(max_length=100) publ...
bsd-3-clause
jseabold/scipy
scipy/__init__.py
62
4048
""" SciPy: A scientific computing package for Python ================================================ Documentation is available in the docstrings and online at http://docs.scipy.org. Contents -------- SciPy imports all the functions from the NumPy namespace, and in addition provides: Subpackages ----------- Using a...
bsd-3-clause
Amechi101/concepteur-market-app
venv/lib/python2.7/site-packages/django/conf/locale/en/formats.py
233
1814
# -*- 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 = 'N j, Y' TIME_FORMAT = 'P' DATETIM...
mit
collective/fourdigits.portlet.keywordrelated
bootstrap.py
1
10500
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFT...
gpl-2.0
fabian4/trove
trove/db/sqlalchemy/migrate_repo/versions/005_heartbeat.py
10
1459
# Copyright 2011 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
w1ll1am23/home-assistant
homeassistant/components/vallox/__init__.py
26
8917
"""Support for Vallox ventilation units.""" from datetime import timedelta import ipaddress import logging from vallox_websocket_api import PROFILE as VALLOX_PROFILE, Vallox from vallox_websocket_api.constants import vlxDevConstants from vallox_websocket_api.exceptions import ValloxApiException import voluptuous as v...
apache-2.0
nicklhy/mxnet
example/speech_recognition/singleton.py
41
1708
# 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
yuchangfu/pythonfun
packages/markupsafe/tests.py
674
6107
# -*- coding: utf-8 -*- import gc import sys import unittest from markupsafe import Markup, escape, escape_silent from markupsafe._compat import text_type class MarkupTestCase(unittest.TestCase): def test_adding(self): # adding two strings should escape the unsafe one unsafe = '<script type="appl...
gpl-3.0
Distrotech/xbmc
lib/gtest/scripts/pump.py
603
23316
#!/usr/bin/env python # # Copyright 2008, 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...
gpl-2.0
tumbl3w33d/ansible
lib/ansible/module_utils/gce.py
187
2535
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
0x73/tornado
tornado/test/auth_test.py
60
18885
# These tests do not currently do much to verify the correct implementation # of the openid/oauth protocols, they just exercise the major code paths # and ensure that it doesn't blow up (e.g. with unicode/bytes issues in # python 3) from __future__ import absolute_import, division, print_function, with_statement from...
apache-2.0
minhphung171093/GreenERP
openerp/addons/stock/__openerp__.py
18
3176
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Inventory Management', 'version': '1.1', 'summary': 'Inventory, Logistics, Warehousing', 'description': """ Manage multi-warehouses, multi- and structured stock locations ======================...
gpl-3.0
jath03/projects
local/Python server-client/MyServer.py
1
2622
from http.server import BaseHTTPRequestHandler, HTTPServer import threading, pickle, re, subprocess class MyHandler(BaseHTTPRequestHandler): def do_GET(self): f_type_map = {'.html': 'text/html', '.css': 'text/css', '.ico': 'image/x-icon', '.jpg': 'image/jpeg', '.png': 'image/png', '.gif': 'image/gif', ...
mit
mjudsp/Tsallis
examples/plot_isotonic_regression.py
303
1767
""" =================== Isotonic Regression =================== An illustration of the isotonic regression on generated data. The isotonic regression finds a non-decreasing approximation of a function while minimizing the mean squared error on the training data. The benefit of such a model is that it does not assume a...
bsd-3-clause
philotas/opencaster
code/libs/dvbobjects/dvbobjects/PSI/TVCT.py
5
2485
#! /usr/bin/env python # This file is part of the dvbobjects library. # # Copyright 2010-2013 Lorenzo Pallara l.pallara@avalpa.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 vers...
gpl-2.0
banmoy/ns3
src/csma/bindings/modulegen__gcc_LP64.py
38
400689
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
dyhpoon/yowsup
yowsup/layers/protocol_groups/protocolentities/iq_groups_participants_add.py
61
1089
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .iq_groups_participants import ParticipantsGroupsIqProtocolEntity class AddParticipantsIqProtocolEntity(ParticipantsGroupsIqProtocolEntity): ''' <iq type="set" id="{{id}}" xmlns="w:g2", to="{{group_jid}}"> <add> <participant j...
gpl-3.0
epssy/hue
desktop/core/ext-py/Django-1.6.10/django/conf/locale/ml/formats.py
233
1814
# -*- 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 = 'N j, Y' TIME_FORMAT = 'P' DATETIM...
apache-2.0
barzan/dbseer
middleware_old/dstat_for_server/plugins/dstat_top_oom.py
3
1754
### Author: Dag Wieers <dag@wieers.com> ### Dstat most expensive process plugin ### Displays the name of the most expensive process ### More information: ### http://lwn.net/Articles/317814/ class dstat_plugin(dstat): def __init__(self): self.name = 'out of memory' self.vars = ('kill score',) ...
apache-2.0
jelugbo/ddi
common/djangoapps/course_modes/views.py
6
8464
""" Views for the course_mode module """ import decimal from django.core.urlresolvers import reverse from django.http import HttpResponseBadRequest from django.shortcuts import redirect from django.views.generic.base import View from django.utils.translation import ugettext as _ from django.contrib.auth.decorators imp...
agpl-3.0
wbyne/QGIS
python/plugins/processing/algs/lidar/fusion/ASCII2DTM.py
5
3565
# -*- coding: utf-8 -*- """ *************************************************************************** ASCII2DTM.py --------------------- Date : May 2014 Copyright : (C) 2014 by Niccolo' Marchi Email : sciurusurbanus at hotmail dot it *********************...
gpl-2.0
pietern/caffe2
caffe2/python/layers/semi_random_features.py
4
6625
# Copyright (c) 2016-present, Facebook, 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...
apache-2.0
KlausTrainer/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Platform/hpux.py
61
1771
"""engine.SCons.Platform.hpux Platform-specific initialization for HP-UX systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 200...
apache-2.0
p0psicles/SickRage
lib/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
gpl-3.0
obnoxxx/samba
lib/tevent/bindings.py
30
3801
#!/usr/bin/python # # Python integration for tevent - tests # # Copyright (C) Jelmer Vernooij 2010 # # ** NOTE! The following LGPL license applies to the tevent # ** library. This does NOT imply that all of Samba is released # ** under the LGPL # # This library is free software; you can redistribute i...
gpl-3.0
popazerty/e2-gui
lib/python/Plugins/Extensions/IniAirPlayer/mediabackends/BaseMediaBackend.py
4
3238
# 2013.05.22 09:49:57 UTC #Embedded file name: /usr/lib/enigma2/python/Plugins/Extensions/IniAirPlayer/mediabackends/BaseMediaBackend.py import base64 import urllib2 class BaseMediaBackend(object): def __init__(self, host = None, port = None, username = None, password = None): self._host = host se...
gpl-2.0
tunneln/CarnotKE
jyhton/lib-python/2.7/test/test_colorsys.py
220
2844
import unittest, test.test_support import colorsys def frange(start, stop, step): while start <= stop: yield start start += step class ColorsysTest(unittest.TestCase): def assertTripleEqual(self, tr1, tr2): self.assertEqual(len(tr1), 3) self.assertEqual(len(tr2), 3) se...
apache-2.0
alirizakeles/zato
code/zato-web-admin/src/zato/admin/web/views/channel/amqp.py
1
3812
# -*- coding: utf-8 -*- """ Copyright (C) 2011 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib import logging from traceback import format_exc # Django from django.ht...
gpl-3.0
ssorgatem/qiime
scripts/split_libraries_fastq.py
11
19913
#!/usr/bin/env python # File created on 07 Jun 2011 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Greg Caporaso", "Emily TerAvest", "Yoshiki Vazquez Baeza", "Rob Knight"] __license__ = "GPL" __version__ = "1.9.1-dev" __ma...
gpl-2.0
javiergarridomellado/Empresa_django
devcodela/lib/python2.7/site-packages/django/contrib/auth/tests/handlers.py
100
2782
from __future__ import unicode_literals from django.contrib.auth.handlers.modwsgi import check_password, groups_for_user from django.contrib.auth.models import User, Group from django.contrib.auth.tests import CustomUser from django.contrib.auth.tests.utils import skipIfCustomUser from django.test import TransactionTe...
gpl-2.0
bbc/kamaelia
Sketches/MPS/Random/Chatterbox.py
3
1806
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Ver...
apache-2.0
albertomurillo/ansible
test/units/modules/network/f5/test_bigip_management_route.py
16
3742
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks 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 import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
apache/bigtop
bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/10-bind-address.py
10
5051
#!/usr/bin/python3 # 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...
apache-2.0
brunobord/critica
apps/archives/views.py
1
2991
# -*- coding: utf-8 -*- """ Views of ``critica.apps.archives`` application. """ from django.shortcuts import render_to_response from django.template import RequestContext from django.core.exceptions import ObjectDoesNotExist from django.core.paginator import Paginator from django.core.paginator import InvalidPage fro...
gpl-3.0
aequitas/home-assistant
homeassistant/components/zwave/__init__.py
1
43527
"""Support for Z-Wave.""" import asyncio import copy from importlib import import_module import logging from pprint import pprint import voluptuous as vol from homeassistant import config_entries from homeassistant.core import callback, CoreState from homeassistant.helpers import discovery from homeassistant.helpers....
apache-2.0
JeyZeta/Dangerous
Dangerous/Weevely/modules/net/ifaces.py
3
1768
from core.module import Module from core.moduleexception import ModuleException, ProbeException from core.argparse import ArgumentParser from external.ipaddr import IPNetwork import re WARN_NO_OUTPUT = 'No execution output' WARN_NO_IFACES = 'No interfaces address found' class Ifaces(Module): '''Print interfaces ...
mit
graysonc/vim
bundle/conque_2.3/autoload/conque_term/conque.py
30
35239
# FILE: autoload/conque_term/conque.py # AUTHOR: Nico Raffo <nicoraffo@gmail.com> # WEBSITE: http://conque.googlecode.com # MODIFIED: 2011-09-02 # VERSION: 2.3, for Vim 7.0 # LICENSE: # Conque - Vim terminal/console emulator # Copyright (C) 2009-2011 Nico Raffo # # MIT License # # Permission is hereby granted,...
mit
msmania/grpc
src/python/grpcio_tests/tests/interop/_intraop_test_case.py
16
1918
# Copyright 2015 gRPC 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 applicable law or agreed to in writing...
apache-2.0
dgdell/enigma2
lib/python/Screens/TimerEntry.py
11
22913
from Screen import Screen import ChannelSelection from ServiceReference import ServiceReference from Components.config import config, ConfigSelection, ConfigText, ConfigSubList, ConfigDateTime, ConfigClock, ConfigYesNo, getConfigListEntry from Components.ActionMap import NumberActionMap from Components.ConfigList impor...
gpl-2.0
BiaDarkia/scikit-learn
sklearn/kernel_ridge.py
16
6766
"""Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression.""" # Authors: Mathieu Blondel <mathieu@mblondel.org> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from .base import BaseEstimator, RegressorMixin from .metrics.pairwise import pairwise...
bsd-3-clause
exelearning/iteexe
twisted/test/test_util.py
16
11459
# -*- test-case-name: twisted.test.test_util -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.python import util from twisted.python.runtime import platformType import os.path, sys import shutil, errno class UtilTestCase(unittest.T...
gpl-2.0
kubum/elasticsearch
dev-tools/create_bwc_repo_with_ancient_indices.py
92
2753
import create_bwc_index import logging import os import shutil import subprocess import sys import tempfile def fetch_version(version): logging.info('fetching ES version %s' % version) if subprocess.call([sys.executable, os.path.join(os.path.split(sys.argv[0])[0], 'get-bwc-version.py'), version]) != 0: raise R...
apache-2.0
adamchainz/ansible
lib/ansible/modules/packaging/os/sorcery.py
71
20890
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015-2016, Vlad Glagolev <scm@vaygr.net> # # 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
Luindil/Glassure
glassure/gui/widgets/control/transfer.py
1
3814
# -*- coding: utf-8 -*- from ...qt import QtWidgets, QtCore from ..custom import FlatButton, HorizontalLine, LabelAlignRight class TransferFunctionWidget(QtWidgets.QWidget): def __init__(self, *args): super(TransferFunctionWidget, self).__init__(*args) self.create_widgets() self.create_...
mit
TemplateVoid/mapnik
tests/python_tests/ogr_and_shape_geometries_test.py
2
1868
#!/usr/bin/env python from nose.tools import * from utilities import execution_path, run_all import os, sys, glob, mapnik def setup(): # All of the paths used are relative, if we run the tests # from another directory we need to chdir() os.chdir(execution_path('.')) # TODO - fix truncation in shapefile...
lgpl-2.1
HousekeepLtd/django
django/contrib/admindocs/urls.py
574
1183
from django.conf.urls import url from django.contrib.admindocs import views urlpatterns = [ url('^$', views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'), name='django-admindocs-docroot'), url('^bookmarklets/$', views.BookmarkletsView.as_view(), name='django-ad...
bsd-3-clause
hectord/lettuce
tests/integration/lib/Django-1.3/django/middleware/transaction.py
447
1090
from django.db import transaction class TransactionMiddleware(object): """ Transaction middleware. If this is enabled, each view function will be run with commit_on_response activated - that way a save() doesn't do a direct commit, the commit is done when a successful response is created. If an exc...
gpl-3.0
nuncjo/odoo
addons/account/project/wizard/__init__.py
427
1337
# -*- 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
fduraffourg/servo
tests/wpt/web-platform-tests/tools/py/py/_io/saferepr.py
273
2483
import py import sys builtin_repr = repr reprlib = py.builtin._tryimport('repr', 'reprlib') class SafeRepr(reprlib.Repr): """ subclass of repr.Repr that limits the resulting size of repr() and includes information on exceptions raised during the call. """ def repr(self, x): return self._c...
mpl-2.0
lukeiwanski/tensorflow
tensorflow/contrib/lite/toco/python/toco_from_protos_test.py
15
3894
# 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
willie01ar/virtualagc
Tools/binsourcer.py
10
8481
# # Python program to aid entering AGC binsource. # # Jim Lawton 2009-10-09 # # binsource files are in the form of blocks of 5-digit octal numbers, # 8 per line, 4 lines per block, 8 blocks per page, 4 pages per bank. # Example: # # 50026 30001 30027 02177 50026 30001 30027 02034 # 50026 30001 30027 02630 50...
gpl-2.0
mdaniel/intellij-community
plugins/hg4idea/testData/bin/hgext/mq.py
90
134782
# mq.py - patch queues for mercurial # # Copyright 2005, 2006 Chris Mason <mason@suse.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''manage a stack of patches This extension lets you work with a stack of patches in a Mer...
apache-2.0
sauloal/cufflinksviewer
venvwin/Lib/encodings/gb2312.py
61
1066
# # gb2312.py: Python Unicode Codec for GB2312 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gb2312') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc....
mit
jamesls/boto
boto/elastictranscoder/exceptions.py
184
1595
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
mit
drufat/sympy
sympy/utilities/misc.py
20
11670
"""Miscellaneous stuff that doesn't really fit anywhere else.""" from __future__ import print_function, division import sys import os import re as _re from textwrap import fill, dedent from sympy.core.compatibility import get_function_name, range def filldedent(s, w=70): """ Strips leading and trailing emp...
bsd-3-clause
mozvip/CouchPotatoServer
couchpotato/core/notifications/notifymyandroid/__init__.py
16
1327
from .main import NotifyMyAndroid def start(): return NotifyMyAndroid() config = [{ 'name': 'notifymyandroid', 'groups': [ { 'tab': 'notifications', 'list': 'notification_providers', 'name': 'notifymyandroid', 'label': 'Notify My Android', ...
gpl-3.0
arnaudsj/mdp-toolkit
mdp/test/run_tests.py
2
181019
#! /usr/bin/env python sources = """ eNrsvW17JEdyILZ3fpGvfTpJ9lm2z3e+2p7DVRWn0QMMudpVH5t7XHJGGolLzsOZkegHhJuF7gJQ i+qqnqrqAaAV9fi7f4Q/+oN/iH+A/4Z/xMVbvlZWd4Mvu/LzGOQA3VWZkZmRkZERkZER/9s//fbt T5I3f7y5ny7K+mq6WBRV0S0Wb//Jm78aj8cRPLsqqqvo45cvoiTeNPVqu8ybNo6yahXFy7pqt2v6 Dh+rfNnlq+hdkUU3+f1t3azaNAIgo9Hbf/rmD7CFtlu9/c9e/x/...
bsd-3-clause
migueldiascosta/easybuild-framework
easybuild/toolchains/craypgi.py
5
1596
## # Copyright 2014-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # the Hercules foundation (http:...
gpl-2.0
Peddle/hue
desktop/core/ext-py/python-dateutil-2.4.2/setup.py
39
1729
#!/usr/bin/python from os.path import isfile import codecs import os import re from setuptools import setup if isfile("MANIFEST"): os.unlink("MANIFEST") TOPDIR = os.path.dirname(__file__) or "." VERSION = re.search('__version__ = "([^"]+)"', codecs.open(TOPDIR + "/dateutil/__init__.py", ...
apache-2.0
darmaa/odoo
addons/stock/wizard/orderpoint_procurement.py
33
2637
# -*- 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
jaddison/ansible
test/units/parsing/test_unquote.py
152
2073
# coding: utf-8 # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 o...
gpl-3.0
kurtgeebelen/rawesome
rawe/ocp/qpoases.py
2
5432
# Copyright 2012-2013 Greg Horn # # This file is part of rawesome. # # rawesome 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 3 of the License, or # (at your option) any later version. ...
lgpl-3.0