code stringlengths 9 256k |
|---|
<s> import re <EOL> import mock <EOL> from testtools import matchers <EOL> from magnumclient . tests import utils <EOL> FAKE_ENV = { '<STR_LIT>' : '<STR_LIT:username>' , <EOL> '<STR_LIT>' : '<STR_LIT:password>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL>... |
<s> from magnumclient . common import cliutils as utils <EOL> from magnumclient . common import utils as magnum_utils <EOL> def do_service_list ( cs , args ) : <EOL> """<STR_LIT>""" <EOL> mservices = cs . mservices . list ( ) <EOL> columns = ( '<STR_LIT:id>' , '<STR_LIT:host>' , '<STR_LIT>' , '<STR_LIT:state>' ) <EOL> ... |
<s> import six <EOL> from mistralclient . api import base <EOL> from mistralclient import utils <EOL> urlparse = six . moves . urllib . parse <EOL> class Workflow ( base . Resource ) : <EOL> resource_name = '<STR_LIT>' <EOL> class WorkflowManager ( base . ResourceManager ) : <EOL> resource_class = Workflow <EOL> def cr... |
<s> import json <EOL> import mock <EOL> import unittest2 <EOL> class FakeResponse ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , status_code , content = None ) : <EOL> self . status_code = status_code <EOL> self . content = content <EOL> self . headers = { } <EOL> def json ( self ) : <EOL> return json .... |
<s> """<STR_LIT>""" <EOL> import cStringIO as StringIO <EOL> import json <EOL> import re <EOL> import sys <EOL> from pylint import lint <EOL> from pylint . reporters import text <EOL> ignore_codes = [ "<STR_LIT>" ] <EOL> ignore_messages = [ "<STR_LIT>" ] <EOL> ignore_modules = [ "<STR_LIT>" ] <EOL> KNOWN_PYLINT_EXCEPTI... |
<s> import datetime <EOL> import json <EOL> import numbers <EOL> import time <EOL> from monascaclient . common import utils <EOL> import monascaclient . exc as exc <EOL> from monascaclient . openstack . common import jsonutils <EOL> severity_types = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> state_... |
<s> import argparse <EOL> from neutronclient . _i18n import _ <EOL> from neutronclient . common import utils <EOL> from neutronclient . neutron import v2_0 as neutronV20 <EOL> class ListFlavorProfile ( neutronV20 . ListCommand ) : <EOL> """<STR_LIT>""" <EOL> resource = '<STR_LIT>' <EOL> list_columns = [ '<STR_LIT:id>' ... |
<s> from __future__ import print_function <EOL> import argparse <EOL> from oslo_serialization import jsonutils <EOL> from neutronclient . _i18n import _ <EOL> from neutronclient . common import exceptions <EOL> from neutronclient . common import utils <EOL> from neutronclient . neutron import v2_0 as neutronV20 <EOL> f... |
<s> import sys <EOL> from mox3 import mox <EOL> from neutronclient . neutron . v2_0 . lb import healthmonitor <EOL> from neutronclient . tests . unit import test_cli20 <EOL> class CLITestV20LbHealthmonitorJSON ( test_cli20 . CLITestV20Base ) : <EOL> def test_create_healthmonitor_with_mandatory_params ( self ) : <EOL> r... |
<s> """<STR_LIT>""" <EOL> import abc <EOL> import contextlib <EOL> import copy <EOL> import hashlib <EOL> import inspect <EOL> import os <EOL> import threading <EOL> from oslo_utils import strutils <EOL> from requests import Response <EOL> import six <EOL> from novaclient import exceptions <EOL> from novaclient import ... |
<s> from novaclient . tests . functional . v2 . legacy import test_fixedips <EOL> class TestFixedIPsNovaClientV24 ( test_fixedips . TestFixedIPsNovaClient ) : <EOL> """<STR_LIT>""" <EOL> COMPUTE_API_VERSION = '<STR_LIT>' <EOL> def test_fixedip_get ( self ) : <EOL> self . _test_fixedip_get ( expect_reserved = True ) </s... |
<s> from novaclient . tests . unit . fixture_data import base <EOL> class Fixture ( base . Fixture ) : <EOL> base_url = '<STR_LIT>' <EOL> def setUp ( self ) : <EOL> super ( Fixture , self ) . setUp ( ) <EOL> get_limits = { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : [ <EOL> { <EOL> "<STR_LIT>" : "<STR_LIT:*>" , <EOL> "<S... |
<s> import datetime <EOL> import mock <EOL> from oslo_utils import strutils <EOL> import re <EOL> import six <EOL> from six . moves . urllib import parse <EOL> import novaclient <EOL> from novaclient import api_versions <EOL> from novaclient import client as base_client <EOL> from novaclient import exceptions <EOL> fro... |
<s> from novaclient import base <EOL> from novaclient . i18n import _ <EOL> from novaclient import utils <EOL> class TenantNetwork ( base . Resource ) : <EOL> def delete ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . manager . delete ( network = self ) <EOL> class TenantNetworkManager ( base . ManagerWithFind ) :... |
<s> """<STR_LIT>""" <EOL> from novaclient import base <EOL> class VirtualInterface ( base . Resource ) : <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" <EOL> class VirtualInterfaceManager ( base . ManagerWithFind ) : <EOL> resource_class = VirtualInterface <EOL> def list ( self , instance_id ) : <EOL> return se... |
<s> from openstack . block_store import block_store_service <EOL> from openstack import format <EOL> from openstack import resource <EOL> class Volume ( resource . Resource ) : <EOL> resource_key = "<STR_LIT>" <EOL> resources_key = "<STR_LIT>" <EOL> base_path = "<STR_LIT>" <EOL> service = block_store_service . BlockSto... |
<s> from openstack . compute import compute_service <EOL> from openstack import resource <EOL> class ServerInterface ( resource . Resource ) : <EOL> id_attribute = '<STR_LIT>' <EOL> resource_key = '<STR_LIT>' <EOL> resources_key = '<STR_LIT>' <EOL> base_path = '<STR_LIT>' <EOL> service = compute_service . ComputeServic... |
<s> from openstack . identity import identity_service <EOL> from openstack import resource <EOL> class User ( resource . Resource ) : <EOL> resource_key = '<STR_LIT:user>' <EOL> resources_key = '<STR_LIT>' <EOL> base_path = '<STR_LIT>' <EOL> service = identity_service . IdentityService ( ) <EOL> allow_create = True <EO... |
<s> from openstack . network . v2 import address_scope as _address_scope <EOL> from openstack . network . v2 import availability_zone <EOL> from openstack . network . v2 import extension <EOL> from openstack . network . v2 import floating_ip as _floating_ip <EOL> from openstack . network . v2 import health_monitor as _... |
<s> import copy <EOL> from openstack import format <EOL> from openstack . object_store import object_store_service <EOL> from openstack . object_store . v1 import _base <EOL> from openstack import resource <EOL> class Object ( _base . BaseResource ) : <EOL> _custom_metadata_prefix = "<STR_LIT>" <EOL> _system_metadata =... |
<s> import uuid <EOL> from openstack . block_store . v2 import type as _type <EOL> from openstack . tests . functional import base <EOL> class TestType ( base . BaseFunctionalTest ) : <EOL> TYPE_NAME = uuid . uuid4 ( ) . hex <EOL> TYPE_ID = None <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> super ( TestType ... |
<s> import unittest <EOL> import uuid <EOL> from openstack . telemetry . v2 import alarm <EOL> from openstack . tests . functional import base <EOL> @ unittest . skip ( "<STR_LIT>" ) <EOL> @ unittest . skipUnless ( base . service_exists ( service_type = "<STR_LIT>" ) , <EOL> "<STR_LIT>" ) <EOL> class TestAlarm ( base .... |
<s> import testtools <EOL> from openstack . compute . v2 import availability_zone as az <EOL> IDENTIFIER = '<STR_LIT>' <EOL> BASIC_EXAMPLE = { <EOL> '<STR_LIT:id>' : IDENTIFIER , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> class TestAvailabilityZone ... |
<s> import testtools <EOL> from openstack . identity . v3 import domain <EOL> IDENTIFIER = '<STR_LIT>' <EOL> EXAMPLE = { <EOL> '<STR_LIT:description>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT:id>' : IDENTIFIER , <EOL> '<STR_LIT:name>' : '<STR_LIT:4>' , <EOL> } <EOL> class TestDomain ( testtools . Te... |
<s> import testtools <EOL> from openstack . metric import metric_service <EOL> class TestMetricService ( testtools . TestCase ) : <EOL> def test_service ( self ) : <EOL> sot = metric_service . MetricService ( ) <EOL> self . assertEqual ( '<STR_LIT>' , sot . service_type ) <EOL> self . assertEqual ( '<STR_LIT>' , sot . ... |
<s> import datetime <EOL> import testtools <EOL> from openstack . network . v2 import subnet_pool <EOL> IDENTIFIER = '<STR_LIT>' <EOL> EXAMPLE = { <EOL> '<STR_LIT>' : <NUM_LIT:8> , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT:id>' : IDENTIFIER , <EOL> '<STR_LIT>' : <NUM_LIT:32> , <EOL> '<STR_LIT:name>' : '<STR_LIT>'... |
<s> import copy <EOL> import json <EOL> import os <EOL> from keystoneauth1 import session <EOL> import mock <EOL> import requests <EOL> from testtools import matchers <EOL> from openstack import exceptions <EOL> from openstack import format <EOL> from openstack import resource <EOL> from openstack . tests . unit import... |
<s> import base64 <EOL> import tempfile <EOL> from rackclient import exceptions as exc <EOL> from rackclient . tests import utils <EOL> from rackclient . tests . v1 import fakes <EOL> from rackclient . v1 import proxy <EOL> class ProxyTest ( utils . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( ProxyTest , self... |
<s> import logging <EOL> from openstack import connection <EOL> from openstackclient . common import utils <EOL> LOG = logging . getLogger ( __name__ ) <EOL> DEFAULT_CLUSTERING_API_VERSION = '<STR_LIT:1>' <EOL> API_VERSION_OPTION = '<STR_LIT>' <EOL> API_NAME = '<STR_LIT>' <EOL> def make_client ( instance ) : <EOL> """<... |
<s> """<STR_LIT>""" <EOL> import logging <EOL> import six <EOL> from cliff import lister <EOL> from cliff import show <EOL> from openstack import exceptions as sdk_exc <EOL> from openstackclient . common import exceptions as exc <EOL> from openstackclient . common import utils <EOL> from senlinclient . common . i18n im... |
<s> """<STR_LIT>""" <EOL> import copy <EOL> import gettext <EOL> import locale <EOL> from logging import handlers <EOL> import os <EOL> from babel import localedata <EOL> import six <EOL> _AVAILABLE_LANGUAGES = { } <EOL> USE_LAZY = False <EOL> class TranslatorFactory ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init_... |
<s> import six <EOL> from solumclient . common import base as solum_base <EOL> from solumclient . common import exc <EOL> from solumclient . common import yamlutils <EOL> from solumclient . openstack . common . apiclient import base as apiclient_base <EOL> from solumclient . openstack . common . apiclient import except... |
<s> """<STR_LIT>""" <EOL> import hashlib <EOL> import hmac <EOL> import json <EOL> import logging <EOL> import six <EOL> import time <EOL> import traceback <EOL> TRUE_VALUES = set ( ( '<STR_LIT:true>' , '<STR_LIT:1>' , '<STR_LIT:yes>' , '<STR_LIT>' , '<STR_LIT:t>' , '<STR_LIT:y>' ) ) <EOL> EMPTY_ETAG = '<STR_LIT>' <EOL... |
<s> import inspect <EOL> import math <EOL> import time <EOL> from xml . dom import minidom <EOL> from lxml import etree <EOL> import six <EOL> import webob <EOL> from rack . api import xmlutil <EOL> from rack import exception <EOL> from rack . openstack . common import gettextutils <EOL> from rack . openstack . common ... |
<s> import six <EOL> six . add_move ( six . MovedModule ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) ) </s>
|
<s> """<STR_LIT>""" <EOL> import webob . dec <EOL> class Middleware ( object ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def factory ( cls , global_conf , ** local_conf ) : <EOL> """<STR_LIT>""" <EOL> return cls <EOL> def __init__ ( self , application ) : <EOL> self . application = application <EOL> def process... |
<s> """<STR_LIT>""" </s>
|
<s> from oslo . config import cfg <EOL> from rack import config <EOL> from rack . openstack . common . fixture import config as config_fixture <EOL> from rack import paths <EOL> from rack . tests import utils <EOL> CONF = cfg . CONF <EOL> CONF . import_opt ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> CONF . import_opt ( '<STR_L... |
<s> from __future__ import print_function <EOL> from rally . cli import cliutils <EOL> from rally . common . plugin import plugin <EOL> from rally . common import utils <EOL> from rally import plugins <EOL> class PluginCommands ( object ) : <EOL> """<STR_LIT>""" <EOL> @ staticmethod <EOL> def _print_plugins_list ( plug... |
<s> from rally . common import db <EOL> from rally import consts <EOL> from rally import exceptions <EOL> _MAP_OLD_TO_NEW_STATUSES = { <EOL> "<STR_LIT:OK>" : "<STR_LIT:success>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> class Verification ( object ) : <EOL> """<STR_LIT>""" <EOL> ... |
<s> import collections <EOL> import multiprocessing <EOL> import threading <EOL> import time <EOL> from six . moves import queue as Queue <EOL> from rally . common import logging <EOL> from rally . common import utils <EOL> from rally import consts <EOL> from rally . task import runner <EOL> from rally . task import ut... |
<s> import collections <EOL> import random <EOL> import uuid <EOL> from oslo_config import cfg <EOL> import six <EOL> from rally . common import broker <EOL> from rally . common . i18n import _ <EOL> from rally . common import logging <EOL> from rally . common import objects <EOL> from rally . common import utils as ru... |
<s> from rally import consts <EOL> from rally . plugins . openstack import scenario <EOL> from rally . task import atomic <EOL> from rally . task import validation <EOL> class Authenticate ( scenario . OpenStackScenario ) : <EOL> """<STR_LIT>""" <EOL> @ validation . required_openstack ( users = True ) <EOL> @ atomic . ... |
<s> import time <EOL> from oslo_config import cfg <EOL> from rally . plugins . openstack . context . manila import consts <EOL> from rally . plugins . openstack import scenario <EOL> from rally . task import atomic <EOL> from rally . task import utils <EOL> MANILA_BENCHMARK_OPTS = [ <EOL> cfg . FloatOpt ( <EOL> "<STR_L... |
<s> from rally . common import logging <EOL> from rally import consts <EOL> from rally . plugins . openstack import scenario <EOL> from rally . plugins . openstack . scenarios . sahara import utils <EOL> from rally . task import validation <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class SaharaJob ( utils . Sah... |
<s> """<STR_LIT>""" <EOL> import abc <EOL> import jsonschema <EOL> import six <EOL> from rally . common . i18n import _ <EOL> from rally . common . plugin import plugin <EOL> def _format_result ( criterion_name , success , detail ) : <EOL> """<STR_LIT>""" <EOL> return { "<STR_LIT>" : criterion_name , <EOL> "<STR_LIT:su... |
<s> import copy <EOL> import inspect <EOL> import json <EOL> import os <EOL> import shutil <EOL> import subprocess <EOL> import tempfile <EOL> from oslo_utils import encodeutils <EOL> from six . moves import configparser <EOL> TEST_ENV = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_... |
<s> import math <EOL> import ddt <EOL> import six <EOL> from rally . common import streaming_algorithms as algo <EOL> from tests . unit import test <EOL> class MeanComputationTestCase ( test . TestCase ) : <EOL> def test_empty_stream ( self ) : <EOL> mean_computation = algo . MeanComputation ( ) <EOL> self . assertIsNo... |
<s> import ddt <EOL> import jsonschema <EOL> from rally . plugins . common . sla import outliers <EOL> from tests . unit import test <EOL> @ ddt . ddt <EOL> class OutliersTestCase ( test . TestCase ) : <EOL> def test_config_schema ( self ) : <EOL> outliers . Outliers . validate ( { "<STR_LIT>" : { "<STR_LIT>" : <NUM_LI... |
<s> import mock <EOL> from rally . plugins . openstack . context . quotas import designate_quotas <EOL> from tests . unit import test <EOL> class DesignateQuotasTestCase ( test . TestCase ) : <EOL> @ mock . patch ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> def test_update ( self , mock_clients ) : <EOL> quotas = designate_... |
<s> import mock <EOL> from rally . plugins . openstack . scenarios . designate import basic <EOL> from tests . unit import test <EOL> DESIGNATE_BASIC = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> class DesignateBasicTestCase ( test . ScenarioTestCase ) : <EOL> @ mock . patch ( DESIGNATE_BASIC + "<STR_LIT>" ) <EOL> @ mock .... |
<s> import mock <EOL> from rally . plugins . openstack . scenarios . nova import availability_zones <EOL> from tests . unit import test <EOL> class NovaAvailabilityZonesTestCase ( test . TestCase ) : <EOL> def test_list_availability_zones ( self ) : <EOL> scenario = availability_zones . NovaAvailabilityZones ( ) <EOL> ... |
<s> import mock <EOL> from rally import exceptions <EOL> from rally . plugins . openstack import types <EOL> from tests . unit import fakes <EOL> from tests . unit import test <EOL> class FlavorTestCase ( test . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( FlavorTestCase , self ) . setUp ( ) <EOL> self . clien... |
<s> import ddt <EOL> from keystoneclient . auth import token_endpoint <EOL> from keystoneclient import exceptions as keystone_exceptions <EOL> import mock <EOL> from oslo_config import cfg <EOL> from testtools import matchers <EOL> from rally . common import objects <EOL> from rally import consts <EOL> from rally impor... |
<s> import functools <EOL> import requests <EOL> from requests_mock import adapter <EOL> from requests_mock import exceptions <EOL> DELETE = '<STR_LIT>' <EOL> GET = '<STR_LIT:GET>' <EOL> HEAD = '<STR_LIT>' <EOL> OPTIONS = '<STR_LIT>' <EOL> PATCH = '<STR_LIT>' <EOL> POST = '<STR_LIT:POST>' <EOL> PUT = '<STR_LIT>' <EOL> ... |
<s> from sahara . utils import patches <EOL> patches . patch_all ( ) <EOL> import os <EOL> import sys <EOL> import oslo_i18n <EOL> from oslo_log import log as logging <EOL> possible_topdir = os . path . normpath ( os . path . join ( os . path . abspath ( sys . argv [ <NUM_LIT:0> ] ) , <EOL> os . pardir , <EOL> os . par... |
<s> """<STR_LIT>""" <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> from alembic import op <EOL> import sqlalchemy as sa <EOL> def upgrade ( ) : <EOL> op . add_column ( '<STR_LIT>' , <EOL> sa . Column ( '<STR_LIT>' , <EOL> sa . String ( length = <NUM_LIT:255> ) ) ) <EOL> op . add_column ( '<STR_LIT... |
<s> import os <EOL> from oslo_config import cfg <EOL> from oslo_log import log <EOL> from oslo_service import service as oslo_service <EOL> from oslo_service import sslutils <EOL> from oslo_service import wsgi as oslo_wsgi <EOL> import stevedore <EOL> from sahara . api import acl <EOL> from sahara . common import confi... |
<s> from oslo_serialization import jsonutils as json <EOL> from sahara . plugins import provisioning as p <EOL> from sahara . utils import files as f <EOL> class ConfigHelper ( object ) : <EOL> path_to_config = '<STR_LIT>' <EOL> CDH5_REPO_URL = p . Config ( <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , priority = <NU... |
<s> from sahara . plugins . cdh import db_helper as dh <EOL> from sahara . utils import files <EOL> def get_hive_db_password ( cluster ) : <EOL> return dh . get_password_from_db ( cluster , dh . HIVE_DB_PASSWORD ) <EOL> def get_sentry_db_password ( cluster ) : <EOL> return dh . get_password_from_db ( cluster , dh . SEN... |
<s> from sahara . plugins . hdp import confighints_helper as ch_helper <EOL> from sahara . plugins . hdp import edp_engine <EOL> from sahara . service . edp import hdfs_helper <EOL> from sahara . utils import edp <EOL> class EdpOozieEngine ( edp_engine . EdpOozieEngine ) : <EOL> def create_hdfs_dir ( self , remote , di... |
<s> import sahara . plugins . mapr . domain . node_process as np <EOL> import sahara . plugins . mapr . domain . service as s <EOL> import sahara . plugins . mapr . util . validation_utils as vu <EOL> MAHOUT = np . NodeProcess ( <EOL> name = '<STR_LIT>' , <EOL> ui_name = '<STR_LIT>' , <EOL> package = '<STR_LIT>' , <EOL... |
<s> import os <EOL> import six <EOL> from sahara import context <EOL> from sahara . i18n import _ <EOL> from sahara . plugins . spark import config_helper as c_helper <EOL> from sahara . plugins . spark import run_scripts as run <EOL> from sahara . plugins import utils <EOL> from sahara . utils import cluster_progress_... |
<s> from oslo_config import cfg <EOL> from oslo_log import log as logging <EOL> from oslo_utils import excutils <EOL> import six <EOL> from six . moves . urllib import parse as urlparse <EOL> from sahara import conductor as c <EOL> from sahara import context <EOL> from sahara . plugins import base as plugin_base <EOL> ... |
<s> from sahara . service . edp . oozie . workflow_creator import base_workflow <EOL> from sahara . utils import xmlutils as x <EOL> class JavaWorkflowCreator ( base_workflow . OozieWorkflowCreator ) : <EOL> def __init__ ( self ) : <EOL> super ( JavaWorkflowCreator , self ) . __init__ ( '<STR_LIT>' ) <EOL> def build_wo... |
<s> from oslo_config import cfg <EOL> from sahara import context <EOL> import sahara . exceptions as ex <EOL> from sahara . i18n import _ <EOL> from sahara . service . api import v10 as api <EOL> from sahara . service . health import verification_base <EOL> from sahara . service . validations import acl <EOL> import sa... |
<s> from tempest . lib . common . utils import data_utils <EOL> from tempest import test <EOL> from sahara . tests . tempest . scenario . data_processing . client_tests import base <EOL> class JobBinaryInternalsTest ( base . BaseDataProcessingTest ) : <EOL> def _check_job_binary_internal_create ( self ) : <EOL> name = ... |
<s> import mock <EOL> import testtools <EOL> from sahara import context <EOL> from sahara . db . sqlalchemy import api <EOL> from sahara . db . sqlalchemy import models as m <EOL> import sahara . tests . unit . base as base <EOL> class TestRegex ( testtools . TestCase ) : <EOL> def test_get_regex_op ( self ) : <EOL> re... |
<s> import mock <EOL> import six <EOL> from sahara . plugins . cdh . v5_3_0 . edp_engine import EdpOozieEngine <EOL> from sahara . plugins . cdh . v5_3_0 . edp_engine import EdpSparkEngine <EOL> from sahara . plugins . cdh . v5_3_0 import versionhandler <EOL> from sahara . tests . unit import base <EOL> class VersionHa... |
<s> import mock <EOL> import yaml <EOL> from sahara import exceptions as ex <EOL> from sahara . plugins import exceptions as p_ex <EOL> from sahara . plugins import images <EOL> from sahara . tests . unit import base as b <EOL> class TestImages ( b . SaharaTestCase ) : <EOL> def test_package_spec ( self ) : <EOL> cls =... |
<s> import uuid <EOL> import mock <EOL> import six <EOL> import testtools <EOL> from sahara import conductor as cond <EOL> from sahara . service . edp import job_utils <EOL> from sahara . tests . unit . service . edp import edp_test_utils as u <EOL> conductor = cond . API <EOL> class JobUtilsTestCase ( testtools . Test... |
<s> import mock <EOL> import testtools <EOL> from sahara import exceptions as ex <EOL> from sahara . service . api import v10 as api <EOL> from sahara . service . health import verification_base <EOL> from sahara . service . validations import clusters as c_val <EOL> from sahara . service . validations import clusters_... |
<s> import xml . dom . minidom as xml <EOL> import six <EOL> import testtools <EOL> from sahara . utils import patches <EOL> class MinidomPatchesTest ( testtools . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( MinidomPatchesTest , self ) . setUp ( ) <EOL> patches . patch_minidom_writexml ( ) <EOL> def _generate... |
<s> from novaclient . v2 import images <EOL> import six <EOL> from sahara import exceptions as exc <EOL> PROP_DESCR = '<STR_LIT>' <EOL> PROP_USERNAME = '<STR_LIT>' <EOL> PROP_TAG = '<STR_LIT>' <EOL> def _iter_tags ( meta ) : <EOL> for key in meta : <EOL> if key . startswith ( PROP_TAG ) and meta [ key ] : <EOL> yield k... |
<s> import collections <EOL> import functools <EOL> import random <EOL> import jinja2 <EOL> from oslo_config import cfg <EOL> from oslo_log import log as logging <EOL> from shaker . engine import utils <EOL> from shaker . openstack . clients import heat <EOL> from shaker . openstack . clients import neutron <EOL> from ... |
<s> import mock <EOL> import testtools <EOL> from shaker . engine . executors import base <EOL> from shaker . engine import quorum <EOL> class TestOperations ( testtools . TestCase ) : <EOL> def test_execute_operation_process_reply ( self ) : <EOL> executor = mock . MagicMock ( ) <EOL> executor . process_reply = mock .... |
<s> import json <EOL> from tempest_lib import exceptions as tempest_exceptions <EOL> from functionaltests . api import base <EOL> sample_data = { '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT:description>' : '<STR_LIT>' } <EOL> assembly_sample_data = { '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT:description>' :... |
<s> from solum . api . controllers import common_types <EOL> from solum . api . controllers . v1 . datamodel import types as api_types <EOL> class Services ( api_types . Base ) : <EOL> """<STR_LIT>""" <EOL> service_links = [ common_types . Link ] <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , ** kwds ) : <EOL> super... |
<s> from wsme import types as wtypes <EOL> from solum . api . controllers . v1 . datamodel import types as api_types <EOL> class Service ( api_types . Base ) : <EOL> """<STR_LIT>""" <EOL> read_only = bool <EOL> """<STR_LIT>""" <EOL> service_type = wtypes . text <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def sample... |
<s> from solum . common import exception as solum_exception <EOL> class Handler ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , context ) : <EOL> super ( Handler , self ) . __init__ ( ) <EOL> self . context = context <EOL> def get ( self , id ) : <EOL> """<STR_LIT>""" <EOL> excp = solum_exception . NotIm... |
<s> import copy <EOL> import keystoneclient . exceptions as kc_exception <EOL> from keystoneclient . v3 import client as kc_v3 <EOL> from oslo_config import cfg <EOL> from solum . common import context <EOL> from solum . common import exception <EOL> from solum . openstack . common . gettextutils import _ <EOL> from so... |
<s> from solum . objects import base <EOL> class Plan ( base . CrudMixin ) : <EOL> VERSION = '<STR_LIT:1.0>' <EOL> class PlanList ( list , base . CrudListMixin ) : <EOL> """<STR_LIT>""" </s>
|
<s> """<STR_LIT>""" <EOL> from alembic import op <EOL> from oslo_utils import timeutils <EOL> import sqlalchemy as sa <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> def upgrade ( ) : <EOL> op . create_table ( <EOL> '<STR_LIT>' , <EOL> sa . Column ( '<STR_LIT:id>' , sa . Integer , primary_key = Tru... |
<s> import mock <EOL> from solum . api . controllers . camp import camp_v1_1_endpoint <EOL> from solum import objects <EOL> from solum . tests import base <EOL> from solum . tests import fakes <EOL> @ mock . patch ( '<STR_LIT>' , new_callable = fakes . FakePecanRequest ) <EOL> @ mock . patch ( '<STR_LIT>' , new_callabl... |
<s> import mock <EOL> from solum . api . handlers import extension_handler as extension <EOL> from solum . tests import base <EOL> from solum . tests import fakes <EOL> from solum . tests import utils <EOL> @ mock . patch ( '<STR_LIT>' ) <EOL> class TestExtensionHandler ( base . BaseTestCase ) : <EOL> def setUp ( self ... |
<s> import datetime <EOL> import mock <EOL> from solum . openstack . common import uuidutils <EOL> fakeAuthTokenHeaders = { '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:test>' , <EOL> '<STR_LIT>' : u'<S... |
<s> import datetime as dt <EOL> import json <EOL> import logging <EOL> import time <EOL> from oslo_config import cfg <EOL> from solum . openstack . common import log as openstack_logger <EOL> import solum . uploaders . local as local_uploader <EOL> import solum . uploaders . swift as swift_uploader <EOL> cfg . CONF . i... |
<s> import datetime <EOL> import mock <EOL> import unittest <EOL> import notification_utils <EOL> from shoebox import roll_checker <EOL> class TestRollChecker ( unittest . TestCase ) : <EOL> def test_time_roll_checker_start ( self ) : <EOL> x = roll_checker . TimeRollChecker ( roll_minutes = <NUM_LIT> ) <EOL> now = dat... |
<s> import logging <EOL> import random <EOL> import simport <EOL> import six <EOL> import time <EOL> import timex <EOL> from winchester . config import ConfigItem <EOL> from winchester . config import ConfigManager <EOL> from winchester . db import DatabaseConnectionError <EOL> from winchester . db import DBInterface <... |
<s> import os <EOL> try : <EOL> from local_settings import * <EOL> db_engine = STACKTACH_DB_ENGINE <EOL> db_name = STACKTACH_DB_NAME <EOL> db_host = STACKTACH_DB_HOST <EOL> db_username = STACKTACH_DB_USERNAME <EOL> db_password = STACKTACH_DB_PASSWORD <EOL> db_port = STACKTACH_DB_PORT <EOL> install_dir = os . path . exp... |
<s> import json <EOL> import views <EOL> from models import * <EOL> INSTANCE_ID_1 = '<STR_LIT>' <EOL> INSTANCE_ID_2 = '<STR_LIT>' <EOL> MESSAGE_ID_1 = '<STR_LIT>' <EOL> MESSAGE_ID_2 = '<STR_LIT>' <EOL> REQUEST_ID_1 = '<STR_LIT>' <EOL> REQUEST_ID_2 = '<STR_LIT>' <EOL> REQUEST_ID_3 = '<STR_LIT>' <EOL> def create_raw ( de... |
<s> """<STR_LIT>""" <EOL> import __builtin__ <EOL> setattr ( __builtin__ , '<STR_LIT:_>' , lambda x : x ) <EOL> import datetime <EOL> import os <EOL> import sys <EOL> from oslo . config import cfg <EOL> CONF = cfg . CONF <EOL> from nova . compute import task_states <EOL> from nova . context import RequestContext <EOL> ... |
<s> from . named import NamedExtensionManager <EOL> class HookManager ( NamedExtensionManager ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , namespace , name , <EOL> invoke_on_load = False , invoke_args = ( ) , invoke_kwds = { } , <EOL> on_load_failure_callback = None , <EOL> verify_requirements = False ) : <EOL... |
<s> '''<STR_LIT>''' <EOL> from six import BytesIO <EOL> from storlet_gateway . storlet_base_gateway import StorletGatewayBase <EOL> class StorletGatewayStub ( StorletGatewayBase ) : <EOL> def __init__ ( self , storlet_conf , logger , app , version , account , <EOL> container , obj ) : <EOL> self . logger = logger <EOL>... |
<s> import base64 <EOL> from hashlib import sha1 <EOL> import hmac <EOL> from httplib import HTTPConnection <EOL> from httplib import HTTPSConnection <EOL> import json <EOL> import swift <EOL> from time import gmtime <EOL> from time import strftime <EOL> from time import time <EOL> from traceback import format_exc <EOL... |
<s> import functools <EOL> import os <EOL> import time <EOL> import six <EOL> from six . moves . configparser import ConfigParser , NoSectionError , NoOptionError <EOL> from six . moves import urllib <EOL> from six . moves . urllib . parse import unquote <EOL> from swift . common import utils , exceptions <EOL> from sw... |
<s> import os <EOL> from six . moves . configparser import ConfigParser , NoSectionError , NoOptionError <EOL> from swift . common . memcached import ( MemcacheRing , CONN_TIMEOUT , POOL_TIMEOUT , <EOL> IO_TIMEOUT , TRY_COUNT ) <EOL> class MemcacheMiddleware ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ... |
<s> import os <EOL> import itertools <EOL> import json <EOL> import time <EOL> from collections import defaultdict <EOL> from eventlet import Timeout <EOL> from swift . container . sync_store import ContainerSyncStore <EOL> from swift . container . backend import ContainerBroker , DATADIR <EOL> from swift . container .... |
<s> import unittest <EOL> from logging . handlers import SysLogHandler <EOL> import mock <EOL> from six import BytesIO <EOL> from six . moves . urllib . parse import unquote <EOL> from test . unit import FakeLogger <EOL> from swift . common . utils import get_logger , split_path <EOL> from swift . common . middleware i... |
<s> """<STR_LIT>""" <EOL> import unittest <EOL> from swift . common . swob import Request , HTTPException , HeaderKeyDict <EOL> from swift . common . storage_policy import POLICIES , EC_POLICY , REPL_POLICY <EOL> from swift . common . request_helpers import is_sys_meta , is_user_meta , is_sys_or_user_meta , strip_sys_m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.