_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 31 13.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q244900 | FakedWBEMConnection._get_class | train | def _get_class(self, classname, namespace, local_only=None,
include_qualifiers=None, include_classorigin=None,
property_list=None):
# pylint: disable=invalid-name
"""
Get class from repository. Gets the class defined by classname
from the repository... | python | {
"resource": ""
} |
q244901 | FakedWBEMConnection._get_association_classes | train | def _get_association_classes(self, namespace):
"""
Return iterator of associator classes from the class repo
Returns the classes that have associations qualifier.
Does NOT copy so these are what is in repository. User functions
| python | {
"resource": ""
} |
q244902 | FakedWBEMConnection._find_instance | train | def _find_instance(iname, instance_repo):
"""
Find an instance in the instance repo by iname and return the
index of that instance.
Parameters:
iname: CIMInstancename to find
instance_repo: the instance repo to search
Return (None, None if not found. Other... | python | {
"resource": ""
} |
q244903 | FakedWBEMConnection._get_instance | train | def _get_instance(self, iname, namespace, property_list, local_only,
include_class_origin, include_qualifiers):
"""
Local method implements getinstance. This is generally used by
other instance methods that need to get an instance from the
repository.
It at... | python | {
"resource": ""
} |
q244904 | FakedWBEMConnection._get_subclass_list_for_enums | train | def _get_subclass_list_for_enums(self, classname, namespace):
""" Get class list (i.e names of subclasses for classname for the
enumerateinstance methods. If conn.lite returns only classname but
no subclasses.
Returns NocaseDict where only the keys are important, This allows... | python | {
"resource": ""
} |
q244905 | FakedWBEMConnection._filter_properties | train | def _filter_properties(obj, property_list):
"""
Remove properties from an instance or class that aren't in the
plist parameter
obj(:class:`~pywbem.CIMClass` or :class:`~pywbem.CIMInstance):
The class or instance from which properties are to be filtered
property_list... | python | {
"resource": ""
} |
q244906 | FakedWBEMConnection._appendpath_unique | train | def _appendpath_unique(list_, path):
"""Append path to list if not already in list"""
for p in list_:
| python | {
"resource": ""
} |
q244907 | FakedWBEMConnection._return_assoc_tuple | train | def _return_assoc_tuple(self, objects):
"""
Create the property tuple for _imethod return of references,
referencenames, associators, and associatornames methods.
This is different than the get/enum imethod return tuples. It creates an
OBJECTPATH for each object in the return li... | python | {
"resource": ""
} |
q244908 | FakedWBEMConnection._return_assoc_class_tuples | train | def _return_assoc_class_tuples(self, rtn_classnames, namespace, iq, ico,
pl):
"""
Creates the correct tuples of for associator and references class
level responses from a list of classnames. This is special because
the class level references and associ... | python | {
"resource": ""
} |
q244909 | FakedWBEMConnection._classnamedict | train | def _classnamedict(self, classname, namespace):
"""Get from _classnamelist and cvt to NocaseDict"""
clns = self._classnamelist(classname, namespace)
rtn_dict | python | {
"resource": ""
} |
q244910 | FakedWBEMConnection._ref_prop_matches | train | def _ref_prop_matches(prop, target_classname, ref_classname,
resultclass_names, role):
"""
Test filters for a reference property
Returns `True` if matches the criteria.
Returns `False` if it does not match.
The match criteria are:
- target_cl... | python | {
"resource": ""
} |
q244911 | FakedWBEMConnection._assoc_prop_matches | train | def _assoc_prop_matches(prop, ref_classname,
assoc_classes, result_classes, result_role):
"""
Test filters of a reference property and its associated entity
Returns `True` if matches the criteria. Returns `False` if it does not
match.
| python | {
"resource": ""
} |
q244912 | FakedWBEMConnection._get_reference_classnames | train | def _get_reference_classnames(self, classname, namespace,
resultclass_name, role):
"""
Get list of classnames that are references for which this classname
is a target filtered by the result_class and role parameters if they
are none.
This is a co... | python | {
"resource": ""
} |
q244913 | FakedWBEMConnection._get_associated_classnames | train | def _get_associated_classnames(self, classname, namespace, assoc_class,
result_class, result_role, role):
"""
Get list of classnames that are associated classes for which this
classname is a target filtered by the assoc_class, role, result_class,
and re... | python | {
"resource": ""
} |
q244914 | FakedWBEMConnection._make_pull_imethod_resp | train | def _make_pull_imethod_resp(objs, eos, context_id):
"""
Create the correct imethod response for the open and pull methods
| python | {
"resource": ""
} |
q244915 | FakedWBEMConnection._open_response | train | def _open_response(self, objects, namespace, pull_type, **params):
"""
Build an open... response once the objects have been extracted from
the repository.
"""
max_obj_cnt = params['MaxObjectCount']
if max_obj_cnt is None:
max_obj_cnt = _DEFAULT_MAX_OBJECT_COUN... | python | {
"resource": ""
} |
q244916 | FakedWBEMConnection._pull_response | train | def _pull_response(self, namespace, req_type, **params):
"""
Common method for all of the Pull methods. Since all of the pull
methods operate independent of the type of data, this single function
severs as common code
This method validates the namespace, gets data on the enumera... | python | {
"resource": ""
} |
q244917 | FakedWBEMConnection._validate_open_params | train | def _validate_open_params(**params):
"""
Validate the fql parameters and if invalid, generate exception
"""
if not params['FilterQueryLanguage'] and params['FilterQuery']:
raise CIMError(
CIM_ERR_INVALID_PARAMETER,
"FilterQuery without FilterQu... | python | {
"resource": ""
} |
q244918 | FakedWBEMConnection._fake_openassociatorinstances | train | def _fake_openassociatorinstances(self, namespace, **params):
"""
Implements WBEM server responder for
WBEMConnection.OpenAssociatorInstances
with data from the instance repository.
"""
self._validate_namespace(namespace)
self._validate_open_params(**params)
... | python | {
"resource": ""
} |
q244919 | ListenerRequestHandler.send_http_error | train | def send_http_error(self, http_code, cim_error=None,
cim_error_details=None, headers=None):
"""
Send an HTTP response back to the WBEM server that indicates
an error at the HTTP level.
"""
self.send_response(http_code, http_client.responses.get(http_code, ... | python | {
"resource": ""
} |
q244920 | ListenerRequestHandler.send_error_response | train | def send_error_response(self, msgid, methodname, status_code, status_desc,
error_insts=None):
"""Send a CIM-XML response message back to the WBEM server that
indicates error."""
resp_xml = cim_xml.CIM(
cim_xml.MESSAGE(
cim_xml.SIMPLEEXPRSP... | python | {
"resource": ""
} |
q244921 | ListenerRequestHandler.send_success_response | train | def send_success_response(self, msgid, methodname):
"""Send a CIM-XML response message back to the WBEM server that
indicates success."""
resp_xml = cim_xml.CIM(
cim_xml.MESSAGE(
cim_xml.SIMPLEEXPRSP(
cim_xml.EXPMETHODRESPONSE(
... | python | {
"resource": ""
} |
q244922 | ListenerRequestHandler.log | train | def log(self, format_, args, level=logging.INFO):
"""
This function is called for anything that needs to get logged.
It logs to the logger of this listener.
It is not defined in the standard handler class; our version
has an additional `level` argument that allows to control the... | python | {
"resource": ""
} |
q244923 | WBEMListener.start | train | def start(self):
"""
Start the WBEM listener threads, if they are not yet running.
A thread serving CIM-XML over HTTP is started if an HTTP port was
specified for the listener.
A thread serving CIM-XML over HTTPS is started if an HTTPS
port was specified for the listener... | python | {
"resource": ""
} |
q244924 | WBEMListener.stop | train | def stop(self):
"""
Stop the WBEM listener threads, if they are running.
"""
# Stopping the server will cause its `serve_forever()` method
# to return, which will cause the server thread to terminate.
# TODO: Describe how the processing threads terminate.
| python | {
"resource": ""
} |
q244925 | WBEMListener.deliver_indication | train | def deliver_indication(self, indication, host):
"""
This function is called by the listener threads for each received
indication. It is not supposed to be called by the user.
It delivers the indication to all callback functions that have been
added to the listener.
If a... | python | {
"resource": ""
} |
q244926 | WBEMListener.add_callback | train | def add_callback(self, callback):
"""
Add a callback function to the listener.
The callback function will be called for each indication this listener
receives from any WBEM server.
If the callback function is already known to the listener, it will not
be added.
... | python | {
"resource": ""
} |
q244927 | cmpname | train | def cmpname(name1, name2):
"""
Compare two CIM names for equality and ordering.
The comparison is performed case-insensitively.
One or both of the items may be `None`, and `None` is considered the lowest
possible value.
The implementation delegates to the '==' and '<' operators of the
nam... | python | {
"resource": ""
} |
q244928 | _qualifiers_tomof | train | def _qualifiers_tomof(qualifiers, indent, maxline=MAX_MOF_LINE):
"""
Return a MOF string with the qualifier values, including the surrounding
square brackets. The qualifiers are ordered by their name.
Return empty string if no qualifiers.
Normally multiline output and may fold qualifiers into mult... | python | {
"resource": ""
} |
q244929 | _mof_escaped | train | def _mof_escaped(strvalue):
# Note: This is a raw docstring because it shows many backslashes, and
# that avoids having to double them.
r"""
Return a MOF-escaped string from the input string.
Parameters:
strvalue (:term:`unicode string`): The string value. Must not be `None`.
Special... | python | {
"resource": ""
} |
q244930 | _scalar_value_tomof | train | def _scalar_value_tomof(
value, type, indent=0, maxline=MAX_MOF_LINE, line_pos=0, end_space=0,
avoid_splits=False):
# pylint: disable=line-too-long,redefined-builtin
"""
Return a MOF string representing a scalar CIM-typed value.
`None` is returned as 'NULL'.
Parameters:
valu... | python | {
"resource": ""
} |
q244931 | _infer_type | train | def _infer_type(value, element_kind, element_name):
"""
Infer the CIM type name of the value, based upon its Python type.
"""
if value is None:
raise ValueError(
_format("Cannot infer CIM type of {0} {1!A} from its value when "
"the value is None", element_kind, ... | python | {
"resource": ""
} |
q244932 | _check_array_parms | train | def _check_array_parms(is_array, array_size, value, element_kind,
element_name):
# pylint: disable=unused-argument
# The array_size argument is unused.
"""
Check whether array-related parameters are ok.
"""
# The following case has been disabled because it cannot happen g... | python | {
"resource": ""
} |
q244933 | _check_embedded_object | train | def _check_embedded_object(embedded_object, type, value, element_kind,
element_name):
# pylint: disable=redefined-builtin
"""
Check whether embedded-object-related parameters are ok.
"""
if embedded_object not in ('instance', 'object'):
raise ValueError(
... | python | {
"resource": ""
} |
q244934 | CIMInstanceName._kbstr_to_cimval | train | def _kbstr_to_cimval(key, val):
"""
Convert a keybinding value string as found in a WBEM URI into a
CIM object or CIM data type, and return it.
"""
if val[0] == '"' and val[-1] == '"':
# A double quoted key value. This could be any of these CIM types:
# *... | python | {
"resource": ""
} |
q244935 | CIMInstance.update | train | def update(self, *args, **kwargs):
"""
Update the properties of this CIM instance.
Existing properties will be updated, and new properties will be added.
Parameters:
*args (list):
Properties for updating the properties of the instance, specified
as... | python | {
"resource": ""
} |
q244936 | CIMInstance.update_existing | train | def update_existing(self, *args, **kwargs):
"""
Update already existing properties of this CIM instance.
Existing properties will be updated, and new properties will be
ignored without further notice.
Parameters:
*args (list):
Properties for updating th... | python | {
"resource": ""
} |
q244937 | CIMInstance.get | train | def get(self, key, default=None):
"""
Return the value of a particular property of this CIM instance,
or a default value.
*New in pywbem 0.8.*
Parameters:
key (:term:`string`):
Name of the property (in any lexical case).
| python | {
"resource": ""
} |
q244938 | CIMInstance.items | train | def items(self):
"""
Return a copied list of the property names and values
of this CIM instance.
Each item in the returned list is | python | {
"resource": ""
} |
q244939 | CIMInstance.iteritems | train | def iteritems(self):
"""
Iterate through the property names and values of this CIM instance.
Each iteration item is a tuple of the property | python | {
"resource": ""
} |
q244940 | CIMInstance.tomof | train | def tomof(self, indent=0, maxline=MAX_MOF_LINE):
"""
Return a MOF string with the specification of this CIM instance.
The returned MOF string conforms to the ``instanceDeclaration``
ABNF rule defined in :term:`DSP0004`, with the following limitations:
* Pywbem does not support ... | python | {
"resource": ""
} |
q244941 | CIMClass.tomof | train | def tomof(self, maxline=MAX_MOF_LINE):
"""
Return a MOF string with the declaration of this CIM class.
The returned MOF string conforms to the ``classDeclaration``
ABNF rule defined in :term:`DSP0004`.
The order of properties, methods, parameters, and qualifiers is
pres... | python | {
"resource": ""
} |
q244942 | CIMProperty.tomof | train | def tomof(
self, is_instance=True, indent=0, maxline=MAX_MOF_LINE, line_pos=0):
"""
Return a MOF string with the declaration of this CIM property for use
in a CIM class, or the specification of this CIM property for use in a
CIM instance.
*New in pywbem 0.9.*
... | python | {
"resource": ""
} |
q244943 | CIMMethod.tomof | train | def tomof(self, indent=0, maxline=MAX_MOF_LINE):
"""
Return a MOF string with the declaration of this CIM method for use in
a CIM class declaration.
The order of parameters and qualifiers is preserved.
Parameters:
indent (:term:`integer`): Number of spaces to indent ... | python | {
"resource": ""
} |
q244944 | CIMParameter.tomof | train | def tomof(self, indent=0, maxline=MAX_MOF_LINE):
"""
Return a MOF string with the declaration of this CIM parameter for use
in a CIM method declaration.
The object is always interpreted as a parameter declaration; so the
:attr:`~pywbem.CIMParameter.value` and
:attr:`~pyw... | python | {
"resource": ""
} |
q244945 | CIMQualifier.tomof | train | def tomof(self, indent=MOF_INDENT, maxline=MAX_MOF_LINE, line_pos=0):
"""
Return a MOF string with the specification of this CIM qualifier
as a qualifier value.
The items of array values are tried to keep on the same line. If the
generated line would exceed the maximum MOF line ... | python | {
"resource": ""
} |
q244946 | CIMQualifierDeclaration.tomof | train | def tomof(self, maxline=MAX_MOF_LINE):
"""
Return a MOF string with the declaration of this CIM qualifier type.
The returned MOF string conforms to the ``qualifierDeclaration``
ABNF rule defined in :term:`DSP0004`.
Qualifier flavors are included in the returned MOF string only ... | python | {
"resource": ""
} |
q244947 | main | train | def main():
"""Main function calls the test functs"""
print("Python version %s" % sys.version)
print("Testing compatibility for function defined with *args")
test_func_args(func_old_args)
test_func_args(func_new)
print("Testing compatibility for function defined with **kwargs")
| python | {
"resource": ""
} |
q244948 | ResolverMixin._validate_qualifiers | train | def _validate_qualifiers(qualifier_list, qual_repo, new_class, scope):
"""
Validate a list of qualifiers against the Qualifier decl in the
repository.
1. Whether it is declared (can be obtained from the declContext).
2. Whether it has the same type as the declaration.
3.... | python | {
"resource": ""
} |
q244949 | ResolverMixin._init_qualifier | train | def _init_qualifier(qualifier, qual_repo):
"""
Initialize the flavors of a qualifier from the qualifier repo and
initialize propagated.
"""
qual_dict_entry = qual_repo[qualifier.name]
qualifier.propagated = False
if qualifier.tosubclass is None:
if qua... | python | {
"resource": ""
} |
q244950 | ResolverMixin._init_qualifier_decl | train | def _init_qualifier_decl(qualifier_decl, qual_repo):
"""
Initialize the flavors of a qualifier declaration if they are not
already set.
"""
assert qualifier_decl.name not in qual_repo
if qualifier_decl.tosubclass is None:
qualifier_decl.tosubclass = True
| python | {
"resource": ""
} |
q244951 | ResolverMixin._set_new_object | train | def _set_new_object(self, new_obj, inherited_obj, new_class, superclass,
qualifier_repo, propagated, type_str):
"""
Set the object attributes for a single object and resolve the
qualifiers. This sets attributes for Properties, Methods, and
Parameters.
"""
... | python | {
"resource": ""
} |
q244952 | ResolverMixin._resolve_qualifiers | train | def _resolve_qualifiers(self, new_quals, inherited_quals, new_class,
super_class, obj_name, obj_type, qualifier_repo,
propagate=False, verbose=False):
"""
Process the override of qualifiers from the inherited_quals dictionary
to the new_qua... | python | {
"resource": ""
} |
q244953 | _validateIterCommonParams | train | def _validateIterCommonParams(MaxObjectCount, OperationTimeout):
"""
Validate common parameters for an iter... operation.
MaxObjectCount must be a positive non-zero integer or None.
OperationTimeout must be positive integer or zero
Raises:
ValueError: if these parameters are invalid
""... | python | {
"resource": ""
} |
q244954 | _validatePullParams | train | def _validatePullParams(MaxObjectCount, context):
"""
Validate the input paramaters for the PullInstances,
PullInstancesWithPath, and PullInstancePaths requests.
MaxObjectCount: Must be integer type and ge 0
context: Must be not None and length ge 2
| python | {
"resource": ""
} |
q244955 | is_subclass | train | def is_subclass(ch, ns, super_class, sub):
"""Determine if one class is a subclass of another class.
Parameters:
ch:
A CIMOMHandle. Either a pycimmb.CIMOMHandle or a
:class:`~pywbem.WBEMConnection` object.
ns (:term:`string`):
Namespace (case independent).
super_cl... | python | {
"resource": ""
} |
q244956 | WBEMConnection._set_default_namespace | train | def _set_default_namespace(self, default_namespace):
"""Internal setter function."""
if default_namespace is not None:
default_namespace = default_namespace.strip('/')
else:
| python | {
"resource": ""
} |
q244957 | WBEMConnection._configure_detail_level | train | def _configure_detail_level(cls, detail_level):
"""
Validate the `detail_level` parameter and return it.
This accepts a string or integer for `detail_level`.
"""
# process detail_level
if isinstance(detail_level, six.string_types):
if detail_level not in LOG_... | python | {
"resource": ""
} |
q244958 | WBEMConnection._configure_logger_handler | train | def _configure_logger_handler(cls, log_dest, log_filename):
"""
Return a logging handler for the specified `log_dest`, or `None` if
`log_dest` is `None`.
"""
if log_dest is None:
return None
msg_format = '%(asctime)s-%(name)s-%(message)s'
if log_des... | python | {
"resource": ""
} |
q244959 | WBEMConnection._activate_logger | train | def _activate_logger(cls, logger_name, simple_name, detail_level, handler,
connection, propagate):
"""
Configure the specified logger, and activate logging and set detail
level for connections.
The specified logger is always a single pywbem logger; the simple
... | python | {
"resource": ""
} |
q244960 | WBEMConnection._iparam_namespace_from_namespace | train | def _iparam_namespace_from_namespace(self, obj):
# pylint: disable=invalid-name,
"""
Determine the namespace from a namespace string, or `None`. The
default namespace of the connection object is used, if needed.
Return the so determined namespace for use as an argument to
... | python | {
"resource": ""
} |
q244961 | WBEMConnection._iparam_namespace_from_objectname | train | def _iparam_namespace_from_objectname(self, objectname, arg_name):
# pylint: disable=invalid-name,
"""
Determine the namespace from an object name, that can be a class
name string, a CIMClassName or CIMInstanceName object, or `None`.
The default namespace of the connection object... | python | {
"resource": ""
} |
q244962 | WBEMConnection._get_rslt_params | train | def _get_rslt_params(self, result, namespace):
"""
Common processing for pull results to separate end-of-sequence,
enum-context, and entities in IRETURNVALUE.
Returns tuple of entities in IRETURNVALUE, end_of_sequence,
and enumeration_context)
"""
rtn_objects = [... | python | {
"resource": ""
} |
q244963 | WBEMConnection.GetInstance | train | def GetInstance(self, InstanceName, LocalOnly=None, IncludeQualifiers=None,
IncludeClassOrigin=None, PropertyList=None, **extra):
# pylint: disable=invalid-name,line-too-long
"""
Retrieve an instance.
This method performs the GetInstance operation
(see :term:... | python | {
"resource": ""
} |
q244964 | WBEMConnection.ModifyInstance | train | def ModifyInstance(self, ModifiedInstance, IncludeQualifiers=None,
PropertyList=None, **extra):
# pylint: disable=invalid-name,line-too-long
"""
Modify the property values of an instance.
This method performs the ModifyInstance operation
(see :term:`DSP020... | python | {
"resource": ""
} |
q244965 | WBEMConnection.CreateInstance | train | def CreateInstance(self, NewInstance, namespace=None, **extra):
# pylint: disable=invalid-name
"""
Create an instance in a namespace.
This method performs the CreateInstance operation
(see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all
methods performing ... | python | {
"resource": ""
} |
q244966 | WBEMConnection.Associators | train | def Associators(self, ObjectName, AssocClass=None, ResultClass=None,
Role=None, ResultRole=None, IncludeQualifiers=None,
IncludeClassOrigin=None, PropertyList=None, **extra):
# pylint: disable=invalid-name, line-too-long
"""
Retrieve the instances associat... | python | {
"resource": ""
} |
q244967 | WBEMConnection.InvokeMethod | train | def InvokeMethod(self, MethodName, ObjectName, Params=None, **params):
# pylint: disable=invalid-name
"""
Invoke a method on a target instance or on a target class.
The methods that can be invoked are static and non-static methods
defined in a class (also known as *extrinsic* me... | python | {
"resource": ""
} |
q244968 | WBEMConnection.ExecQuery | train | def ExecQuery(self, QueryLanguage, Query, namespace=None, **extra):
# pylint: disable=invalid-name
"""
Execute a query in a namespace.
This method performs the ExecQuery operation
(see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all
methods performing such... | python | {
"resource": ""
} |
q244969 | WBEMConnection.OpenAssociatorInstancePaths | train | def OpenAssociatorInstancePaths(self, InstanceName, AssocClass=None,
ResultClass=None, Role=None,
ResultRole=None,
FilterQueryLanguage=None, FilterQuery=None,
OperationTimeout=... | python | {
"resource": ""
} |
q244970 | WBEMConnection.OpenQueryInstances | train | def OpenQueryInstances(self, FilterQueryLanguage, FilterQuery,
namespace=None, ReturnQueryResultClass=None,
OperationTimeout=None, ContinueOnError=None,
MaxObjectCount=None, **extra):
# pylint: disable=invalid-name
"""
... | python | {
"resource": ""
} |
q244971 | WBEMConnection.EnumerateClasses | train | def EnumerateClasses(self, namespace=None, ClassName=None,
DeepInheritance=None, LocalOnly=None,
IncludeQualifiers=None, IncludeClassOrigin=None,
**extra):
# pylint: disable=invalid-name,line-too-long
"""
Enumerate the su... | python | {
"resource": ""
} |
q244972 | WBEMConnection.EnumerateClassNames | train | def EnumerateClassNames(self, namespace=None, ClassName=None,
DeepInheritance=None, **extra):
# pylint: disable=invalid-name,line-too-long
"""
Enumerate the names of subclasses of a class, or of the top-level
classes in a namespace.
This method perfor... | python | {
"resource": ""
} |
q244973 | WBEMConnection.ModifyClass | train | def ModifyClass(self, ModifiedClass, namespace=None, **extra):
# pylint: disable=invalid-name
"""
Modify a class.
This method performs the ModifyClass operation
(see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all
methods performing such operations.
... | python | {
"resource": ""
} |
q244974 | WBEMConnection.DeleteClass | train | def DeleteClass(self, ClassName, namespace=None, **extra):
# pylint: disable=invalid-name,line-too-long
"""
Delete a class.
This method performs the DeleteClass operation
(see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all
methods performing such operatio... | python | {
"resource": ""
} |
q244975 | WBEMClient.connectionMade | train | def connectionMade(self):
"""Send a HTTP POST command with the appropriate CIM over HTTP
headers and payload."""
self.factory.request_xml = str(self.factory.payload)
self.sendCommand('POST', '/cimom')
self.sendHeader('Host', '%s:%d' %
(self.transport.ad... | python | {
"resource": ""
} |
q244976 | WBEMClient.handleResponse | train | def handleResponse(self, data):
"""Called when all response data has been received."""
self.factory.response_xml = data
if self.status == '200':
| python | {
"resource": ""
} |
q244977 | WBEMClient.handleStatus | train | def handleStatus(self, version, status, message):
"""Save the status code for processing | python | {
"resource": ""
} |
q244978 | WBEMClient.handleHeader | train | def handleHeader(self, key, value):
"""Handle header values."""
if key == 'CIMError':
self.CIMError = urllib.parse.unquote(value)
| python | {
"resource": ""
} |
q244979 | WBEMClient.handleEndHeaders | train | def handleEndHeaders(self):
"""Check whether the status was OK and raise an error if not
using previously saved header information."""
if self.status != '200':
if not hasattr(self, 'cimerror') or \
not hasattr(self, 'errordetail'):
self.factory.defer... | python | {
"resource": ""
} |
q244980 | WBEMClientFactory.imethodcallPayload | train | def imethodcallPayload(self, methodname, localnsp, **kwargs):
"""Generate the XML payload for an intrinsic methodcall."""
param_list = [pywbem.IPARAMVALUE(x[0], pywbem.tocimxml(x[1]))
for x in kwargs.items()]
payload = cim_xml.CIM(
cim_xml.MESSAGE(
... | python | {
"resource": ""
} |
q244981 | WBEMClientFactory.methodcallPayload | train | def methodcallPayload(self, methodname, obj, namespace, **kwargs):
"""Generate the XML payload for an extrinsic methodcall."""
if isinstance(obj, CIMInstanceName):
path = obj.copy()
path.host = None
path.namespace = None
localpath = cim_xml.LOCALINSTAN... | python | {
"resource": ""
} |
q244982 | WBEMClientFactory.parseErrorAndResponse | train | def parseErrorAndResponse(self, data):
"""Parse returned XML for errors, then convert into
appropriate Python objects."""
xml = fromstring(data)
error = xml.find('.//ERROR')
| python | {
"resource": ""
} |
q244983 | CIMListener.start | train | def start(self):
''' doesn't work'''
| python | {
"resource": ""
} |
q244984 | CIMProvider2.MI_associatorNames | train | def MI_associatorNames(self,
env,
objectName,
assocClassName,
resultClassName,
role,
resultRole):
# pylint: disable=invalid-name
"""Return ins... | python | {
"resource": ""
} |
q244985 | ProviderProxy._get_callable | train | def _get_callable(self, classname, cname):
"""Return a function or method object appropriate to fulfill a request
classname -- The CIM class name associated with the request.
cname -- The function or method name to look for.
"""
callable = None
if classname in self.pro... | python | {
"resource": ""
} |
q244986 | ProviderProxy._reload_if_necessary | train | def _reload_if_necessary(self, env):
"""Check timestamp of loaded python provider module, and if it has
changed since load, then reload the provider module.
"""
try:
mod = sys.modules[self.provider_module_name]
except KeyError:
mod = None
if (mod i... | python | {
"resource": ""
} |
q244987 | NocaseDict._real_key | train | def _real_key(self, key):
"""
Return the normalized key to be used for the internal dictionary,
from the input key.
"""
if key is not None:
try:
return key.lower()
except AttributeError:
raise TypeError(
... | python | {
"resource": ""
} |
q244988 | NocaseDict.copy | train | def copy(self):
"""
Return a copy of the dictionary.
This is a middle-deep copy; the copy is independent of the original in
all attributes that have mutable types except for:
* The values in the dictionary
Note that the Python functions :func:`py:copy.copy` and
... | python | {
"resource": ""
} |
q244989 | t_error | train | def t_error(t):
""" Lexer error callback from PLY Lexer with token in error.
"""
msg = | python | {
"resource": ""
} |
q244990 | p_error | train | def p_error(p):
"""
YACC Error Callback from the parser. The parameter is the token
in error and contains information on the file and position of the
error. If p is `None`, PLY is returning eof error.
"""
if p is None:
| python | {
"resource": ""
} |
q244991 | _fixStringValue | train | def _fixStringValue(s, p):
"""Clean up string value including special characters, etc."""
# pylint: disable=too-many-branches
s = s[1:-1]
rv = ''
esc = False
i = -1
while i < len(s) - 1:
i += 1
ch = s[i]
if ch == '\\' and not esc:
esc = True
c... | python | {
"resource": ""
} |
q244992 | _build_flavors | train | def _build_flavors(p, flist, qualdecl=None):
"""
Build and return a dictionary defining the flavors from the
flist argument.
This function maps from the input keyword definitions for the flavors
(ex. EnableOverride) to the PyWBEM internal definitions
(ex. overridable)
... | python | {
"resource": ""
} |
q244993 | _find_column | train | def _find_column(input_, token):
"""
Find the column in file where error occured. This is taken from
token.lexpos converted to the position on the current line by
finding the previous EOL.
"""
i = token.lexpos
while i | python | {
"resource": ""
} |
q244994 | _get_error_context | train | def _get_error_context(input_, token):
"""
Build a context string that defines where on the line the defined
error occurs. This consists of the characters ^ at the position
and for the length defined by the lexer position and token length
"""
try:
line = input_[token.lexpos... | python | {
"resource": ""
} |
q244995 | _build | train | def _build(verbose=False):
"""Build the LEX and YACC table modules for the MOF compiler, if they do
not exist yet, or if their table versions do not match the installed
version of the `ply` package.
"""
if verbose:
print(
| python | {
"resource": ""
} |
q244996 | _yacc | train | def _yacc(verbose=False):
"""Return YACC parser object for the MOF compiler.
As a side effect, the YACC table module for the MOF compiler gets created
if it does not exist yet, or updated if its table version does not match
the installed version of the `ply` package.
"""
# In yacc(), the 'debu... | python | {
"resource": ""
} |
q244997 | _lex | train | def _lex(verbose=False):
"""Return LEX analyzer object for the MOF Compiler.
As a side effect, the LEX table module for the MOF compiler gets created
if it does not exist yet, or updated if its table version does not match
the installed version of the `ply` package.
To debug lex you may set debug=... | python | {
"resource": ""
} |
q244998 | MOFWBEMConnection._setns | train | def _setns(self, value):
"""
Set the default repository namespace to be used.
This method exists for compatibility. Use the :attr:`default_namespace` | python | {
"resource": ""
} |
q244999 | MOFWBEMConnection.CreateInstance | train | def CreateInstance(self, *args, **kwargs):
"""Create a CIM instance in the local repository of this class.
For a description of the parameters, see
:meth:`pywbem.WBEMConnection.CreateInstance`.
"""
inst = args[0] if args else kwargs['NewInstance']
try:
| python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.