code
stringlengths
9
256k
<s> from oslo_config import cfg <EOL> import oslo_messaging as messaging <EOL> from ironic . common import context as ironic_context <EOL> from ironic . common import exception <EOL> CONF = cfg . CONF <EOL> TRANSPORT = None <EOL> NOTIFIER = None <EOL> ALLOWED_EXMODS = [ <EOL> exception . __name__ , <EOL> ] <EOL> EXTRA_...
<s> """<STR_LIT>""" <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> from alembic import op <EOL> from sqlalchemy import String <EOL> from sqlalchemy . sql import table , column , null <EOL> node = table ( '<STR_LIT>' , <EOL> column ( '<STR_LIT>' , String ( <NUM_LIT> ) ) , <EOL> column ( '<STR_LIT>'...
<s> """<STR_LIT>""" <EOL> import errno <EOL> import os <EOL> import psutil <EOL> import signal <EOL> import subprocess <EOL> import time <EOL> from ironic_lib import utils as ironic_utils <EOL> from oslo_concurrency import processutils <EOL> from oslo_config import cfg <EOL> from oslo_log import log as logging <EOL> fr...
<s> import os <EOL> from ironic_lib import disk_utils <EOL> from ironic_lib import utils as ironic_utils <EOL> from oslo_config import cfg <EOL> from oslo_log import log as logging <EOL> from oslo_utils import fileutils <EOL> from six . moves . urllib import parse <EOL> from ironic . common import dhcp_factory <EOL> fr...
<s> from oslo_utils import strutils <EOL> from oslo_utils import uuidutils <EOL> from oslo_versionedobjects import base as object_base <EOL> from ironic . common import exception <EOL> from ironic . common . i18n import _ <EOL> from ironic . db import api as db_api <EOL> from ironic . objects import base <EOL> from iro...
<s> import os <EOL> import shutil <EOL> from ironic_lib import disk_utils <EOL> from ironic_lib import utils as ironic_utils <EOL> import mock <EOL> from oslo_concurrency import processutils <EOL> from oslo_config import cfg <EOL> import six <EOL> import six . moves . builtins as __builtin__ <EOL> from ironic . common ...
<s> """<STR_LIT>""" <EOL> from oslo_utils import uuidutils <EOL> import six <EOL> from ironic . common import exception <EOL> from ironic . tests . unit . db import base <EOL> from ironic . tests . unit . db import utils as db_utils <EOL> class DbPortTestCase ( base . DbTestCase ) : <EOL> def setUp ( self ) : <EOL> sup...
<s> """<STR_LIT>""" <EOL> import mock <EOL> from oslo_config import cfg <EOL> from ironic . common import exception <EOL> from ironic . common import states <EOL> from ironic . conductor import task_manager <EOL> from ironic . conductor import utils as manager_utils <EOL> from ironic . drivers . modules import agent <E...
<s> """<STR_LIT>""" <EOL> import time <EOL> import mock <EOL> from oslo_config import cfg <EOL> from pysnmp . entity . rfc3413 . oneliner import cmdgen <EOL> from pysnmp import error as snmp_error <EOL> from ironic . common import exception <EOL> from ironic . common import states <EOL> from ironic . conductor import t...
<s> from glanceclient import exc as glance_exc <EOL> NOW_GLANCE_FORMAT = "<STR_LIT>" <EOL> class StubGlanceClient ( object ) : <EOL> def __init__ ( self , images = None ) : <EOL> self . _images = [ ] <EOL> _images = images or [ ] <EOL> map ( lambda image : self . create ( ** image ) , _images ) <EOL> self . images = la...
<s> import base64 <EOL> import hashlib <EOL> import json <EOL> import os <EOL> import sys <EOL> import zlib <EOL> def json_exit ( msg = None , failed = False , changed = False ) : <EOL> if type ( msg ) is not dict : <EOL> msg = { '<STR_LIT>' : str ( msg ) } <EOL> msg . update ( { '<STR_LIT>' : failed , '<STR_LIT>' : ch...
<s> import argparse <EOL> from oschecks import utils <EOL> def check_amqp ( ) : <EOL> parser = argparse . ArgumentParser ( <EOL> description = '<STR_LIT>' ) <EOL> parser . add_argument ( dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> options = parser . parse_args ( ) <EOL> utils . check_process_exists_and_amqp_c...
<s> import abc <EOL> import six <EOL> from networking_bgpvpn . neutron . db import bgpvpn_db <EOL> @ six . add_metaclass ( abc . ABCMeta ) <EOL> class BGPVPNDriverBase ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , service_plugin ) : <EOL> self . service_plugin = service_plugin <EOL> @ property <EOL> de...
<s> """<STR_LIT>""" <EOL> from networking_cisco . _i18n import _LE , _LI <EOL> from networking_cisco . apps . saf . agent . vdp import lldpad <EOL> from networking_cisco . apps . saf . agent . vdp import vdp_constants as constants <EOL> from networking_cisco . apps . saf . common import constants as cconstants <EOL> fr...
<s> """<STR_LIT>""" <EOL> from neutron . db . migration import cli <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> branch_labels = ( cli . EXPAND_BRANCH , ) <EOL> def upgrade ( ) : <EOL> pass </s>
<s> import logging <EOL> from oslo_serialization import jsonutils <EOL> from networking_cisco . plugins . cisco . cfg_agent . device_drivers import ( <EOL> devicedriver_api ) <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class DummyRoutingDriver ( devicedriver_api . RoutingDriverBase ) : <EOL> """<STR_LIT>""" <EOL...
<s> import abc <EOL> import six <EOL> @ six . add_metaclass ( abc . ABCMeta ) <EOL> class PluginSidePluggingDriver ( object ) : <EOL> """<STR_LIT>""" <EOL> @ abc . abstractmethod <EOL> def create_hosting_device_resources ( self , context , complementary_id , <EOL> tenant_id , mgmt_context , max_hosted ) : <EOL> """<STR...
<s> class NoopL3RouterHostingDeviceScheduler ( object ) : <EOL> """<STR_LIT>""" <EOL> def schedule_router ( self , plugin , context , r_hd_binding ) : <EOL> return <EOL> def unschedule_router ( self , plugin , context , r_hd_binding ) : <EOL> return True </s>
<s> import sqlalchemy as sa <EOL> from neutron . db import model_base <EOL> from neutron . db import models_v2 <EOL> class NexusPortBinding ( model_base . BASEV2 ) : <EOL> """<STR_LIT>""" <EOL> __tablename__ = "<STR_LIT>" <EOL> binding_id = sa . Column ( sa . Integer , primary_key = True , autoincrement = True ) <EOL> ...
<s> import eventlet <EOL> from oslo_log import log as logging <EOL> from sqlalchemy . sql import expression as expr <EOL> from networking_cisco . _i18n import _LE , _LI , _LW <EOL> from neutron . api . v2 import attributes <EOL> from neutron . common import exceptions as n_exc <EOL> from neutron . db import models_v2 <...
<s> import mock <EOL> import webob . exc <EOL> from networking_cisco . plugins . ml2 . drivers . cisco . n1kv import ( <EOL> constants as n1kv_const ) <EOL> from networking_cisco . plugins . ml2 . drivers . cisco . n1kv import ( <EOL> exceptions as n1kv_exc ) <EOL> from networking_cisco . plugins . ml2 . drivers . cisc...
<s> from __future__ import print_function <EOL> import ConfigParser <EOL> import optparse <EOL> import os <EOL> import platform <EOL> import re <EOL> import shlex <EOL> import subprocess as subp <EOL> import sys <EOL> NEUTRON = '<STR_LIT>' <EOL> KEYSTONE = '<STR_LIT>' <EOL> conf_file_list = [ <EOL> '<STR_LIT>' , <EOL> ...
<s> from oslo_config import cfg <EOL> from oslo_log import helpers as log_helpers <EOL> from oslo_log import log as logging <EOL> from networking_onos . common import config <EOL> from networking_onos . common import utils as onos_utils <EOL> from networking_sfc . services . sfc . drivers import base as sfc_driver <EOL...
<s> from oslo_config import cfg <EOL> from oslo_log import log <EOL> import stevedore <EOL> from neutron . _i18n import _ , _LE , _LI <EOL> LOG = log . getLogger ( __name__ ) <EOL> L2_AGENT_EXT_MANAGER_NAMESPACE = '<STR_LIT>' <EOL> L2_AGENT_EXT_MANAGER_OPTS = [ <EOL> cfg . ListOpt ( '<STR_LIT>' , <EOL> default = [ ] , ...
<s> import os <EOL> import shutil <EOL> import jinja2 <EOL> from oslo_config import cfg <EOL> from oslo_log import log as logging <EOL> import six <EOL> from neutron . agent . linux import external_process <EOL> from neutron . agent . linux import pd <EOL> from neutron . agent . linux import pd_driver <EOL> from neutro...
<s> import abc <EOL> import collections <EOL> import uuid <EOL> from oslo_config import cfg <EOL> from oslo_utils import importutils <EOL> import six <EOL> from neutron . _i18n import _ <EOL> interface_map = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> OPTS = [ <EOL> cfg . StrOpt ...
<s> from oslo_log import log as logging <EOL> import oslo_messaging <EOL> from neutron . _i18n import _LW <EOL> from neutron . common import constants <EOL> from neutron . common import rpc as n_rpc <EOL> from neutron . common import topics <EOL> from neutron . common import utils <EOL> from neutron import manager <EOL...
<s> import sys <EOL> from oslo_config import cfg <EOL> from oslo_log import log as logging <EOL> from neutron . _i18n import _LE , _LI <EOL> from neutron . common import config <EOL> from neutron . common import utils as n_utils <EOL> from neutron . plugins . ml2 . drivers . linuxbridge . agent import linuxbridge_neutr...
<s> from neutron . common import utils <EOL> from neutron . db import l3_attrs_db <EOL> from neutron . extensions import availability_zone as az_ext <EOL> class RouterAvailabilityZoneMixin ( l3_attrs_db . ExtraAttributesMixin ) : <EOL> """<STR_LIT>""" <EOL> extra_attributes = [ { '<STR_LIT:name>' : az_ext . AZ_HINTS , ...
<s> from alembic import op <EOL> import sqlalchemy as sa <EOL> segment_type = sa . Enum ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> name = '<STR_LIT>' ) <EOL> profile_type = sa . Enum ( '<STR_LIT>' , '<STR_LIT>' , name = '<STR_LIT>' ) <EOL> network_profile_type = sa . Enum ( '<STR_LIT>' , '<STR_LIT>...
<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>' , sa . Integer ( ) , <EOL> server_default = '<STR_LIT:0>' , nullable = False ) ) </s...
<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>' , sa . String ( length = <NUM_LIT:255> ) ) ) </s>
<s> from neutron_lib import exceptions <EOL> from oslo_db import api as oslo_db_api <EOL> from oslo_log import log <EOL> from neutron . common import exceptions as n_exc <EOL> from neutron . db import api as db_api <EOL> from neutron . db import common_db_mixin as common_db <EOL> from neutron . db . quota import api as...
<s> from neutron_lib . api import converters <EOL> from neutron_lib import constants <EOL> from neutron_lib import exceptions as nexception <EOL> from neutron . _i18n import _ <EOL> from neutron . api import extensions <EOL> from neutron . api . v2 import attributes as attr <EOL> class InvalidRoutes ( nexception . Inva...
<s> import sqlalchemy as sa <EOL> from sqlalchemy import orm as sa_orm <EOL> from neutron . db import model_base <EOL> class IpamAvailabilityRange ( model_base . BASEV2 ) : <EOL> """<STR_LIT>""" <EOL> allocation_pool_id = sa . Column ( sa . String ( <NUM_LIT> ) , <EOL> sa . ForeignKey ( '<STR_LIT>' , <EOL> ondelete = "...
<s> import pecan <EOL> from neutron . _i18n import _ <EOL> from neutron . api import extensions <EOL> from neutron . pecan_wsgi . controllers import utils <EOL> class ExtensionsController ( object ) : <EOL> @ utils . expose ( ) <EOL> def _lookup ( self , alias , * remainder ) : <EOL> return ExtensionController ( alias ...
<s> from neutron_lib import constants as const <EOL> from oslo_serialization import jsonutils <EOL> from oslo_utils import timeutils <EOL> from neutron . db import agents_db <EOL> from neutron . db import models_v2 <EOL> from neutron . plugins . ml2 import models as ml2_models <EOL> def get_agent_ip_by_host ( session ,...
<s> from ryu . lib . packet import ether_types <EOL> from ryu . lib . packet import icmpv6 <EOL> from ryu . lib . packet import in_proto <EOL> class OVSDVRProcessMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> @ staticmethod <EOL> def _dvr_process_ipv4_match ( ofp , ofpp , vlan_tag , gateway_ip ) : <EOL> return ofpp . O...
<s> from eventlet import greenthread <EOL> from neutron_lib . api import validators <EOL> from neutron_lib import constants as const <EOL> from neutron_lib import exceptions as exc <EOL> from oslo_concurrency import lockutils <EOL> from oslo_config import cfg <EOL> from oslo_db import api as oslo_db_api <EOL> from oslo...
<s> from neutron . api . rpc . agentnotifiers import metering_rpc_agent_api <EOL> from neutron . common import rpc as n_rpc <EOL> from neutron . common import topics <EOL> from neutron . db . metering import metering_db <EOL> from neutron . db . metering import metering_rpc <EOL> class MeteringPlugin ( metering_db . Me...
<s> import datetime <EOL> import os <EOL> from neutron_lib import constants <EOL> from oslo_utils import timeutils <EOL> import six <EOL> import testtools <EOL> import neutron <EOL> from neutron . common import constants as n_const <EOL> from neutron . common import topics <EOL> from neutron import context <EOL> from n...
<s> import multiprocessing <EOL> import os <EOL> import time <EOL> import fixtures <EOL> from neutron . agent . linux import utils <EOL> from neutron . tests import tools <EOL> class RecursivePermDirFixture ( fixtures . Fixture ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , directory , perms ) : <EOL> super ( Re...
<s> from neutron_lib import constants <EOL> from neutron_lib import exceptions as n_exc <EOL> from oslo_config import cfg <EOL> from oslo_db . sqlalchemy import session <EOL> import testtools <EOL> from neutron import context <EOL> from neutron . db import db_base_plugin_v2 as base_plugin <EOL> from neutron . db import...
<s> from tempest import test <EOL> from neutron . tests . tempest . api import base <EOL> class DHCPAgentSchedulersTestJSON ( base . BaseAdminNetworkTest ) : <EOL> @ classmethod <EOL> @ test . requires_ext ( extension = "<STR_LIT>" , service = "<STR_LIT>" ) <EOL> def resource_setup ( cls ) : <EOL> super ( DHCPAgentSche...
<s> from tempest . lib . common . utils import data_utils <EOL> from tempest . lib import exceptions as lib_exc <EOL> from tempest import test <EOL> import testtools <EOL> from neutron . tests . tempest . api import base_routers as base <EOL> class DvrRoutersNegativeTest ( base . BaseRouterTest ) : <EOL> @ classmethod ...
<s> import mock <EOL> from neutron_lib import constants as l3_constants <EOL> from oslo_utils import uuidutils <EOL> from neutron . agent . l3 import legacy_router <EOL> from neutron . agent . linux import ip_lib <EOL> from neutron . tests import base <EOL> _uuid = uuidutils . generate_uuid <EOL> class BasicRouterTestC...
<s> import mock <EOL> from neutron . callbacks import events <EOL> from neutron . callbacks import exceptions <EOL> from neutron . callbacks import manager <EOL> from neutron . callbacks import resources <EOL> from neutron . tests import base <EOL> def callback_1 ( * args , ** kwargs ) : <EOL> callback_1 . counter += <...
<s> import copy <EOL> import os <EOL> import sys <EOL> import textwrap <EOL> from alembic . autogenerate import api as alembic_ag_api <EOL> from alembic import config as alembic_config <EOL> from alembic . operations import ops as alembic_ops <EOL> from alembic import script as alembic_script <EOL> import fixtures <EOL...
<s> from neutron_lib . api import validators <EOL> from webob import exc <EOL> from neutron import context <EOL> from neutron . db import db_base_plugin_v2 <EOL> from neutron . db import portsecurity_db <EOL> from neutron . db import securitygroups_db <EOL> from neutron . extensions import portsecurity as psec <EOL> fr...
<s> import collections <EOL> import copy <EOL> import random <EOL> import mock <EOL> from neutron_lib import exceptions as n_exc <EOL> from oslo_db import exception as obj_exc <EOL> from oslo_utils import timeutils <EOL> from oslo_utils import uuidutils <EOL> from oslo_versionedobjects import base as obj_base <EOL> fro...
<s> import mock <EOL> from oslo_config import cfg <EOL> from oslo_utils import uuidutils <EOL> from neutron . agent . l2 . extensions import manager as l2_ext_manager <EOL> from neutron . agent import rpc as agent_rpc <EOL> from neutron . extensions import portbindings <EOL> from neutron . plugins . ml2 . drivers . mec...
<s> from neutron_lib import constants <EOL> from neutron . _i18n import _ <EOL> from neutron . api import extensions <EOL> EXTENDED_ATTRIBUTES_2_0 = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT:default>' : constants . ATTR_NOT_SPECIFIED , <EOL> '<STR_LIT>...
<s> import mock <EOL> from oslo_config import cfg <EOL> from oslo_utils import uuidutils <EOL> from neutron . common import exceptions as n_exc <EOL> from neutron import context <EOL> from neutron import manager <EOL> from neutron . objects import base as base_object <EOL> from neutron . objects . qos import policy as ...
<s> from nova . scheduler . filters import compute_filter <EOL> from nova_solverscheduler . scheduler . solvers import constraints <EOL> class ActiveHostsConstraint ( constraints . BaseFilterConstraint ) : <EOL> """<STR_LIT>""" <EOL> host_filter_cls = compute_filter . ComputeFilter </s>
<s> from oslo_log import log as logging <EOL> from nova_solverscheduler . scheduler . solvers import constraints <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class ServerGroupAffinityConstraint ( constraints . BaseLinearConstraint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> ...
<s> import mock <EOL> from nova import context <EOL> from nova import test <EOL> from nova_solverscheduler . scheduler . solvers . constraints import aggregate_vcpu <EOL> from nova_solverscheduler . tests . scheduler import solver_scheduler_fakes as fakes <EOL> class TestAggregateVcpuConstraint ( test . NoDBTestCase ) ...
<s> """<STR_LIT>""" <EOL> from nova import context <EOL> from nova . scheduler import host_manager <EOL> from nova import test <EOL> from nova_solverscheduler . scheduler . solvers import costs <EOL> from nova_solverscheduler . scheduler . solvers . costs import ram_cost <EOL> from nova_solverscheduler . tests . schedu...
<s> from nova . api . openstack import common <EOL> from nova . api . openstack . compute . views import servers <EOL> class ViewBuilder ( common . ViewBuilder ) : <EOL> _collection_name = "<STR_LIT>" <EOL> def __init__ ( self ) : <EOL> super ( ViewBuilder , self ) . __init__ ( ) <EOL> self . _server_builder = servers ...
<s> from oslo_config import cfg <EOL> password_length = cfg . IntOpt ( <EOL> '<STR_LIT>' , <EOL> default = <NUM_LIT:12> , <EOL> help = '<STR_LIT>' ) <EOL> instance_usage_audit_period = cfg . StrOpt ( <EOL> '<STR_LIT>' , <EOL> default = '<STR_LIT>' , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> use_rootwrap_daemon...
<s> import itertools <EOL> from oslo_config import cfg <EOL> vmware_group = cfg . OptGroup ( '<STR_LIT>' , title = '<STR_LIT>' ) <EOL> vmwareapi_vif_opts = [ <EOL> cfg . StrOpt ( '<STR_LIT>' , <EOL> default = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) , <EOL> cfg . StrOpt ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' <EOL> '<...
<s> """<STR_LIT>""" <EOL> import calendar <EOL> import inspect <EOL> import os <EOL> import re <EOL> import time <EOL> import netaddr <EOL> import netifaces <EOL> from oslo_concurrency import processutils <EOL> from oslo_log import log as logging <EOL> from oslo_serialization import jsonutils <EOL> from oslo_utils impo...
<s> from oslo_reports import guru_meditation_report as gmr <EOL> from nova import test <EOL> from nova import version <EOL> class TestServerGet ( test . TestCase ) : <EOL> def test_guru_meditation_report_generation ( self ) : <EOL> """<STR_LIT>""" <EOL> generator = gmr . TextGuruMeditation ( version ) <EOL> generator ....
<s> import mock <EOL> from webob import exc <EOL> from nova . api . openstack . compute import extension_info <EOL> from nova . api . openstack . compute import server_tags <EOL> from nova . api . openstack . compute import servers <EOL> from nova . db . sqlalchemy import models <EOL> from nova import exception <EOL> f...
<s> from oslo_config import fixture as config_fixture <EOL> from oslo_policy import opts as policy_opts <EOL> import nova . conf <EOL> from nova . conf import paths <EOL> from nova import config <EOL> from nova import ipv6 <EOL> from nova . tests . unit import utils <EOL> CONF = nova . conf . CONF <EOL> CONF . import_o...
<s> import mock <EOL> from nova import objects <EOL> from nova . tests . unit . objects import test_objects <EOL> FAKE_UUID = '<STR_LIT>' <EOL> class _TestNetworkRequestObject ( object ) : <EOL> def test_basic ( self ) : <EOL> request = objects . NetworkRequest ( ) <EOL> request . network_id = '<STR_LIT>' <EOL> request...
<s> import os <EOL> from six . moves import StringIO <EOL> from nova . virt . libvirt import utils as libvirt_utils <EOL> files = { '<STR_LIT>' : True } <EOL> disk_sizes = { } <EOL> disk_backing_files = { } <EOL> disk_type = "<STR_LIT>" <EOL> RESIZE_SNAPSHOT_NAME = libvirt_utils . RESIZE_SNAPSHOT_NAME <EOL> def create_...
<s> from oslo_concurrency import processutils <EOL> from oslo_config import cfg <EOL> from oslo_log import log as logging <EOL> import six <EOL> import nova . conf <EOL> from nova . conf import paths <EOL> from nova . i18n import _LE , _LW <EOL> from nova import utils <EOL> from nova . virt . libvirt import utils as li...
<s> from ooi . api import base <EOL> import ooi . api . helpers <EOL> from ooi import exception <EOL> from ooi . occi . core import collection <EOL> from ooi . occi . infrastructure import network <EOL> FLOATING_PREFIX = "<STR_LIT>" <EOL> FIXED_PREFIX = "<STR_LIT>" <EOL> def _build_network ( name , prefix = None ) : <E...
<s> from ooi . occi . core import attribute as attr <EOL> from ooi . occi . core import kind <EOL> from ooi . occi . core import link <EOL> from ooi . occi import helpers <EOL> class StorageLink ( link . Link ) : <EOL> attributes = attr . AttributeCollection ( [ "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ] ) <...
<s> import uuid <EOL> import mock <EOL> from ooi . tests import fakes <EOL> from ooi . tests . middleware import test_middleware <EOL> from ooi import utils <EOL> class TestStorageLinkController ( test_middleware . TestMiddleware ) : <EOL> """<STR_LIT>""" <EOL> def test_list_vols_empty ( self ) : <EOL> tenant = fakes ....
<s> import argparse <EOL> import os <EOL> import subprocess <EOL> from cafe . configurator . managers import TestEnvManager <EOL> def entry_point ( ) : <EOL> argparser = argparse . ArgumentParser ( prog = '<STR_LIT>' ) <EOL> argparser . add_argument ( <EOL> "<STR_LIT>" , <EOL> nargs = <NUM_LIT:1> , <EOL> metavar = "<ST...
<s> from time import sleep <EOL> from pyes import ES <EOL> from pyes import TermQuery , BoolQuery , Search <EOL> from pyes . connection import NoServerAvailable <EOL> from pyes . connection_http import update_connection_pool <EOL> from pyes . exceptions import IndexMissingException <EOL> from cafe . engine . clients . ...
<s> import os <EOL> from Crypto . PublicKey import RSA <EOL> import datetime <EOL> import re <EOL> from cafe . engine . behaviors import BaseBehavior , behavior <EOL> from cafe . engine . ssh . client import BaseSSHClient <EOL> from cafe . engine . config import EngineConfig <EOL> from cafe . engine . ssh . models . ss...
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import argparse <EOL> import yaml <EOL> def represent_dict ( self , data ) : <EOL> def key_function ( ( key , value ) ) : <EOL> prio = { "<STR_LIT>" : <NUM_LIT:0> , "<STR_LIT>" : <NUM_LIT:1> , "<STR_LIT>" : <NUM_LIT:2> } . get ( key , <NUM_LIT> ) <EO...
<s> extensions = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> templates_path = [ '<STR_LIT>' ] <EOL> source_suffix = '<STR_LIT>' <EOL> master_doc = '<STR_LIT:index>' <EOL> project = u'<STR_LIT>' <EOL> copyright = u'<STR_LIT>' <EOL> from os_doc_tools . version import version_info as doc_tools_version <EOL> re...
<s> """<STR_LIT>""" <EOL> __import__ ( '<STR_LIT>' ) . declare_namespace ( __name__ ) </s>
<s> import copy <EOL> import logging <EOL> import threading <EOL> from oslo_config import cfg <EOL> from oslo_db . _i18n import _LE <EOL> from oslo_db import api <EOL> LOG = logging . getLogger ( __name__ ) <EOL> tpool_opts = [ <EOL> cfg . BoolOpt ( '<STR_LIT>' , <EOL> default = False , <EOL> deprecated_name = '<STR_LI...
<s> import alembic <EOL> import mock <EOL> from oslotest import base as test_base <EOL> import sqlalchemy <EOL> from oslo_db import exception <EOL> from oslo_db . sqlalchemy . migration_cli import ext_alembic <EOL> from oslo_db . sqlalchemy . migration_cli import ext_migrate <EOL> from oslo_db . sqlalchemy . migration_...
<s> from oslotest import base as test_base <EOL> import six <EOL> import oslo_i18n <EOL> from oslo_i18n import _gettextutils <EOL> from oslo_i18n . _i18n import _ <EOL> from oslo_i18n import _lazy <EOL> from oslo_i18n import _message <EOL> from oslo_i18n import _translate <EOL> from oslo_i18n import fixture <EOL> class...
<s> </s>
<s> import webob <EOL> from oslo_middleware . base import ConfigurableMiddleware <EOL> from oslo_middleware . base import Middleware <EOL> from oslotest . base import BaseTestCase <EOL> @ webob . dec . wsgify <EOL> def application ( req ) : <EOL> return '<STR_LIT>' <EOL> class TestBase ( BaseTestCase ) : <EOL> """<STR_...
<s> """<STR_LIT>""" <EOL> import math <EOL> from eventlet import greenthread <EOL> from eventlet import timeout <EOL> import mock <EOL> from oslo_vmware import exceptions <EOL> from oslo_vmware import image_transfer <EOL> from oslo_vmware import rw_handles <EOL> from oslo_vmware . tests import base <EOL> class Blocking...
<s> """<STR_LIT>""" <EOL> NIC_FRU_OUT = ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> NIC_FRU_OUT_NO_PORT_DETAILS = ( <EOL> "<STR_LIT>" <EOL...
<s> from pyghmi . ipmi . oem . lenovo . inventory import EntryField , parse_inventory_category_entry <EOL> dimm_fields = ( <EOL> EntryField ( "<STR_LIT:index>" , "<STR_LIT:B>" ) , <EOL> EntryField ( "<STR_LIT>" , "<STR_LIT:B>" ) , <EOL> EntryField ( "<STR_LIT>" , "<STR_LIT:B>" ) , <EOL> EntryField ( "<STR_LIT>" , "<STR...
<s> from __future__ import absolute_import , division <EOL> import time <EOL> import os <EOL> try : <EOL> unicode <EOL> except NameError : <EOL> unicode = str <EOL> from . import LockBase , NotLocked , NotMyLock , LockTimeout , AlreadyLocked <EOL> class SQLiteLockFile ( LockBase ) : <EOL> "<STR_LIT>" <EOL> testdb = Non...
<s> from keystoneclient import session <EOL> import mock <EOL> from requests_mock . contrib import fixture <EOL> import testtools <EOL> from barbicanclient import client <EOL> from barbicanclient import exceptions <EOL> class TestClient ( testtools . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( TestClient , se...
<s> """<STR_LIT>""" <EOL> import os <EOL> from oslo_config import cfg <EOL> TEST_CONF = None <EOL> def setup_config ( config_file = '<STR_LIT>' ) : <EOL> global TEST_CONF <EOL> TEST_CONF = cfg . ConfigOpts ( ) <EOL> identity_group = cfg . OptGroup ( name = '<STR_LIT>' ) <EOL> identity_options = [ <EOL> cfg . StrOpt ( '...
<s> from climateclient . v1 import hosts <EOL> from climateclient . v1 import leases <EOL> class Client ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , climate_url , auth_token ) : <EOL> self . climate_url = climate_url <EOL> self . auth_token = auth_token <EOL> self . lease = leases . LeaseClientManager...
<s> from cinderclient import base <EOL> from cinderclient . openstack . common . apiclient import base as common_base <EOL> from cinderclient import utils <EOL> class Extension ( common_base . HookableMixin ) : <EOL> """<STR_LIT>""" <EOL> SUPPORTED_HOOKS = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def __init__ ( self , name ...
<s> from datetime import datetime <EOL> import six . moves . urllib . parse as urlparse <EOL> from cinderclient import client as base_client <EOL> from cinderclient . tests . unit import fakes <EOL> import cinderclient . tests . unit . utils as utils <EOL> from cinderclient . v1 import client <EOL> def _stub_volume ( *...
<s> import fixtures <EOL> import mock <EOL> from requests_mock . contrib import fixture as requests_mock_fixture <EOL> from six . moves . urllib import parse <EOL> from cinderclient import client <EOL> from cinderclient import exceptions <EOL> from cinderclient import shell <EOL> from cinderclient . v2 import volumes <...
<s> from cinderclient . v2 . client import Client </s>
<s> from cinderclient import base <EOL> from cinderclient import utils <EOL> class ListExtResource ( base . Resource ) : <EOL> @ property <EOL> def summary ( self ) : <EOL> descr = self . description . strip ( ) <EOL> if not descr : <EOL> return '<STR_LIT>' <EOL> lines = descr . split ( "<STR_LIT:\n>" ) <EOL> if len ( ...
<s> import abc <EOL> import argparse <EOL> import os <EOL> import six <EOL> from stevedore import extension <EOL> from cloudkittyclient . openstack . common . apiclient import exceptions <EOL> _discovered_plugins = { } <EOL> def discover_auth_systems ( ) : <EOL> """<STR_LIT>""" <EOL> global _discovered_plugins <EOL> _d...
<s> from cloudkittyclient . v1 . rating . pyscripts import client <EOL> from cloudkittyclient . v1 . rating . pyscripts import shell <EOL> class Extension ( object ) : <EOL> """<STR_LIT>""" <EOL> @ staticmethod <EOL> def get_client ( http_client ) : <EOL> return client . Client ( http_client ) <EOL> @ staticmethod <EOL...
<s> import mock <EOL> from congressclient . osc . v1 import api_versions <EOL> from congressclient . tests import common <EOL> class TestAPIVersions ( common . TestCongressBase ) : <EOL> def test_list_api_versions ( self ) : <EOL> fake_response = { <EOL> "<STR_LIT>" : [ <EOL> { <EOL> "<STR_LIT:status>" : "<STR_LIT>" , ...
<s> import logging <EOL> import sys <EOL> from gbpclient . gbp . v2_0 import groupbasedpolicy as gbp <EOL> from gbpclient . tests . unit import test_cli20 <EOL> class CLITestV20L3PolicyJSON ( test_cli20 . CLITestV20Base ) : <EOL> LOG = logging . getLogger ( __name__ ) <EOL> def setUp ( self ) : <EOL> super ( CLITestV20...
<s> from __future__ import print_function <EOL> import argparse <EOL> import base64 <EOL> import contextlib <EOL> import gzip <EOL> import json <EOL> import os <EOL> import shutil <EOL> import subprocess <EOL> import tempfile <EOL> from oslo_utils import importutils <EOL> from oslo_utils import strutils <EOL> from iron...
<s> import mock <EOL> from oslo_utils import uuidutils <EOL> from ironicclient . common . apiclient import exceptions <EOL> from ironicclient . common import cliutils <EOL> from ironicclient . common import utils as commonutils <EOL> from ironicclient . tests . unit import utils <EOL> import ironicclient . v1 . chassis...
<s> import os <EOL> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( '<STR_LIT>' ) ) <EOL> extensions = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> source_suffix = '<STR_LIT>' <EOL> master_doc = '<STR_LIT:index>' <EOL> project = u'<STR_LIT>' <EOL> copyright = u'<STR_LIT>' <EOL> add...