text
stringlengths
475
200k
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
# 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...
# -*- coding: utf-8 -*- ################################################################################## # # Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com) # and 2004-2010 Tiny SPRL (<http://tiny.be>). # # $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $ # # This program is free software: you can redistri...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2018 OSGeo # # 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 ...
# -*- coding: utf-8 -*- """ OneLogin_Saml2_Logout_Request class Copyright (c) 2010-2018 OneLogin, Inc. MIT License Logout Request class of OneLogin's Python Toolkit. """ from app.lib.onelogin.saml2 import compat from app.lib.onelogin.saml2.constants import OneLogin_Saml2_Constants from app.lib.onelogin.saml2.utils...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
"""$Id: author.py 699 2006-09-25 02:01:18Z rubys $""" __author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>" __version__ = "$Revision: 699 $" __date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $" __copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim" from b...
from core.models import Slice, SliceDeployments, User from synchronizers.base.deleter import Deleter from openstack.driver import OpenStackDriver class SliceDeploymentsDeleter(Deleter): model='SliceDeployments' def call(self, pk): slice_deployment = SliceDeployments.objects.get(pk=pk) user = U...
class LRUCache: ''' >>> l = LRUCache(maxsize=3) >>> l.add('a') >>> l.add('b') >>> l.add('c') >>> l.add('d') >>> l.to_list() ['b', 'c', 'd'] >>> l.add('b') >>> l.to_list() ['c', 'b', 'd'] >>> l.add('b') >>> l.to_list() ['c', 'd', 'b'] >>> l.add('b') >>> l...
#!/usr/bin/env python # Copyright (c) 2013 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ increment-version.py -- Bump Beta or Canary version number across all required files. Crosswalk's versioning schema is "MAJOR.MI...
# -*- coding: utf-8 -*- """Celery error types. Error Hierarchy =============== - :exc:`Exception` - :exc:`celery.exceptions.CeleryError` - :exc:`~celery.exceptions.ImproperlyConfigured` - :exc:`~celery.exceptions.SecurityError` - :exc:`~celery.exceptions.TaskPredicate` - :exc:`...
# # # genWix.py is used to generate a WiX .wxs format file that # can be compiled by the candle.exe WiX compiler. # # Usage: python genWix.py <output_file> # # The current directory is expected to be the top of a tree # of built programs, libraries, documentation and files. # # The list of directories traversed is at ...
# Natural Language Toolkit: Corpus Reader Utilities # # Copyright (C) 2001-2012 NLTK Project # Author: Steven Bird <[EMAIL]> # Edward Loper <[EMAIL]> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT import os import sys import bisect import re import tempfile try: import cPickle as pick...
import unittest from unittest import TestCase from algorithms.dataStructures.Deque import Deque class deque_Test(TestCase): def setUp(self): self.d = Deque() def test_create_deque(self): self.assertIsInstance(self.d, Deque) def test_push_to_empty_deque(self): self.d.push(1) ...
# # This file is part of pyasn1-modules software. # # Copyright (c) 2005-2017, Ilya Etingof <[EMAIL]> # License: http://pyasn1.sf.net/license.html # # PKCS#8 syntax # # ASN.1 source from: # http://tools.ietf.org/html/rfc5208 # # Sample captures could be obtained with "openssl pkcs8 -topk8" command # from pyasn1_modules...
# Copyright 2014 Google Inc. All Rights Reserved. """Utilities for subcommands that need to SSH into virtual machine guests.""" import logging import os import subprocess from googlecloudsdk.calliope import exceptions from googlecloudsdk.compute.lib import base_classes from googlecloudsdk.compute.lib import constants...
# 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 License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
# 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...
########################################################################## # # Copyright (c) 2010, Image Engine Design 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: # # * Redistribu...
from __future__ import absolute_import from django.test import TestCase from django.utils import six from .models import (ObjectQuerySet, RelatedObject, Person, Book, Car, PersonManager, PublishedBookManager) class CustomManagerTests(TestCase): def test_manager(self): p1 = Person.objects.create(firs...
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public t...
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Windows platform implementation.""" import errno import functools import os import sys from collections import namedtuple from ...
import urllib2, os, tempfile import numpy as np from scipy.misc import imread from cs231n.fast_layers import conv_forward_fast """ Utility functions used for viewing and processing images. """ def blur_image(X): """ A very gentle image blurring operation, to be used as a regularizer for image generation. ...
# # Copyright (c) 2016, Alliance for Open Media. All rights reserved # # This source code is subject to the terms of the BSD 2 Clause License and # the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License # was not distributed with this source code in the LICENSE file, you can # obtain it at www.aome...
'''OpenGL extension NV.parameter_buffer_object This module customises the behaviour of the OpenGL.raw.GL.NV.parameter_buffer_object to provide a more Python-friendly API Overview (from the spec) This extension, in conjunction with NV_gpu_program4, provides a new type of program parameter than can be used as a c...
from __future__ import unicode_literals import sys from django.conf import settings from django.template import Library, Node, TemplateSyntaxError, Variable from django.template.base import TOKEN_TEXT, TOKEN_VAR, render_value_in_context from django.template.defaulttags import token_kwargs from django.utils import six...
#!/usr/bin/env python from __future__ import print_function __author__ = "Martin Paul Eve" __email__ = "[EMAIL]" """ A class to handle an interactive prompt. Portions of this file are Copyright 2014, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software an...
apiAttachAvailable = u'\u0414\u043e\u0441\u0442\u044a\u043f\u0435\u043d \u0447\u0440\u0435\u0437 API' apiAttachNotAvailable = u'\u041d\u0435\u0434\u043e\u0441\u0442\u044a\u043f\u0435\u043d' apiAttachPendingAuthorization = u'\u0427\u0430\u043a\u0430 \u0441\u0435 \u043e\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u...
""" support methods for python clients """ import json import collections from datetime import datetime from uuid import UUID from enum import Enum from dateutil import parser # python2/3 compatible basestring, for use in to_dict try: basestring except NameError: basestring = str def timestamp_from_datetim...
""" Unit tests for the stem.util.str_tools functions. """ import datetime import unittest from stem.util import str_tools class TestStrTools(unittest.TestCase): def test_to_int(self): """ Checks the _to_int() function. """ test_inputs = { '': 0, 'h': 104, 'hi': 26729, 'hel...
# 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 use ...
# -*- coding: utf-8 -*- """ Tests for the account API. """ import re from unittest import skipUnless from nose.tools import raises from mock import patch import ddt from dateutil.parser import parse as parse_datetime from django.core import mail from django.test import TestCase from django.conf import settings from ...
from __future__ import division, absolute_import, print_function __all__ = ['less', 'cosh', 'arcsinh', 'add', 'ceil', 'arctan2', 'floor_divide', 'fmod', 'hypot', 'logical_and', 'power', 'sinh', 'remainder', 'cos', 'equal', 'arccos', 'less_equal', 'divide', 'bitwise_or', 'bitwise_and', ...
#!/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 that two targets with the same name generates an error. """ import os import sys import TestGyp import TestCmd # TODO(sbc): Remo...
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist from django.template import resolve_variable from django.core.cache import cache from django.utils.encoding import force_unicode from django.utils.http import urlquote from django.utils.hashcompat import md5_constructor regi...
#-*- 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 ...
# 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. """Presubmit script for ChromeVox.""" def CheckChangeOnUpload(input_api, output_api): paths = input_api.AbsoluteLocalPaths() def ShouldCheckFile(path):...
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
# -*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2015 Savoir-faire Linux. 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 publish...
from test import test_support import unittest nis = test_support.import_module('nis') class NisTests(unittest.TestCase): def test_maps(self): try: maps = nis.maps() except nis.error, msg: # NIS is probably not active, so this test isn't useful if test_support.ve...
from __future__ import unicode_literals import mimetypes import os import random import time from email import ( charset as Charset, encoders as Encoders, generator, message_from_string, ) from email.header import Header from email.message import Message from email.mime.base import MIMEBase from email.mime.message...
"""Tests for pytest-services plugin.""" import os.path import socket import pylibmc import MySQLdb def test_memcached(request, memcached, memcached_socket): """Test memcached service.""" mc = pylibmc.Client([memcached_socket]) mc.set('some', 1) assert mc.get('some') == 1 # check memcached cleane...
"""Support for Join notifications.""" import logging import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService, ) from homeassistant.const import CONF_API_KEY import homeassistant.helpers.config_validati...
""" Provide urlresolver functions that return fully qualified URLs or view names """ from __future__ import unicode_literals from django.core.urlresolvers import reverse as django_reverse from django.core.urlresolvers import NoReverseMatch from django.utils import six from django.utils.functional import lazy from res...
""" ================= Drop Shadow Frame ================= A widget providing a drop shadow (gaussian blur effect) around another widget. """ from PyQt4.QtGui import ( QWidget, QPainter, QPixmap, QGraphicsScene, QGraphicsRectItem, QGraphicsDropShadowEffect, QColor, QPen, QPalette, QStyleOption, QAbstractS...
# -*- coding: utf-8 -*- # # 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 #...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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....
from rest_framework import status from rest_framework.test import APITestCase from django.urls import reverse from faker import Factory from django.contrib.auth.models import User from farms.models import Farm,Zone from farms.serializers import FarmSerializer from collections import OrderedDict ###### Module configs ...
# Copyright 2012 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...
# Copyright (C) 2011 Midokura KK # Copyright (C) 2011 Nicira, Inc # 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 # # ...
# -*- coding: utf-8 -*- """ flask.globals ~~~~~~~~~~~~~ Defines all the global objects that are proxies to the current active context. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import partial from werkzeug.local import LocalStack, ...
from django.db import models class R(models.Model): is_default = models.BooleanField(default=False) def __str__(self): return "%s" % self.pk get_default_r = lambda: R.objects.get_or_create(is_default=True)[0] class S(models.Model): r = models.ForeignKey(R) class T(models.Model): s = mod...
# -*- coding: utf-8 -*- """ pygments.lexers.templates ~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for various template engines' markup. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexers.web import \ PhpLexer, H...
# (c) 2012, Michael DeHaan <[EMAIL]> # Copyright 2015 Abhijit Menon-Sen <[EMAIL]> # Copyright 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 Fou...
# 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 ...
""" Stub implementation of YouTube for acceptance tests. To start this stub server on its own from Vagrant: 1.) Locally, modify your Vagrantfile so that it contains: config.vm.network :forwarded_port, guest: 8031, host: 8031 2.) From within Vagrant dev environment do: cd common/djangoapps/terrain pyth...
# -*- coding: utf-8 -*- from email.parser import BytesParser from django.core.cache import cache from servo.lib.utils import empty from servo.exceptions import ConfigurationError from servo.models import Configuration, User, Order, Note, Template def get_rules(): """ Get the rules from the JSON file and cac...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Hiroaki Nakamura <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1'...
"""add geoloc tables Revision ID: 2b35f2f2adcb Revises: 29474f196c96 Create Date: 2015-11-09 00:12:02.604229 """ # revision identifiers, used by Alembic. revision = '2b35f2f2adcb' down_revision = '29474f196c96' branch_labels = None depends_on = None import os import json from alembic import op import sqlalchemy as...
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
# 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...
"""Tests of the builder registry.""" import unittest from bs4 import BeautifulSoup from bs4.builder import ( builder_registry as registry, HTMLParserTreeBuilder, TreeBuilderRegistry, ) try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError: HTML5LIB_PRESENT =...
""" Fenced Code Extension for Python Markdown ========================================= This extension adds Fenced Code Blocks to Python-Markdown. >>> import markdown >>> text = ''' ... A paragraph before a fenced code block: ... ... ~~~ ... Fenced code block ... ~~~ ... ''' >>> ht...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) Pilot Systems and Libération, 2010-2011 # This file is part of SeSQL. # SeSQL 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 th...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Cloudscaling Group, 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/LI...
import unittest def merge_sort(array): if len(array) <= 1: return array mid = len(array) / 2 merge1, merge2 = merge_sort(array[:mid]), merge_sort(array[mid:]) def merge(left, right): l, r = 0, 0 while l < len(left) and r < len(right): if left[l] < right[r]: ...
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
from openerp import models from openerp.tools import mute_logger from openerp.osv.orm import except_orm from openerp.tests import common class TestAPI(common.TransactionCase): """ test the new API of the ORM """ def assertIsRecordset(self, value, model): self.assertIsInstance(value, models.BaseModel...
# -*- coding: utf-8 -*- """ jinja2.parser ~~~~~~~~~~~~~ Implements the template parser. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2 import nodes from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError from jinja2.lexer impo...
import datetime import unittest from django.apps.registry import Apps from django.core.exceptions import ValidationError from django.db import models from django.test import TestCase from .models import ( CustomPKModel, FlexibleDatePost, ModelToValidate, Post, UniqueErrorsModel, UniqueFieldsModel, UniqueForDa...
__author__ = "Luke Hart" __copyright__ = "Copyright 2014, The Jeff Museum" __credits__ = ["Luke Hart","Joe Ellis", "Chris Sewell", "Matt Ribbins", "Sebastian Beaven", "Joshua Webb", "Andrew Bremmer"] __license__ = "GPL" __version__ = "0.9" __maintainer__ = "Luke Hart" __email__ = "[EMAIL]" __status__ = "...
from django import http from django.conf import settings from django.db.models import Q from django.shortcuts import render from django.utils import translation from django.utils.encoding import smart_str from django.views.decorators.vary import vary_on_headers import commonware.log from mobility.decorators import mob...
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
from sympy.liealgebras.weyl_group import WeylGroup from sympy.liealgebras.type_a import TypeA from sympy.liealgebras.type_b import TypeB from sympy.matrices import Matrix def test_weyl_group(): c = WeylGroup("A3") assert c.matrix_form('r1*r2') == Matrix([[0, 0, 1, 0], [1, 0, 0, 0], [0, 1, 0, 0], [0, 0,...
# 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/. from __future__ import absolute_import import structlog from flask import Blueprint from flask import current_app from ...
"""Serializers for commment REST APIs""" from datetime import datetime, timezone from django.contrib.auth import get_user_model from praw.models import Comment, MoreComments from praw.models.reddit.submission import Submission from rest_framework import serializers from rest_framework.exceptions import ValidationError...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
import aioreactive as rx import pytest from aioreactive.notification import OnCompleted, OnNext from aioreactive.testing import AsyncTestObserver, VirtualTimeEventLoop from aioreactive.types import AsyncObservable from expression.core import pipe @pytest.yield_fixture() # type: ignore def event_loop(): loop = Vi...
from sympy.core.symbol import Symbol from sympy.core.compatibility import u, range from sympy.printing.pretty.stringpict import prettyForm class BaseScalar(Symbol): """ A coordinate symbol/base scalar. Ideally, users should not instantiate this class. """ def __new__(cls, name, index, system, p...
""" Implementation of the command-line I{pyflakes} tool. """ import sys import os import _ast checker = __import__('pyflakes.checker').checker def check(codeString, filename): """ Check the Python source given by C{codeString} for flakes. @param codeString: The Python source to check. @type codeStr...
from __future__ import print_function import numpy as np from theano.compat.six.moves import cStringIO, xrange import theano.tensor as T from theano.tests import disturb_mem from theano.tests.record import Record, RecordMode from pylearn2.compat import first_key from pylearn2.costs.cost import Cost, SumOfCosts, Defau...
__all__ = ['Serializer', 'SerializerError'] from error import YAMLError from events import * from nodes import * class SerializerError(YAMLError): pass class Serializer(object): ANCHOR_TEMPLATE = u'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=No...
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.base import Base from geocoder.keys import app_id, app_code from geocoder.location import Location from geocoder.here import Here class HereReverse(Here, Base): """ HERE Geocoding REST API ======================= Se...
"""Fallback pure Python implementation of msgpack""" from datetime import datetime as _DateTime import sys import struct PY2 = sys.version_info[0] == 2 if PY2: int_types = (int, long) def dict_iteritems(d): return d.iteritems() else: int_types = int unicode = str xrange = range de...
#! /usr/bin/env python ############################################################################ ## setup.py ## ## Copyright 2008 Jeet Sukumaran. ## ## 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 Softwa...
# util/_collections.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Collection classes and helpers.""" import sys import itertools import weakref...
import sys import datetime import os from contextlib import contextmanager import freezegun import pytest import pretend import pip from pip._vendor import lockfile from pip.utils import outdated @pytest.mark.parametrize( ['stored_time', 'newver', 'check', 'warn'], [ ('1970-01-01T10:00:00Z', '2.0', ...
# -*- coding: utf-8 -*- import bisect from collections import defaultdict import io import json import logging import zipfile from babelfish import Language from guessit import guessit from requests import Session from . import ParserBeautifulSoup, Provider from .. import __short_version__ from ..cache import SHOW_EX...
# Copyright (c) 2011 OpenStack, LLC. # # 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...
__author__ = 'Nicholas C Pandolfi' #The MIT License (MIT) # #Copyright (c) 2014 Nicholas C Pandolfi # #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 lim...
# # Copyright 2015 Naver 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 to in writing...
""" arfile - A module to parse GNU ar archives. Copyright (c) 2006-7 Paul Sokolovsky This file is released under the terms of GNU General Public License v2 or later. """ import sys import os import tarfile class FileSection: "A class which allows to treat portion of file as separate file object." def __in...
# # distutils/version.py # # Implements multiple version numbering conventions for the # Python Module Distribution Utilities. # # $Id$ # """Provides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion and LooseVe...
import sys, string, os from xml.etree import ElementTree as ET from xml.dom import minidom projFile = sys.argv[1] targetPath = sys.argv[2] def getLinkElement(): global targetPath ret = ET.Element('link') nameEle = ET.Element('name') nameEle.text = 'plugin-x' typeEle = ET.Element('type') typeEl...
# util/deprecations.py # Copyright (C) 2005-2011 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 """Helpers related to deprecation of functions, methods, classes, other functiona...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import unittest import settings import time import mosquitto import serial def on_message(mosq, obj, msg): obj.message_queue.append(msg) class mqtt_publish_in_callback(unittest.TestCase): message_queue = [] @classmethod def setUpClass(self): self.client = mosquitto.Mosquitto("pubsubclient_ut", cle...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
""" Convenience routines for creating non-trivial Field subclasses, as well as backwards compatibility utilities. Add SubfieldBase as the metaclass for your Field subclass, implement to_python() and the other necessary methods and everything will work seamlessly. """ class SubfieldBase(type): """ A metaclass ...
from ansible.modules.cloud.amazon import redshift_cross_region_snapshots as rcrs mock_status_enabled = { 'SnapshotCopyGrantName': 'snapshot-us-east-1-to-us-west-2', 'DestinationRegion': 'us-west-2', 'RetentionPeriod': 1, } mock_status_disabled = {} mock_request_illegal = { 'snapshot_copy_grant': 'cha...