content
string
"""BibFormat element - Prints authors """ from cgi import escape from invenio.webauthorprofile_config import serialize def format_element(bfo): """ Return list of profile data. """ data_dict = {} year_fields = map(bfo.fields, ['260__c', '269__c', '773__y', '502__d']) recid = bfo.recID da...
# Publications are stored actions which are taken when a feed is created, updated, deleted, or there is a matching percolator query. # # topic_id - The key for the parent topic # id - The identifier of the publication class Publication(): def __init__(self, topic_id, id, client): self.topic_id = topic_id self.id ...
"""Sort performance test. See main() for command line syntax. See tabulate() for output format. """ import sys import time import random import marshal import tempfile import os td = tempfile.gettempdir() def randfloats(n): """Return a list of n random floats in [0, 1).""" # Generating floats is expensive,...
from __future__ import absolute_import # Avoid importing `importlib` from this package. import copy from importlib import import_module import os import sys import warnings from django.core.exceptions import ImproperlyConfigured from django.utils import six from django.utils.deprecation import RemovedInDjango19Warni...
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLis...
import unittest from django.utils import html class TestUtilsHtml(unittest.TestCase): def check_output(self, function, value, output=None): """ Check that function(value) equals output. If output is None, check that function(value) equals value. """ if output is None: ...
"""Tests for laguerre module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.laguerre as lag from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_mod...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains th...
import copy import pytest from .utils import * import numpy as np import psi4 pytestmark = pytest.mark.quick _vars_entered = { 'VAR A': 4.0, 'VaR B': -4.0, 'MATVAR A': psi4.core.Matrix.from_array(np.arange(6).reshape(2, 3)), 'MatvaR B': psi4.core.Matrix.from_array(np.arange(3).reshape(1, 3)), '...
import re from couchpotato.core.helpers.rss import RSS from couchpotato.core.helpers.variable import tryInt, splitString from couchpotato.core.logger import CPLog from couchpotato.core.media.movie.providers.automation.base import Automation log = CPLog(__name__) autoload = 'CrowdAI' class CrowdAI(Aut...
from Screen import Screen from Components.config import ConfigClock, ConfigDateTime, getConfigListEntry from Components.ActionMap import NumberActionMap from Components.ConfigList import ConfigListScreen from Components.Label import Label from Components.Pixmap import Pixmap import time import datetime class TimeDateI...
"""Tests for MetricSpec.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools # pylint: disable=g-bad-todo,g-import-not-at-top from tensorflow.contrib.learn.python.learn.metric_spec import MetricSpec from tensorflow.python.platform import te...
def web_socket_do_extra_handshake(request): if request.ws_origin == 'http://example.com': return raise ValueError('Unacceptable origin: %r' % request.ws_origin) def web_socket_transfer_data(request): message = 'origin_check_wsh.py is called for %s, %s' % ( request.ws_resource, request.ws_p...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_generate_copy_without_render --------------------------------- """ from __future__ import unicode_literals import os import pytest from cookiecutter import generate from cookiecutter import utils @pytest.fixture(scope='function') def remove_test_dir(request): ...
#!/usr/bin/python # coding=utf-8 ############################################################################### from test import CollectorTestCase from test import get_collector_config from test import run_only from mock import patch from slony import SlonyCollector def run_only_if_psycopg2_is_available(func): ...
import difflib import os import rally from rally.cli import cliutils from rally.utils import encodeutils from tests.unit import test RES_PATH = os.path.join(os.path.dirname(rally.__file__), os.pardir, "etc") class BashCompletionTestCase(test.TestCase): def test_bash_completion(self): with open(os.path.j...
import string import httplib, sys import myparser import re import time class search_google: def __init__(self,word,limit,start,filetype): self.word=word self.results="" self.totalresults="" self.filetype=filetype self.server="www.google.com" self.hostname="www.google.com" self.userAgent="(Mozilla/5.0 (...
import boost.parallel.mpi as mpi from generators import * def scatter_test(comm, generator, kind, root): if comm.rank == root: print ("Scattering %s from root %d..." % (kind, root)), if comm.rank == root: values = list() for p in range(0, comm.size): values.append(generator...
from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from .FakeAnsibleModule import FakeAnsibleModule, ExitJsonException, FailJsonException from .common import fake_xenapi_ref def test_xenserverobject_xenapi_lib_detection(mocker, fake_ansible_module, xenserver): "...
import os import unittest import tempfile from gppylib.db import dbconn from gppylib.db.test import skipIfDatabaseDown from gppylib import gplog from gppylib.commands import pg from gppylib.gparray import GpArray logger = gplog.get_default_logger() gplog.enable_verbose_logging() @skipIfDatabaseDown() class PgCommand...
import re import urllib from HTMLParser import HTMLParser class BlogAttachmentPageParser(HTMLParser): """HTMLParser used to extract the url of Bing images from a Blog Post Attachment Page from www.iorise.com (e.g.: http://www.iorise.com/blog/?attachment_id=44)""" def __init__(self, result_list): ...
def test(): def gen(n): for x in xrange(n): yield str(x) def f_1(xs): """ :type xs: list of int """ return xs def f_2(xs): """ :type xs: collections.Sequence of int """ return xs def f_3(xs): """ :type xs...
import click from os import cpu_count, environ, execvp from sys import prefix from .app import create_app @click.group() def cli(): pass @cli.command() def run_uwsgi(): """ Run API through uwsgi server. """ # avoid fork problems with tensorflow (and other non-serializable objects) environ[...
# Wrapper module for _ssl, providing some additional facilities # implemented in Python. Written by Bill Janssen. """\ This module provides some more Pythonic support for SSL. Object types: SSLSocket -- subtype of socket.socket which does SSL over the socket Exceptions: SSLError -- exception raised for I/O er...
""" Copyright 2015-2016 @_rc0r <<EMAIL>> 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, s...
from . import serialize from .eventtarget import EventTarget class Entity: """ Attempt to implement an entity component system This is the base object Components are given on construction. Once a component is added to the object the attach method will be called on the component (if it has one). T...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import re import sys import os import glob import helper from mockable_test_result import MockableTestResult from runner import path_to_enlightenment from libs.colorama import init, Fore, Style init() # init colorama class Sensei(MockableTestResult): ...
""" Construct a corpus from a Wikipedia (or other MediaWiki-based) database dump. If you have the `pattern` package installed, this module will use a fancy lemmatization to get a lemma of each token (instead of plain alphabetic tokenizer). The package is available at https://github.com/clips/pattern . See scripts/pro...
import testtools from openstack.block_store import block_store_service class TestBlockStoreService(testtools.TestCase): def test_service(self): sot = block_store_service.BlockStoreService() self.assertEqual("volume", sot.service_type) self.assertEqual("public", sot.interface) sel...
import logging import psycopg2 from socorro.external import DatabaseError, MissingArgumentError from socorro.external.postgresql.base import PostgreSQLBase from socorro.lib import external_common logger = logging.getLogger("webapi") class SkipList(PostgreSQLBase): filters = [ ("category", None, ["str"]...
from openerp.osv import fields, osv from openerp.tools.translate import _ class crm_partner_binding(osv.osv_memory): """ Handle the partner binding or generation in any CRM wizard that requires such feature, like the lead2opportunity wizard, or the phonecall2opportunity wizard. Try to find a matching ...
"""module providing: * process information (linux specific: rely on /proc) * a class for resource control (memory / time / cpu time) This module doesn't work on windows platforms (only tested on linux) :organization: Logilab """ __docformat__ = "restructuredtext en" import os import stat from resource import getr...
import two_jets as tj import numpy as np DIM = tj.DIM = 2 N = tj.N = 4 SIGMA = tj.SIGMA = 1.0 def d2zip(grid): return np.dstack(grid).reshape([-1,2]) q = SIGMA*2*np.random.randn(N,DIM) #q = SIGMA*2*np.mgrid[-1.5:1.5:np.complex(0,np.sqrt(N)),-1.5:1.5:np.complex(0,np.sqrt(N))] # particles in regular grid #q = d2z...
from openerp.osv import osv, fields from openerp.tools.safe_eval import safe_eval class base_config_settings(osv.TransientModel): _inherit = 'base.config.settings' _columns = { 'auth_signup_reset_password': fields.boolean('Enable password reset from Login page', help="This allows users to ...
import time import unittest import threading import synapse.async as s_async import synapse.lib.threads as s_threads from synapse.tests.common import * class AsyncTests(SynTest): def test_async_basics(self): boss = s_async.Boss() data = {} def jobmeth(x, y=20): return x + y...
data = ( 'Ben ', # 0x00 'Yuan ', # 0x01 'Wen ', # 0x02 'Re ', # 0x03 'Fei ', # 0x04 'Qing ', # 0x05 'Yuan ', # 0x06 'Ke ', # 0x07 'Ji ', # 0x08 'She ', # 0x09 'Yuan ', # 0x0a 'Shibui ', # 0x0b 'Lu ', # 0x0c 'Zi ', # 0x0d 'Du ', # 0x0e '[?] ', # 0x0f 'Jian ', # 0x10 'Mi...
''' Color Picker ============ .. versionadded:: 1.7.0 .. warning:: This widget is experimental. Its use and API can change at any time until this warning is removed. .. image:: images/colorpicker.png :align: right The ColorPicker widget allows a user to select a color from a chromatic wheel where pinch...
from openerp import api, models, fields class MrpProductionWorkcenterLine(models.Model): _inherit = 'mrp.production.workcenter.line' operation_time_lines = fields.One2many('operation.time.line', 'operation_time', string='Op...
#!/usr/bin/env python -i # preceeding line should have path for Python on your machine # mc.py # Purpose: mimic operation of example/MC/in.mc via Python # Syntax: mc.py in.mc # in.mc = LAMMPS input script import sys,random,math # set these parameters # make sure neigh skin (in in.mc) > 2*deltamove nloop =...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class MorningstarIE(InfoExtractor): IE_DESC = 'morningstar.com' _VALID_URL = r'https?://(?:www\.)?morningstar\.com/[cC]over/video[cC]enter\.aspx\?id=(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.mo...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.slxos import slxos_config from units.modules.utils import set_module_args from .slxos_module import TestSlxosModule, load_fixture class TestSlxosConfigModule(TestSl...
"""Module keeping state for Ganeti watcher. """ import os import time import logging from ganeti import utils from ganeti import serializer from ganeti import errors # Delete any record that is older than 8 hours; this value is based on # the fact that the current retry counter is 5, and watcher runs every # 5 min...
''' Copyright (C) 2013 TopCoder Inc., All Rights Reserved. ''' ''' This is the module that provides useful helper functions. Thread Safety: The implementation is thread safe. @author: TCSASSEMLBER @version: 1.0 ''' def log_entrance(logger, signature, parasMap): ''' Logs for entrance into public methods at DE...
microcode = ''' def macroop PAND_XMM_XMM { mand xmml, xmml, xmmlm mand xmmh, xmmh, xmmhm }; def macroop PAND_XMM_M { lea t1, seg, sib, disp, dataSize=asz ldfp ufp1, seg, [1, t0, t1], dataSize=8 ldfp ufp2, seg, [1, t0, t1], 8, dataSize=8 mand xmml, xmml, ufp1 mand xmmh, xmmh, ufp2 }; def ma...
#!/usr/bin/env python # -*- coding: utf-8 -*- import csv import os import six try: import unittest2 as unittest except ImportError: import unittest from csvkit import unicsv @unittest.skipIf(six.PY3, "Not supported in Python 3.") class TestUnicodeCSVReader(unittest.TestCase): def test_utf8(self): ...
import sys from pyspark import since, SparkContext from pyspark.sql.column import _to_seq, _to_java_column __all__ = ["Window", "WindowSpec"] def _to_java_cols(cols): sc = SparkContext._active_spark_context if len(cols) == 1 and isinstance(cols[0], list): cols = cols[0] return _to_seq(sc, cols, ...
from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class Article(models.Model): """ A simple Article model for testing """ site = models.ForeignKey('sites.Site', related_name="admin_articles") title = models.CharField(max_length=...
from django import forms from django.contrib.auth.forms import UserCreationForm from django.core.exceptions import ValidationError from accounts.models import User class UserRegistrationForm(UserCreationForm): MONTH_ABBREVIATIONS = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept...
""" Initial, and very limited, unit tests for ELBConnection. """ import boto import time from tests.compat import unittest from boto.ec2.elb import ELBConnection import boto.ec2.elb class ELBConnectionTest(unittest.TestCase): ec2 = True def setUp(self): """Creates a named load balancer that can be s...
"""Tests for SparseTensorsMap.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.client import session from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.pyt...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from abc import ABCMeta, abstractmethod from functools import wraps from ansible.errors import AnsibleError from ansible.module_utils.six import with_metaclass from ansible.module_utils._text import to_bytes try: from ncclien...
"""Tests the text output of Google C++ Testing Framework. SYNOPSIS gtest_output_test.py --build_dir=BUILD/DIR --gengolden # where BUILD/DIR contains the built gtest_output_test_ file. gtest_output_test.py --gengolden gtest_output_test.py """ __author__ = '<EMAIL> (Zhanyong Wan)' import ...
""" Parser for resource of Microsoft Windows Portable Executable (PE). Documentation: - Wine project VS_FIXEDFILEINFO structure, file include/winver.h Author: Victor Stinner Creation date: 2007-01-19 """ from hachoir_core.field import (FieldSet, ParserError, Enum, Bit, Bits, SeekableFieldSet, UInt16, UInt3...
from __future__ import unicode_literals import frappe import json from frappe.model.document import Document class EmployeeAttendanceTool(Document): pass @frappe.whitelist() def get_employees(date, department = None, branch = None, company = None): attendance_not_marked = [] attendance_marked = [] filters = {"s...
{ 'name': 'Helpdesk', 'category': 'Customer Relationship Management', 'version': '1.0', 'description': """ Helpdesk Management. ==================== Like records and processing of claims, Helpdesk and Support are good tools to trace your interventions. This menu is more adapted to oral communication, ...
from __future__ import print_function, division from itertools import product from sympy import Tuple, Add, Mul, Matrix, log, expand, Rational from sympy.core.trace import Tr from sympy.printing.pretty.stringpict import prettyForm from sympy.physics.quantum.dagger import Dagger from sympy.physics.quantum.operator imp...
#!/usr/local/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ WCA fluid and WCA dimer systems. DESCRIPTION COPYRIGHT @author John D. Cho...
import abc import six NETWORK = 'network' PORT = 'port' CORE_RESOURCES = [NETWORK, PORT] @six.add_metaclass(abc.ABCMeta) class CoreResourceExtension(object): @abc.abstractmethod def process_fields(self, context, resource_type, requested_resource, actual_resource): """Proce...
""" GraphViz Tag --------- This implements a Liquid-style graphviz tag for Pelican. You can use different Graphviz programs like dot, neato, twopi etc. [1] [1] http://www.graphviz.org/ Syntax ------ {% graphviz <program> { <DOT code> } %} Examples -------- {% graphviz dot { digraph graph...
import os.path from PyQt4 import QtGui, QtCore from PyQt4.uic.uiparser import UIParser from PyQt4.uic.Loader.qobjectcreator import LoaderCreatorPolicy class DynamicUILoader(UIParser): def __init__(self): UIParser.__init__(self, QtCore, QtGui, LoaderCreatorPolicy()) def createToplevelWidget(self, cla...
# -*- coding: utf-8 -*- """ pygments.lexers.ooc ~~~~~~~~~~~~~~~~~~~ Lexers for the Ooc language. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroups, words from pygments.token import Text, C...
import os import uuid from pygal import Pie def test_donut(): chart = Pie(inner_radius=.3, pretty_print=True) chart.title = 'Browser usage in February 2012 (in %)' chart.add('IE', 19.5) chart.add('Firefox', 36.6) chart.add('Chrome', 36.3) chart.add('Safari', 4.5) chart.add('Opera', 2.3) ...
from django.conf.urls.defaults import * from piston.resource import Resource from csc.webapi.docs import documentation_view from csc.webapi.handlers import * # This gives a way to accept "query.foo" on the end of the URL to set the # format to 'foo'. "?format=foo" works as well. Q = r'(query\.(?P<emitter_format>.+))?$...
# -*- coding: utf-8 -*- from __future__ import with_statement import binascii import re from Crypto.Cipher import AES from module.plugins.internal.Container import Container from module.utils import fs_encode class RSDF(Container): __name__ = "RSDF" __type__ = "container" __version__ = "0.31" ...
import os import socket import geoip2.database from django.conf import settings from django.core.validators import ipv4_re from django.utils import six from django.utils.ipv6 import is_valid_ipv6_address from .resources import City, Country # Creating the settings dictionary with any settings, if needed. GEOIP_SETT...
""" HTTP errors. """ from twisted.trial import unittest from twisted.web import error class ErrorTestCase(unittest.TestCase): """ Tests for how L{Error} attributes are initialized. """ def test_noMessageValidStatus(self): """ If no C{message} argument is passed to the L{Error} construc...
from __future__ import absolute_import import copy import mock from orquesta import exceptions as orquesta_exc from orquesta.specs import loader as specs_loader from orquesta import statuses as wf_statuses import st2tests import st2tests.config as tests_config tests_config.parse_args() from st2common.bootstrap im...
import hashlib import os import openerp import openerp.tests.common HASH_SPLIT = 2 # FIXME: testing implementations detail is not a good idea class test_ir_attachment(openerp.tests.common.TransactionCase): def setUp(self): super(test_ir_attachment, self).setUp() registry, cr, uid = self.regi...
import os import logging.config from flask.config import Config from ConfigParser import ConfigParser from StringIO import StringIO def load_config(): """ Loads the config files merging the defaults with the file defined in environ.LINTREVIEW_SETTINGS if it exists. """ config = Config(os.getcwd()...
"""Multi-credential file store with lock support. This module implements a JSON credential store where multiple credentials can be stored in one file. That file supports locking both in a single process and across processes. The credential themselves are keyed off of: * client_id * user_agent * scope The format of t...
from __future__ import print_function from os import environ from twisted.internet.defer import inlineCallbacks from autobahn.twisted.util import sleep from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner class Component(ApplicationSession): """ An application component that publishes an ...
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_allclose, assert_array_almost_equal from pytest import raises as assert_raises from scipy import sparse from scipy.sparse import csgraph def _explicit_laplacian(x, normed=False): if sparse.isspar...
#!/usr/bin/env python import base import re import sys import requests from termcolor import colored # Control whether the module is enabled or not ENABLED = True class style: BOLD = '\033[1m' END = '\033[0m' def banner(): print colored(style.BOLD + '\n---> Searching Scribd Docs\n' +...
"""Access Ansible Core CI remote services.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import tempfile import time from .util import ( SubprocessError, ApplicationError, cmd_quote, display, ANSIBLE_TEST_DATA_ROOT, ) from .util_common import...
from __future__ import absolute_import, division, print_function import abc from fractions import gcd import six from cryptography import utils from cryptography.exceptions import UnsupportedAlgorithm, _Reasons from cryptography.hazmat.backends.interfaces import RSABackend @six.add_metaclass(abc.ABCMeta) class RSA...
# coding=UTF-8 """ Performance tests for field overrides. """ import ddt import itertools import mock from nose.plugins.skip import SkipTest from courseware.views import progress from courseware.field_overrides import OverrideFieldData from datetime import datetime from django.conf import settings from django.core.cac...
import openerp from openerp.tools.safe_eval import safe_eval as eval class DiagramView(openerp.http.Controller): @openerp.http.route('/web_diagram/diagram/get_diagram_info', type='json', auth='user') def get_diagram_info(self, req, id, model, node, connector, src_node, des_node, label...
""" Django's standard crypto functions and utilities. """ from __future__ import unicode_literals import binascii import hashlib import hmac import random import struct import time from django.conf import settings from django.utils import six from django.utils.encoding import force_bytes from django.utils.six.moves i...
"""System configuration library.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path as _os_path import platform as _platform from tensorflow.python.framework.versions import CXX11_ABI_FLAG as _CXX11_ABI_FLAG from tensorflow.python.framework.v...
from __future__ import unicode_literals import re import unicodedata from gzip import GzipFile from io import BytesIO from django.utils import six from django.utils.encoding import force_text from django.utils.functional import SimpleLazyObject, allow_lazy from django.utils.safestring import SafeText, mark_safe from ...
from collections import defaultdict from functools import wraps import logging import os.path import threading try: import cPickle as pickle except ImportError: import pickle __all__ = ['Cache', 'cachedmethod'] logger = logging.getLogger(__name__) class Cache(object): """A Cache object contains cached v...
""" Script for importing courseware from XML format """ from django.core.management.base import BaseCommand, CommandError, make_option from django_comment_common.utils import (seed_permissions_roles, are_permissions_roles_seeded) from xmodule.modulestore.xml_importer import imp...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( ExtractorError, clean_html, ) class MovieClipsIE(InfoExtractor): _VALID_URL = r'https?://movieclips\.com/(?P<id>[\da-zA-Z]+)(?:-(?P<display_id>[\da-z-]+))?' ...
import gc import io import os import sys import signal import weakref import unittest @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " "if threa...
#-*- coding: utf-8 -*- import sys sys.path.append('D:/github-release') import unittest import json # Other import uasio.os_io.io_wrapper as iow # App import _http_requester as http_request def _split_url(url): """ http://www.dessci.com/en/products/mathplayer/ to www.dessci.com /en/products/mathplayer/ - д...
from openerp import report from . import wizard from . import models
# Django settings for demoproject project. from os.path import abspath, dirname, join demoproject_dir = dirname(abspath(__file__)) DEBUG = True ADMINS = ( # ('Your Name', '<EMAIL>'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', '...
""" Odnoklassniki OAuth2 and Iframe Application backends, docs at: https://python-social-auth.readthedocs.io/en/latest/backends/odnoklassnikiru.html """ from hashlib import md5 from six.moves.urllib_parse import unquote from .base import BaseAuth from .oauth import BaseOAuth2 from ..exceptions import AuthFailed ...
import re from flask import jsonify, request from bkr.server import identity from bkr.server.app import app from bkr.server.model import System, SystemPool, SystemAccessPolicy, \ SystemAccessPolicyRule, User, Group, SystemPermission, Activity from bkr.server.flask_util import auth_required, \ convert_internal_e...
import os from textwrap import dedent from apache.thermos.config.schema import Process, Resources, SequentialTask, Task, Tasks from apache.thermos.testing.runner import RunnerTestBase from gen.apache.thermos.ttypes import ProcessState, TaskState class TestRunnerBasic(RunnerTestBase): portmap = {'named_port': 8123...
import struct from packet_base import packet_base from packet_utils import ethtype_to_str from pox.lib.addresses import * ETHER_ANY = EthAddr(b"\x00\x00\x00\x00\x00\x00") ETHER_BROADCAST = EthAddr(b"\xff\xff\xff\xff\xff\xff") BRIDGE_GROUP_ADDRESS = EthAddr(b"\x01\x80\xC2\x00\x00\x00") LLDP_MULTICAST ...
import logging from playcert.lib.artist import Artist from playcert.cache import cache_data_in_hash log = logging.getLogger(__name__) class Event(object): def __init__(self, title, when, venue, artist_name=None, redis=None): self.title = title self.when = when self.venue = venue ...
from __future__ import division import serial import time from array_devices import array3710 __author__ = 'JoeSacher' """ This is a crude script to play with PC baud rates while the load is set to a fixed baud rate. """ load_addr = 1 # This should match load base_baud_rate = 9600 serial_conn = serial.Serial('COM4'...
from MenuList import MenuList from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename from os import path from enigma import eListboxPythonMultiContent, RT_VALIGN_CENTER, gFont, eServiceCenter from Tools.LoadPixmap import LoadPixmap import skin STATE_PLAY = 0 STATE_PAUSE = 1 STATE_STOP = 2 STATE_REWIND = ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json from ansible.compat.tests.mock import patch from ansible.modules.network.edgeos import edgeos_command from units.modules.utils import set_module_args from .edgeos_module import TestEdgeosModule, load_fixture class T...
""" globals attached to frappe module + some utility functions that should probably be moved """ from __future__ import unicode_literals from werkzeug.local import Local, release_local import os, importlib, inspect, logging, json # public from frappe.__version__ import __version__ from .exceptions import * from .util...
"""Benchmark on the keras built-in application models.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=g-bad-import-order import numpy as np from absl import app as absl_app from absl import flags import tensorflow as tf # pylint: enable...
""" Django settings for hummingbird_django project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_D...
# Class definition: # NordugridATLASSiteInformation # This class is the Nordugrid-ATLAS site information class inheriting from ATLASSiteInformation # Instances are generated with SiteInformationFactory via pUtil::getSiteInformation() # Implemented as a singleton class # http://stackoverflow.com/questions/4255...
#!/usr/bin/env python import sys import unittest from PyQt5 import QtCore, QtWidgets from peacock.PostprocessorViewer.plugins.AxesSettingsPlugin import main from peacock.utils import Testing class TestAxesSettingsPlugin(Testing.PeacockImageTestCase): """ Test class for the ArtistToggleWidget which toggles po...