code
stringlengths
1
199k
u"""Test auth.guest :copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function import pytest def test_happy_path(auth_fc): fc = auth_fc from pykern import pkconfig, pkunit, pki...
"""This example downloads activity tags for a given floodlight activity.""" import argparse import sys from apiclient import sample_tools from oauth2client import client argparser = argparse.ArgumentParser(add_help=False) argparser.add_argument( 'profile_id', type=int, help='The ID of the profile to download ta...
""" Platform for Ecobee Thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.ecobee/ """ import logging import voluptuous as vol from homeassistant.components import ecobee from homeassistant.components.climate import ( DOMAIN, STATE_CO...
"""Tests for Keras Vis utils.""" from tensorflow.python import keras from tensorflow.python.keras.utils import vis_utils from tensorflow.python.lib.io import file_io from tensorflow.python.ops import math_ops from tensorflow.python.platform import test class ModelToDotFormatTest(test.TestCase): def test_plot_model_cn...
""" pygments.lexers.stata ~~~~~~~~~~~~~~~~~~~~~ Lexer for Stata :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, default, include, words from pygments.token import Comment, Keyword, Name, N...
from oslo_log import log as logging from heat_integrationtests.common import test LOG = logging.getLogger(__name__) class CeilometerAlarmTest(test.HeatIntegrationTest): """Class is responsible for testing of ceilometer usage.""" def setUp(self): super(CeilometerAlarmTest, self).setUp() self.clie...
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import xrange from nose.tools import assert_equal, assert_true from matplotlib.testing.decorators import image_comparison, cleanup from matplotlib.axes import Axes import matplotlib.pyp...
import io import os import sys from setuptools import setup from setuptools import find_packages with io.open('README.md', 'rt', encoding='utf8') as f: README = f.read() if sys.argv[-1] == 'test': os.system('python -sm unittest discover tests "*_test.py"') sys.exit(0) if sys.argv[-1] == 'publish': os.sy...
"""OpenGLDemo.py -- A simple demo of using OpenGL with Cocoa To build the demo program, run this line in Terminal.app: $ python setup.py py2app -A This creates a directory "dist" containing OpenGLDemo.app. (The -A option causes the files to be symlinked to the .app bundle instead of copied. This means you don't hav...
from PyQt4.QtCore import QSize from PyQt4.QtGui import QVBoxLayout class MyVBoxLayout(QVBoxLayout): def __init__(self, parent=None): QVBoxLayout.__init__(self, parent) self._last_size = QSize(0, 0) def setGeometry(self, r): QVBoxLayout.setGeometry(self, r) try: wid = ...
from Foundation import * from PyObjCTools.TestSupport import * class TestNSXMLNodeOptions (TestCase): def testConstants(self): self.assertEqual(NSXMLNodeOptionsNone, 0) self.assertEqual(NSXMLNodeIsCDATA, 1 << 0) self.assertEqual(NSXMLNodeExpandEmptyElement, 1 << 1) self.assertEqual(N...
import os.path as path import sys root=path.abspath(path.dirname(__file__)) sys.path.insert(0,root)
from __future__ import absolute_import from sentry.models import Activity from .mail import ActivityMailDebugView class DebugUnassignedEmailView(ActivityMailDebugView): def get_activity(self, request, event): return {"type": Activity.UNASSIGNED, "user": request.user}
DEBUG = True TEMPLATE_DEBUG = DEBUG CARROT_BACKEND = "amqp" CELERY_RESULT_BACKEND = "database" BROKER_HOST = "localhost" BROKER_VHOST = "/" BROKER_USER = "guest" BROKER_PASSWORD = "guest" ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = 'developmen...
import logging logger = logging.getLogger(__name__) logger.warning('DEPRECATED: pyface.grid, use pyface.ui.wx.grid instead.') from pyface.ui.wx.grid.inverted_grid_model import *
from string import Template import optparse import os import sys try: grit_module_path = os.path.join( os.path.dirname(__file__), '..', '..', '..', 'tools', 'grit') sys.path.insert(0, grit_module_path) from grit.format import data_pack as DataPack except ImportError, e: print 'ImportError: ', e sys.exi...
'''This allows running a bit of code on couchdb docs. code should take a json python object, modify it and hand back to the code Not quite that slick yet, need way to pass in code or make this a decorator ''' import importlib from harvester.collection_registry_client import Collection from harvester.couchdb_init import...
import pytest import six from sqlalchemy_utils import Currency, i18n @pytest.fixture def set_get_locale(): i18n.get_locale = lambda: i18n.babel.Locale('en') @pytest.mark.skipif('i18n.babel is None') @pytest.mark.usefixtures('set_get_locale') class TestCurrency(object): def test_init(self): assert Curren...
"""Various custom data types for use throughout the unexpected pass finder.""" from __future__ import print_function import collections import copy import fnmatch import logging import six FULL_PASS = 1 NEVER_PASS = 2 PARTIAL_PASS = 3 Expectation = None Result = None BuildStats = None TestExpectationMap = None def SetE...
""" 42. Storing files according to a custom storage system ``FileField`` and its variations can take a ``storage`` argument to specify how and where files should be stored. """ import random import tempfile from django.db import models from django.core.files.base import ContentFile from django.core.files.storage import...
from __future__ import print_function import argparse import json import os _FILE_URL = 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-messaging/21.0.1/firebase-messaging-21.0.1.aar' _FILE_NAME = 'firebase-messaging-21.0.1.aar' _FILE_VERSION = '21.0.1' def do_latest(): print(_FILE_VERSION) de...
from __future__ import absolute_import import numpy.linalg as npla from .numpy_wrapper import wrap_namespace, dot from . import numpy_wrapper as anp wrap_namespace(npla.__dict__, globals()) def atleast_2d_col(x): # Promotes a 1D array into a column rather than a row. return x if x.ndim > 1 else x[:,None] inv.de...
from netforce.model import Model, fields, get_model class BarcodeIssueLine(Model): _name = "barcode.issue.line" _transient = True _fields = { "wizard_id": fields.Many2One("barcode.issue", "Wizard", required=True, on_delete="cascade"), "product_id": fields.Many2One("product", "Product", requi...
from txaws.server.method import Method from txaws.server.tests.fixtures import method @method class TestMethod(Method): pass
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager doc = DocumentManager.Instance.CurrentDBDocument faminstances = UnwrapElement(IN[...
import sys from healthcareai.common.healthcareai_error import HealthcareAIError def validate_pyodbc_is_loaded(): """ Simple check that alerts user if they are do not have pyodbc installed, which is not a requirement. """ if 'pyodbc' not in sys.modules: raise HealthcareAIError('Using this function requir...
def deleteNoneSpacelstrip(str): while(str.lstrip('\n') is not str):str = str.lstrip('\n') while(str.lstrip('\t') is not str):str = str.lstrip('\t') while(str.lstrip('\0') is not str):str = str.lstrip('\0') while(str.lstrip('\n') is not str):str = str.lstrip('\n') while(str.lstrip('\t') is not str):s...
'''OpenGL extension ARB.fragment_program This module customises the behaviour of the OpenGL.raw.GL.ARB.fragment_program to provide a more Python-friendly API Overview (from the spec) Unextended OpenGL mandates a certain set of configurable per- fragment computations defining texture application, texture environment,...
import base64 import json from pcs_test.tools.command_env.mock_node_communicator import ( place_multinode_call, ) class FilesShortcuts: def __init__(self, calls): self.__calls = calls def put_files( self, node_labels=None, pcmk_authkey=None, corosync_authkey=None, ...
"""SQLAlchemy ORM exceptions.""" from .. import exc as sa_exc from .. import util NO_STATE = (AttributeError, KeyError) """Exception types that may be raised by instrumentation implementations.""" class StaleDataError(sa_exc.SQLAlchemyError): """An operation encountered database state that is unaccounted for. C...
''' script.skin.helper.service Helper service and scripts for Kodi skins mainmodule.py All script methods provided by the addon ''' import xbmc import xbmcvfs import xbmcgui import xbmcaddon from skinsettings import SkinSettings from simplecache import SimpleCache from utils import log_msg, KODI_VERSION...
import io import os from unittest import mock from xml.etree import ElementTree import fixtures from testtools.matchers import HasLength import snapcraft from snapcraft import tests from snapcraft.plugins import maven class MavenPluginTestCase(tests.TestCase): def setUp(self): super().setUp() class ...
import sys def unparseToC(vars, annot_body_code, indent, extra_indent): '''Unparse to C/C++ code''' if len(vars) == 0: return annot_body_code s = '\n' s += indent + '#pragma disjoint (' for i, v in enumerate(vars): if i > 0: s += ', ' s += '*' + __printAddressC(v....
from __future__ import (absolute_import, division, print_function, unicode_literals) import testcommon import backtrader as bt import backtrader.indicators as btind chkdatas = 1 chkvals = [ ['4076.212366', '3655.193634', '3576.228000'], ['4178.117675', '3746.573475', '3665.633700'], ...
""" Parses the results found for the ETW started on a machine, downloads the results and stops the ETW. All credit to pauldotcom- http://pauldotcom.com/2012/07/post-exploitation-recon-with-e.html Module built by @harmj0y """ import settings from lib import command_methods from lib import helpers from lib import sm...
from openerp import models, fields, api, _ import math class MrpBom(models.Model): _inherit = 'mrp.bom' @api.model def _bom_explode(self, bom, product, factor, properties=None, level=0, routing_id=False, previous_products=None, master_bom=None): routing_id =...
from UM.Mesh.MeshWriter import MeshWriter from UM.Math.Vector import Vector from UM.Logger import Logger from UM.Math.Matrix import Matrix from UM.Application import Application import UM.Scene.SceneNode import Savitar import numpy MYPY = False try: if not MYPY: import xml.etree.cElementTree as ET except Im...
import exporter import dataset_export import update_datastore_content #enter key as an argument from sys import argv script, env, res_id, api_key = argv with open(env + '.csv', 'w') as f: csv_string = exporter.export('https://' + env + '.data.gov.bc.ca', 'columns.json') f.write(csv_string) if __name__ == '__main__': ...
from spack import * from glob import glob class Cuda(Package): """CUDA is a parallel computing platform and programming model invented by NVIDIA. It enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU). Note: This package does not currently in...
from ming import * import sys srcdir=sys.argv[1] m = SWFMovie(); font = SWFFont(srcdir + "/../Media/test.ttf") text = SWFText(1) w = font.getStringWidth("The quick brown fox jumps over the lazy dog. 1234567890") text.setFont(font) text.setColor(0,0,0,255) text.setHeight(20) text.moveTo(w,0) text.addString("|") m.add(t...
"""Tests for certbot.plugins.disco.""" import unittest import mock import pkg_resources import zope.interface from certbot import errors from certbot import interfaces from certbot.plugins import standalone from certbot.plugins import webroot EP_SA = pkg_resources.EntryPoint( "sa", "certbot.plugins.standalone", ...
from poster.encode import multipart_encode from poster.streaminghttp import register_openers import urllib2,urllib,sys,time import cookielib,mechanize import re DEBUG =0 reload(sys) sys.setdefaultencoding('utf8') #@UndefinedVariable register_openers() headers = { 'Host':'agent.anjuke.com', 'User-A...
from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611 from aquilon.worker.commands.show_hostlink import CommandShowHostlink class CommandShowHostlinkHostlink(CommandShowHostlink): required_parameters = ["hostlink"]
import sqlalchemy def upgrade(migrate_engine): meta = sqlalchemy.MetaData(bind=migrate_engine) stack = sqlalchemy.Table('stack', meta, autoload=True) name_index = sqlalchemy.Index('ix_stack_owner_id', stack.c.owner_id, mysql_length=36) name_index.create(migrate_engine)
"""Support for Axis camera streaming.""" from homeassistant.components.camera import SUPPORT_STREAM from homeassistant.components.mjpeg.camera import ( CONF_MJPEG_URL, CONF_STILL_IMAGE_URL, MjpegCamera, filter_urllib3_logging, ) from homeassistant.const import ( CONF_AUTHENTICATION, CONF_DEVICE,...
"""EfficientNet models for Keras. Reference: - [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks]( https://arxiv.org/abs/1905.11946) (ICML 2019) """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import math from t...
import math import numpy def run(self, Input): number_of_steps = 16 self.time = numpy.zeros(number_of_steps) uniform = Input["uniform"] self.out = numpy.zeros(number_of_steps) for i in range(len(self.time)): self.time[i] = 0.25*i time = self.time[i] self.out[i] = math.sin(time+uniform)
import re from django.conf import settings from django.template import Context # noqa from django.template import Template # noqa from django.utils.text import normalize_newlines # noqa from horizon.test import helpers as test from horizon.test.test_dashboards.cats.dashboard import Cats # noqa from horizon.test.tes...
"""Platform for retrieving meteorological data from Environment Canada.""" import datetime import re from env_canada import ECData # pylint: disable=import-error import voluptuous as vol from homeassistant.components.weather import ( ATTR_FORECAST_CONDITION, ATTR_FORECAST_PRECIPITATION_PROBABILITY, ATTR_FO...
import json import logging import inspect from .decorators import pipeline_functions, register_pipeline from indra.statements import get_statement_by_name, Statement logger = logging.getLogger(__name__) class AssemblyPipeline(): """An assembly pipeline that runs the specified steps on a given set of statements....
""" sha1Hash_test.py Unit tests for sha1.py """ from crypto.hash.sha1Hash import SHA1 import unittest import struct assert struct.calcsize('!IIIII') == 20, '5 integers should be 20 bytes' class SHA1_FIPS180_TestCases(unittest.TestCase): """ SHA-1 tests from FIPS180-1 Appendix A, B and C """ def testFIPS18...
from datetime import datetime from django.contrib.contenttypes.models import ContentType from actstream.managers import ActionManager, stream class MyActionManager(ActionManager): @stream def testfoo(self, object, time=None): if time is None: time = datetime.now() return object.actor...
from neo.io.basefromrawio import BaseFromRaw from neo.rawio.plexonrawio import PlexonRawIO class PlexonIO(PlexonRawIO, BaseFromRaw): """ Class for reading the old data format from Plexon acquisition system (.plx) Note that Plexon now use a new format PL2 which is NOT supported by this IO. Compat...
''' Copyright (c) 2013 Potential Ventures Ltd Copyright (c) 2013 SolarFlare Communications Inc All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above co...
"""Add mod versioning Revision ID: 1d46e8d4483 Revises: 2650a2191fe Create Date: 2014-06-10 01:29:49.567535 """ revision = '1d46e8d4483' down_revision = '2650a2191fe' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.drop_column('mod', '...
import pyspeckit import os from pyspeckit.spectrum.models import nh2d import numpy as np import astropy.units as u if not os.path.exists('p-nh2d_spec.fits'): import astropy.utils.data as aud from astropy.io import fits f = aud.download_file('https://github.com/pyspeckit/pyspeckit-example-files/raw/master/p-...
import email from email.Parser import Parser as MailParser import time def get_message_date(content, header='Date'): """ Parses mail and returns resulting timestamp. :param header: the header to extract date from; :returns: timestamp or `None` in the case of failure. """ message = MailParser().p...
class BookmarkData: def __init__(self, _id, _title, _url, _parent, _type): self.mId = _id self.mTitle = _title self.mUrl = _url self.mParent = _parent self.mType = _type def dump(self, _intent=' '): print "%s-> %d, %s, %s, %d, %d" % (_intent, self.mId, self.mTitle, self.mUrl, self.mParent, self.mType...
"""Configuration for Zenodo Records.""" from __future__ import absolute_import, print_function from flask_babelex import gettext from speaklater import make_lazy_gettext _ = make_lazy_gettext(lambda: gettext) ZENODO_COMMUNITIES_AUTO_ENABLED = True """Automatically add and request to communities upon publishing.""" ZENO...
from .Base import Base from .misc import parse_name, safename class Crypter(Base): __name__ = "Crypter" __type__ = "crypter" __version__ = "0.20" __status__ = "stable" __pattern__ = r'^unmatchable$' __config__ = [("activated", "bool", "Activated", True), ("use_premium", "bool",...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import base64 import datetime import os import time from ansible import constants as C from ansible.plugins.action import ActionBase from ansible.utils.hashing import checksum_s from ansible.utils.unicode import to_bytes class Actio...
from spack import * class Xgc(AutotoolsPackage): """xgc is an X11 graphics demo that shows various features of the X11 core protocol graphics primitives.""" homepage = "http://cgit.freedesktop.org/xorg/app/xgc" url = "https://www.x.org/archive/individual/app/xgc-1.0.5.tar.gz" version('1.0.5', '...
import scoop scoop.DEBUG = False import unittest import subprocess import time import copy import os import sys import operator import signal import math from tests_parser import TestUtils from tests_stat import TestStat from tests_stopwatch import TestStopWatch from scoop import futures, _control, utils, shared from s...
from typing import Any from django.db import connection from zerver.lib.management import ZulipBaseCommand def create_indexes() -> None: # Creating concurrent indexes is kind of a pain with current versions # of Django/postgres, because you will get this error with seemingly # reasonable code: # ...
import os import itertools import json import time from collections import defaultdict from eventlet import Timeout from swift.container.sync_store import ContainerSyncStore from swift.container.backend import ContainerBroker, DATADIR from swift.container.reconciler import ( MISPLACED_OBJECTS_ACCOUNT, incorrect_pol...
from c7n.manager import resources from c7n.query import QueryResourceManager @resources.register('rest-api') class RestAPI(QueryResourceManager): resource_type = "aws.apigateway.restapis"
import unittest import numpy as np from op_test import OpTest def smooth_l1_loss_forward(val, sigma2): abs_val = abs(val) if abs_val < 1.0 / sigma2: return 0.5 * val * val * sigma2 else: return abs_val - 0.5 / sigma2 class TestSmoothL1LossOp1(OpTest): def setUp(self): self.op_typ...
"""Tests for Grappler LayoutOptimizer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.core.protobuf import config_pb2 from tensorflow.core.protobuf import device_properties_pb2 from tensorflow.core.protobuf import rewrit...
import os from unittest import TestCase from mock import patch from os.path import exists import shutil from carbon.tests.util import TestSettings from carbon.database import WhisperDatabase, CeresDatabase class WhisperDatabaseTest(TestCase): def setUp(self): self._sep_patch = patch.object(os.path, 'sep', "...
import os from oslo.serialization import jsonutils as json from glance.common import client as base_client from glance.common import exception from glance import i18n _ = i18n._ class CacheClient(base_client.BaseClient): DEFAULT_PORT = 9292 DEFAULT_DOC_ROOT = '/v1' def delete_cached_image(self, image_id): ...
import sys if sys.version_info[:2] >= (3, 3): import queue else: import Queue as queue from pickle import PicklingError if sys.version_info >= (3, 4): from multiprocessing.process import BaseProcess else: from multiprocessing.process import Process as BaseProcess if sys.platform == "win32": from .co...
import unittest import webapp2 import webtest from google.appengine.ext import ndb from dashboard import group_report from dashboard import test_owner from dashboard import testing_common from dashboard import utils from dashboard.models import anomaly from dashboard.models import bug_data from dashboard.models import ...
from __future__ import unicode_literals from ..model import Level1Design def test_Level1Design_inputs(): input_map = dict(bases=dict(mandatory=True, ), contrasts=dict(), ignore_exception=dict(nohash=True, usedefault=True, ), interscan_interval=dict(mandatory=True, ), model_serial_cor...
""" sentry.client.celery.tasks ~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from celery.decorators import task from sentry.client.base import SentryClient from sentry.client.celery import conf @task(routing_key=conf.CE...
import argparse import zipfile import os import sys def _zip_dir(path, zip_file, prefix): path = path.rstrip('/\\') for root, dirs, files in os.walk(path): for file in files: zip_file.write(os.path.join(root, file), os.path.join( root.replace(path, prefix), file)) def main(args): zip_file = zi...
from __future__ import absolute_import import errno import os import sys import signal from celery import _find_option_with_arg from celery import platforms from celery.five import open_fqdn from celery.platforms import ( get_fdmax, ignore_errno, set_process_title, signals, maybe_drop_privileges, ...
from functools import partial from time import sleep from mock import call, Mock from scrapy.crawler import Crawler from scrapy.http import Request from scrapy import log, signals from scrapy.settings import Settings from scrapy.spider import BaseSpider from scrapy.xlib.pydispatch import dispatcher from twisted.interne...
""" simple and hopefully reusable widgets to ease the creation of UPnP UI applications icons taken from the Tango Desktop Project """ import os.path import urllib import traceback import pygtk pygtk.require("2.0") import gtk import gobject import dbus from dbus.mainloop.glib import DBusGMainLoop DBusGMainLoop(s...
import os import time import hostapd def test_module_wpa_supplicant(dev, apdev, params): """wpa_supplicant module tests""" if "OK" not in dev[0].global_request("MODULE_TESTS"): raise Exception("Module tests failed") # allow eloop test to complete time.sleep(0.75) dev[0].relog() with open...
''' Created on Jun 11, 2011 @author: mkiyer ''' class Breakpoint(object): def __init__(self): self.name = None self.seq5p = None self.seq3p = None self.chimera_names = [] @property def pos(self): """ return position of break along sequence measured from 5' -> ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: azure_rm_managed_disk version_added: "2.4" short_description: M...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: redhat_subscription short_description: Manage registration and ...
from __future__ import unicode_literals import six from django.utils.translation import ugettext_lazy as _ from django.views.generic.detail import DetailView from shoop.core.models import PaymentMethod, ShippingMethod from shoop.utils.excs import Problem from shoop.utils.importing import load class _BaseMethodDetailVie...
class Amrvis(MakefilePackage): """Amrvis is a visualization package specifically designed to read and display output and profiling data from codes built on the AMReX framework. """ homepage = "https://github.com/AMReX-Codes/Amrvis" git = "https://github.com/AMReX-Codes/Amrvis.git" ...
import re from .common import InfoExtractor class TrailerAddictIE(InfoExtractor): _VALID_URL = r'(?:http://)?(?:www\.)?traileraddict\.com/(?:trailer|clip)/(?P<movie>.+?)/(?P<trailer_name>.+)' _TEST = { u'url': u'http://www.traileraddict.com/trailer/prince-avalanche/trailer', u'file': u'76184.mp4...
import os import ctypes from os import path _audio_path = path.join(path.dirname(__file__), '..', 'pykinect', 'audio', 'PyKinectAudio.dll') if not os.path.exists(_audio_path): _audio_path = path.join(path.dirname(__file__), '..', '..', '..', '..', '..', '..', 'Binaries', 'Debug', 'PyKinectAudio.dll') if not pat...
from selenium.webdriver.common import by from openstack_dashboard.test.integration_tests.pages import basepage from openstack_dashboard.test.integration_tests.pages.project.compute.volumes.\ volumespage import VolumesPage from openstack_dashboard.test.integration_tests.regions import forms from openstack_dashboard....
"""An example that verifies the counts and includes best practices. On top of the basic concepts in the wordcount example, this workflow introduces logging to Cloud Logging, and using assertions in a Dataflow pipeline. To execute this pipeline locally, specify a local output file or output prefix on GCS:: --output [Y...
"""A tf.distribute.Strategy for running on a single device.""" from tensorflow.python.distribute import device_util from tensorflow.python.distribute import distribute_lib from tensorflow.python.distribute import distribute_utils from tensorflow.python.distribute import input_lib from tensorflow.python.distribute impor...
"""Tests for pprof_profiler.""" import gzip from proto import profile_pb2 from tensorflow.core.framework import step_stats_pb2 from tensorflow.core.protobuf import config_pb2 from tensorflow.python.framework import constant_op from tensorflow.python.framework import test_util from tensorflow.python.ops import control_f...
""" Horizontal graph base """ from pygal.graph.graph import Graph from pygal.view import HorizontalView, HorizontalLogView class HorizontalGraph(Graph): """Horizontal graph""" def __init__(self, *args, **kwargs): self.horizontal = True super(HorizontalGraph, self).__init__(*args, **kwargs) d...
import random from tests.checks.common import AgentCheckTest, load_check from utils.containers import hash_mutable MOCK_CONFIG = { 'init_config': {}, 'instances' : [{ 'url': 'http://localhost:8500', 'catalog_checks': True, }] } MOCK_CONFIG_SERVICE_WHITELIST = { 'init_config': {}, 'in...
from __future__ import unicode_literals from django.contrib.auth.models import User from django.core import management from django.test import TestCase from django.utils.six import StringIO from .models import ( Car, CarDriver, Driver, Group, Membership, Person, UserMembership, ) class M2MThroughTestCase(TestCase):...
'''"Executable documentation" for the pickle module. Extensive comments about the pickle protocols and pickle-machine opcodes can be found here. Some functions meant for external use: genops(pickle) Generate all the opcodes in a pickle, as (opcode, arg, position) triples. dis(pickle, out=None, memo=None, indentleve...
import numpy as np import pytest import pandas as pd import pandas._testing as tm def test_basic(): s = pd.Series([[0, 1, 2], np.nan, [], (3, 4)], index=list("abcd"), name="foo") result = s.explode() expected = pd.Series( [0, 1, 2, np.nan, np.nan, 3, 4], index=list("aaabcdd"), dtype=object, name="fo...
"""vtk_kit package driver file. This performs all initialisation necessary to use VTK from DeVIDE. Makes sure that all VTK classes have ErrorEvent handlers that report back to the ModuleManager. Inserts the following modules in sys.modules: vtk, vtkdevide. @author: Charl P. Botha <http://cpbotha.net/> """ import re im...
import datetime import sys import textwrap import common from xml.dom import pulldom PARSER = """\ /** * Copyright 2009 Joe LaPenna */ package com.joelapenna.foursquare.parsers; import com.joelapenna.foursquare.Foursquare; import com.joelapenna.foursquare.error.FoursquareError; import com.joelapenna.foursquare.error....
""" WSGI config for made_with_twd_project 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_A...
import account
from collections import OrderedDict from patman import command from binman.entry import Entry, EntryArg from dtoc import fdt_util from patman import tools gbb_flag_properties = { 'dev-screen-short-delay': 0x1, 'load-option-roms': 0x2, 'enable-alternate-os': 0x4, 'force-dev-switch-on': 0x8, 'force-dev-boot-usb...