content
string
""" WSGI config for fedinv project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
class KostensoortGroup: def __init__(self, name, descr, level, parent): self.name = name self.descr = descr self.parent = parent # KostensoortGroup class self.level = level self.kostenSoorten = {} # KS die bij deze node horen (uit kostensoortgroep) self.children = [...
# -*- coding: utf-8 -*- """ L{Options} class: collect the possible options that govern the parsing possibilities. The module also includes the L{ProcessorGraph} class that handles the processor graph, per RDFa 1.1 (i.e., the graph containing errors and warnings). @summary: RDFa parser (distiller) @requires: U{RDFLib<...
# -*- coding: utf-8 -*- """ werkzeug.contrib.lint ~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module provides a middleware that performs sanity checks of the WSGI application. It checks that :pep:`333` is properly implemented and warns on some common HTTP errors such as non-empty respons...
from django.conf import settings from django.utils import unittest from django.conf import settings, UserSettingsHolder, global_settings class SettingsTests(unittest.TestCase): # # Regression tests for #10130: deleting settings. # def test_settings_delete(self): settings.TEST = 'test' ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} DOCUMENTATION = r''' --- module: aci_interface_policy_leaf_profile short_description: Manage ...
from django.conf import settings from django.core.checks.security import base, csrf, sessions from django.test import SimpleTestCase from django.test.utils import override_settings class CheckSessionCookieSecureTest(SimpleTestCase): @property def func(self): from django.core.checks.security.sessions i...
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
{ 'name': 'Repairs Management', 'version': '1.0', 'category': 'Manufacturing', 'description': """ The aim is to have a complete module to manage all products repairs. ==================================================================== The following topics should be covered by this module: ------------...
from django import forms from django.conf import settings from PIL import Image class ShareImageForm(forms.Form): WORD_CHOICES = ( ('', '2. WATER GIVES ME...'), ('joy', 'joy'), ('friendship', 'friendship'), ('life', 'life'), ('family', 'family'), ('nourishment', 'no...
"""Test air_quality of GIOS integration.""" from datetime import timedelta import json from gios import ApiError from homeassistant.components.air_quality import ( ATTR_AQI, ATTR_CO, ATTR_NO2, ATTR_OZONE, ATTR_PM_2_5, ATTR_PM_10, ATTR_SO2, ) from homeassistant.components.gios.air_quality i...
try: from cs import CloudStack, CloudStackException, read_config has_lib_cs = True except ImportError: has_lib_cs = False # import cloudstack common from ansible.module_utils.cloudstack import * RESOURCE_TYPES = { 'instance': 0, 'ip_address': 1, 'volume': 2,...
import asyncio import asyncio_redis from elude import config from elude.servers import BaseServer REDIS_REQUEST_WIP_KEY = '_elude:request_wip' class RedisServer(BaseServer): def __init__(self, proxy_gatherer, serialize_func, deserialize_func): super().__init__(proxy_gatherer) self.serialize = ser...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} import os import ssl as ssl_lib from distutils.version import LooseVersion try: from pymongo.errors import ConnectionFailure from pymongo.errors import OperationFailure ...
import logging import socket import sys import unittest def run_tests(test_case, driver, webserver): logging.basicConfig(level=logging.WARN) webserver.start() try: testLoader = unittest.TestLoader() testRunner = unittest.TextTestRunner() test_case_name = "selenium.test.selenium.we...
"""Find all constraints attached to the selected element.""" from pyrevit import revit, DB def listconstraints(selected_el): print('THIS OBJECT ID: {0}'.format(selected_el.Id)) clconst = DB.FilteredElementCollector(revit.doc)\ .OfCategory(DB.BuiltInCategory.OST_Constraints)\ ....
""" Classifiers that make use of the external 'Weka' package. """ from __future__ import print_function import time import tempfile import os import subprocess import re import zipfile from sys import stdin from nltk import compat from nltk.probability import DictionaryProbDist from nltk.internals import java, config_...
""" A MindAgent to test the application of the context rules """ from opencog.cogserver import MindAgent from pln.chainers import Chainer from pln.rules import * __author__ = 'Sebastian Ruder' class ContextAgent(MindAgent): def __init__(self): self.chainer = None def create_chainer(self, atomspace)...
""" Base class for Scrapy commands """ import os from optparse import OptionGroup from twisted.python import failure from scrapy.utils.conf import arglist_to_dict from scrapy.exceptions import UsageError class ScrapyCommand(object): requires_project = False crawler_process = None # default settings to ...
""" task.py ========== This is the task handler for the error handler. :copyright: (c) 2015 by GammaRay. :license: BSD, see LICENSE for more details. Author: GammaRay Version: 1.0 Date: 3/11/2015 """ """ ============================================= Imports...
import os.path import rose.config from StringIO import StringIO import unittest class TestConfigData(unittest.TestCase): """Test usage of the rose.config.ConfigNode object.""" def test_init(self): """Test empty Config object.""" conf = rose.config.ConfigNode() self.assertFalse(conf is...
{ 'name': 'Invoice Picking Directly', 'version': '1.0', 'category' : 'Warehouse Management', 'description': """ Invoice Wizard for Delivery. ============================ When you send or deliver goods, this module automatically launch the invoicing wizard if the delivery is to be invoiced. """, ...
from django.conf.urls.defaults import * from corehq.apps.reports.dispatcher import AdminReportDispatcher from .views import FlagBrokenBuilds urlpatterns = patterns('corehq.apps.hqadmin.views', url(r'^$', 'default', name="default_admin_report"), url(r'^export/global/$', 'global_report', name="export_global_repo...
from datetime import datetime import boto from boto import sts import os import inspect import json from dataactcore.config import CONFIG_BROKER class s3UrlHandler: """ This class acts a wrapper for S3 URL Signing """ BASE_URL = "https://s3.amazonaws.com/" ENABLE_S3 = True URL_LIFETIME = 2000 ...
import arrow from OnePy.sys_module.components.exceptions import BacktestFinished from OnePy.sys_module.metabase_env import OnePyEnvBase from OnePy.utils.easy_func import get_day_ratio class Calendar(OnePyEnvBase): def __init__(self, instrument): if instrument == 'A_shares': self.is_trading_t...
__author__ = "David Rusk <<EMAIL>>" import unittest from hamcrest import assert_that, equal_to from ossos import coding class EncodingDecodingTest(unittest.TestCase): def test_base36_encode_decode_1(self): assert_that(coding.base36encode(1), equal_to("1")) assert_that(coding.base36decode("1"), ...
import os def openstack_argument_spec(): # DEPRECATED: This argument spec is only used for the deprecated old # OpenStack modules. It turns out that modern OpenStack auth is WAY # more complex than this. # Consume standard OpenStack environment variables. # This is mainly only useful for ad-hoc co...
from PyQt4.uic.exceptions import NoSuchWidgetError def invoke(driver): """ Invoke the given command line driver. Return the exit status to be passed back to the parent process. """ exit_status = 1 try: exit_status = driver.invoke() except IOError, e: driver.on_IOError(e) ...
"""Implements basics of Capa, including class CapaModule.""" import json import logging import sys from lxml import etree from pkg_resources import resource_string import dogstats_wrapper as dog_stats_api from .capa_base import CapaMixin, CapaFields, ComplexEncoder from capa import responsetypes from .progress import...
# -*- coding: utf-8 -*- """ flask.testsuite ~~~~~~~~~~~~~~~ Tests Flask itself. The majority of Flask is already tested as part of Werkzeug. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import print_function import os import sys im...
microcode = ''' def macroop PUNPCKLBW_XMM_XMM { unpack xmmh, xmml, xmmlm, ext=1, size=1 unpack xmml, xmml, xmmlm, ext=0, size=1 }; def macroop PUNPCKLBW_XMM_M { ldfp ufp1, seg, sib, disp, dataSize=8 unpack xmmh, xmml, ufp1, ext=1, size=1 unpack xmml, xmml, ufp1, ext=0, size=1 }; def macroop PUNPCK...
#!/usr/bin/env python """ @package mi.dataset.parser.spkir_abj_dcl @file marine-integrations/mi/dataset/parser/spkir_abj_dcl.py @author Steve Myerson @brief Parser for the spkir_abj_dcl dataset driver This file contains code for the spkir_abj_dcl parsers and code to produce data particles. For telemetered data, there...
from .state import EOF from .tokens import TokenEof from .tokens_base import TOKEN_COMMAND_WRITE_AND_QUIT_ALL from .tokens_base import TokenOfCommand from Vintageous import ex from Vintageous.ex.ex_error import ERR_INVALID_ARGUMENT from Vintageous.ex.ex_error import VimError plus_plus_translations = { 'ff': 'fil...
import os import ycm_core # These are the compilation flags that will be used in case there's no # compilation database set (by default, one is not set). # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. flags = [ '-Wall', '-Wextra', '-Werror', '-Wno-long-long', '-Wno-variadic-macros', '-f...
""" Source object for Gramps. """ #------------------------------------------------------------------------- # # Gramps modules # #------------------------------------------------------------------------- from .primaryobj import PrimaryObject from .mediabase import MediaBase from .notebase import NoteBase from .tagbas...
from __future__ import unicode_literals import itertools import hashlib import json import re from .common import InfoExtractor from ..compat import ( compat_str, compat_HTTPError, ) from ..utils import ( ExtractorError, get_element_by_attribute, int_or_none, lowercase_escape, std_headers,...
"""Test lldb's expression evaluations and collect statistics.""" from __future__ import print_function import sys import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbbench import * from lldbsuite.test.lldbtest import * from lldbsuite.test import configuration from lldbsuite.test import lldbut...
#!/usr/bin/env python # -*- coding: utf-8 -*- import ast import re import sys from setuptools import setup _version_re = re.compile(r'__version__\s+=\s+(.*)') with open('gitless/cli/gl.py', 'rb') as f: version = str(ast.literal_eval(_version_re.search( f.read().decode('utf-8')).group(1))) # Build helper ...
#!/usr/bin/env python import os import glob import sys from lib.config import s3_config from lib.util import atom_gyp, execute, rm_rf, safe_mkdir, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) SYMBOLS_DIR = 'dist\\symbols' DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchr...
class NoStemmer(Exception): pass class NoStopWords(Exception): pass # Data and functions for language names languages = ("ar", "da", "nl", "en", "fi", "fr", "de", "hu", "it", "no", "pt", "ro", "ru", "es", "sv", "tr") aliases = { # By ISO 639-1 three letter codes "ara": "...
# pylint:disable=pointless-string-statement, fixme, misplaced-comparison-constant, comparison-with-itself """Stray backslash escapes may be missing a raw-string prefix.""" __revision__ = '$Id$' # Bad escape sequences, which probably don't do what you expect. A = "\[\]\\" # [anomalous-backslash-in-string,anomalous-ba...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Feed.skip_errors' db.add_column('feedjack_feed', 'skip_errors', self.g...
# -*- coding: utf-8 -*- """Base classes.""" __author__ = 'Patrick Michl' __email__ = '<EMAIL>' __license__ = 'GPLv3' __docformat__ = 'google' from pathlib import Path from nemoa.base import entity, check, ndict, env from nemoa.types import Any, ClassVar, Dict, OptInt, OptStr, PathLike class ObjectIP: """Base cla...
{ 'name': 'Intrastat Reporting', 'version': '1.0', 'category': 'Accounting & Finance', 'description': """ A module that adds intrastat reports. ===================================== This module gives the details of the goods traded between the countries of European Union.""", 'author': 'OpenERP SA'...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) # Ralf Habacker, 2006 (rh) import os, optparse import Utils, Options, Configure import ccroot, ar from Configure import conftest @conftest def find_sxx(conf): v = conf.env cc = None if v['CXX']: cc = v['CXX'] elif 'CXX' in conf.environ: cc = conf.e...
import cStringIO import struct import dns.exception import dns.dnssec import dns.rdata import dns.tokenizer _ctype_by_value = { 1 : 'PKIX', 2 : 'SPKI', 3 : 'PGP', 253 : 'URI', 254 : 'OID', } _ctype_by_name = { 'PKIX' : 1, 'SPKI' : 2, 'PGP' : 3, 'URI' : 253, 'OID' : 254, ...
#!/usr/bin/env python # File created on 08 Jun 2012 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = "<EMAIL>" from unittest impor...
from ctypes import c_void_p from django.contrib.gis.gdal.error import GDALException from django.utils import six class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _p...
import imp import os import sys from SCons.Script import BoolVariable, Environment, Variables monoreg = imp.load_source('mono_reg_utils', 'modules/mono/mono_reg_utils.py') def find_file_in_dir(directory, files, prefix='', extension=''): if not extension.startswith('.'): extension = '.' + extension ...
import pygame import time print 'Init joystick module with pygame...\n' # Initialize the joystick module. pygame.joystick.init() # Get the number of joysticks. num = pygame.joystick.get_count() if num <> 0: c = 1 if num <> 1: print 'There is %d joysticks, choose one.' % num c = input(">> ") ...
"""Tasks used for main OAI harvesting workflow.""" import os import time from functools import wraps from invenio.base.globals import cfg def init_harvesting(obj, eng): """Get all the options from previous state. This function gets all the option linked to the task and stores them into the object to b...
# -*- coding: utf-8 -*- """ Marks: Classes to define Vega Marks """ from .core import grammar, GrammarClass, KeyedList from .values import ValueRef from .properties import PropertySet from ._compat import str_types class MarkProperties(GrammarClass): """Sets of all Mark properties Mark properties can chang...
from __future__ import unicode_literals from datetime import datetime from django.test import TestCase from .models import Article, IndexErrorArticle, Person class EarliestOrLatestTests(TestCase): """Tests for the earliest() and latest() objects methods""" def tearDown(self): """Makes sure Article...
#!/usr/bin/env python # -*- coding: utf-8 -*- class RPCError(Exception): """Base class for all excetions thrown by :py:mod:`tinyrpc`.""" class BadRequestError(RPCError): """Base class for all errors that caused the processing of a request to abort before a request object could be instantiated.""" de...
# # organize_photos.py: (C) 2011-2014 Sameer Sundresh. No warranty. # # exif_cache.py is a helper for organize_photos.py # # It maintains a cache file exif_cache.json in the source directory that # keeps track of which files have already been copied out of that source # directory, including where they were copied and t...
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
''' Utilities to allow inserting docstring fragments for common parameters into function and method docstrings''' import sys def docformat(docstring, docdict=None): ''' Fill a function docstring from variables in dictionary Adapt the indent of the inserted docs Parameters ---------- docstring : ...
# -*- coding:utf8 -*- # File : grad_modifier.py # Email : <EMAIL> # # This file is part of TensorArtist. import tensorflow as tf from ..tfutils import clean_name from ...core.logger import get_logger from ...core.utils.match import NameMatcher logger = get_logger(__file__) __all__ = [ 'GradModifierBase', 'N...
from __future__ import unicode_literals import boto import boto3 import pytest import sure # noqa from boto.exception import EC2ResponseError from moto import mock_ec2, mock_ec2_deprecated @mock_ec2_deprecated def test_create_vpn_connections(): conn = boto.connect_vpc("the_key", "the_secret") vpn_connection...
"""Quantized distribution.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import check_ops from tensorflow.python.ops ...
import time from openerp.osv import osv from openerp.report import report_sxw class bank_statement_balance_report(report_sxw.rml_parse): def set_context(self, objects, data, ids, report_type=None): cr = self.cr cr.execute('SELECT s.name as s_name, s.date AS s_date, j.code as j_code, s.balance_en...
# -*- coding: utf-8 -*- from django.contrib.auth.models import User, Permission, Group from django_any import any_model def any_user(password=None, permissions=[], groups=[], **kwargs): """ Shortcut for creating Users Permissions could be a list of permission names If not specified, creates active, n...
import itertools class corners(object): def __init__(self, i, j): # i, j are position of corner self.i = i self.j = j def __str__(self): return "[" + str(self.i) + ", " + str(self.j) + "]" # return corner on the same line def same_line(index, list): for c in list: ...
from sippy.UaStateGeneric import UaStateGeneric from sippy.CCEvents import CCEventRing, CCEventConnect, CCEventFail, CCEventRedirect, \ CCEventDisconnect, CCEventPreConnect from sippy.SipContact import SipContact from sippy.SipAddress import SipAddress from sippy.Time.Timeout import TimeoutAbsMono class UasStateTryi...
"""Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. """ import fcntl import fnmatch import glob import json import os import plistlib import re import shutil import string import subprocess import sys import tempfile def main(args...
import unittest from trac import perm from trac.core import * from trac.resource import Resource from trac.test import EnvironmentStub class DefaultPermissionStoreTestCase(unittest.TestCase): def setUp(self): self.env = \ EnvironmentStub(enable=[perm.DefaultPermissionStore, ...
import numpy as np from scipy.optimize import curve_fit def expfit(x, y): """ expfit calculates an exponential power law fit based upon levenburg-marquardt minimization. Fits are of the form. y = ax**b Parameters: ----------- x: array_like independent variable y: array_like ...
import time from openerp.report import report_sxw class summary_report_print(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(summary_report_print, self).__init__(cr, uid, name, context) self.localcontext.update({ 'time': time, 'get_total': self.get_t...
#!/usr/bin/env python3 """ License statement applies to this file (glgen.py) only. """ """ 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 limi...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.ops import array_ops from tensorflow.python.ops import math_ops from tensorflow.python.p...
"""A cross-platform execution counter viewer. The stats viewer reads counters from a binary file and displays them in a window, re-reading and re-displaying with regular intervals. """ import mmap import optparse import os import re import struct import sys import time import Tkinter # The interval, in milliseconds...
import logging from gevent.pywsgi import WSGIServer, WSGIHandler logger = logging.getLogger(__name__) class LymphWSGIHandler(WSGIHandler): def format_request(self): # XXX(Mouad): Copied shamessly from gevent.pywsgi.WSGIHandler's format_request # and removed only the datetime from the output, s...
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os, unittest, shutil from calibre import CurrentDir from calibre.pte...
""" This module holds simple classes to convert geospatial values from the database. """ from decimal import Decimal from django.contrib.gis.db.models.fields import GeoSelectFormatMixin from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.measure import Area, Distance class BaseField: ...
# -*- coding: utf-8 -*- """ sockjs.tornado.transports.rawwebsocket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Raw websocket transport implementation """ import logging import socket from sockjs.tornado import websocket, session from sockjs.tornado.transports import base LOG = logging.getLogger("tornado.gener...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function, division import logging log = logging.getLogger("forecast") has_pywapi = False try: import pywapi has_pywapi = True except: log.error('Error loading library pywapi. Library not found.') def fahrenheit_to_celcius(f): re...
from PyQt4 import QtCore, QtGui def format (color, style=''): """Return a QTextCharFormat with the given attributes.""" format = QtGui.QTextCharFormat() format.setForeground(getattr(QtCore.Qt, color)) if 'bold' in style: format.setFontWeight(QtGui.QFont.Bold) if 'italic' in style: ...
'''Manager for predicates. Created on Jun 15, 2013 @author: Cam Moore ''' import sys import inspect from apps.managers.challenge_mgr.models import RoundSetting, GameInfo from apps.widgets.smartgrid_library.models import LibraryEvent, LibraryAction from apps.widgets.smartgrid_design.models import DesignerLevel, Design...
#!/usr/bin/env python """ AM_ifSensorsNotOK_notRelease Assertion monitor For use in Human-Robot Interaction simulator. Created by David Western, July 2015. Implements assertion: if human is ready and NOT sensorsOk and contact_robot_hand_and_object ==1 then assert after T, contact_robot_hand_and_object == 1 (robot d...
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic Regression 3-class Classifier ========================================================= Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wikipedia.org/wiki/Iris_f...
#!/usr/local/bin/python # -*- coding: utf-8 -*- ''' Created on Oct 20, 2015 クロールの流れ 1.FeaturedGamesで最近のゲームを取得 2.ParticipantsのSummonerNamesを取得 3.SummonerNamesを使ってSummonerIdを取得 4.SummonerIdを使ってSummonerGamesを取得 5.SummonerGamesからMatchStatsを取得 6.保存 @author: ochi ''' import urllib2 import urllib import json import lolapi...
import datetime import time from openerp.osv import osv from openerp.report import report_sxw class report_hr_salary_employee_bymonth(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(report_hr_salary_employee_bymonth, self).__init__(cr, uid, name, context=context) self.loc...
""" Commonly useful validators. """ from __future__ import absolute_import, division, print_function from ._make import attr, attributes @attributes(repr=False, slots=True) class _InstanceOfValidator(object): type = attr() def __call__(self, inst, attr, value): """ We use a callable class t...
"""Support for the Pico TTS speech service.""" import logging import os import shutil import subprocess import tempfile import voluptuous as vol from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider _LOGGER = logging.getLogger(__name__) SUPPORT_LANGUAGES = ["en-US", "en-GB", "de-DE", "es-ES"...
import requests import redis from requests.exceptions import Timeout, ConnectionError, HTTPError import json import time from tornado.options import options import config from ate_logger import AteLogger class NotifyMonitor(object): def __init__(self, logger=None): if logger: self.__logger = ...
""" SCons generator. This contains class definitions and supporting functions for generating pieces of SCons files for the different types of GYP targets. """ import os def WriteList(fp, list, prefix='', separator=',\n ', preamble=None, post...
"""Python representation for Chromium Omnibox. Obtain one of these from PyUITestSuite::GetOmniboxInfo() call. Example: class MyTest(pyauto.PyUITest): def testBasic(self): info = self.OmniboxInfo() # fetch omnibox snapshot print info.Matches() See more tests in chrome/test/functional/omnibox.py. """ impor...
''' Websocket proxy that is compatible with OpenStack Nova. Leverages websockify.py by Joel Martin ''' import socket import sys from oslo_log import log as logging from six.moves import http_cookies as Cookie import six.moves.urllib.parse as urlparse import websockify import nova.conf from nova.consoleauth import rp...
import asyncio from atoolbox import patch from atoolbox.db.helpers import run_sql_section from textwrap import dedent, indent from time import time from tqdm import tqdm @patch async def run_logic_sql(conn, settings, **kwargs): """ run the "logic" section of models.sql """ await run_sql_section('logic...
import collections import copy import traceback from telemetry import value as value_module from telemetry.results import page_run from telemetry.results import progress_reporter as progress_reporter_module from telemetry.value import failure from telemetry.value import skip class PageTestResults(object): def __in...
from datetime import date from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class RegroupTagTests(SimpleTestCase): @setup({'regroup01': '' '{% regroup data by bar as grouped %}' '{% for group in gro...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys from nose.plugins.skip import SkipTest if sys.version_info < (2, 7): raise SkipTest("F5 Ansible modules require Python >= 2.7") from units.compat import unittest from units.compa...
from Child import Child from Node import Node # noqa: I201 PATTERN_NODES = [ # type-annotation -> ':' type Node('TypeAnnotation', kind='Syntax', children=[ Child('Colon', kind='ColonToken'), Child('Type', kind='Type'), ]), # enum-case-pattern -> type-identifie...
from m5.util import makeDir from slicc.generate import html from slicc.symbols.StateMachine import StateMachine from slicc.symbols.Type import Type from slicc.util import Location class SymbolTable(object): def __init__(self, slicc): self.slicc = slicc self.sym_vec = [] self.sym_map_vec =...
"""An input/output window for the glade reactor inspector. """ import time import gtk import gobject import gtk.glade from twisted.python.util import sibpath from twisted.python import reflect from twisted.manhole.ui import gtk2manhole from twisted.python.components import Adapter, registerAdapter from twisted.python...
""" Target cell filter. A scheduler hint of 'target_cell' with a value of a full cell name may be specified to route a build to a particular cell. No error handling is done as there's no way to know whether the full path is a valid. """ from nova.cells import filters from nova.openstack.common.gettextutils import _ ...
r""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected i...
""" Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon class TestPrefixesAndSuffixes(unittest.TestCase): def test_BinaryNamesWindows(self): writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'build.ninja', '.', 'build.n...
'''This example demonstrates embedding a standalone Bokeh document into a simple Flask application, with a basic HTML web form. To view the example, run: python simple.py in this directory, and navigate to: http://localhost:5000 ''' from __future__ import print_function import flask from bokeh.embed impo...
"""Tests that leaked mock objects can be caught be Google Mock.""" __author__ = '<EMAIL> (Zhanyong Wan)' import gmock_test_utils PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_') TEST_WITH_EXPECT_CALL = [PROGRAM_PATH, '--gtest_filter=*ExpectCall*'] TEST_WITH_ON_CALL = [PROGRAM_PATH, '--gtes...