content
string
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class EditNewsletter(Choreography): def __init__(self, temboo_session): """ Create ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import jinja2 __all__ = ['AnsibleJ2Template'] class AnsibleJ2Template(jinja2.environment.Template): ''' A helper class, which prevents Jinja2 from running _jinja2_vars through dict(). Without this, {% include %} and ...
from nova.api.openstack import extensions from nova import network ALIAS = 'os-floating-ip-pools' authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS) def _translate_floating_ip_view(pool_name): return { 'name': pool_name, } def _translate_floating_ip_pools_view(pools): return...
"""Tests for stochastic graphs.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib.bayesflow.python.ops import stochastic_gradient_estimators from tensorflow.contrib.bayesflow.python.ops import stochastic_tensor_i...
from __future__ import absolute_import # The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # u...
try: import unittest2 as unittest except ImportError: import unittest import collections try: from unittest import mock except ImportError: import mock from pymongo.cursor import Cursor from simon import connection, query from simon._compat import range from .utils import AN_OBJECT_ID, ModelFactory...
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2011, Kovid Goyal <<EMAIL>>' __docformat__ = 'restructuredtext en' import os, re, cPickle, traceback from functools import partial from collections import defaultdict from copy import deepcopy from cali...
""" =========================================== Spectral clustering for image segmentation =========================================== In this example, an image with connected circles is generated and spectral clustering is used to separate the circles. In these settings, the :ref:`spectral_clustering` approach solve...
import sys absolute_import = (sys.version_info[0] >= 3) if not absolute_import : if __name__.startswith('bsddb3.') : # import _pybsddb binary as it should be the more recent version from # a standalone pybsddb addon package than the version included with # python as bsddb._bsddb. fr...
"""Support for beets plugins.""" from __future__ import division, absolute_import, print_function import inspect import traceback import re from collections import defaultdict from functools import wraps import beets from beets import logging from beets import mediafile PLUGIN_NAMESPACE = 'beetsplug' # Plugins us...
""" tests.test_traversal ==================== Tests traversing the sysfs hierarchy. .. moduleauthor:: mulhern <<EMAIL>> """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import pyblk import pytes...
from nova.api.ec2 import ec2utils from nova import context from nova import objects from nova import test class EC2UtilsTestCase(test.TestCase): def setUp(self): self.ctxt = context.get_admin_context() ec2utils.reset_cache() super(EC2UtilsTestCase, self).setUp() def test_get_int_id_fr...
import sys import os file_path = os.path.abspath(__file__) dir_path = os.path.dirname(file_path) lib_path = os.path.join(dir_path, "lib") sys.path.insert(0, lib_path) import pymongo # connnecto to the db on standard port connection = pymongo.MongoClient("mongodb://localhost") db = connection.students ...
#!/usr/bin/python """ takes templated file .xxx.src and produces .xxx file where .xxx is .i or .c or .h, using the following template rules /**begin repeat -- on a line by itself marks the start of a repeated code segment /**end repeat**/ -- on a line by itself marks it's end After the /**begin ...
from __future__ import unicode_literals from datetime import date from django.test import ignore_warnings, override_settings from django.utils.deprecation import RemovedInDjango110Warning from .base import SitemapTestsBase @override_settings(ROOT_URLCONF='sitemaps_tests.urls.https') class HTTPSSitemapTests(Sitemap...
"""Tests for pyu2f.hardware.""" import sys import mock from pyu2f import errors from pyu2f import hardware if sys.version_info[:2] < (2, 7): import unittest2 as unittest # pylint: disable=g-import-not-at-top else: import unittest # pylint: disable=g-import-not-at-top class HardwareTest(unittest.TestCase): ...
"""Implements (a subset of) Sun XDR -- eXternal Data Representation. See: RFC 1014 """ import struct try: from cStringIO import StringIO as _StringIO except ImportError: from StringIO import StringIO as _StringIO __all__ = ["Error", "Packer", "Unpacker", "ConversionError"] # exceptions class Error(Exceptio...
import numpy as np from scipy import stats, special from . import link_functions from .likelihood import Likelihood from .gaussian import Gaussian from ..core.parameterization import Param from paramz.transformations import Logexp from ..core.parameterization import Parameterized import itertools class MixedNoise(Like...
""" Verify that building an object file correctly depends on running actions in dependent targets, but not the targets themselves. """ import os import sys import TestGyp # NOTE(piman): This test will not work with other generators because: # - it explicitly tests the optimization, which is not implemented (yet?) on ...
"""Tests for reconiliation behaviour that is repository independent.""" from bzrlib import ( bzrdir, errors, tests, ) from bzrlib.reconcile import reconcile, Reconciler from bzrlib.tests import per_repository class TestWorksWithSharedRepositories(per_repository.TestCaseWithRepository): def test...
from __future__ import with_statement # for python 2.5 from modules.base_module import RanaModule import threading # only import GKT libs if GTK GUI is used from core import gs if gs.GUIString == "GTK": import gobject elif gs.GUIString.lower() == "qt5": import pyotherside elif gs.GUIString.lower() == "qml": ...
import optparse import os import sys import copy # Temporary storage for instructions. The queue is filled in out-of-order # until it reaches 'max_threshold' number of instructions. It is then # sorted out and instructions are printed out until their number drops to # 'min_threshold'. # It is assumed that the instruct...
from setuptools.command.easy_install import easy_install from distutils.util import convert_path from pkg_resources import Distribution, PathMetadata, normalize_path from distutils import log from distutils.errors import * import sys, os, setuptools, glob class develop(easy_install): """Set up package for developm...
import time from osv import fields, osv class AccountReportGeneralLedgerWizard(osv.osv_memory): """Will launch general ledger report and pass requiered args""" _inherit = "account.common.account.report" _name = "general.ledger.webkit" _description = "General Ledger Report" def _get_account_ids...
{ 'name': 'Metro MRP', 'version': '1.0', 'category': 'Metro', 'description': """ Metro MRP Extension: 1.Add CNC Work Order (Ported to OpenERP v 7.0 by Metro Tower Trucks. """, 'author': 'Metro Tower Trucks', 'web...
# -*- coding: utf-8 -*- import re from ..internal.SimpleCrypter import SimpleCrypter class CryptCat(SimpleCrypter): __name__ = "CryptCat" __type__ = "crypter" __version__ = "0.04" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?crypt\.cat/\w+' __config__ = [("activated", "bool", "...
#squid.py Library import RPi.GPIO as GPIO import time WHITE = (30, 30, 30) OFF = (0, 0, 0) RED = (100, 0, 0) GREEN = (0, 100, 0) BLUE = (0, 0, 100) YELLOW = (50, 50, 0) PURPLE = (50, 0, 50) CYAN = (0, 50, 50) class Squid: RED_PIN = 0 GREEN_PIN = 0 BLUE_PIN = 0 red_pwm = 0 green_pwm = 0 blu...
"""Tests for mock module.""" import Queue import threading import unittest import set_sys_path # Update sys.path to locate mod_pywebsocket module. from test import mock class MockConnTest(unittest.TestCase): """A unittest for MockConn class.""" def setUp(self): self._conn = mock.MockConn('ABC\r\...
__docformat__ = 'restructuredtext' import os import sys import traceback try: from sphinx.application import Sphinx except ImportError: print "#################################" print "Dependency missing: Python Sphinx" print "#################################" sys.exit(1) import os class SphinxB...
from .. import NextGenInstanceResource, NextGenListResource class Voice(object): """Holds references to the Voice pricing resources.""" name = "Voice" key = "voice" def __init__(self, base_uri, auth, timeout): self.uri = "%s/Voice" % base_uri self.countries = VoiceCountries(self.uri,...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import oscar.models.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = ...
""" <Started> July 2013 <Author> Savvas Savvides <<EMAIL>> <Purpose> Acts as the parent for all parsers. Defines some abstract methods required by all parsers and some helper methods that can be used by any parser. """ import pickle class Parser(): def __init__(self, trace_path): """ ...
from __future__ import print_function, division from sympy.core import Mul, sympify from sympy.strategies import unpack, flatten, condition, exhaust, do_one from sympy.matrices.expressions.matexpr import MatrixExpr, ShapeError def hadamard_product(*matrices): """ Return the elementwise (aka Hadamard) product...
"""Parser driver. This provides a high-level interface to parse a file into a syntax tree. """ __author__ = "Guido van Rossum <<EMAIL>>" __all__ = ["Driver", "load_grammar"] # Python imports import codecs import os import logging import StringIO import sys # Pgen imports from . import grammar, parse, token, token...
""" Description =========== This module Provides backup and restore functions for a database. The backup function saves the data into backup files, while the restore function loads the data back into a database. You should only restore the data into an empty database. Implementation ============== Not all of the da...
from __future__ import absolute_import import unittest import pickle from io import BytesIO as StringIO from autobahn.wamp.message import Subscribe from crossbar._compat import long from crossbar.router.observation import ExactUriObservation, \ PrefixUriObservation, WildcardUriObservation, UriObservationMap cl...
import matplotlib as mpl mpl.use('Agg') from matplotlib import pyplot as plt import argparse import mxnet as mx from mxnet import gluon from mxnet.gluon import nn from mxnet import autograd import numpy as np import logging from datetime import datetime import os import time def fill_buf(buf, i, img, shape): n = ...
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division import numpy as np import random import first import normal import th...
""" This page is in the table of contents. Coil is a script to coil wire or filament around an object. ==Operation== The default 'Activate Coil' checkbox is on. When it is on, the functions described below will work, when it is off, the functions will not be called. ==Settings== ===Minimum Tool Distance=== Default i...
{ 'name': 'HR Gamification', 'version': '1.0', 'author': 'OpenERP SA', 'category': 'hidden', 'website': 'https://www.odoo.com/page/employees', 'depends': ['gamification', 'hr'], 'description': """Use the HR ressources for the gamification process. The HR officer can now manage challenges an...
from __future__ import absolute_import, unicode_literals import os import mock import tornado.testing import tornado.web import tornado.websocket import mopidy from mopidy.http import handlers class StaticFileHandlerTest(tornado.testing.AsyncHTTPTestCase): def get_app(self): return tornado.web.Applic...
""" ======================== Random Number Generation ======================== ==================== ========================================================= Utility functions ============================================================================== random Uniformly distributed values of a given sha...
""" .. _tut-head-pos: ================================================ Extracting and visualizing subject head movement ================================================ Continuous head movement can be encoded during MEG recordings by use of HPI coils that continuously emit sinusoidal signals. These signals can then b...
import os import re from webob import Request, Response from webob import exc from tempita import HTMLTemplate VIEW_TEMPLATE = HTMLTemplate("""\ <html> <head> <title>{{page.title}}</title> </head> <body> <h1>{{page.title}}</h1> {{if message}} <div style="background-color: #99f">{{message}}</div> {{endif}} <div>{...
import os import urllib2 from ocw.esgf.constants import DEFAULT_ESGF_SEARCH from ocw.esgf.download import download from ocw.esgf.logon import logon from ocw.esgf.search import SearchClient import ocw.data_source.local as local from bs4 import BeautifulSoup import requests def load_dataset(dataset_id, ...
from __future__ import absolute_import from django.conf import settings import logging import traceback import platform from django.core import mail from django.http import HttpRequest from django.utils.log import AdminEmailHandler from django.views.debug import ExceptionReporter, get_exception_reporter_filter from...
import unittest as real_unittest from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models import get_app, get_apps from django.test import _doctest as doctest from django.test.utils import setup_test_environment, teardown_test_environment from django.test.testcases...
#!/usr/bin/env python # encoding: utf-8 """ gtest is a Waf tool for test builds in Ardupilot """ from waflib import Utils from waflib.Configure import conf import boards def configure(cfg): cfg.env.HAS_GTEST = False if cfg.options.disable_tests: return board = cfg.get_board() if isinstance(...
# These are some strings that we need for successful extraction. They come from # Django and is not included in our POT file otherwise. This file itself is not # used for a running Pootle. # Don't change any of these strings unless they changed in Django. The adding # of extra comments to help translators is fine. _(...
import socket as _socket import os import types import _lightbluecommon from _obexcommon import OBEXError # public attributes __all__ = ("sendfile", "recvfile") def sendfile(address, channel, source): if not isinstance(source, (types.StringTypes, types.FileType)): raise TypeError("source must be string o...
""" Support for MQTT Template lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.mqtt_template/ """ import logging import voluptuous as vol import homeassistant.components.mqtt as mqtt from homeassistant.components.light import ( ATTR_BRI...
"""Add new columns on SessionActivity.""" import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = 'e12419831262' down_revision = '9848d0149abd' branch_labels = () depends_on = None def upgrade(): """Upgrade database.""" with op.batch_alter_table('accounts_user_sess...
""" The acl module contains the objects and methods used to manage ACLs in Autotest. The valid actions are: add: adds acl(s), or users or hosts to an ACL remove: deletes acl(s), or users or hosts from an ACL list: lists acl(s) The common options are: --alist / -A: file containing a list of ACLs See topic...
"""This example gets all premium rates. """ # Import appropriate modules from the client library. from googleads import ad_manager def main(client): # Initialize appropriate service. premium_rate_service = client.GetService( 'PremiumRateService', version='v201811') # Create a statement to select premium...
import tensorflow as tf def get_width_upright(bboxes): with tf.name_scope('BoundingBoxTransform/get_width_upright'): bboxes = tf.cast(bboxes, tf.float32) x1, y1, x2, y2 = tf.split(bboxes, 4, axis=1) width = x2 - x1 + 1. height = y2 - y1 + 1. # Calculate up right point of b...
from __future__ import print_function import os import pickle import numpy as np import unittest as ut import espressomd from espressomd.electrostatics import * from espressomd import scafacos import tests_common @ut.skipIf(not espressomd.has_features(["ELECTROSTATICS"]), "Features not available, skipping ...
from __future__ import unicode_literals import webnotes from webnotes.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns() last_col = len(columns) item_list = get_items(filters) item_tax, tax_accounts = get_tax_accounts(item_list, columns) data = [] for d in item_l...
"""A utility function for importing TensorFlow graphs.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib from tensorflow.core.framework import attr_value_pb2 from tensorflow.core.framework import graph_pb2 from tensorflow.core.framework i...
#!/usr/bin/python # wbx.py - dump MikroTik winbox addresses.wbx file format # Mon Oct 13 10:03:26 SAST 2008 import sys def munge_pair(pair): """ Convert integer values to integers """ name, value, offset = pair if name in ['secure-mode', 'keep-pwd']: value = ord(value) return (name, value, off...
# sympy/galgebra/debug.py from __future__ import print_function from itertools import islice def ostr(obj, dict_mode=False): """ Recursively convert iterated object (list/tuple/dict/set) to string. """ def ostr_rec(obj, dict_mode): global ostr_s if isinstance(obj, tuple): ...
import unittest from memory_inspector.classification import mmap_classifier from memory_inspector.core import memory_map _TEST_RULES = """ [ { 'name': 'anon', 'mmap_file': r'^\[anon', 'children': [ { 'name': 'jit', 'mmap_prot': 'r-x', }, ], }, { 'name': 'dev', 'mmap_file': r'^/dev', ...
import sys from avro.io import DatumReader from avro.datafile import DataFileReader def main(fn, out_fn, avro_mode=''): with open(out_fn, 'w') as fo: with open(fn, 'rb') as f: reader = DataFileReader(f, DatumReader()) for r in reader: if avro_mode.upper() == 'KV': ...
"""V-trace (IMPALA) learner for Google Research Football.""" from absl import app from absl import flags from seed_rl.agents.vtrace import learner from seed_rl.common import actor from seed_rl.common import common_flags from seed_rl.football import env from seed_rl.football import networks import tensorflow as tf ...
import traceback from ..common.Properties import Properties from com.sun.star.awt import WindowDescriptor from com.sun.star.awt import Rectangle from com.sun.star.awt.WindowClass import SIMPLE from com.sun.star.awt.VclWindowPeerAttribute import CLIPCHILDREN from com.sun.star.awt.WindowAttribute import SHOW ''' @autho...
#encoding=utf-8 import os, zipfile, sys BASEDIR = os.path.split(os.path.abspath(__file__))[0] class UpgradeEnv(object): def __init__(self, basedir): self.basedir = basedir def upgradeFromZip(self, filename): with zipfile.ZipFile(filename) as fs: try: with fs.open('...
import numpy def vl_xyz2lab(I,il='E'): # VL_XYZ2LAB Convert XYZ color space to LAB # J = VL_XYZ2LAB(I) converts the image from XYZ format to LAB format. # # VL_XYZ2LAB(I,IL) uses one of the illuminants A, B, C, E, D50, D55, # D65, D75, D93. The default illuminant is E. # # See also:: VL_XYZ2LUV(), VL_HELP(). ...
__all__ = ['FlashStatusFilter','FlashStatusViewFilter'] from pyasm.common import SetupException from pyasm.biz import * from pyasm.web import * from pyasm.widget import * from pyasm.search import Search class FlashStatusFilter(Widget): def __init__(my, pipeline_name="dept"): my.pipeline_name = pipeline_n...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1'} from ansible.module_utils.aws.core import AnsibleAWSModule from ansible.module_utils.ec2 import boto3_conn, get_aws_connection_info try: from botocore.exceptions import Client...
import mock from google.api_core.future import _helpers @mock.patch('threading.Thread', autospec=True) def test_start_deamon_thread(unused_thread): deamon_thread = _helpers.start_daemon_thread(target=mock.sentinel.target) assert deamon_thread.daemon is True def test_safe_invoke_callback(): callback = m...
"""A Python 3 script to write a file with a specified number of keypairs, using bigchaindb.crypto.generate_key_pair() The written file is always named keypairs.py and it should be interpreted as a Python 2 script. Usage: $ python3 write_keypairs_file.py num_pairs Using the list in other Python scripts: # in a...
import numpy as np def windowed_sum_slow(arrays, span, t=None, indices=None, tpowers=0, period=None, subtract_mid=False): """Compute the windowed sum of the given arrays. This is a slow function, used primarily for testing and validation of the faster version of ``windowed_sum()`` ...
import unittest import os import sys import commands import shutil import time import subprocess import glob from TestApp import * reload(sys) sys.setdefaultencoding('utf-8') SCRIPT_PATH = os.path.realpath(__file__) ConstPath = os.path.dirname(SCRIPT_PATH) appsrc = ConstPath + "/../testapp/helloworld" approot = ConstP...
#!/usr/bin/env python #enchoding: utf8 import sys, rospy, math from pimouse_ros_2.msg import MotorFreqs from geometry_msgs.msg import Twist from std_srvs.srv import Trigger, TriggerResponse class Motor(): def __init__(self): if not self.set_power(False): sys.exit(1) rospy.on_shutdown(self.set_power) sel...
import portal_wizard import share_wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
"""Configuration manager for reading and writing SC configuration files.""" import simplejson as json import os import rdflib __author__ = 'cwilli34' # noinspection PyBroadException,PyBroadException class ConfigManager(object): """ Configuration File Creator """ def __init__(self, filename='sc.config'): ...
# -*- coding: utf-8 -*- """ flask.blueprints ~~~~~~~~~~~~~~~~ Blueprints are the recommended way to implement larger or more pluggable applications in Flask 0.7 and later. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import update_wrap...
"""Test file for syntax highlighting of editors. Meant to cover a wide range of different types of statements and expressions. Not necessarily sensical or comprehensive (assume that if one exception is highlighted that all are, for instance). Extraneous trailing whitespace can't be tested because of svn pre-commit ho...
import os import sys import shutil import string import random import tempfile import unittest from imp import cache_from_source from test.support import run_unittest class TestImport(unittest.TestCase): def __init__(self, *args, **kw): self.package_name = 'PACKAGE_' while self.package_name in sy...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ========================================================================= Program: Visualization Toolkit Module: TestNamedColorsIntegration.py Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www....
""" "Rel objects" for related fields. "Rel objects" (for lack of a better name) carry information about the relation modeled by a related field and provide some utility functions. They're stored in the ``remote_field`` attribute of the field. They also act as reverse fields for the purposes of the Meta API because th...
"""Chrome-specific options for configuring a ChromeDriver instance.""" import base64 class ChromeOptions(object): """Chrome-specific options for configuring a ChromeDriver instance.""" def __init__(self): """Initialize ChromeOptions object.""" self._capabilities = {'chrome.switches': [], 'chrome.extensi...
import collections import copy import json import os import pipes import re import subprocess import sys import bb_utils sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from pylib import constants CHROMIUM_COVERAGE_BUCKET = 'chromium-code-coverage' _BotConfig = collections.namedtuple( 'BotConfig...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import subprocess import sys from collections import Mapping from ansible import constants as C from ansible.errors import * from ansible.inventory.host import Host from ansible.inventory.group import Group from ansible...
import os, unittest, shutil import zipfile from StringIO import StringIO from cuddlefish import initializer from cuddlefish.templates import TEST_MAIN_JS, PACKAGE_JSON tests_path = os.path.abspath(os.path.dirname(__file__)) class TestInit(unittest.TestCase): def run_init_in_subdir(self, dirname, f, *args, **kwar...
from __future__ import absolute_import, print_function import pprint from mercurial import ( minirst, ) def debugformat(text, form, **kwargs): if form == 'html': print("html format:") out = minirst.format(text, style=form, **kwargs) else: print("%d column format:" % form) ou...
import b2.build.targets as targets import b2.build.virtual_target as virtual_target from b2.manager import get_manager from b2.util import bjam_signature class CastTargetClass(targets.TypedTarget): def construct(name, source_targets, ps): result = [] for s in source_targets: if not is...
""" Wrapper to the Yahoo's new PlaceFinder API. (doc says that the API RELEASE 1.0 (22 JUNE 2010)) """ import xml.dom.minidom from geopy import util from geopy import Point from urllib import urlencode from urllib2 import urlopen from geopy.geocoders.base import Geocoder try: import json except ImportError: try...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited SPDX-License-Identifier: Apache-2.0 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 ...
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import os import shutil from setuptools.extern import six from setuptools import Command class rotate(Command): """Delete older distributions""" description = "delete older distributions, kee...
import os try: import sqlite3 as dbapi except ImportError: from pysqlite2 import dbapi2 as dbapi from keystone.catalog.backends import templated as catalog_templated from keystone.common.sql import legacy from keystone.common.sql import util as sql_util from keystone import config from keystone.identity.backe...
''' topology_helpers_unittest.py ''' # pylint: disable=missing-docstring import unittest2 as unittest from heron.common.src.python import constants from heron.tools.tracker.src.python import topology_helpers from mock_proto import MockProto class TopologyHelpersTest(unittest.TestCase): def setUp(self): self.moc...
# hesapmak1 print("\nSürüm kontrolü yapıldı, 3.X sürümü kullanılıyor\n") karşılama = open("karşılama.txt","r") print("\n",karşılama.read()) karşılama.close() def kimlik(): #KİMLİK FONKSİYONU print("1.) Merhabalar Yeni Kullanıcı Detaylı Kimlik Kartını Oluşturmak\n\ ister misin? Evet için 'E', Hayır içi...
"""Class representing message/* MIME documents. """ from email import Message from email.MIMENonMultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class representing message/* MIME documents.""" def __init__(self, _msg, _subtype='rfc822'): """Create a message/* type MIME doc...
""" Selectors tests, specific for libxml2 backend """ import unittest from scrapy.http import TextResponse, HtmlResponse, XmlResponse from scrapy.selector.libxml2sel import XmlXPathSelector, HtmlXPathSelector, \ XPathSelector from scrapy.selector.document import Libxml2Document from scrapy.utils.test import libxm...
import RPi.GPIO as GPIO, subprocess #if( int(time.strftime('%H')) >= 8 and int(time.strftime('%H')) <= 21 ): def checkFacebook(): nbr_notif = int(open("/home/pi/RaspiNotifier/nbr/nbr_facebook.txt", "r").read()) GPIO_PIN = int(config.get("Facebook", "gpioPin")) GPIO.setmode(GPIO.BOARD) GPIO.setup(GPIO_PIN,...
#!/usr/bin/python """ PasswordState Ansible Module """ from ansible.module_utils.basic import * import urllib import urllib2 import json class PasswordIdException(Exception): msg = 'Either the password id or the match ' \ 'field id and value must be configured' class Password(object): """ Passwor...
""" Tests of the LMS XBlock Mixin """ import ddt from xblock.validation import ValidationMessage from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_TOY_MODULES...
from oslo_utils import timeutils from oslo_utils import versionutils from nova.compute import utils as compute_utils from nova.db import api as db from nova import exception from nova import objects from nova.objects import base from nova.objects import fields # TODO(berrange): Remove NovaObjectDictCompat @base.Nova...
from __future__ import absolute_import from datetime import timedelta from django.core.exceptions import PermissionDenied from django.http import HttpResponseRedirect from django.utils import timezone from allauth.compat import reverse from allauth.exceptions import ImmediateHttpResponse from allauth.utils import bu...
from django.contrib.redirects.models import Redirect from django import http from django.conf import settings class RedirectFallbackMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response # No need to check for a redirect for non-404 re...