_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 31 13.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q244800 | get_profiles_in_svr | train | def get_profiles_in_svr(nickname, server, all_profiles_dict, org_vm,
add_error_list=False):
"""
Test all profiles in server.profiles to determine if profile is in
the all_profiles_dict.
Returns list of profiles in the profile_dict and in the defined server.
If add_error_list... | python | {
"resource": ""
} |
q244801 | possible_target_profiles | train | def possible_target_profiles(nickname, server, all_profiles_dict,
org_vm, autonomous=True, output='path'):
"""
Get list of possible autonomous or component profiles based on the list
of all profiles and the list of profiles in the defined server.
Returns list of *paths or i... | python | {
"resource": ""
} |
q244802 | show_tree | train | def show_tree(nickname, server, org_vm, reference_direction='snia'):
"""
sShow a tree view of the registered profiles using the ECTP and
referencedprofile associations to define the tree. Starts with SMI-S
if it iexists
"""
scoping_result_role = "Dependent" if reference_direction == 'snia' \
... | python | {
"resource": ""
} |
q244803 | display_servers | train | def display_servers(server_definitions_filename):
"""
display the defined servers information as a table.
"""
servers = ServerDefinitionFile2(server_definitions_filename)
title = 'List of all servers that can be tested'
headers = ['Name', 'Url', 'Default_namespace']
rows = []
for serve... | python | {
"resource": ""
} |
q244804 | ElapsedTimer.elapsed_ms | train | def elapsed_ms(self):
""" Get the elapsed time in milliseconds. returns floating
point representation of elapsed time in seconds.
"""
| python | {
"resource": ""
} |
q244805 | ServerDefinitionFile2.list_servers | train | def list_servers(self, nicknames=None):
"""
Iterate through the servers of the server group with the specified
nicknames, or the single server with the specified nickname, and yield
a `ServerDefinition` object for each server.
nicknames may be: None, string defining a nickname o... | python | {
"resource": ""
} |
q244806 | print_profile_info | train | def print_profile_info(org_vm, profile_instance):
"""
Print information on a profile defined by profile_instance.
Parameters:
org_vm: The value mapping for CIMRegisterdProfile and
RegisteredOrganization so that the value and not value mapping
is displayed.
profile_instance... | python | {
"resource": ""
} |
q244807 | create_indication_data | train | def create_indication_data(msg_id, sequence_number, source_id, delta_time, \
protocol_ver):
'''
Create a singled indication XML from the template and the included
sequence_number, delta_time, and protocol_ver
Returns the completed indication XML
'''
data_template = "... | python | {
"resource": ""
} |
q244808 | send_indication | train | def send_indication(url, headers, payload, verbose, verify=None, keyfile=None,
timeout=4):
'''
Send indication using requests module.
Parameters:
url(:term:`string):
listener url including scheme, host name, port
headers:
All headers for the request
pyload:
... | python | {
"resource": ""
} |
q244809 | _get_required_attribute | train | def _get_required_attribute(node, attr):
"""Return an attribute by name. Raise ParseError if not present."""
if not node.hasAttribute(attr):
raise ParseError(
| python | {
"resource": ""
} |
q244810 | _get_end_event | train | def _get_end_event(parser, tagName):
"""Check that the next event is the end of a particular XML tag."""
(event, node) = six.next(parser)
if event != pulldom.END_ELEMENT or node.tagName != tagName:
| python | {
"resource": ""
} |
q244811 | make_parser | train | def make_parser(stream_or_string):
"""Create a xml.dom.pulldom parser."""
if isinstance(stream_or_string, six.string_types):
# XXX: the pulldom.parseString() function doesn't seem to
# like operating on | python | {
"resource": ""
} |
q244812 | parse_any | train | def parse_any(stream_or_string):
"""Parse any XML string or stream. This function fabricates
the names of the parser functions by prepending parse_ to
the node name and then calling that function.
"""
parser = make_parser(stream_or_string)
(event, node) = six.next(parser)
if event !... | python | {
"resource": ""
} |
q244813 | _process_indication | train | def _process_indication(indication, host):
'''This function gets called when an indication is received.'''
global RECEIVED_INDICATION_DICT
COUNTER_LOCK.acquire()
if host in RECEIVED_INDICATION_DICT:
| python | {
"resource": ""
} |
q244814 | _get_argv | train | def _get_argv(index, default=None):
''' get the argv input argument defined by index. Return the default
attribute if that argument does not exist
| python | {
"resource": ""
} |
q244815 | status | train | def status(reset=None):
'''
Show status of indications received. If optional reset attribute
is True, reset the counter.
'''
global RECEIVED_INDICATION_DICT
for host, count in six.iteritems(RECEIVED_INDICATION_DICT):
print('Host %s Received %s indications' % (host, count))
... | python | {
"resource": ""
} |
q244816 | AutoAutoSummary._get_members | train | def _get_members(self, class_obj, member_type, include_in_public=None):
"""
Return class members of the specified type.
class_obj: Class object.
member_type: Member type ('method' or 'attribute').
include_in_public: set/list/tuple with member names that should be
inc... | python | {
"resource": ""
} |
q244817 | AutoAutoSummary._get_def_class | train | def _get_def_class(self, class_obj, member_name):
"""
Return the class object in MRO order that defines a member.
class_obj: Class object that exposes (but not necessarily defines) the
member. I.e. starting point of the search.
member_name: Name of the member (method or attri... | python | {
"resource": ""
} |
q244818 | OperationStatistic.reset | train | def reset(self):
"""
Reset the statistics data for this object.
"""
self._count = 0
self._exception_count = 0
self._stat_start_time = None
self._time_sum = float(0)
self._time_min = float('inf')
self._time_max = float(0)
self._server_time_... | python | {
"resource": ""
} |
q244819 | OperationStatistic.start_timer | train | def start_timer(self):
"""
This is a low-level method that is called by pywbem at the begin of an
operation. It starts the measurement for that operation, if statistics
is enabled for the connection.
A subsequent invocation of :meth:`~pywbem.OperationStatistic.stop_timer`
... | python | {
"resource": ""
} |
q244820 | OperationStatistic.stop_timer | train | def stop_timer(self, request_len, reply_len, server_time=None,
exception=False):
"""
This is a low-level method is called by pywbem at the end of an
operation. It completes the measurement for that operation by capturing
the needed data, and updates the statistics data... | python | {
"resource": ""
} |
q244821 | OperationStatistic.formatted | train | def formatted(self, include_server_time):
"""
Return a formatted one-line string with the statistics
values for the operation for which this statistics object
maintains data.
This is a low-level method that is called by
:meth:`pywbem.Statistics.formatted`.
"""
... | python | {
"resource": ""
} |
q244822 | Statistics.formatted | train | def formatted(self):
# pylint: disable=line-too-long
"""
Return a human readable string with the statistics for this container.
The operations are sorted by decreasing average time.
The three columns for `ServerTime` are included only if the WBEM server
has returned WBEM... | python | {
"resource": ""
} |
q244823 | Statistics.reset | train | def reset(self):
"""
Reset all statistics and clear any statistic names.
All statistics must be inactive before a reset will execute
Returns: True if reset, False if not
"""
# Test for any stats being currently timed.
for stat in six.itervalues(self._op_stats): | python | {
"resource": ""
} |
q244824 | remove_duplicate_metadata_dirs | train | def remove_duplicate_metadata_dirs(package_name):
"""Remove duplicate metadata directories of a package."""
print("Removing duplicate metadata directories of package: %s" %
package_name)
module = importlib.import_module(package_name)
py_mn = "%s.%s" % (sys.version_info[0], sys.version_info[... | python | {
"resource": ""
} |
q244825 | display_path_info | train | def display_path_info(descriptor, class_, namespace):
"""
Display info on the instance names of the class parameter retrieved
from the interop namespace of the server defined by CONN.
The descriptor is text defining the class(ex. Filter)).
Returns a list of the paths
| python | {
"resource": ""
} |
q244826 | kids | train | def kids(tup_tree):
"""
Return a list with the child elements of tup_tree.
The child elements are represented as tupletree nodes.
Child nodes that are | python | {
"resource": ""
} |
q244827 | TupleParser.pcdata | train | def pcdata(self, tup_tree):
"""
Return the concatenated character data within the child nodes of a
tuple tree node, as a unicode string. Whitespace is preserved.
The child nodes must be text nodes (no element nodes).
"""
try:
data = u''.join(tup_tree[2])
... | python | {
"resource": ""
} |
q244828 | TupleParser.check_node | train | def check_node(self, tup_tree, nodename, required_attrs=None,
optional_attrs=None, allowed_children=None,
allow_pcdata=False):
# pylint: disable=too-many-branches
"""
Check static local constraints on a tuple tree node.
The node must have the given ... | python | {
"resource": ""
} |
q244829 | TupleParser.one_child | train | def one_child(self, tup_tree, acceptable):
"""
Parse children of a node with exactly one child node.
acceptable is a list/tuple of acceptable child nodes
PCData is ignored.
"""
k = kids(tup_tree)
if not k:
raise CIMXMLParseError(
_f... | python | {
"resource": ""
} |
q244830 | TupleParser.notimplemented | train | def notimplemented(self, tup_tree):
"""
Raise exception for not implemented function.
"""
raise CIMXMLParseError(
_format("Internal Error: Parsing support for | python | {
"resource": ""
} |
q244831 | TupleParser.parse_value | train | def parse_value(self, tup_tree):
"""
Parse a VALUE element and return its text content as a unicode string.
Whitespace is preserved.
The conversion of the text representation of the value to a CIM data
type object requires CIM type information which is not available on the
... | python | {
"resource": ""
} |
q244832 | TupleParser.parse_value_array | train | def parse_value_array(self, tup_tree):
"""
Parse a VALUE.ARRAY element and return the items in the array as a list
of unicode strings, or None for NULL items. Whitespace is preserved.
::
<!ELEMENT VALUE.ARRAY (VALUE | VALUE.NULL)*>
| python | {
"resource": ""
} |
q244833 | TupleParser.parse_value_reference | train | def parse_value_reference(self, tup_tree):
"""
Parse a VALUE.REFERENCE element and return the instance path or class
path it represents as a CIMInstanceName or CIMClassName object,
respectively.
::
<!ELEMENT VALUE.REFERENCE (CLASSPATH | LOCALCLASSPATH | CLASSNAME ... | python | {
"resource": ""
} |
q244834 | TupleParser.parse_value_refarray | train | def parse_value_refarray(self, tup_tree):
"""
Parse a VALUE.REFARRAY element and return the array of instance paths
or class paths it represents as a list of CIMInstanceName or
CIMClassName objects, respectively.
::
<!ELEMENT VALUE.REFARRAY (VALUE.REFERENCE | VALU... | python | {
"resource": ""
} |
q244835 | TupleParser.parse_value_instancewithpath | train | def parse_value_instancewithpath(self, tup_tree):
"""
The VALUE.INSTANCEWITHPATH is used to define a value that comprises
a single CIMInstance with additional information that defines the
absolute path to that object.
::
<!ELEMENT VALUE.INSTANCEWITHPATH (INSTANCEP... | python | {
"resource": ""
} |
q244836 | TupleParser.parse_localnamespacepath | train | def parse_localnamespacepath(self, tup_tree):
"""
Parse a LOCALNAMESPACEPATH element and return the namespace it
represents as a unicode string.
The namespace is formed by joining the namespace components (one from
each NAMESPACE child element) with a slash (e.g. to "root/cimv2"... | python | {
"resource": ""
} |
q244837 | TupleParser.parse_host | train | def parse_host(self, tup_tree):
"""
Parse a HOST element and return its text content as a unicode string.
::
<!ELEMENT HOST (#PCDATA)>
| python | {
"resource": ""
} |
q244838 | TupleParser.parse_classpath | train | def parse_classpath(self, tup_tree):
"""
Parse a CLASSPATH element and return the class path it represents as a
CIMClassName object.
::
<!ELEMENT CLASSPATH (NAMESPACEPATH, CLASSNAME)>
"""
self.check_node(tup_tree, 'CLASSPATH')
k = kids(tup_tree)
... | python | {
"resource": ""
} |
q244839 | TupleParser.parse_localclasspath | train | def parse_localclasspath(self, tup_tree):
"""
Parse a LOCALCLASSPATH element and return the class path it represents
as a CIMClassName object.
::
<!ELEMENT LOCALCLASSPATH (LOCALNAMESPACEPATH, CLASSNAME)>
"""
self.check_node(tup_tree, 'LOCALCLASSPATH')
... | python | {
"resource": ""
} |
q244840 | TupleParser.parse_classname | train | def parse_classname(self, tup_tree):
"""
Parse a CLASSNAME element and return the class path it represents as a
CIMClassName object.
::
<!ELEMENT CLASSNAME EMPTY>
| python | {
"resource": ""
} |
q244841 | TupleParser.parse_instancepath | train | def parse_instancepath(self, tup_tree):
"""
Parse an INSTANCEPATH element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT INSTANCEPATH (NAMESPACEPATH, INSTANCENAME)>
"""
self.check_node(tup_tree, 'INSTANCEPATH')
... | python | {
"resource": ""
} |
q244842 | TupleParser.parse_localinstancepath | train | def parse_localinstancepath(self, tup_tree):
"""
Parse a LOCALINSTANCEPATH element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT LOCALINSTANCEPATH (LOCALNAMESPACEPATH, INSTANCENAME)>
"""
self.check_node(tup_tree, 'LO... | python | {
"resource": ""
} |
q244843 | TupleParser.parse_instancename | train | def parse_instancename(self, tup_tree):
"""
Parse an INSTANCENAME element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT INSTANCENAME (KEYBINDING* | KEYVALUE? |
VALUE.REFERENCE?)>
<!ATTL... | python | {
"resource": ""
} |
q244844 | TupleParser.parse_keybinding | train | def parse_keybinding(self, tup_tree):
"""
Parse a KEYBINDING element and return the keybinding as a one-item
dictionary from name to value, where the value is a CIM data type
object, based upon the type information in the child elements, if
present. If no type information is pres... | python | {
"resource": ""
} |
q244845 | TupleParser.parse_keyvalue | train | def parse_keyvalue(self, tup_tree):
"""
Parse a KEYVALUE element and return the keybinding value as a CIM data
type object, based upon the type information in its VALUETYPE and TYPE
attributes, if present.
If TYPE is specified, its value is used to create the corresponding CIM
... | python | {
"resource": ""
} |
q244846 | TupleParser.parse_class | train | def parse_class(self, tup_tree):
"""
Parse CLASS element returning a CIMClass if the parse was successful.
::
<!ELEMENT CLASS (QUALIFIER*, (PROPERTY | PROPERTY.ARRAY |
PROPERTY.REFERENCE)*, METHOD*)>
<!ATTLIST CLASS
... | python | {
"resource": ""
} |
q244847 | TupleParser.parse_instance | train | def parse_instance(self, tup_tree):
"""
Return a CIMInstance.
The instance contains the properties, qualifiers and classname for
the instance.
::
<!ELEMENT INSTANCE (QUALIFIER*, (PROPERTY | PROPERTY.ARRAY |
PROPERTY.RE... | python | {
"resource": ""
} |
q244848 | TupleParser.parse_scope | train | def parse_scope(self, tup_tree):
"""
Parse a SCOPE element and return a dictionary with an item for each
specified scope attribute.
The keys of the dictionary items are the scope names in upper case; the
values are the Python boolean values True or False.
Unspecified sc... | python | {
"resource": ""
} |
q244849 | TupleParser.parse_qualifier_declaration | train | def parse_qualifier_declaration(self, tup_tree):
"""
Parse QUALIFIER.DECLARATION element.
::
<!ELEMENT QUALIFIER.DECLARATION (SCOPE?, (VALUE | VALUE.ARRAY)?)>
<!ATTLIST QUALIFIER.DECLARATION
%CIMName;
%CIMType; #REQUIRED
... | python | {
"resource": ""
} |
q244850 | TupleParser.parse_qualifier | train | def parse_qualifier(self, tup_tree):
"""
Parse QUALIFIER element returning CIMQualifier.
::
<!ELEMENT QUALIFIER (VALUE | VALUE.ARRAY)>
<!ATTLIST QUALIFIER
%CIMName;
%CIMType; #REQUIRED
%Propagated;
... | python | {
"resource": ""
} |
q244851 | TupleParser.parse_property | train | def parse_property(self, tup_tree):
"""
Parse PROPERTY into a CIMProperty object.
VAL is just the pcdata of the enclosed VALUE node.
::
<!ELEMENT PROPERTY (QUALIFIER*, VALUE?)>
<!ATTLIST PROPERTY
%CIMName;
%CIMType; ... | python | {
"resource": ""
} |
q244852 | TupleParser.parse_paramvalue | train | def parse_paramvalue(self, tup_tree):
"""
Parse PARAMVALUE element.
::
<!ELEMENT PARAMVALUE (VALUE | VALUE.REFERENCE | VALUE.ARRAY |
VALUE.REFARRAY | CLASSNAME | INSTANCENAME |
CLASS | INSTANCE | VALUE.NAMEDINSTA... | python | {
"resource": ""
} |
q244853 | TupleParser.parse_expparamvalue | train | def parse_expparamvalue(self, tup_tree):
"""
Parse for EXPPARMVALUE Element. I.e.
::
<!ELEMENT EXPPARAMVALUE (INSTANCE?)>
<!ATTLIST EXPPARAMVALUE
%CIMName;>
"""
| python | {
"resource": ""
} |
q244854 | TupleParser.parse_simplersp | train | def parse_simplersp(self, tup_tree):
"""
Parse for SIMPLERSP Element.
::
<!ELEMENT SIMPLERSP (METHODRESPONSE | IMETHODRESPONSE)> | python | {
"resource": ""
} |
q244855 | TupleParser.parse_methodresponse | train | def parse_methodresponse(self, tup_tree):
"""
Parse expected METHODRESPONSE ELEMENT. I.e.
::
<!ELEMENT METHODRESPONSE (ERROR | (RETURNVALUE?, PARAMVALUE*))>
<!ATTLIST METHODRESPONSE
%CIMName;>
"""
| python | {
"resource": ""
} |
q244856 | TupleParser.parse_expmethodresponse | train | def parse_expmethodresponse(self, tup_tree):
# pylint: disable=unused-argument
"""
This function not implemented.
| python | {
"resource": ""
} |
q244857 | TupleParser.parse_imethodresponse | train | def parse_imethodresponse(self, tup_tree):
"""
Parse the tuple for an IMETHODRESPONE Element. I.e.
::
<!ELEMENT IMETHODRESPONSE (ERROR | (IRETURNVALUE?, PARAMVALUE*))>
<!ATTLIST IMETHODRESPONSE
%CIMName;>
| python | {
"resource": ""
} |
q244858 | TupleParser.parse_returnvalue | train | def parse_returnvalue(self, tup_tree):
"""
Parse the RETURNVALUE element. Returns name, attributes, and
one child as a tuple.
::
<!ELEMENT RETURNVALUE (VALUE | VALUE.REFERENCE)?>
<!ATTLIST RETURNVALUE
%EmbeddedObject;
%ParamType... | python | {
"resource": ""
} |
q244859 | TupleParser.parse_ireturnvalue | train | def parse_ireturnvalue(self, tup_tree):
"""
Parse IRETURNVALUE element. Returns name, attributes and values of the
tup_tree.
::
<!ELEMENT IRETURNVALUE (CLASSNAME* | INSTANCENAME* | VALUE* |
VALUE.OBJECTWITHPATH* |
... | python | {
"resource": ""
} |
q244860 | TupleParser.parse_iparamvalue | train | def parse_iparamvalue(self, tup_tree):
"""
Parse expected IPARAMVALUE element. I.e.
::
<!ELEMENT IPARAMVALUE (VALUE | VALUE.ARRAY | VALUE.REFERENCE |
INSTANCENAME | CLASSNAME |
QUALIFIER.DECLARATION |
... | python | {
"resource": ""
} |
q244861 | TupleParser.parse_embeddedObject | train | def parse_embeddedObject(self, val):
# pylint: disable=invalid-name
"""
Parse and embedded instance or class and return the CIMInstance or
CIMClass.
Parameters:
val (string):
The string value that contains the embedded object in CIM-XML
format.... | python | {
"resource": ""
} |
q244862 | TupleParser.unpack_value | train | def unpack_value(self, tup_tree):
"""
Find VALUE or VALUE.ARRAY under tup_tree and convert to a Python value.
Looks at the TYPE of the node to work out how to decode it.
Handles nodes with no value (e.g. when representing NULL by omitting
VALUE)
"""
valtype = at... | python | {
"resource": ""
} |
q244863 | TupleParser.unpack_boolean | train | def unpack_boolean(self, data):
"""
Unpack a string value of CIM type 'boolean' and return its CIM data
type object, or None.
data (unicode string): CIM-XML string value, or None (in which case
None is returned).
"""
if data is None:
return None
... | python | {
"resource": ""
} |
q244864 | TupleParser.unpack_numeric | train | def unpack_numeric(self, data, cimtype):
"""
Unpack a string value of a numeric CIM type and return its CIM data
type object, or None.
data (unicode string): CIM-XML string value, or None (in which case
None is returned).
cimtype (string): CIM data type name (e.g. 'ui... | python | {
"resource": ""
} |
q244865 | TupleParser.unpack_datetime | train | def unpack_datetime(self, data):
"""
Unpack a CIM-XML string value of CIM type 'datetime' and return it
as a CIMDateTime object, or None.
data (unicode string): CIM-XML string value, or None (in which case
None is returned).
"""
if data is None:
re... | python | {
"resource": ""
} |
q244866 | TupleParser.unpack_char16 | train | def unpack_char16(self, data):
"""
Unpack a CIM-XML string value of CIM type 'char16' and return it
as a unicode string object, or None.
data (unicode string): CIM-XML string value, or None (in which case
None is returned).
"""
if data is None:
ret... | python | {
"resource": ""
} |
q244867 | execute_request | train | def execute_request(server_url, creds, namespace, classname):
""" Open a connection with the server_url and creds, and
enumerate instances defined by the functions namespace and
classname arguments.
Displays either the error return or the mof for instances
returned.
"""
prin... | python | {
"resource": ""
} |
q244868 | get_keys_from_class | train | def get_keys_from_class(cc):
"""Return list of the key property names for a class """
return [prop.name | python | {
"resource": ""
} |
q244869 | build_instance_name | train | def build_instance_name(inst, obj=None):
"""Return an instance name from an instance, and set instance.path """
if obj is None:
for _ in inst.properties.values():
inst.path.keybindings.__setitem__(_.name, _.value)
return inst.path
if not isinstance(obj, list):
return buil... | python | {
"resource": ""
} |
q244870 | CIMProvider.set_instance | train | def set_instance(self, env, instance, previous_instance, cim_class):
"""Return a newly created or modified instance.
Keyword arguments:
env -- Provider Environment (pycimmb.ProviderEnvironment)
instance -- The new pywbem.CIMInstance. If modifying an existing
instance, the p... | python | {
"resource": ""
} |
q244871 | CIMProvider.references | train | def references(self, env, object_name, model, assoc_class,
result_class_name, role, result_role, keys_only):
"""Instrument Associations.
All four association-related operations (Associators, AssociatorNames,
References, ReferenceNames) are mapped to this method.
This ... | python | {
"resource": ""
} |
q244872 | CIMProvider.MI_deleteInstance | train | def MI_deleteInstance(self,
env,
instanceName):
# pylint: disable=invalid-name
"""Delete a CIM instance
Implements the WBEM operation DeleteInstance in terms
of the delete_instance method. A derived class will not normally
ove... | python | {
"resource": ""
} |
q244873 | cimtype | train | def cimtype(obj):
"""
Return the CIM data type name of a CIM typed object, as a string.
For an array, the type is determined from the first array element
(CIM arrays must be homogeneous w.r.t. the type of their elements).
If the array is empty, that is not possible and
:exc:`~py:exceptions.Valu... | python | {
"resource": ""
} |
q244874 | type_from_name | train | def type_from_name(type_name):
"""
Return the Python type object for a given CIM data type name.
For example, type name ``"uint8"`` will return type object
:class:`~pywbem.Uint8`.
For CIM data type names ``"string"`` and ``"char16"``, the
:term:`unicode string` type is returned (Unicode string... | python | {
"resource": ""
} |
q244875 | atomic_to_cim_xml | train | def atomic_to_cim_xml(obj):
"""
Convert an "atomic" scalar value to a CIM-XML string and return that
string.
The returned CIM-XML string is ready for use as the text of a CIM-XML
'VALUE' element.
Parameters:
obj (:term:`CIM data type`, :term:`number`, :class:`py:datetime`):
The ... | python | {
"resource": ""
} |
q244876 | _CIMComparisonMixin.__ordering_deprecated | train | def __ordering_deprecated(self):
"""Deprecated warning for pywbem CIM Objects"""
msg = _format("Ordering comparisons involving {0} objects are "
"deprecated.", self.__class__.__name__)
if DEBUG_WARNING_ORIGIN:
| python | {
"resource": ""
} |
q244877 | CIMDateTime._to_int | train | def _to_int(value_str, min_value, rep_digit, field_name, dtarg):
"""
Convert value_str into an integer, replacing right-consecutive
asterisks with rep_digit, and an all-asterisk value with min_value.
field_name and dtarg are passed only for informational purposes.
"""
if... | python | {
"resource": ""
} |
q244878 | ServerContextFactory.getContext | train | def getContext(self):
"""Create an SSL context with a dodgy certificate."""
ctx = SSL.Context(SSL.SSLv23_METHOD)
| python | {
"resource": ""
} |
q244879 | execute_request | train | def execute_request(conn, classname, max_open, max_pull):
"""
Enumerate instances defined by the function's
classname argument using the OpenEnumerateInstances and
PullInstancesWithPath.
* classname - Classname for the enumeration.
* max_open - defines the maximum number of... | python | {
"resource": ""
} |
q244880 | _pcdata_nodes | train | def _pcdata_nodes(pcdata):
"""Return a list of minidom nodes with the properly escaped ``pcdata``
inside.
The following special XML characters are escaped:
* left angle bracket (<)
* Right angle bracket (>)
* Ampersand (&)
By default, XML-based escaping is used for these characters. ... | python | {
"resource": ""
} |
q244881 | _uprint | train | def _uprint(dest, text):
"""
Write text to dest, adding a newline character.
Text may be a unicode string, or a byte string in UTF-8 encoding.
It must not be None.
If dest is None, the text is encoded to a codepage suitable for the current
stdout and is written to stdout.
Otherwise, dest ... | python | {
"resource": ""
} |
q244882 | _pretty_xml | train | def _pretty_xml(xml_string):
"""
Common function to produce pretty xml string from an input xml_string.
This function is NOT intended to be used in major code paths since it
uses the minidom | python | {
"resource": ""
} |
q244883 | FakedWBEMConnection.add_namespace | train | def add_namespace(self, namespace):
"""
Add a CIM namespace to the mock repository.
The namespace must not yet exist in the mock repository.
Note that the default connection namespace is automatically added to
the mock repository upon creation of this object.
Parameter... | python | {
"resource": ""
} |
q244884 | FakedWBEMConnection._remove_namespace | train | def _remove_namespace(self, namespace):
"""
Remove a CIM namespace from the mock repository.
The namespace must exist in the mock repository and must be empty.
The default connection namespace cannot be removed.
Parameters:
namespace (:term:`string`):
Th... | python | {
"resource": ""
} |
q244885 | FakedWBEMConnection.compile_mof_string | train | def compile_mof_string(self, mof_str, namespace=None, search_paths=None,
verbose=None):
"""
Compile the MOF definitions in the specified string and add the
resulting CIM objects to the specified CIM namespace of the mock
repository.
If the namespace do... | python | {
"resource": ""
} |
q244886 | FakedWBEMConnection.compile_dmtf_schema | train | def compile_dmtf_schema(self, schema_version, schema_root_dir, class_names,
use_experimental=False, namespace=None,
verbose=False):
"""
Compile the classes defined by `class_names` and their dependent
classes from the DMTF CIM schema versio... | python | {
"resource": ""
} |
q244887 | FakedWBEMConnection.add_method_callback | train | def add_method_callback(self, classname, methodname, method_callback,
namespace=None,):
"""
Register a callback function for a CIM method that will be called when
the CIM method is invoked via `InvokeMethod`.
If the namespace does not exist, :exc:`~pywbem.CIM... | python | {
"resource": ""
} |
q244888 | FakedWBEMConnection.display_repository | train | def display_repository(self, namespaces=None, dest=None, summary=False,
output_format='mof'):
"""
Display the namespaces and objects in the mock repository in one of
multiple formats to a destination.
Parameters:
namespaces (:term:`string` or list o... | python | {
"resource": ""
} |
q244889 | FakedWBEMConnection._get_inst_repo | train | def _get_inst_repo(self, namespace=None):
"""
Test support method that returns instances from the repository with
no processing. It uses the default namespace if input parameter
for namespace is None
"""
| python | {
"resource": ""
} |
q244890 | FakedWBEMConnection._class_exists | train | def _class_exists(self, classname, namespace):
"""
Test if class defined by classname parameter exists in
repository defined by namespace parameter.
| python | {
"resource": ""
} |
q244891 | FakedWBEMConnection._remove_qualifiers | train | def _remove_qualifiers(obj):
"""
Remove all qualifiers from the input objectwhere the object may
be an CIMInstance or CIMClass. Removes qualifiers from the object and
from properties, methods, and parameters
This is used to process the IncludeQualifier parameter for classes
... | python | {
"resource": ""
} |
q244892 | FakedWBEMConnection._remove_classorigin | train | def _remove_classorigin(obj):
"""
Remove all ClassOrigin attributes from the input object. The object
may be a CIMInstance or CIMClass.
Used to process the IncludeClassOrigin parameter of requests
"""
assert isinstance(obj, (CIMInstance, CIMClass))
for prop in ob... | python | {
"resource": ""
} |
q244893 | FakedWBEMConnection._validate_namespace | train | def _validate_namespace(self, namespace):
"""
Validate whether a CIM namespace exists in the mock repository.
Parameters:
namespace (:term:`string`):
The name of the CIM namespace in the mock repository. Must not be
`None`.
Raises:
:exc:`~p... | python | {
"resource": ""
} |
q244894 | FakedWBEMConnection._get_class_repo | train | def _get_class_repo(self, namespace):
"""
Returns the class repository for the specified CIM namespace
within the mock repository. This is the original instance variable,
so any modifications will change the mock repository.
Validates that the namespace exists in the mock reposi... | python | {
"resource": ""
} |
q244895 | FakedWBEMConnection._get_instance_repo | train | def _get_instance_repo(self, namespace):
"""
Returns the instance repository for the specified CIM namespace
within the mock repository. This is the original instance variable,
so any modifications will change the mock repository.
Validates that the namespace exists in the mock ... | python | {
"resource": ""
} |
q244896 | FakedWBEMConnection._get_qualifier_repo | train | def _get_qualifier_repo(self, namespace):
"""
Returns the qualifier repository for the specified CIM namespace
within the mock repository. This is the original instance variable,
so any modifications will change the mock repository.
Validates that the namespace exists in the moc... | python | {
"resource": ""
} |
q244897 | FakedWBEMConnection._get_method_repo | train | def _get_method_repo(self, namespace=None):
"""
Returns the method repository for the specified CIM namespace
within the mock repository. This is the original instance variable,
so any modifications will change the mock repository.
Validates that the namespace exists in the mock... | python | {
"resource": ""
} |
q244898 | FakedWBEMConnection._get_superclassnames | train | def _get_superclassnames(self, cn, namespace):
"""
Get list of superclasses names from the class repository for the
defined classname in the namespace.
Returns in order of descending class hiearchy.
"""
class_repo = self._get_class_repo(namespace)
superclass_name... | python | {
"resource": ""
} |
q244899 | FakedWBEMConnection._get_subclass_names | train | def _get_subclass_names(self, classname, namespace, deep_inheritance):
"""
Get class names that are subclasses of the
classname input parameter from the repository.
If DeepInheritance is False, get only classes in the
repository for the defined namespace for whic... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.