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
benhoff/listenerplugins
listenerplugins/password.py
24
2419
import string import random as std_random from cloudbot import hook try: from Crypto.Random import random gen = random.StrongRandom() except ImportError: # Just use the regular random module, not the strong one gen = std_random.SystemRandom() with open("data/password_words.txt") as f: common_wor...
gpl-3.0
a10networks/a10sdk-python
a10sdk/core/slb/slb_template_cipher.py
2
7785
from a10sdk.common.A10BaseClass import A10BaseClass class CipherCfg(A10BaseClass): """This class does not support CRUD Operations please use parent. :param priority: {"description": "Cipher priority (Cipher priority (default 1))", "format": "number", "default": 1, "maximum": 100, "minimum": 1, "type": "...
apache-2.0
rxtender/rxt-backend-base
test/python3/base_type/test_base_type.py
1
1258
from unittest import TestCase from .base_type_rxt import SingleField, SingleField_deserialize, SingleField_serialize,MultiFields class BaseTypeSerializationTestCase(TestCase): def test_create_SingleField(self): item = SingleField(42) self.assertEqual(42, item.foo32) def test_create_MultiFiel...
mit
ayushin78/coala
tests/settings/DocstringMetadataTest.py
33
3492
import unittest from coalib.settings.DocstringMetadata import DocstringMetadata from collections import OrderedDict class DocstringMetadataTest(unittest.TestCase): def test_from_docstring(self): self.check_from_docstring_dataset('') self.check_from_docstring_dataset(' description only ', ...
agpl-3.0
KohlsTechnology/ansible
test/units/modules/system/test_iptables.py
36
17522
from ansible.compat.tests import unittest from ansible.compat.tests.mock import patch from ansible.module_utils import basic from ansible.modules.system import iptables from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args def get_bin_path(*args, **kwargs): return "/sbi...
gpl-3.0
andresriancho/moto
tests/test_cloudformation/fixtures/single_instance_with_ebs_volume.py
1
12483
template = { "Description": "AWS CloudFormation Sample Template Gollum_Single_Instance_With_EBS_Volume: Gollum is a simple wiki system built on top of Git that powers GitHub Wikis. This template installs a Gollum Wiki stack on a single EC2 instance with an EBS volume for storage and demonstrates using the AWS Cloud...
apache-2.0
rhshah/basicfiltering
tests/test_mutect.py
1
3007
''' @Description : This tool helps to test mutect @Created : 03/23/2017 @Updated : 03/23/2017 @author : Ronak H Shah ''' import filecmp import os from subprocess import Popen import shlex import nose import logging def setup_module(): this_dir, this_filename = os.path.split(__file__) new_dir = os.path.dirn...
apache-2.0
klmitch/glance
glance/db/sqlalchemy/migrate_repo/versions/041_add_artifact_tables.py
12
10367
# Copyright (c) 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
NeuralEnsemble/neuroConstruct
lib/jython/Lib/test/test_mailbox.py
50
86537
import os import sys import time import stat import socket import email import email.message import re import shutil import StringIO import tempfile from test import test_support import unittest import mailbox import glob try: import fcntl except ImportError: pass # Silence Py3k warning rfc822 = test_support.i...
gpl-2.0
jhjguxin/blogserver
lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/runserver.py
163
1264
from optparse import make_option from django.conf import settings from django.core.management.commands.runserver import BaseRunserverCommand from django.contrib.staticfiles.handlers import StaticFilesHandler class Command(BaseRunserverCommand): option_list = BaseRunserverCommand.option_list + ( make_opti...
mit
sestrella/ansible
lib/ansible/modules/remote_management/cpm/cpm_plugcontrol.py
55
7369
#!/usr/bin/python # -*- coding: utf-8 -*- # # (C) 2018 Red Hat Inc. # Copyright (C) 2018 Western Telematic Inc. <kenp@wti.com> # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FI...
gpl-3.0
Eric-Gaudiello/tensorflow_dev
tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/pip/compat/__init__.py
248
3402
"""Stuff that differs in different Python versions and platform distributions.""" from __future__ import absolute_import, division import os import sys from pip._vendor.six import text_type try: from logging.config import dictConfig as logging_dictConfig except ImportError: from pip.compat.dictconfig import ...
gpl-3.0
TheTypoMaster/chromium-crosswalk
build/android/gyp/util/build_utils.py
36
10668
# 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. import ast import contextlib import fnmatch import json import os import pipes import re import shlex import shutil import subprocess import sys import tempf...
bsd-3-clause
youdonghai/intellij-community
python/lib/Lib/Queue.py
90
7758
"""A multi-producer, multi-consumer queue.""" from time import time as _time from collections import deque __all__ = ['Empty', 'Full', 'Queue'] class Empty(Exception): "Exception raised by Queue.get(block=0)/get_nowait()." pass class Full(Exception): "Exception raised by Queue.put(block=0)/put_nowait()....
apache-2.0
TheTypoMaster/my-vim-set-mac
.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/requests/requests/api.py
160
5280
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :par...
gpl-2.0
gauribhoite/personfinder
env/google_appengine/lib/django-1.5/django/contrib/gis/geoip/tests.py
102
4766
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from django.conf import settings from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis.geoip import GeoIP, GeoIPException from django.utils import unittest from django.utils import six # Note: Requires use of both the GeoIP ...
apache-2.0
danuzclaudes/robottelo
robottelo/ui/login.py
4
2058
# -*- encoding: utf-8 -*- """Implements Login UI""" import requests from robottelo.config import settings from robottelo.ui.base import Base, UINoSuchElementError from robottelo.ui.locators import common_locators, locators from robottelo.ui.navigator import Navigator class Login(Base): """Implements login, logo...
gpl-3.0
sanketloke/scikit-learn
sklearn/tests/test_grid_search.py
68
28856
""" Testing for grid search module (sklearn.grid_search) """ from collections import Iterable, Sized from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.externals.six.moves import xrange from itertools import chain, product import pickle import warnings import sys import numpy as np import sci...
bsd-3-clause
rodrigoj42/AnaliseTSE
workbench/vereadores.py
1
2773
from prettytable import PrettyTable t = open('dados_rj.txt').readlines() candidatos = [] for linha in t[2:-1]: candidatos.append(eval(linha[:-3])) candidatos.append(eval(t[-1][:-4])) coligacoes = {} for candidato in candidatos: h = candidato['cc'].find('-') if h == -1: coligacao = candidato['cc'] el...
mit
tyler6389/count_kernel_grand
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
shashank971/edx-platform
cms/djangoapps/contentstore/tests/test_import_pure_xblock.py
162
3002
""" Integration tests for importing courses containing pure XBlocks. """ from xblock.core import XBlock from xblock.fields import String from xmodule.modulestore.django import modulestore from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.xml_importer import import_course_from_xml from xmodule.m...
agpl-3.0
Carreau/python-prompt-toolkit
prompt_toolkit/layout/utils.py
2
1073
from __future__ import unicode_literals __all__ = ( 'TokenList', ) class TokenList(object): """ Wrapper around (Token, text) tuples. Implements logical slice and len operations. """ def __init__(self, iterator=None): if iterator is not None: self._list = list(iterator) ...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow/source/google/protobuf/internal/file_options_test_pb2.py
4
3021
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/file_options_test.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.p...
mit
pigletto/django-lfs
lfs/net_price/__init__.py
2
1258
# lfs imports from lfs.plugins import PriceCalculator class NetPriceCalculator(PriceCalculator): """ The value of product.price stored in the database excludes tax, in other words, the stored price is the net price of the product. See lfs.plugins.PriceCalculator for more information. """ def ...
bsd-3-clause
thaim/ansible
lib/ansible/plugins/action/fail.py
122
1477
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (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 ...
mit
mlhenderson/ui-common
functional-site/js/angular-1.2.14/docs/components/bootstrap-3.1.1/test-infra/s3_cache.py
1700
3523
#!/usr/bin/env python2.7 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, remove as _delete_file from os.path import isfile, dirname, basename, abspath from hashlib import sha256 from subprocess import check_call as run from boto.s3....
mit
GauravSahu/odoo
addons/hr_payroll/hr_payroll.py
144
49776
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
charbeljc/OCB
addons/hr_recruitment/res_config.py
352
3627
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-Today OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
polimediaupv/edx-platform
cms/djangoapps/contentstore/utils.py
10
11758
""" Common utility functions useful throughout the contentstore """ # pylint: disable=no-member import logging from opaque_keys import InvalidKeyError import re from datetime import datetime from pytz import UTC from django.conf import settings from django.core.urlresolvers import reverse from django_comment_common.m...
agpl-3.0
leonhong/thrift
lib/py/setup.py
4
1434
#!/usr/bin/env python # # 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 # "L...
apache-2.0
suutari-ai/shoop
shuup/core/migrations/0010_update_managers.py
4
1315
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-09-22 23:00 from __future__ import unicode_literals from django.db import migrations import django.db.models.manager class Migration(migrations.Migration): dependencies = [ ('shuup', '0009_update_tax_name_max_length'), ] operations = [...
agpl-3.0
kow3ns/kubernetes
hack/update_owners.py
15
9035
#!/usr/bin/env python3 # Copyright 2016 The Kubernetes 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 appl...
apache-2.0
poiesisconsulting/openerp-restaurant
base_action_rule/tests/base_action_rule_test.py
395
7455
from openerp import SUPERUSER_ID from openerp.tests import common from .. import test_models class base_action_rule_test(common.TransactionCase): def setUp(self): """*****setUp*****""" super(base_action_rule_test, self).setUp() cr, uid = self.cr, self.uid self.demo = self.registry(...
agpl-3.0
alexallah/django
django/contrib/flatpages/forms.py
60
2017
from django import forms from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.utils.translation import gettext, gettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField( label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',...
bsd-3-clause
benbox69/pyload
module/network/Bucket.py
41
1820
#!/usr/bin/env python # -*- coding: 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 License, or (at your option) any later version. This prog...
gpl-3.0
jvrsantacruz/XlsxWriter
xlsxwriter/test/comparison/test_page_breaks05.py
8
1333
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
bverburg/CouchPotatoServer
couchpotato/core/notifications/pushalot.py
81
2534
import traceback from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification log = CPLog(__name__) autoload = 'Pushalot' class Pushalot(Notification): urls = { 'api': 'https://pushalot.com/api/sendmessa...
gpl-3.0
MrLoick/python-for-android
python-build/python-libs/gdata/src/gdata/Crypto/PublicKey/ElGamal.py
228
3947
# # ElGamal.py : ElGamal encryption/decryption and signatures # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # warrant...
apache-2.0
m-takeuchi/ilislife_wxp
make_rsa_kay.py
2
2959
#!/usr/bin/env python3 # coding=utf-8 from Crypto.PublicKey import RSA from Crypto import Random import os,sys random_func = Random.new().read rsa = RSA.generate(2048, random_func) def get_id_rsa(id_rsa_file, passphrase=None): with open(id_rsa_file, 'rb') as f: id_rsa = RSA.importKey(f.read()) return ...
mit
n3ocort3x/msm_htc_helper
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
Dingmatt/AMSA
Plug-ins/Amsa.bundle/Contents/Libraries/Shared/unidecode/x0fc.py
253
3595
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
gpl-3.0
BernardFW/bernard
src/bernard/platforms/test/platform.py
1
4333
# coding: utf-8 from typing import ( List, Text, Tuple, Type, ) from bernard.engine.fsm import ( FSM, ) from bernard.engine.platform import ( Platform, ) from bernard.engine.request import ( BaseMessage, Conversation, Request, User, ) from bernard.engine.responder import ( R...
agpl-3.0
jonathan-beard/edx-platform
openedx/core/lib/api/permissions.py
74
3045
from django.conf import settings from rest_framework import permissions from django.http import Http404 from student.roles import CourseStaffRole class ApiKeyHeaderPermission(permissions.BasePermission): def has_permission(self, request, view): """ Check for permissions by matching the configured...
agpl-3.0
FelixZYY/gyp
test/subdirectory/gyptest-top-all.py
261
1373
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output b...
bsd-3-clause
etherkit/OpenBeacon2
client/macos/venv/lib/python3.8/site-packages/PyInstaller/depend/bindepend.py
3
37312
#----------------------------------------------------------------------------- # Copyright (c) 2013-2020, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt...
gpl-3.0
TribusGNULinux/tribus
tribus/common/charms/bundle.py
2
3818
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013-2014 Tribus Developers # # This file is part of Tribus. # # Tribus 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 L...
gpl-3.0
SaberMod/gdb-saber
gdb/contrib/test_pubnames_and_indexes.py
46
6368
#! /usr/bin/env python # Copyright (C) 2011-2015 Free Software Foundation, Inc. # # This file is part of GDB. # # 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, ...
gpl-2.0
arborh/tensorflow
tensorflow/lite/python/lite.py
3
47752
# Lint as: python2, python3 # 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 # ...
apache-2.0
forumber/temiz_kernel_g2
toolchain/share/gdb/python/gdb/prompt.py
124
4210
# Extended prompt utilities. # Copyright (C) 2011-2014 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 ...
gpl-2.0
peiyuwang/pants
src/python/pants/engine/legacy/graph.py
1
14329
# coding=utf-8 # Copyright 2015 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 logging from...
apache-2.0
muffinresearch/addons-server
apps/amo/management/commands/extract_loc.py
22
1526
import os import re from django.conf import settings from django.core.files.storage import default_storage as storage from django.core.management.base import BaseCommand from amo.storage_utils import walk_storage _loc_re = re.compile(r"""\\?(loc)\(.*?\)""", (re.M | re.S)) _exts = ('.py', '.html') _root = settings.RO...
bsd-3-clause
alex/django-old
django/utils/text.py
69
9831
import re from django.utils.encoding import force_unicode from django.utils.functional import allow_lazy from django.utils.translation import ugettext_lazy from htmlentitydefs import name2codepoint # Capitalizes the first letter of a string. capfirst = lambda x: x and force_unicode(x)[0].upper() + force_unicode(x)[1:]...
bsd-3-clause
rysson/filmkodi
plugin.video.xbmcfilm/resources/lib/jsbeautifier/unpackers/tests/testmyobfuscate.py
111
1163
# # written by Stefano Sanfilippo <a.little.coder@gmail.com> # """Tests for MyObfuscate unpacker.""" import unittest import os from jsbeautifier.unpackers.myobfuscate import detect, unpack from jsbeautifier.unpackers.tests import __path__ as path INPUT = os.path.join(path[0], 'test-myobfuscate-input.js') OUTPUT ...
apache-2.0
minlexx/pyevemon
esi_client/models/get_corporations_npccorps_internal_server_error.py
1
3114
# coding: utf-8 """ EVE Swagger Interface An OpenAPI for EVE Online OpenAPI spec version: 0.4.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class GetCorporationsNpccorpsInternalServerError(object): ""...
gpl-3.0
MaPePeR/numpy
numpy/lib/tests/test_recfunctions.py
45
31143
from __future__ import division, absolute_import, print_function import numpy as np import numpy.ma as ma from numpy.ma.mrecords import MaskedRecords from numpy.ma.testutils import assert_equal from numpy.testing import TestCase, run_module_suite, assert_ from numpy.lib.recfunctions import ( drop_fields, rename_fi...
bsd-3-clause
pbmanis/acq4
acq4/devices/MultiClamp/taskGUI.py
3
13805
# -*- coding: utf-8 -*- from __future__ import print_function from acq4.util import Qt import sys from acq4.devices.Device import TaskGui from acq4.util.SequenceRunner import * from acq4.pyqtgraph.WidgetGroup import WidgetGroup import numpy from .TaskTemplate import * from acq4.util.debug import * import sip class Mul...
mit
legalsylvain/OpenUpgrade
addons/stock/__init__.py
376
1115
# -*- 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
javaos74/neutron
neutron/extensions/dvr.py
28
2674
# 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
MphasisWyde/eWamSublimeAdaptor
POC/v0_3_POC_with_project_aborted/third-party/requests/packages/urllib3/contrib/pyopenssl.py
197
10094
'''SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested wi...
mit
MichelRottleuthner/RIOT
tests/ps_schedstatistics/tests/01-run.py
2
2328
#!/usr/bin/env python3 # Copyright (C) 2017 Inria # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import sys PS_EXPECTED = ( ('\tpid | name | state Q | pri | stac...
lgpl-2.1
jillesme/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/botinfo.py
127
2054
# Copyright (c) 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 ...
bsd-3-clause
thehyve/variant
eggs/django-1.3.1-py2.7.egg/django/template/debug.py
232
3797
from django.conf import settings from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError from django.utils.encoding import force_unicode from django.utils.html import escape from django.utils.safestring import SafeData, EscapeData from django.utils.formats import localize cl...
apache-2.0
yanheven/nova
nova/api/openstack/compute/schemas/v3/cells.py
70
3321
# 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-2.0 # # Unless required ...
apache-2.0
rebroad/bitcoin
qa/rpc-tests/multi_rpc.py
32
4575
#!/usr/bin/env python3 # Copyright (c) 2015-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. # # Test multiple rpc user config option rpcauth # from test_framework.test_framework import BitcoinTest...
mit
yaojingwu1992/XlsxWriter
xlsxwriter/test/worksheet/test_sparkline11.py
8
9334
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet class TestAss...
bsd-2-clause
j00bar/ansible
lib/ansible/modules/cloud/amazon/lambda_alias.py
77
12327
#!/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 distributed...
gpl-3.0
stamhe/pybitcointools
cryptos/wallet_utils.py
1
6572
# -*- coding: utf-8 -*- # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious with changes by pycryptools developers # # 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 Softwa...
mit
erlimar/prototypeguide
src/lib/flask_cache/backends.py
14
2427
from werkzeug.contrib.cache import (BaseCache, NullCache, SimpleCache, MemcachedCache, GAEMemcachedCache, FileSystemCache) class SASLMemcachedCache(MemcachedCache): def __init__(self, servers=None, default_timeout=300, key_prefix=None, username=None, password=N...
mit
hugoatease/magpie-django
magpie/management/admin.py
1
1301
# Copyright 2013-2015 Hugo Caille # # 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
ojengwa/odoo
addons/lunch/report/report_lunch_order.py
341
2771
# -*- 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
CLVsol/oehealth_gs
oehealth_gs_medicament/__init__.py
1
1431
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
chuan9/chromium-crosswalk
tools/cygprofile/mergetraces_unittest.py
101
1535
# 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 unittest import mergetraces class GroupByProcessAndThreadIdTestBasic(unittest.TestCase): def runTest(self): # (sec, usec, 'pid:tid', function ...
bsd-3-clause
jaeh/runtime
deps/v8/tools/testrunner/local/utils.py
11
4316
# Copyright 2012 the V8 project authors. 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 conditi...
apache-2.0
Storj/driveshare-graph
tests/test_storage.py
2
1859
import os import unittest from pymongo import MongoClient import datetime as dt import time import sqlite3 import pygal import driveshare_graph.storage as storage class Storage(unittest.TestCase): def test_avg_gb_farmer(self): client = MongoClient('localhost', 27017) collection = client['GroupB']...
mit
PKRoma/poedit
deps/boost/libs/python/test/numpy/ndarray.py
9
3957
#!/usr/bin/env python # Copyright Jim Bosch & Ankit Daftery 2010-2012. # Distributed under 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) import ndarray_ext import unittest import numpy class TestNdarray(unittest.TestCa...
mit
mj10777/QGIS
python/plugins/processing/algs/qgis/RandomPointsPolygons.py
4
8707
# -*- coding: utf-8 -*- """ *************************************************************************** RandomPointsPolygons.py --------------------- Date : April 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com ******...
gpl-2.0
abstract-open-solutions/management-system
__unported__/mgmtsystem_review/__openerp__.py
3
1750
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it und...
agpl-3.0
chengdh/openerp-ktv
openerp/pychart/axis_doc.py
15
4884
# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc_x="""Attributes supported by this class are: draw_tics_above(type:int) default="If true, tick lines and labels are drawn above the axis line.". minor_tic_len(type:length in points (\\xref{unit})) default="The length of minor tick marks. The val...
agpl-3.0
crosswalk-project/crosswalk-test-suite
stability/stability-lowresource-android-tests/lowresource/TestApp.py
15
6686
#!/usr/bin/env python # coding=utf-8 # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of c...
bsd-3-clause
Sodki/ansible
lib/ansible/modules/system/timezone.py
26
22063
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Shinichi TAMURA (@tmshn) # # 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 ...
gpl-3.0
windskyer/nova
nova/tests/functional/db/test_archive.py
3
4820
# Copyright 2015 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 # # Unless required by applicable law or agreed t...
gpl-2.0
tumbl3w33d/ansible
lib/ansible/modules/packaging/os/homebrew.py
4
27897
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Andrew Dunham <andrew@du.nham.ca> # (c) 2013, Daniel Jaouen <dcj24@cornell.edu> # (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com> # # Based on macports (Jimmy Tang <jcftang@gmail.com>) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org...
gpl-3.0
cherylyli/stress-aid
env/lib/python3.5/site-packages/jinja2/lexer.py
119
28238
# -*- coding: utf-8 -*- """ jinja2.lexer ~~~~~~~~~~~~ This module implements a Jinja / Python combination lexer. The `Lexer` class provided by this module is used to do some preprocessing for Jinja. On the one hand it filters out invalid operators like the bitshift operators we don't allow...
mit
EmadMokhtar/Django
tests/select_related/tests.py
67
9796
from django.core.exceptions import FieldError from django.test import SimpleTestCase, TestCase from .models import ( Bookmark, Domain, Family, Genus, HybridSpecies, Kingdom, Klass, Order, Phylum, Pizza, Species, TaggedItem, ) class SelectRelatedTests(TestCase): @classmethod def create_tree(cls, stri...
mit
plone/plone.app.mosaic
src/plone/app/mosaic/registry.py
1
13263
# -*- coding: utf-8 -*- from copy import deepcopy from plone.app.mosaic.interfaces import IMosaicRegistryAdapter from plone.app.mosaic.utils import extractFieldInformation from plone.dexterity.utils import iterSchemataForType from plone.registry.interfaces import IRegistry from Products.CMFCore.interfaces._content impo...
gpl-2.0
grantmcconnaughey/django-sql-explorer
explorer/counter.py
9
2054
# Taken from http://code.activestate.com/recipes/576611-counter-class/ class Counter(dict): '''Dict subclass for counting hashable objects. Sometimes called a bag or multiset. Elements are stored as dictionary keys and their counts are stored as dictionary values. >>> Counter('zyzygy') Counter({...
mit
shakamunyi/tensorflow
tensorflow/compiler/tests/unary_ops_test.py
4
22277
# 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
ruibarreira/linuxtrail
usr/lib/python3.4/posixpath.py
92
13448
"""Common operations on Posix pathnames. Instead of importing this module directly, import os and refer to this module as os.path. The "os.path" name is an alias for this module on Posix systems; on other systems (e.g. Mac, Windows), os.path provides the same operations in a manner specific to that platform, and is a...
gpl-3.0
afdnlw/dnf
tests/test_cli_format.py
13
2245
# Copyright (C) 2012-2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will...
gpl-2.0
chenyyx/scikit-learn-doc-zh
examples/en/ensemble/plot_forest_importances.py
168
1793
""" ========================================= Feature importances with forests of trees ========================================= This examples shows the use of forests of trees to evaluate the importance of features on an artificial classification task. The red bars are the feature importances of the forest, along wi...
gpl-3.0
hexlism/xx_net
python27/1.0/lib/stringprep.py
30
13794
# This file is generated by mkstringprep.py. DO NOT EDIT. """Library that exposes various tables found in the StringPrep RFC 3454. There are two kinds of tables: sets, for which a member test is provided, and mappings, for which a mapping function is provided. """ from unicodedata import ucd_3_2_0 as unicodeda...
bsd-2-clause
sankhesh/VTK
ThirdParty/Twisted/twisted/web/test/test_agent.py
19
95379
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.client.Agent} and related new client APIs. """ import cookielib import zlib from StringIO import StringIO from zope.interface.verify import verifyObject from twisted.trial.unittest import TestCase from twisted.web im...
bsd-3-clause
avorio/rdflib
rdflib/plugins/sparql/aggregates.py
21
3932
from rdflib import Literal, XSD from rdflib.plugins.sparql.evalutils import _eval from rdflib.plugins.sparql.operators import numeric from rdflib.plugins.sparql.datatypes import type_promotion from rdflib.plugins.sparql.compat import num_max, num_min from decimal import Decimal """ Aggregation functions """ def _...
bsd-3-clause
slonik-az/cython
Cython/Build/Dependencies.py
13
37765
from __future__ import absolute_import, print_function import cython from .. import __version__ import re, os, sys, time from glob import iglob try: import gzip gzip_open = gzip.open gzip_ext = '.gz' except ImportError: gzip_open = open gzip_ext = '' import shutil import subprocess try: impo...
apache-2.0
etashjian/ECE757-final
tests/configs/realview64-switcheroo-o3.py
33
2453
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
unseenlaser/python-for-android
python3-alpha/python3-src/Lib/test/test_site.py
49
16063
"""Tests for 'site'. Tests assume the initial paths in sys.path once the interpreter has begun executing have not been removed. """ import unittest from test.support import run_unittest, TESTFN, EnvironmentVarGuard from test.support import captured_stderr import builtins import os import sys import re import encoding...
apache-2.0
encukou/samba
python/samba/tests/upgradeprovisionneeddc.py
32
7461
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008 # # 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 opti...
gpl-3.0
fw1121/escher.github.io
escher/server.py
1
9485
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from escher.plots import (Builder, local_index, model_json_for_name, map_json_for_name) from escher.urls import get_url from escher.urls import root_directory import os, subprocess from os.path import join impor...
mit
damonkohler/sl4a
python/gdata/src/gdata/contacts/__init__.py
134
13897
#!/usr/bin/python # # Copyright (C) 2008 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
kawasaki2013/python-for-android-x86
python-modules/twisted/twisted/words/protocols/jabber/ijabber.py
54
5333
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Public Jabber Interfaces. """ from zope.interface import Attribute, Interface class IInitializer(Interface): """ Interface for XML stream initializers. Initializers perform a step in getting the XML stream ready to be ...
apache-2.0