text
stringlengths
475
200k
# -*- 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...
import atexit import os import shutil import string import sys import tempfile import traceback import mock from .. import base from pulp.plugins.cataloger import Cataloger from pulp.plugins.distributor import Distributor from pulp.plugins.importer import Importer from pulp.plugins.loader import exceptions, loading, ...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
from __future__ import unicode_literals import collections import getpass import optparse import os import re import shutil import socket import subprocess import sys import itertools try: import urllib.request as compat_urllib_request except ImportError: # Python 2 import urllib2 as compat_urllib_request ...
#!/usr/bin/python # # Copyright (c) 2008 Steven Watanabe # # 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) # Test that the common.copy rule set the modification date of the new file to # the current time. import B...
from __future__ import print_function from builtins import range from six.moves import cPickle as pickle import numpy as np import os from scipy.misc import imread import platform def load_pickle(f): version = platform.python_version_tuple() if version[0] == '2': return pickle.load(f) elif versio...
from lib.hachoir_core.tools import (humanDatetime, humanDuration, timestampUNIX, timestampMac32, timestampUUID60, timestampWin64, durationWin64) from lib.hachoir_core.field import Bits, FieldSet from datetime import datetime class GenericTimestamp(Bits): def __init__(self, parent, name, size, description=N...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <[EMAIL]> # Copyright 2007 Kenneth Loafman <[EMAIL]> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the...
import attr import dataclasses @dataclasses.dataclass(frozen=True) class A1: a: int = 1 @dataclasses.dataclass(frozen=True) class B1(A1): b: str = "1" <error descr="'A1' object attribute 'a' is read-only">A1().a</error> = 2 <error descr="'B1' object attribute 'a' is read-only">B1().a</error> = 2 <error desc...
# -*- 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...
from inspect import cleandoc from coala_utils.decorators import ( enforce_signature, generate_consistency_check) @generate_consistency_check('definition', 'example', 'example_language', 'importance_reason', 'fix_suggestions') class Documentation: """ This class contains docume...
#!/usr/bin/env python # -*- coding: utf-8 -*- from saml2 import BINDING_SOAP, BINDING_URI from saml2 import BINDING_HTTP_REDIRECT from saml2 import BINDING_HTTP_POST from saml2 import BINDING_HTTP_ARTIFACT from saml2.saml import NAMEID_FORMAT_PERSISTENT from saml2.saml import NAME_FORMAT_URI from pathutils import full...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os from textwrap import dedent from pants.backend.codegen.ragel.java.java_ragel_library import JavaRagelLibrary from pants.backend.codegen.ragel.java.ragel_gen import RagelGen, cal...
""" Ridge regression """ # Author: Mathieu Blondel <[EMAIL]> # Reuben Fletcher-Costin <[EMAIL]> # Fabian Pedregosa <[EMAIL]> # Michael Eickenberg <[EMAIL]> # License: BSD 3 clause from abc import ABCMeta, abstractmethod import warnings import numpy as np from scipy import linalg from scipy i...
# Copyright (c) 2013 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 ...
""" Utilities for writing third_party_auth tests. Used by Django and non-Django tests; must not have Django deps. """ from contextlib import contextmanager from django.conf import settings import django.test import mock import os.path from third_party_auth.models import OAuth2ProviderConfig, SAMLProviderConfig, SAML...
# coding: utf-8 from flask import Flask, session, redirect, url_for, request,abort import config config = config.rec() def on_finish(): None def currentUserGet(): if 'user' in session: user = session['user'] return user['username'] else: return None def currentUserSet(username):...
from django.utils import unittest from django.utils.termcolors import (parse_color_setting, PALETTES, DEFAULT_PALETTE, LIGHT_PALETTE, DARK_PALETTE, NOCOLOR_PALETTE, colorize) class TermColorTests(unittest.TestCase): def test_empty_string(self): self.assertEqual(parse_color_setting(''), PALETTES[DEFAU...
#!/usr/bin/env python # # Copyright 2010 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 o...
# Copyright (C) 2011 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import compat_str from ..utils import ( qualities, unescapeHTML, xpath_element, ) class AllocineIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?allocine\.fr/(?P<...
# 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...
from __future__ import print_function #import unittest import os import sys from functools import wraps from django.conf import settings from south.hacks import hacks # Make sure skipping tests is available. try: # easiest and best is unittest included in Django>=1.3 from django.utils import unittest except I...
#!/usr/bin/python """Interface to journalctl.""" from time import time import json import re import subprocess from ansible.module_utils.basic import AnsibleModule class InvalidMatcherRegexp(Exception): """Exception class for invalid matcher regexp.""" pass class InvalidLogEntry(Exception): """Excepti...
data = ( 'Chang ', # 0x00 'Chi ', # 0x01 'Bing ', # 0x02 'Zan ', # 0x03 'Yao ', # 0x04 'Cui ', # 0x05 'Lia ', # 0x06 'Wan ', # 0x07 'Lai ', # 0x08 'Cang ', # 0x09 'Zong ', # 0x0a 'Ge ', # 0x0b 'Guan ', # 0x0c 'Bei ', # 0x0d 'Tian ', # 0x0e 'Shu ', # 0x0f 'Shu ', # 0x10...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP SA (<http://openerp.com>). # # This program is free software: you can ...
#!/usr/bin/python """ This is the utility for watering flowers """ # Copyright (c) 2010-2016 LiTtl3.1 Industries (LiTtl3.1). # All rights reserved. # This source code and any compilation or derivative thereof is the # proprietary information of LiTtl3.1 Industries and is # confidential in nature. # Use of this source...
# -*- coding: utf-8 -*- """ jinja2.filters ~~~~~~~~~~~~~~ Bundled jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import math from random import choice from operator import itemgetter from itertools import groupby from jinja2.utils...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
#!/usr/local/bin/python #coding :utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2021 yutiansut/QUANTAXIS # # 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, includ...
#!/usr/bin/env python # # Copyright 2005,2006,2007 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 you...
""" Find in Demo Employees file by NAME, DEPTartment or MAKE Adapt DBID, FNR and AUTOFNR Note: when using FIND with MAKE and AUTOFNR != 12, file number in search criterium must be changed in searchfield() parms $Date: 2008-08-29 16:48:48 +0200 (Fri, 29 Aug 2008) $ $Rev: 68 $ """ # Copyright 2004-20...
"""CPStats, a package for collecting and reporting on program statistics. Overview ======== Statistics about program operation are an invaluable monitoring and debugging tool. Unfortunately, the gathering and reporting of these critical values is usually ad-hoc. This package aims to add a centralized place for gather...
import os from django.conf import settings as django_settings from django.test.signals import setting_changed DEFAULTS = { 'AWS_XRAY_DAEMON_ADDRESS': '127.0.0.1:2000', 'AUTO_INSTRUMENT': True, 'AWS_XRAY_CONTEXT_MISSING': 'RUNTIME_ERROR', 'PLUGINS': (), 'SAMPLING': True, 'SAMPLING_RULES': None,...
#!/usr/bin/env python import collections import json import os import requests from datetime import datetime from tabulate import tabulate IdleTimeRecord = collections.namedtuple('IdleTimeRecord', ['pull_request', 'idle_time']) def created_at(pull_request): # String format can parse: 2018-01-29T16:23:55Z, 2018-0...
# failed system call counts, by pid # (c) 2010, Tom Zanussi <[EMAIL]> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(o...
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for dict methods. d.keys() -> list(d.keys()) d.items() -> list(d.items()) d.values() -> list(d.values()) d.iterkeys() -> iter(d.keys()) d.iteritems() -> iter(d.items()) d.itervalues() -> iter(d.values()) d.v...
"""Proxy models for Program annotations for Home Page and Program Page ProgramMetrics - superset of classes for shared program annotation functions ProgramForHomePage - classes to support the Country/Portfolio roll-up of Program metrics ProgramForProgramPage - classes to support in depth single-program que...
import functools import sys import unittest from test import test_support from weakref import proxy import pickle @staticmethod def PythonPartial(func, *args, **keywords): 'Pure Python approximation of partial()' def newfunc(*fargs, **fkeywords): newkeywords = keywords.copy() newkeywords.update...
#!/usr/bin/env python """ This script starts a process locally, using <client-id> <hostfile> as inputs. """ import os from os.path import dirname import time import sys from optparse import OptionParser if len(sys.argv) < 3: print "usage: %s <client-id> <hostfile>" % sys.argv[0] sys.exit(1) # app_dir is 2 dirs...
""" sentry.db.models.manager ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import hashlib import logging import threading import weakref from django.conf imp...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Cisco Systems, Inc. # Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use...
"""Drop-in replacement for the thread module. Meant to be used as a brain-dead substitute so that threaded code does not need to be rewritten for when the thread module is not present. Suggested usage is:: try: import _thread except ImportError: import _dummy_thread as _thread """ # Exports ...
# # Copyright 2008 Google Inc. All Rights Reserved. # """ This module contains the generic CLI object High Level Design: The atest class contains attributes & method generic to all the CLI operations. The class inheritance is shown here using the command 'atest host create ...' as an example: atest <-- host <-- hos...
#!/usr/bin/env python # Copyright (c) 2016 The Khronos Group Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and/or associated documentation files (the # "Materials"), to deal in the Materials without restriction, including # without limitation the rights to use...
#!/usr/bin/env python # -*- coding: utf-8 -*- # sigma tests. # Copyright 2013 Grigory Petrov # See LICENSE for details. import sys sys.dont_write_bytecode = True import sigma assert sigma.parse( """ #!/usr/bin/python ##{ print( "foo" ) ##} ##@ This is TOC. """.strip() ) == [ sigma.TagTxt( ...
import py_pjsua status = py_pjsua.create() print "py status " + `status` # # Create configuration objects # ua_cfg = py_pjsua.config_default() log_cfg = py_pjsua.logging_config_default() media_cfg = py_pjsua.media_config_default() # # Logging callback. # def logging_cb1(level, str, len): print str, # # Config...
"""Bisection algorithms.""" def insort_right(a, x, lo=0, hi=None): """Insert item x in list a, and keep it sorted assuming a is sorted. If x is already in a, insert it to the right of the rightmost x. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. ...
# -*- coding: utf-8 -*- # (c) 2017 Toshio Kuratomi <[EMAIL]> # # 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) ...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Development script to get the multiplicity of the separation facets for some model coordination environments """ __author__ = "David Waroquiers" __copyright__ = "Copyright 2012, The Materials Project" __ve...
""" Test cases adapted from the test_bsddb.py module in Python's regression test suite. """ import os, string import unittest from test_all import db, hashopen, btopen, rnopen, verbose, \ get_new_database_path class CompatibilityTestCase(unittest.TestCase): def setUp(self): self.filename = get_n...
# -*- coding: utf-8 -*- # daemon/version/__init__.py # Part of python-daemon, an implementation of PEP 3143. # # Copyright © 2008–2009 Ben Finney <[EMAIL]> # This is free software: you may copy, modify, and/or distribute this work # under the terms of the Python Software Foundation License, version 2 or # later as pub...
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** This will append site-specific paths to the module sear...
""" Management command to update content libraries' search index """ # lint-amnesty, pylint: disable=cyclic-import import logging from textwrap import dedent from django.core.management import BaseCommand from opaque_keys.edx.locator import LibraryLocatorV2 from openedx.core.djangoapps.content_libraries.api import...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, js_to_json, ) class OnDemandKoreaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ondemandkorea\.com/(?P<id>[^/]+)\.html' _GEO_COUNTRIES = ['US', 'CA'] _TEST = { ...
# 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...
# encoding: utf-8 # module _io calls itself io # from (built-in) # by generator 1.135 """ The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. ...
# -*- 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...
#!/usr/bin/env python # Copyright (c) 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. """Chrome Version Tool Scrapes Chrome channel information and prints out the requested nugget of information. """ import json imp...
from packetbeat import BaseTest class Test(BaseTest): def test_amqp_emit_receive(self): self.render_config_template( amqp_ports=[5672], ) self.run_packetbeat(pcap="amqp_emit_receive.pcap", debug_selectors=["amqp,tcp,publish"]) o...
# This file is part of pdar. # # Copyright 2011 Jason Penney # # 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 applicab...
from django.contrib.syndication.views import Feed from django.contrib.syndication.views import FeedDoesNotExist from django.core.exceptions import ObjectDoesNotExist from django_fixmystreet.fixmystreet.models import Report class LatestReports(Feed): title = "All FixMyStreet Reports" link = "/reports/" des...
#!/usr/bin/python # -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) Vauxoo (<http://vauxoo.com>). # All Rights Reserved ###############Credits#########################################...
# 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...
# Author: Nic Wolfe <[EMAIL]> # URL: https://sickrage.tv # Git: https://github.com/SiCKRAGETV/SickRage.git # # This file is part of SickRage. # # SickRage 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...
"""Utilities using NDG HTTPS Client, including a main module that can be used to fetch from a URL. """ __author__ = "R B Wilkinson" __date__ = "09/12/11" __copyright__ = "(C) 2011 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "[EMAIL]" __revision_...
#!/usr/bin/env python """Wrapper around yamllint that supports YAML embedded in Ansible modules.""" from __future__ import absolute_import, print_function import ast import json import os import sys from yamllint import linter from yamllint.config import YamlLintConfig def main(): """Main program body.""" ...
""" Module: feed_def_reader Description: Reads in fed def file and controls the feed construction process Authored by: MapLarge, Inc. (Scott Rowles) Change Log: """ """ Define all the imports for the feed_def_reader module """ import json import sys from website_feed_constructor import WebsiteFeedConstructor from d...
import six SERIALIZABLE_TYPES = (dict, list, tuple, set, bool, type(None)) + \ six.integer_types + six.string_types + \ (six.text_type, six.binary_type,) def partial_to_session(strategy, next, backend, request=None, *args, **kwargs): user = kwargs.get('user') social...
# This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep) import stringprep, re, codecs from unicodedata import ucd_3_2_0 as unicodedata # IDNA section 3.1 dots = re.compile("[\u002E\u3002\uFF0E\uFF61]") # IDNA section 5 ace_prefix = b"xn--" sace_prefix = "xn--" # This assumes query strings, so AllowUnassig...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Module: l10n_hr # Author: Goran Kliska # mail: goran.kliska(AT)slobodni-programi.hr # Copyright (C) 2011- Slobodni programi d.o.o., Zagreb # Contrib...
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified under the terms of # the GNU Lesser General Pub...
""" Real spectrum tranforms (DCT, DST, MDCT) """ from __future__ import division, print_function, absolute_import __all__ = ['dct', 'idct', 'dst', 'idst'] import numpy as np from scipy.fftpack import _fftpack from scipy.fftpack.basic import _datacopied import atexit atexit.register(_fftpack.destroy_ddct1_cache) ate...
import os from contextlib import closing from StringIO import StringIO try: from urllib import parse as urlparse except ImportError: import urlparse import dropbox from libearth.repository import (FileNotFoundError, NotADirectoryError, Repository, RepositoryKeyError) __all__ =...
# # File: courseware/capa/inputtypes.py # """ Module containing the problem elements which render into input objects - textline - textbox (aka codeinput) - schematic - choicegroup (aka radiogroup, checkboxgroup) - javascriptinput - imageinput (for clickable image) - optioninput (for option list) - filesubmission (...
"""Generated message classes for bigquery version v2. A data platform for customers to create, manage, share and query data. """ from protorpc import messages from googlecloudapis.apitools.base.py import encoding from googlecloudapis.apitools.base.py import extra_types package = 'bigquery' class BigqueryDatasets...
""" View validation code (using assertions, not the RNG schema). """ import logging _logger = logging.getLogger(__name__) def valid_page_in_book(arch): """A `page` node must be below a `book` node.""" return not arch.xpath('//page[not(ancestor::notebook)]') def valid_field_in_graph(arch): """ Children...
""" Unit tests for nonlinear solvers Author: Ondrej Certik May 2007 """ from __future__ import division, print_function, absolute_import from numpy.testing import assert_, dec, TestCase, run_module_suite from scipy._lib.six import xrange from scipy.optimize import nonlin, root from numpy import matrix, diag, dot from...
import sys, os from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer lexers['php'] = PhpLexer(startinline=True, linenos=1) lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) primary_domain = 'php' # -- General configuration -----------------------------------------------------...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
import hearthbreaker.game_objects class ProxyCharacter: def __init__(self, character_ref): if type(character_ref) is str: if character_ref.find(":") > -1: [self.player_ref, self.minion_ref] = character_ref.split(':') self.minion_ref = int(self.minion_ref) ...
import os class suppress_stdout_stderr(object): ''' A context manager for doing a "deep suppression" of stdout and stderr in Python, i.e. will suppress all print, even if the print originates in a compiled C/Fortran sub-function. This will not suppress raised exceptions, since exceptions are p...
# -*- coding: utf-8 -*- """ functions.py - Miscellaneous functions with no other home Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. """ from __future__ import division import warnings import numpy as np import decimal, re import ctypes import sys, struct from ...
from io import BytesIO from django.core.handlers.wsgi import WSGIRequest from django.core.servers.basehttp import WSGIRequestHandler from django.test import SimpleTestCase from django.test.client import RequestFactory from django.test.utils import captured_stderr class Stub(object): def __init__(self, **kwargs):...
"""Attribute selector plugin. Oftentimes when testing you will want to select tests based on criteria rather then simply by filename. For example, you might want to run all tests except for the slow ones. You can do this with the Attribute selector plugin by setting attributes on your test methods. Here is an example:...
"""Fix incompatible renames Fixes: * sys.maxint -> sys.maxsize """ # Author: Christian Heimes # based on Collin Winter's fix_import # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {"sys": {"maxint" : "maxsize"}, } LOOKUP = {} def alternates(members): re...
# engine/threadlocal.py # Copyright (C) 2005-2016 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 """Provides a thread-local transactional wrapper around the root Engine class....
#!/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. """ Verifies that dependent Xcode settings are processed correctly. """ import TestGyp import TestMac import subprocess import sys if sys...
def pytest_configure(): from django.conf import settings settings.configure( DEBUG_PROPAGATE_EXCEPTIONS=True, DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}}, SITE_ID=1, SECRET_KEY='not very secret in tests', ...
import datetime import base64 import hashlib import math def _write_cpp_header(f, include_guard): year = datetime.date.today().year f.write(( "// Copyright %(year)d The Chromium Authors. All rights reserved.\n" "// Use of this source code is governed by a BSD-style license" " that can b...
from __future__ import absolute_import, print_function import time import parser import warnings from numpy import (float32, float64, complex64, complex128, zeros, random, array) from numpy.testing import (TestCase, assert_equal, assert_allclose, run_module_suite) from ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # Copyright (C) 2011 University of Dundee & Open Microscopy Environment. # All rights reserved. # # 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 Fou...
from django.template.defaultfilters import addslashes from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class AddslashesTests(SimpleTestCase): @setup({'addslashes01': '{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}'}) ...
#!/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. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class User(models.Model): username = models.CharField(max_length=100) email = models.EmailField() def __str__(self): return self.username @python_2_unicode_compatible class Us...
#!/usr/bin/env python # # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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...
#!/usr/bin/env python # This file is part of tcollector. # Copyright (C) 2011-2013 The tcollector Authors. # # This program 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 Licen...
#!/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...
""" Parent classes describing a layer, model or operator """ __docformat__ = 'restructedtext en' __authors__ = ("Razvan Pascanu " "KyungHyun Cho " "Caglar Gulcehre ") __contact__ = "Razvan Pascanu <r.pascanu@gmail>" import numpy import copy import cPickle as pkl import logging import th...