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
Versent/ansible
v1/ansible/utils/su_prompts.py
113
1576
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
gpl-3.0
jerpat/csmake
csmake/test-TestPython-source/tests/test_failing_example.py
2
1430
# <copyright> # (c) Copyright 2017 Hewlett Packard Enterprise Development LP # # 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 ve...
gpl-3.0
uday1889/gensim
gensim/interfaces.py
33
10470
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ This module contains basic interfaces used throughout the whole gensim package. The interfaces are realized as abstract base classe...
gpl-3.0
felixjimenez/django
tests/select_related/models.py
114
1906
""" 41. Tests for select_related() ``select_related()`` follows all relationships and pre-caches any foreign key values so that complex trees can be fetched in a single query. However, this isn't always a good idea, so the ``depth`` argument control how many "levels" the select-related behavior will traverse. """ fro...
bsd-3-clause
ysekky/GPy
GPy/util/mocap.py
6
27949
import os import numpy as np import math from GPy.util import datasets as dat class vertex: def __init__(self, name, id, parents=[], children=[], meta = {}): self.name = name self.id = id self.parents = parents self.children = children self.meta = meta def __str__(self)...
bsd-3-clause
Zord13appdesa/python-for-android
python-build/python-libs/gdata/build/lib/gdata/health/__init__.py
263
7090
#!/usr/bin/python # # Copyright 2009 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 b...
apache-2.0
vrsys/avangong
avango-menu/python/avango/menu/widget/__init__.py
6
1776
# -*- Mode:Python -*- ########################################################################## # # # This file is part of AVANGO. # # ...
lgpl-3.0
LinguList/server
app/lpserver/util.py
2
2564
# author : Johann-Mattis List # email : mattis.list@uni-marburg.de # created : 2014-12-05 22:36 # modified : 2014-12-05 22:36 """ Utility functions for LingPy Server. """ __author__="Johann-Mattis List" __date__="2014-12-05" from glob import glob import io import unicodedata import os from pathlib import Path f...
gpl-2.0
sv-dev1/odoo
addons/website/models/test_models.py
335
1386
# -*- coding: utf-8 -*- from openerp.osv import orm, fields class test_converter(orm.Model): _name = 'website.converter.test' # disable translation export for those brilliant field labels and values _translate = False _columns = { 'char': fields.char(), 'integer': fields.integer(), ...
agpl-3.0
echodaemon/LVDOWin
GUI.py
2
11065
# -*- coding: utf-8 -*- """ This is a sample GUI for LVDOWin written by Aaron Gokaslan. The GUI just feeds a very simplistic set of parameters to and from video. """ from PySide import QtGui from PySide.QtCore import Qt, QRegExp from subprocess import Popen, PIPE, STDOUT import os #####################################...
gpl-3.0
mosbasik/buzhug
javasrc/lib/Jython/Lib/test/test_float_jy.py
9
4186
"""Float tests Made for Jython. """ import math import sys import unittest from test import test_support jython = test_support.is_jython class FloatTestCase(unittest.TestCase): def test_float_repr(self): self.assertEqual(repr(12345678.000000005), '12345678.000000006') self.assertEqual(repr(12345...
bsd-3-clause
giggsey/SickRage
lib/hachoir_parser/guess.py
56
4384
""" Parser list managment: - createParser() find the best parser for a file. """ import os from hachoir_core.error import warning, info, HACHOIR_ERRORS from hachoir_parser import ValidateError, HachoirParserList from hachoir_core.stream import FileInputStream from hachoir_core.i18n import _ import weakref class Quer...
gpl-3.0
gocardless/gocardless-pro-python
tests/integration/payer_authorisations_integration_test.py
1
26990
# WARNING: Do not edit by hand, this file was generated by Crank: # # https://github.com/gocardless/crank # import json import requests import responses from nose.tools import ( assert_equal, assert_is_instance, assert_is_none, assert_is_not_none, assert_not_equal, assert_raises ) from gocardless_pro.e...
mit
azulpanda/azulpanda_html
lib/werkzeug/exceptions.py
316
17799
# -*- coding: utf-8 -*- """ werkzeug.exceptions ~~~~~~~~~~~~~~~~~~~ This module implements a number of Python exceptions you can raise from within your views to trigger a standard non-200 response. Usage Example ------------- :: from werkzeug.wrappers import BaseRequest ...
apache-2.0
particl/particl-core
test/functional/rpc_part_signmessage.py
2
2362
#!/usr/bin/env python3 # Copyright (c) 2016-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test RPC commands for signing and verifying messages.""" from test_framework.test_particl import Parti...
mit
shurihell/testasia
lms/djangoapps/instructor/tests/test_enrollment.py
27
29497
# -*- coding: utf-8 -*- """ Unit tests for instructor.enrollment methods. """ import json import mock from mock import patch from abc import ABCMeta from courseware.models import StudentModule from django.conf import settings from django.test import TestCase from django.utils.translation import get_language from djang...
agpl-3.0
seanwestfall/django
django/contrib/sites/managers.py
472
2132
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.core import checks from django.core.exceptions import FieldDoesNotExist from django.db import models class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the curre...
bsd-3-clause
skbkontur/Diamond
src/collectors/mountstats/mountstats.py
28
8068
# coding=utf-8 """ The function of MountStatsCollector is to parse the detailed per-mount NFS performance statistics provided by `/proc/self/mountstats` (reads, writes, remote procedure call count/latency, etc.) and provide counters to Diamond. Filesystems may be included/excluded using a regular expression filter, lik...
mit
ayushagrawal288/zamboni
mkt/developers/tests/test_cron.py
13
6326
# -*- coding: utf-8 -*- import datetime import mock from nose.tools import eq_ import mkt from mkt.developers.cron import (_flag_rereview_adult, exclude_new_region, process_iarc_changes, send_new_region_emails) from mkt.developers.models import ActivityLog from mkt.site.tests import T...
bsd-3-clause
ESRC-CDRC/ckan-datapusher-service
datapusher/jobs.py
1
14146
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import urllib2 import socket import requests import urlparse import itertools import datetime import locale import pprint import logging import decimal import hashlib import cStringIO import time import ssl import messytables from slugify imp...
agpl-3.0
grepme/CMPUT410Lab01
virt_env/virt1/lib/python2.7/site-packages/SQLAlchemy-0.9.8-py2.7-linux-x86_64.egg/sqlalchemy/util/langhelpers.py
32
37539
# util/langhelpers.py # Copyright (C) 2005-2014 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 """Routines to help with the creation, loading and introspection of modules, cla...
apache-2.0
minhphung171093/OpenERP_V7
openerp/addons/account/wizard/account_report_common_partner.py
56
2031
# -*- 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
sein-tao/pyBioUtil
BioUtil/vcf.py
1
3924
#!/usr/bin/env python3 """ This module serves as a wrapper for vcf module [https://github.com/jamescasbon/PyVCF] open() and vcfFile class is for directly init of vcf file object, vcfReader and vcfWriter is wraper for vcf.Reader and vcf.Writer, which accept file name as first argument (other than fsock), and also could...
gpl-2.0
mjirayu/sit_academy
common/lib/chem/chem/chemtools.py
250
10721
"""This module originally includes functions for grading Vsepr problems. Also, may be this module is the place for other chemistry-related grade functions. TODO: discuss it. """ import json import unittest import itertools def vsepr_parse_user_answer(user_input): """ user_input is json generated by vsepr.js...
agpl-3.0
bakhtout/odoo-educ
addons/account_test/report/account_test_report.py
156
3740
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
davidharrigan/django
tests/postgres_tests/test_ranges.py
98
24582
import datetime import json import unittest from django import forms from django.core import exceptions, serializers from django.db import connection from django.db.models import F from django.test import TestCase, override_settings from django.utils import timezone from . import PostgreSQLTestCase from .models impor...
bsd-3-clause
meteorcloudy/tensorflow
tensorflow/contrib/learn/python/learn/estimators/composable_model.py
42
15409
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
donald-pinckney/EM-Simulator
EM Sim/EM SimContent/Lib/encodings/cp857.py
593
34164
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.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_map) def decode(self,input,errors='strict'): ...
apache-2.0
shantanu561993/volatility
volatility/plugins/mac/session_hash_table.py
12
2938
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
gpl-2.0
Learningtribes/edx-platform
common/lib/xmodule/xmodule/randomize_module.py
27
3876
import logging import random from xmodule.x_module import XModule, STUDENT_VIEW from xmodule.seq_module import SequenceDescriptor from lxml import etree from xblock.fields import Scope, Integer from xblock.fragment import Fragment log = logging.getLogger('edx.' + __name__) class RandomizeFields(object): choic...
agpl-3.0
zentner-kyle/servo
tests/wpt/harness/wptrunner/manifestinclude.py
39
4804
# 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/. """Manifest structure used to store paths that should be included in a test run. The manifest is represented by a tree ...
mpl-2.0
mulkieran/justbytes
doc/conf.py
1
9393
# -*- coding: utf-8 -*- # # justbytes documentation build configuration file, created by # sphinx-quickstart on Tue Feb 17 09:02:33 2015. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
gpl-2.0
ther12k/android-client
phone/jni/pjsip/sources/pkgconfig.py
75
4188
import sys import os REMOVE_THESE = ["-I/usr/include", "-I/usr/include/", "-L/usr/lib", "-L/usr/lib/"] class Pkg: def __init__(self, pkg_name): self.name = pkg_name self.priority = 0 self.vars = {} def parse(self, pkg_config_path): f = None for pkg_path in pkg_config_path.split(':'): if pkg_path[-1] !...
gpl-3.0
sloanyang/gyp
test/variables/commands/gyptest-commands.py
311
1208
#!/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. """ Test variable expansion of '<!()' syntax commands. """ import os import TestGyp test = TestGyp.TestGyp(format='gypd') expect = test....
bsd-3-clause
samdoran/ansible
lib/ansible/utils/path.py
32
3357
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
kidmaple/CoolWall
user/python/Lib/plat-linux2/SOCKET.py
4
3569
# Generated by h2py from /usr/include/sys/socket.h # Included from features.h _FEATURES_H = 1 _GNU_SOURCE = 1 __USE_ANSI = 1 __FAVOR_BSD = 1 _BSD_SOURCE = 1 _SVID_SOURCE = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 2 __USE_POSIX = 1 __USE_POSIX2 = 1 __USE_MISC = 1 __USE_BSD = 1 __USE_SVID = 1 __USE_GNU = 1 __GNU_LIBRARY__ ...
gpl-2.0
Yukarumya/Yukarum-Redfoxes
python/pytest/_pytest/pastebin.py
181
3483
""" submit failure or test session information to a pastebin service. """ import pytest import sys import tempfile def pytest_addoption(parser): group = parser.getgroup("terminal reporting") group._addoption('--pastebin', metavar="mode", action='store', dest="pastebin", default=None, choices=[...
mpl-2.0
lokeshjindal15/pd-gem5
src/arch/x86/isa/insts/x87/transcendental_functions/__init__.py
91
2337
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
bsd-3-clause
richardnpaul/FWL-Website
lib/python2.7/site-packages/pip/vendor/html5lib/trie/datrie.py
80
1177
from __future__ import absolute_import, division, unicode_literals from datrie import Trie as DATrie from pip.vendor.six import text_type from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): chars = set() for key in data.keys(): if not isinstance(key, tex...
gpl-3.0
MMKrell/pyspace
pySPACE/resources/dataset_defs/time_series.py
2
39469
""" Load and store data of the type :mod:`pySPACE.resources.data_types.time_series` """ import itertools import copy import os import cPickle import sys import scipy import yaml import csv import numpy import logging import warnings import glob from pySPACE.missions.support.WindowerInterface import AbstractStreamReade...
gpl-3.0
olga-perederieieva/pyDEA
tests/test_main.py
2
1640
import os import shutil from pyDEA.main import main from pyDEA.core.data_processing.parameters import parse_parameters_from_file from pyDEA.core.utils.dea_utils import auto_name_if_needed def test_main_correct_params(): filename = 'tests/params_new_format.txt' params = parse_parameters_from_file(filename) ...
mit
bzbarsky/servo
tests/wpt/web-platform-tests/tools/six/documentation/conf.py
420
7015
# -*- coding: utf-8 -*- # # six documentation build configuration file import os import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like ...
mpl-2.0
burdell/CS4464-Final-Project
django/contrib/localflavor/il/forms.py
317
2192
""" Israeli-specific form helpers """ import re from django.core.exceptions import ValidationError from django.core.validators import EMPTY_VALUES from django.forms.fields import RegexField, Field, EMPTY_VALUES from django.utils.checksums import luhn from django.utils.translation import ugettext_lazy as _ # Israeli I...
bsd-3-clause
wndias/bc.repository
script.module.urlresolver/lib/urlresolver/plugins/watchvideo.py
4
2141
''' This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT...
gpl-2.0
Micronaet/micronaet-contract
base_import_fraternita/partner.py
1
2667
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP module # Copyright (C) 2010 Micronaet srl (<http://www.micronaet.it>) # # Italian OpenERP Community (<http://www.openerp-italia.com>) # #####################################################...
agpl-3.0
juju/juju-tosca
resources/juju/metadata.py
1
2213
#!/usr/bin/python # # Copyright 2014 IBM Corporation # Zhaizhixiang (zhzxzhai@cn.ibm.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 Free Software Foundation, either version 3 of the License, or # (at your...
agpl-3.0
ykim362/mxnet
example/reinforcement-learning/a3c/sym.py
53
1903
# 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
projetoquixique/quixique
node_modules/node-gyp/gyp/tools/graphviz.py
2679
2878
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
gpl-3.0
Elico-Corp/odoo_OCB
addons/anonymization/__openerp__.py
18
1112
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Database Anonymization', 'version': '1.0', 'category': 'Extra Tools', 'description': """ This module allows you to anonymize a database. =============================================== This...
agpl-3.0
simbs/edx-platform
lms/djangoapps/student_account/views.py
22
15892
""" Views for a student's account information. """ import logging import json import urlparse from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import ( HttpResponse, HttpResponseBadRequest, HttpResponseForbidden ) from ...
agpl-3.0
xuxiaoxin/micropython
tests/basics/int_mpz.py
14
2093
# to test arbitrariy precision integers x = 1000000000000000000000000000000 y = 2000000000000000000000000000000 # printing print(x) print(y) # addition print(x + 1) print(x + y) # subtraction print(x - 1) print(x - y) print(y - x) # multiplication print(x * 2) print(x * y) # integer division print(x // 2) print(y...
mit
jordij/wagtail
wagtail/wagtailadmin/views/account.py
25
4016
from django.conf import settings from django.shortcuts import render, redirect from django.contrib import messages from django.contrib.auth.forms import SetPasswordForm from django.contrib.auth.views import logout as auth_logout, login as auth_login from django.contrib.auth import update_session_auth_hash from django.u...
bsd-3-clause
Sweetgrassbuffalo/ReactionSweeGrass-v2
.meteor/local/dev_bundle/python/Lib/ctypes/test/test_frombuffer.py
26
2461
from ctypes import * import array import gc import unittest class X(Structure): _fields_ = [("c_int", c_int)] init_called = False def __init__(self): self._init_called = True class Test(unittest.TestCase): def test_fom_buffer(self): a = array.array("i", range(16)) x = (c_int * ...
gpl-3.0
raphui/linux
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
2013Commons/HUE-SHARK
build/env/lib/python2.7/site-packages/Mako-0.7.2-py2.7.egg/mako/ext/autohandler.py
57
1841
# ext/autohandler.py # Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """adds autohandler functionality to Mako templates. requires that the TemplateLookup class is...
apache-2.0
dhodhala88/Bosch1
weblate/trans/views/git.py
2
5180
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eithe...
gpl-3.0
jayflo/scikit-learn
sklearn/feature_selection/tests/test_rfe.py
209
11733
""" Testing Recursive feature elimination """ import warnings import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_equal, assert_true from scipy import sparse from sklearn.feature_selection.rfe import RFE, RFECV from sklearn.datasets import load_iris,...
bsd-3-clause
sanguinariojoe/aquagpusph
examples/2D/spheric_testcase6_movingsquare/cMake/Motion.py
1
2887
######################################################################### # # # # ## # # # # # # # # # # # # # # # # # ##### # # #...
gpl-3.0
DrimTim32/py_proj_lights
develop_scripts/code_check/code_check.py
1
3156
import os import re import sys total = 0.0 count = 0 BASE_DIRECTORY = os.getcwd() EXTENDED = "" TYPE = "text" excluded_directories = ["develop_scripts", "tests", "docs", "demo"] excluded_files = ["__init__.py", "setup.py", "custom_assertions.py", "conftest.py"] expected_html_tags = ["<table>", "<html>"] expected_par...
mit
dhruvsrivastava/OJ
python/lib/python2.7/site-packages/pip/utils/logging.py
199
3326
from __future__ import absolute_import import contextlib import logging import logging.handlers import os try: import threading except ImportError: import dummy_threading as threading from pip.compat import WINDOWS from pip.utils import ensure_dir try: from pip._vendor import colorama # Lots of differen...
bsd-3-clause
venmo/ansible
lib/ansible/plugins/lookup/fileglob.py
176
1345
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
kobolabs/calibre
src/chardet/big5freq.py
323
82588
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
gpl-3.0
Tiryoh/mbed
workspace_tools/export/ds5_5.py
22
1997
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
androidarmv6/android_external_chromium_org
tools/crx_id/crx_id_unittest.py
120
3482
#!/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. """Verify that crx_id.py generates a reasonable string for a canned CRX file. """ import crx_id import os import shutil import s...
bsd-3-clause
atlassian/dd-agent
utils/dockerutil.py
7
6857
# stdlib import logging import os # 3rd party from docker import Client from docker import tls class MountException(Exception): pass # Default docker client settings DEFAULT_TIMEOUT = 5 DEFAULT_VERSION = 'auto' CHECK_NAME = 'docker_daemon' log = logging.getLogger(__name__) _docker_client_settings = {"version": ...
bsd-3-clause
SaschaMester/delicium
third_party/mojo/src/mojo/public/third_party/markupsafe/__init__.py
371
8205
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re from markupsafe._compat import text_type, string_types, int_types, \ unichr, PY2 __all__ = ['Markup', 'soft_unicod...
bsd-3-clause
iRGBit/QGIS
python/plugins/processing/gui/EditScriptAction.py
23
2221
# -*- coding: utf-8 -*- """ *************************************************************************** EditScriptAction.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
gpl-2.0
nishant8BITS/node-gyp
gyp/pylib/gyp/xcode_emulation.py
241
63805
# 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. """ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. """ import copy import gyp.common...
mit
alexbredo/ipfix-receiver
urllib3/filepost.py
1009
2281
import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_boundary. """ return uuid4().hex...
bsd-2-clause
jbking/demo-appengine-django-golang
myproject/django/contrib/localflavor/ie/ie_counties.py
503
1127
""" Sources: Irish Counties: http://en.wikipedia.org/wiki/Counties_of_Ireland """ from django.utils.translation import ugettext_lazy as _ IE_COUNTY_CHOICES = ( ('antrim', _('Antrim')), ('armagh', _('Armagh')), ('carlow', _('Carlow')), ('cavan', _('Cavan')), ('clare', _('Clare')), ('cork...
mit
CalebBell/ht
ht/conv_packed_bed.py
1
8259
# -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2016, Caleb Bell <Caleb.Andrew.Bell@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal...
mit
ashmanmode/TTSDNNRepo
src/frontend/merge_features.py
2
2200
import numpy, sys from io_funcs.binary_io import BinaryIOCollection import logging class MergeFeat(object): def __init__(self, lab_dim = 481, feat_dim = 1): self.logger = logging.getLogger("labels") self.lab_dim = lab_dim self.feat_dim = feat_dim def merge_da...
apache-2.0
vcshing/gae-pytz
setup.py
11
1712
""" gae-pytz ======== pytz has a severe performance problem that impedes its usage on Google App Engine. This is caused because pytz.__init__ builds a list of available zoneinfos checking the entire zoneinfo database (which means: it tries to open hundreds of files). This is done in the module globals, so it is not eas...
mit
Moriadry/tensorflow
tensorflow/compiler/tests/tensor_array_ops_test.py
7
36344
# 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
karlgluck/heroes-of-the-storm-replay-parser
s2protocol/protocol16755.py
28
20109
# Copyright (c) 2013 Blizzard Entertainment # # 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 # to use, copy, modify, merge, publi...
mit
sanguinariojoe/FreeCAD
src/Mod/Fem/feminout/convert2TetGen.py
12
13032
# *************************************************************************** # * Copyright (c) 2010 Juergen Riegel <juergen.riegel@web.de> * # * Copyright (c) 2018 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * Th...
lgpl-2.1
knifenomad/django
tests/generic_views/test_edit.py
51
18099
from __future__ import unicode_literals from django import forms from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.test import SimpleTestCase, TestCase, override_settings from django.test.client import RequestFactory from django.views.generic.base import V...
bsd-3-clause
saurabhjn76/sympy
sympy/functions/special/tests/test_hyper.py
58
13415
from sympy import (hyper, meijerg, S, Tuple, pi, I, exp, log, cos, sqrt, symbols, oo, Derivative, gamma, O) from sympy.series.limits import limit from sympy.abc import x, z, k from sympy.utilities.pytest import raises, slow from sympy.utilities.randtest import ( random_complex_number as randcplx,...
bsd-3-clause
ccellis/WHACK2016
flask/lib/python2.7/site-packages/whoosh/fields.py
2
56441
# Copyright 2007 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
bsd-3-clause
sudosurootdev/external_chromium_org
chrome/common/extensions/docs/server2/file_system.py
25
7914
# 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 posixpath import traceback from future import Future from path_util import ( AssertIsDirectory, AssertIsValid, IsDirectory, IsValid, SplitPar...
bsd-3-clause
Endika/c2c-rd-addons
hr_attendance_sheet_check/__openerp__.py
4
1635
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH (<http://www.camptocamp.at>) # # Thi...
agpl-3.0
yask123/django
tests/template_tests/filter_tests/test_linebreaksbr.py
331
1742
from django.template.defaultfilters import linebreaksbr from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LinebreaksbrTests(SimpleTestCase): """ The contents in "linebreaksbr" are escaped according to the current autoescape setting. "...
bsd-3-clause
zadgroup/edx-platform
common/djangoapps/xblock_django/migrations/0001_initial.py
79
4946
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'XBlockDisableConfig' db.create_table('xblock_django_xbloc...
agpl-3.0
nandhp/youtube-dl
youtube_dl/extractor/tlc.py
15
1578
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveLegacyIE from ..compat import compat_parse_qs class TlcDeIE(InfoExtractor): IE_NAME = 'tlc.de' _VALID_URL = r'https?://www\.tlc\.de/(?:[^/]+/)*videos/(?P<title>[^/?#]+)?(?:....
unlicense
OMS-NetZero/FAIR
setup.py
1
1405
from setuptools import setup from setuptools import find_packages import versioneer # README # def readme(): with open('README.rst') as f: return f.read() AUTHORS = [ ("Chris Smith", "c.j.smith1@leeds.ac.uk"), ("Richard Millar", "richard.millar@ouce.ox.ac.uk"), ("Zeb Nicholls", "zebedee.nichol...
apache-2.0
AutorestCI/azure-sdk-for-python
azure-servicemanagement-legacy/azure/servicemanagement/_common_serialization.py
6
6340
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apa...
mit
joeythesaint/yocto-autobuilder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/test/test_threadable.py
25
3223
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import sys, pickle try: import threading except ImportError: threading = None from twisted.trial import unittest from twisted.python import threadable from twisted.internet import defer, reactor class TestObject: synchronized = ['aM...
gpl-2.0
eMarco/omap
tools/perf/python/twatch.py
3213
1338
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
Nexenta/s3-tests
virtualenv/lib/python2.7/site-packages/nose/plugins/collect.py
96
3113
""" This plugin bypasses the actual execution of tests, and instead just collects test names. Fixtures are also bypassed, so running nosetests with the collection plugin enabled should be very quick. This plugin is useful in combination with the testid plugin (``--with-id``). Run both together to get an indexed list ...
mit
parpg/parpg
parpg/dialoguecontroller.py
1
2557
# This file is part of PARPG. # PARPG 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. # PARPG is distributed in the hope ...
gpl-3.0
openstack/cloudbase-init
cloudbaseinit/conf/default.py
4
15944
# Copyright 2016 Cloudbase Solutions Srl # # 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...
apache-2.0
goodhanrry/updaten_915s_to_lollipop
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
ibelem/crosswalk-test-suite
webapi/tct-cors-w3c-tests/cors-py/support/cors_credential_false.py
25
2284
# Copyright (c) 2012 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 conditions and the following disclaimer....
bsd-3-clause
biospi/seamass-windeps
src/boost_1_57_0/tools/boostbook/test/more/run-tests.py
38
3883
#!/usr/bin/env python # Copyright 2010 Daniel James. # 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) """Boostbook tests Usage: python build_docs.py [--generate-gold] """ import difflib, getopt, os, re, sys import ...
apache-2.0
bguillot/OpenUpgrade
addons/auth_openid/controllers/__init__.py
443
1033
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
jpautom/scikit-learn
sklearn/utils/tests/test_shortest_path.py
303
2841
from collections import defaultdict import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.utils.graph import (graph_shortest_path, single_source_shortest_path_length) def floyd_warshall_slow(graph, directed=False): N = graph.shape[0] #set nonzer...
bsd-3-clause
Thoshh/wapad
lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py
24
14373
from __future__ import unicode_literals import os from collections import OrderedDict from django.contrib.staticfiles.finders import get_finders from django.contrib.staticfiles.storage import staticfiles_storage from django.core.files.storage import FileSystemStorage from django.core.management.base import BaseComman...
mit
jasbro1/PDMProject
node_modules/node-gyp/gyp/pylib/gyp/input_test.py
1841
3207
#!/usr/bin/env python # Copyright 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. """Unit tests for the input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
mit
vibhorag/scikit-learn
doc/tutorial/machine_learning_map/svg2imagemap.py
360
3411
#!/usr/local/bin/python """ This script converts a subset of SVG into an HTML imagemap Note *subset*. It only handles <path> elements, for which it only pays attention to the M and L commands. Futher, it only notices the "translate" transform. It was written to generate the examples in the documentation f...
bsd-3-clause
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons/mass_mailing/models/mass_mailing_stats.py
91
5053
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0