code
stringlengths
1
199k
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ ...
from __future__ import unicode_literals from udata.api import api, fields, base_reference from udata.core.badges.api import badge_fields from udata.core.dataset.api_fields import dataset_ref_fields from udata.core.organization.api_fields import org_ref_fields from udata.core.user.api_fields import user_ref_fields from ...
""" Helper for keeping processes singletons """ __license__ = """ This file is part of RAPD Copyright (C) 2016-2018 Cornell University All rights reserved. RAPD is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundatio...
import os from django.core.exceptions import ImproperlyConfigured from shoop.utils.setup import Setup from . import base_settings def configure(setup): base_settings.configure(setup) local_settings_file = os.getenv('LOCAL_SETTINGS_FILE') # Backward compatibility: Find from current directory, if # LOCAL_...
from . import test_accounting from . import test_donation
import test_purchase_group_by_period
__cvsid = '$Id: mencode_unittests.py,v 1.1 2002/06/25 03:54:57 zooko Exp $' import operator import random import traceback try: import unittest except: class unittest: class TestCase: pass pass pass import humanreadable import memutil from mencode import * class Testy(unittest.Te...
import simplejson from django.core.management.base import BaseCommand from django.contrib.gis.geos import MultiPolygon, Polygon from ...models import State class Command(BaseCommand): args = 'filename' help = 'Import states from a GeoJSON file' def handle(self, *args, **options): for filename in arg...
from odoo import api, fields, models, _ import odoo.addons.decimal_precision as dp class ShippingContainerType(models.Model): _name = "shipping.container.type" name = fields.Char("Container type", required=True) volume = fields.Float("Volumen", help="Container volume (m3)", required=True) length = field...
from . import base_mapping from . import advanced_query_mapping
from . import family_aux_mass_edit from . import family_associate_to_family_aux from . import family_aux_associate_to_address_aux
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('base', '0023_messagetemp...
""" Courseware page. """ from bok_choy.page_object import PageObject, unguarded from bok_choy.promise import EmptyPromise import re from selenium.webdriver.common.action_chains import ActionChains from common.test.acceptance.pages.lms.bookmarks import BookmarksPage from common.test.acceptance.pages.lms.course_page impo...
""" Factories for Program Enrollment tests. """ from __future__ import absolute_import from uuid import uuid4 import factory from factory.django import DjangoModelFactory from opaque_keys.edx.keys import CourseKey from lms.djangoapps.program_enrollments import models from student.tests.factories import CourseEnrollment...
""" Database ORM models managed by this Django app Please do not integrate directly with these models!!! This app currently offers one programmatic API -- api.py for direct Python integration. """ import re from django.core.exceptions import ValidationError from django.db import models from django.utils.translation im...
import os import os.path import sys ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path = [ ROOT, os.path.join(ROOT, 'apps'), ] + sys.path os.environ.setdefault("DJANGO_SETTINGS_MODULE", "koedquiz.settings") from django.core.wsgi import get_wsgi_application application = get_wsgi_applica...
""" Enables interactivity for CLI operations """ import sys def query_yes_no(question, default="yes"): """Ask a yes/no question via raw_input() and return their answer. "question" is a string that is presented to the user. "default" is the presumed answer if the user just hits <Enter>. It must be "y...
from flask_wtf import Form from wtforms import TextField, DecimalField, TextAreaField, DateField, validators, PasswordField, BooleanField class CommentForm(Form): text = TextField('Title', [validators.Required()]) text2 = TextAreaField('Body') longitude = DecimalField('Longitude') latitude = DecimalFiel...
"""solution: Default solutions for testing.""" from tests.lib.helper import Helper class Solution(object): # pylint: disable=too-few-public-methods """Default solutions for testing.""" _BEATS = 0 _NGINX = 1 _KAFKA = 2 _KAFKA_MKDN = 3 # Default time is same for the default content. See 'Test cas...
from odoo.exceptions import ValidationError from odoo import models, api, _ class ProductProduct(models.Model): _inherit = 'product.product' _rec_name = 'config_name' """ Copy the function from product_configurator to show price using price list. To Fix : - Extra price For Attribute value ...
""" View logic for handling course messages. """ from __future__ import absolute_import from datetime import datetime from babel.dates import format_date, format_timedelta from django.contrib import auth from django.template.loader import render_to_string from django.utils.http import urlquote_plus from django.utils.tr...
class TaxingContext(object): def __init__(self, customer_tax_group=None, customer_tax_number=None, location=None): self.customer_tax_group = customer_tax_group self.customer_tax_number = customer_tax_number self.country_code = getattr(location, "country_code", None) or getattr(location, "cou...
import pytest from django.utils import translation from shoop.simple_cms.models import Page from shoop_tests.simple_cms.utils import create_multilanguage_page @pytest.mark.django_db def test_create_multilanguage_page(): with translation.override("de"): page_id = create_multilanguage_page(url="multi").pk ...
from copy import copy import json from cnxepub.utils import squash_xml_to_text from cnxml.parse import parse_metadata as parse_cnxml_metadata from cnxtransforms import cnxml_abstract_to_html from lxml import etree __all__ = ( 'convert_to_model_compat_metadata', 'scan_for_id_mapping', 'scan_for_uuid_mapping'...
from django.conf.urls.defaults import patterns, url urlpatterns = patterns('', url('^json/get/$', 'django_notify.views.get_notifications', name='json_get', kwargs={}), url('^json/mark-read/$', 'django_notify.views.mark_read', name='json_mark_read_base', kwargs={}), url('^json/mark-read/(\d+)/$', 'django_not...
from odoo import api, fields, models class SlotVerificationRequest(models.Model): _name = 'stock.slot.verification.request' _inherit = 'mail.thread' @api.model def create(self, vals): if not vals.get('name') or vals.get('name') == '/': vals['name'] = self.env['ir.sequence'].next_by_c...
class Widget(object): def __init__(self, options, *args, **kwargs): super(Widget, self).__init__(*args, **kwargs) self.options = options def get_display_name(self): raise NotImplementedError def render(self, request): raise NotImplementedError def render_option_form(self)...
from unittest import TestCase from gofer.messaging.adapter.url import URL from gofer.messaging.adapter.url import PORT, Scheme class Test(object): def __init__(self, url, adapter=None, scheme=None, host=None, port=None, ...
class Class(object): pass def func(): return 3.14 CONSTANT = 42
""" """ from smartcard.System import readers from smartcard.pcsc.PCSCPart10 import getTlvProperties, SCARD_SHARE_DIRECT for reader in readers(): print print "Reader:", reader card_connection = reader.createConnection() card_connection.connect(mode=SCARD_SHARE_DIRECT) # get the TLV PROPERTIES tlv...
__version__="v2.5 beta10" welcome_block=""" """ import numpy as np def fitmodels_direct(catd,mmix,mask,t2s,tes,fout=None,reindex=False,mmixN=None,full_sel=True,debugout=False): """ Usage: fitmodels_direct(fout) Input: fout is flag for output of per-component TE-dependence maps t2s is a (nx,ny,nz) n...
"""Configuration and injectable fixtures for Pytest. Supposed to replace the too-complex current UnitTest-based testing framework. DI and functions over complex inheritance hierarchies FTW! """ import os import warnings pytest_plugins = ["abilian.testing.fixtures"] if os.environ.get("FAIL_ON_WARNINGS"): # Don't rem...
import urlparse import importlib import re class Template(object): def __init__(self, source, protocol, hostname, port, username, password, path, params): """ :param source: template source name :param protocol: network tran...
import os import sys def start(): # enable profling by adding to local conf.yaml "with_internal_profiling: True" # required: "pip install GreenletProfiler" # Provides function stats in formats 'pstat', 'callgrind', 'ystat' # stats are saved at "/var/lib/tendrl/profiling/$NS.publisher_id/last_run_func_stat.$stat...
from __future__ import absolute_import, division, unicode_literals import gpg import os.path print(""" This script adds a new user ID to an existing key. The gpg-agent and pinentry are invoked to enter the passphrase. """) c = gpg.Context() homedir = input("Enter the GPG configuration directory path (optional): ") fpr0...
"""Sinusoidal grating calculated in realtime.""" import VisionEgg VisionEgg.start_default_logging(); VisionEgg.watch_exceptions() from VisionEgg.Core import * from VisionEgg.FlowControl import Presentation from VisionEgg.Gratings import * screen = get_default_screen() stimulus = SinGrating2D(position = ( screen...
import sys from cStringIO import StringIO import core class OutputStream: def __init__(self): self.output_str = StringIO() # define output stream writer method # sim_obj should be derived from either PyEntity or PyService def write(self,sim_obj,record_type,*message): for token in me...
import argparse import gettext import logging import multiprocessing import operator import os import signal import sys import time from multiprocessing import Manager from silentdune_client import modules from silentdune_client.utils.log import setup_logging from silentdune_client.utils.misc import node_info_dump from...
import pytest import time from v8py import JavaScriptTerminated, current_context, new def test_glob(context): context.eval('foo = "bar"') assert context.glob.foo == 'bar' def test_getattr(context): context.foo = 'bar' assert context.foo == 'bar' assert context.glob.foo == 'bar' assert context.ev...
""" DESCRIPTION: Helpers for telecommand wrapper functions. PACKAGE: spell.lang.helpers.tchelper PROJECT: SPELL Copyright (C) 2008, 2015 SES ENGINEERING, Luxembourg S.a.r.l. This file is part of SPELL. This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General ...
import sys sys.path.insert(0, "..") import logging import time try: from IPython import embed except ImportError: import code def embed(): vars = globals() vars.update(locals()) shell = code.InteractiveConsole(vars) shell.interact() from opcua import Client from opcua import ...
import abc import math import numpy from scipy.io import loadmat from Configs import Configs from Paths import Paths from datasets.LupusFilter import VisitsFilter, \ NullFIlter, TemporalSpanFilter from infos.Info import Info, NullInfo from infos.InfoElement import SimpleDescription, PrintableInfoElement from infos....
import codecs import os import re import json from . import WIKI_DIR from collections import defaultdict def _get_filename(slug): return os.path.join(WIKI_DIR, '%s.md' % (slug,)) class Index(object): def __init__(self): self.texts, self.words = {}, set() self.finvindex = defaultdict(set) def...
"""This module defines some special functions (originally defined in SpecialFunctions.h).""" __all__ = ["MeshCoordinates", "FacetArea", "FacetNormal", "CellSize", "CellVolume", 'SpatialCoordinate', 'CellNormal', 'Circumradius', 'MinFacetEdgeLength', 'MaxFacetEdgeLength'] import ufl import dolfin.cpp as cpp f...
{ 'name': "Reminders and Agenda for Phonecalls", 'version': '1.0.0', 'author': 'IT-Projects LLC, Ivan Yelizariev', 'category': 'Reminders and Agenda', 'website': 'https://yelizariev.github.io', 'price': 6.00, 'currency': 'EUR', 'depends': ['reminder_base', 'crm'], 'data': [ '...
from django.core.management.base import NoArgsCommand, CommandError import sys from xadrpy.core.workers.daemon import DaemonHandler class Command(NoArgsCommand): def handle(self, **options): daemon_handler = DaemonHandler("daemon.pid", "daemon.sock") try: daemon_handler.stop() ...
import urllib2 import json import sys from settings import BAIDU_AK from log import * reload(sys) sys.setdefaultencoding('utf-8') def geocode(loc): lat, lng = -1, -1 url = 'http://api.map.baidu.com/geocoder/v2/?address=%s&output=json&ak=%s' % (loc, BAIDU_AK) others = [u'其他', u'美国', u'英国', u'澳大利亚', u'伊朗', u'...
import os import KBEngine from KBEDebug import * def onBaseAppReady(isBootstrap): """ KBEngine method. baseapp已经准备好了 @param isBootstrap: 是否为第一个启动的baseapp @type isBootstrap: BOOL """ INFO_MSG('onBaseAppReady: isBootstrap=%s, appID=%s, bootstrapGroupIndex=%s, bootstrapGlobalIndex=%s' % \ (isBootstrap, os.getenv(...
from fenrirscreenreader.core import debug settingsData = { 'sound': { 'enabled': True, 'driver': 'genericDriver', 'theme': 'default', 'volume': 1.0, 'genericPlayFileCommand': 'play -q -v fenrirVolume fenrirSoundFile', 'genericFrequencyCommand': 'play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenri...
from __future__ import unicode_literals from weboob.tools.backend import Module, BackendConfig from weboob.capabilities.base import find_object from weboob.capabilities.bill import CapDocument, Document, SubscriptionNotFound, Subscription, DocumentNotFound from weboob.tools.value import Value, ValueBackendPassword from...
import pytest from eos_data_distribution import DirTools from gi.repository import GLib ITER_COUNT = 10 class TestClass: @pytest.mark.timeout(timeout=3, method='thread') def test_0(self, tmpdir): loop = GLib.MainLoop() self.__called = 0 def cb_changed(M, p, m, f, o, evt, d=None, e=None):...
import math import os from datetime import date class InPsight: # POV-Ray defines defines = {} defines['Shadows'] = 'false' defines['Background_Color'] = '<0.6,0.6,0.6>' defines['Output_File_Type'] = 'N' defines['Output_Alpha'] = 'true' defines['Light_Color'] = '<1,1,1>' defines['Filenam...
import re import Queue class AbsAnalyst(object): """docstring for AbsAnalyst""" LOGTIME_REGEXP = re.compile("(?P<log_time>\w{4}-\w{2}-\w{2} \w{2}:\w{2}:\w{2})") def __init__(self): raise NotImplemented def isMatch(self, line): raise NotImplemented def doStatistic(self): raise NotImplemented def doAnalyse(se...
from pycp2k.inputsection import InputSection class _each126(InputSection): def __init__(self): InputSection.__init__(self) self.Just_energy = None self.Powell_opt = None self.Qs_scf = None self.Xas_scf = None self.Md = None self.Pint = None self.Metady...
import sys if __name__ == "__main__": print("Genoa python script") sys.exit(0)
import pythymio import random from gardenworld import * init('info2_1') with pythymio.thymio(["acc"],[]) as Thym: state = dict([]) state["time"] = 0 state["delay"] = 10 def dispatch(evtid, evt_name, evt_args): # https://www.thymio.org/en:thymioapi prox freq is 16Hz if evt_name == "fwd.ac...
from __future__ import print_function import sys import os from pkg_resources import get_distribution, working_set, VersionConflict def samefile(path, other): """ Workaround for missing ``os.path.samefile`` in Windows Python 2.7. """ return os.path.normcase(os.path.normpath(os.path.realpath(path))) \ ...
from bliss.controllers.tango_attr_as_counter import TangoAttrCounter class tango_fe(TangoAttrCounter): def __init__(self, name, config): TangoAttrCounter.__init__(self, name, config)
import threading import logging import time LOGGER = logging.getLogger(__name__) DEFAULT_MIN_INTERVAL = 30 class Monitor(threading.Thread): """Will monitor heartbeats. Will set alarm event if no heartbeat received in specified time interval. Will do nothing if no time interval scale defined. """ def...
from logging import getLogger from eos import __version__ as eos_version from eos.eve_obj_builder import EveObjBuilder from eos.util.repr import make_repr_str from .exception import ExistingSourceError from .exception import UnknownSourceError from .source import Source logger = getLogger(__name__) class SourceManager:...
from django.db import models from _datetime import date class Restaurant(models.Model): name = models.CharField(max_length=200) transportation = models.BooleanField(default=False) weatherSensetion = models.BooleanField(default=False) status = models.BooleanField(default=True) totalDay = models.Integ...
from base64 import b64encode, b64decode from Crypto import Random from Crypto.Cipher import AES, PKCS1_OAEP from Crypto.Hash import SHA256 from Crypto.PublicKey import RSA from Crypto.Random import random from Crypto.Signature import PKCS1_v1_5 privateKeyStr = """-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAws5ZlcsF...
from compiler import * check_item_use_trigger = (ti_on_scene_prop_use, [ (store_trigger_param_1, ":agent_id"), (store_trigger_param_2, ":instance_id"), #for only server itself----------------------------------------------------------------------------------------------- (call_script, "script_use_item", ":insta...
import threading import time import sys import trace from inspect import isgeneratorfunction import format class KillableThread(threading.Thread): """A subclass of threading.Thread, with a kill() method provided by courtsey of Connelly Barnes.""" def __init__(self, *args, **keywords): threading.Thread._...
from __future__ import unicode_literals import re from .mtv import MTVServicesInfoExtractor from ..compat import ( compat_str, compat_urllib_parse, ) from ..utils import ( ExtractorError, float_or_none, unified_strdate, ) class ComedyCentralIE(MTVServicesInfoExtractor): _VALID_URL = r'''(?x)http...
from whiffle import wikidotapi from util import hook @hook.command def author(inp): ".author <Author Name> -- Will return details regarding the author" if firstrefresh == 0:#make sure the cache actually exists return "Cache has not yet updated, please wait a minute and search again." api = wikidotapi.connection() ...
from paxes_nova import _ PAUSE_SUCCESS = (_("Pause of virtual machine {instance_name} on host " "{host_name} was successful.")) PAUSE_ERROR = (_("Pause of virtual machine {instance_name} on host " "{host_name} failed with exception: {error}")) SUSPEND_SUCCESS = (_("Suspend of virtual...
import gast import pytest from tangent import optimization from tangent import quoting def test_assignment_propagation(): def f(x): y = x z = y return z node = quoting.parse_function(f) node = optimization.assignment_propagation(node) assert len(node.body[0].body) == 2 def test_dce(): def f(x): ...
import re from swift.common.middleware.proxy_logging import ProxyLoggingMiddleware from swift.common.swob import Request from swift.common.utils import config_true_value, get_logger def flat_dict_from_dict(dict_): """ Create a dictionary without depth. { 'depth0': { 'depth1': { ...
import mock import os from oslo_utils import importutils from midonet.neutron.db import task # noqa from neutron.extensions import portbindings from neutron.tests.unit import _test_extension_portbindings as test_bindings import neutron.tests.unit.test_db_plugin as test_plugin import neutron.tests.unit.test_extension_e...
import logging from flask import abort from flask import Blueprint from flask import current_app from flask import flash from flask import redirect from flask import session from flask import url_for from testrail_reporting.auth.models import AuthUser from testrail_reporting.auth.oauth import get_google log = logging.g...
import dask from .scheduler import ray_dask_get, ray_dask_get_sync from .callbacks import ( RayDaskCallback, local_ray_callbacks, unpack_ray_callbacks, ) from .optimizations import dataframe_optimize dask_persist = dask.persist def ray_dask_persist(*args, **kwargs): kwargs["ray_persist"] = True retu...
import os import requests import socket import subprocess import unittest import json import ray from ray.rllib import _register_all from ray.tune.trial import Trial, Resources from ray.tune.web_server import TuneClient from ray.tune.trial_runner import TrialRunner def get_valid_port(): port = 4321 while True: ...
"""Control flow statements: loops, conditionals, etc.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.autograph.operators import py_builtins from tensorflow.python.autograph.operators import special_values from tensorflow.python.auto...
import platform class OSCollector(object): def __init__(self, docker_client=None): self.docker_client = docker_client def key_name(self): return "osInfo" def _zip_fields_values(self, keys, values): data = {} for key, value in zip(keys, values): if len(value) > 0: ...
import datetime import sys from django.utils.timezone import utc, now from django.core.management.base import BaseCommand from feeds.models import Feed, Meta from feeds.exceptions import FeedException class Command(BaseCommand): help = 'Fetches the items from all stored feeds.' def handle(self, *args, **options...
import os import threading from cachetools import LRUCache from customUtilities.logger import logger class Cache(): def __init__(self,cachefilename,CACHE_SIZE,logger=logger('detoursCache.log')): self.lock = threading.RLock() self.cachefilename = cachefilename self.entry = LRUCache(maxsize=CA...
""" This script constructs an Marathon application definition for the stress tester container. Be sure to deploy the latest stress tester docker image to the registry before running this. """ import argparse import json import os import sys BASE_PATH = os.path.dirname(os.path.realpath(__file__)) PROJECT_PATH = os.path....
import copy import math import socket import time import uuid from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder.openstack.common import loopingcall from...
from pathlib import Path from jobman.jobman import JobMan from mc.clients.job_record_client import JobRecordClient from mc.clients.flow_record_client import FlowRecordClient from mc.flows.flow_engine import FlowEngine from mc.db.db import Db from mc.runners.flow_runner import FlowRunner from mc.runners.jobman_job_runne...
from datetime import datetime def get_id(obj): """Get obj's uuid or object itself if no uuid Abstracts the common pattern of allowing both an object or an object's ID (UUID) as a parameter when dealing with relationships. """ try: return obj.uuid or obj['uuid'] except AttributeError: ...
"""A utility for GitHub REST API. This script handles GitHub Issue, Pull Request, Comment, Label and Artifact """ import requests import json import shutil import re from absl import logging from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry RETRIES = 3 BACKOFF = 5 RETRY_ST...
""" Records for SMART Reference EMR Ben Adida & Josh Mandel """ from base import * from django.utils import simplejson from django.conf import settings from smart.common.rdf_tools.rdf_ontology import ontology from smart.common.rdf_tools.util import rdf, foaf, vcard, sp, serialize_rdf, parse_rdf, bound_graph, URIRef, Na...
from django.db import models class Snippet(models.Model): """A text snippet. Not meant for use by anyone other than a designer""" name = models.CharField(max_length=255) snippet = models.TextField(blank=True) class Meta: pass def __unicode__(self): return self.snippet
import os import sys from utils.SinfonierConstants import Environment as EnvConst SINFONIER_API_NAME = os.environ[EnvConst.SINFONIER_ENV_KEY] if SINFONIER_API_NAME == EnvConst.DEVELOP_ENVIRONMENT: from environmentConfig.Develop import * elif SINFONIER_API_NAME == EnvConst.PROD_ENVIRONMENT: from environmentConfi...
print("""# ******* WARNING - AUTO GENERATED CODE - DO NOT EDIT ******* module VimSdk module VmomiSupport """) import ServerObjects import PbmObjects import SmsObjects print(""" end end """)
""" Publish and subscribe to MQTT messages. Additional information at http://mqtt.org and http://ibmstreams.github.io/streamsx.messaging """ from future.builtins import * from streamsx.topology.topology import * from streamsx.topology import schema class MqttStreams(object): """ A simple connector to a MQTT bro...
import sys path = '/home/khasm08/PythonSandbox/KFrame_0_01' if path not in sys.path: sys.path.append(path) from index import application
import requests import pytest import subprocess class TestAuto(object): PREFIX = 'http://localhost:8089' USER = 'testauto' LIST_ID = '' AUTO_ID = '' NUM_BROWSERS = 2 @classmethod def setup_class(cls): cls.session = requests.session() @classmethod def teardown_class(cls): ...
"""Handles all requests relating to compute resources (e.g. guest VMs, networking and storage of VMs, and compute hosts on which they run).""" import base64 import functools import re import string import uuid from oslo.config import cfg import six from nova import availability_zones from nova import block_device from ...
""" tests for supporting multiple NIC's in advanced zone with security groups in cloudstack 4.14.0.0 """ from nose.plugins.attrib import attr from marvin.cloudstackTestCase import cloudstackTestCase, unittest from marvin.sshClient import SshClient from marvin.lib.utils import (validateList, ...
'''Runner for debugging with JLink.''' from os import path import os from .core import ZephyrBinaryRunner, get_env_or_bail DEFAULT_JLINK_GDB_PORT = 2331 class JLinkBinaryRunner(ZephyrBinaryRunner): '''Runner front-end for the J-Link GDB server.''' def __init__(self, device, gdbserver='JLinkGDBS...
import jinja2 import os import webapp2 import logging from google.appengine.api import memcache jinja_environment = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=['jinja2.ext.autoescape'], autoescape=True) class MainPage(webapp2.RequestHandler): def get(self):...
"""Tests for mac notes plugin.""" from __future__ import unicode_literals import unittest from plaso.lib import definitions from plaso.parsers.sqlite_plugins import mac_notes from tests.parsers.sqlite_plugins import test_lib class MacNotesTest(test_lib.SQLitePluginTestCase): """Tests for mac notes database plugin."""...
"""Main entry point into the Identity service.""" import abc import functools import os import uuid from oslo.config import cfg import six from keystone import clean from keystone.common import dependency from keystone.common import driver_hints from keystone.common import manager from keystone import config from keyst...
import osgtest.library.core as core import osgtest.library.files as files import osgtest.library.osgunittest as osgunittest class TestLcMaps(osgunittest.OSGTestCase): required_rpms = ['lcmaps', 'lcmaps-db-templates', 'vo-client', 'vo-client-lcmaps-voms'] def test_01_configure(self): core.config['lcmaps....
import cv2 import numpy as np template = np.zeros((500,500,3),np.uint8) template[:,:,0] = 255 template[:,:,1] = 255 template[:,:,2] = 255 x = [50,250,250,50,50] y = [50,50,250,250,50] cnt = np.asarray(zip(x,y)) cv2.drawContours(template,[cnt],0,0,1) x = [100,200,200,100,100] y = [300,300,150,150,300] cnt = np.asarray(z...
from vt_manager_kvm.models import * from vt_manager_kvm.communication.utils.XmlUtils import * import xmlrpclib am = xmlrpclib.Server('https://expedient:expedient@192.168.254.193:8445/xmlrpc/agent') xml = xmlFileToString('communication/utils/queryDelete.xml') am.send(xml)
import os import sys import utils_tests import trappy sys.path.append(os.path.join(utils_tests.TESTS_DIRECTORY, "..", "trappy")) class BaseTestSched(utils_tests.SetupDirectory): def __init__(self, *args, **kwargs): super(BaseTestSched, self).__init__( [("trace_sched.txt", "trace.txt")], ...
def pytest_addoption(parser): parser.addoption('--jenkins-docker', action='store', default='jenkins/jenkins', help='The Jenkins Docker container to launch')