repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
listlengths
20
707
docstring
stringlengths
3
17.3k
docstring_tokens
listlengths
3
222
sha
stringlengths
40
40
url
stringlengths
87
242
partition
stringclasses
1 value
idx
int64
0
252k
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection._iparam_namespace_from_namespace
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
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 ...
[ "def", "_iparam_namespace_from_namespace", "(", "self", ",", "obj", ")", ":", "# pylint: disable=invalid-name,", "if", "isinstance", "(", "obj", ",", "six", ".", "string_types", ")", ":", "namespace", "=", "obj", ".", "strip", "(", "'/'", ")", "elif", "obj", ...
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 imethodcall().
[ "Determine", "the", "namespace", "from", "a", "namespace", "string", "or", "None", ".", "The", "default", "namespace", "of", "the", "connection", "object", "is", "used", "if", "needed", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L2134-L2156
train
28,400
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection._iparam_namespace_from_objectname
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
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...
[ "def", "_iparam_namespace_from_objectname", "(", "self", ",", "objectname", ",", "arg_name", ")", ":", "# pylint: disable=invalid-name,", "if", "isinstance", "(", "objectname", ",", "(", "CIMClassName", ",", "CIMInstanceName", ")", ")", ":", "namespace", "=", "objec...
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 is used, if needed. Return the so determined namespace for use as an argument to imethodcall().
[ "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",...
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L2158-L2183
train
28,401
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection._get_rslt_params
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
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 = [...
[ "def", "_get_rslt_params", "(", "self", ",", "result", ",", "namespace", ")", ":", "rtn_objects", "=", "[", "]", "end_of_sequence", "=", "False", "enumeration_context", "=", "None", "end_of_sequence_found", "=", "False", "# flag True if found and valid value", "enumer...
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)
[ "Common", "processing", "for", "pull", "results", "to", "separate", "end", "-", "of", "-", "sequence", "enum", "-", "context", "and", "entities", "in", "IRETURNVALUE", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L2253-L2303
train
28,402
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.GetInstance
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
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:...
[ "def", "GetInstance", "(", "self", ",", "InstanceName", ",", "LocalOnly", "=", "None", ",", "IncludeQualifiers", "=", "None", ",", "IncludeClassOrigin", "=", "None", ",", "PropertyList", "=", "None", ",", "*", "*", "extra", ")", ":", "# pylint: disable=invalid...
Retrieve an instance. This method performs the GetInstance operation (see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all methods performing such operations. If the operation succeeds, this method returns. Otherwise, this method raises an exception. Para...
[ "Retrieve", "an", "instance", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L2620-L2791
train
28,403
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.ModifyInstance
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
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...
[ "def", "ModifyInstance", "(", "self", ",", "ModifiedInstance", ",", "IncludeQualifiers", "=", "None", ",", "PropertyList", "=", "None", ",", "*", "*", "extra", ")", ":", "# pylint: disable=invalid-name,line-too-long", "# noqa: E501", "exc", "=", "None", "method_name...
Modify the property values of an instance. This method performs the ModifyInstance operation (see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all methods performing such operations. The `PropertyList` parameter determines the set of properties that are designated...
[ "Modify", "the", "property", "values", "of", "an", "instance", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L2793-L2984
train
28,404
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.CreateInstance
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
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 ...
[ "def", "CreateInstance", "(", "self", ",", "NewInstance", ",", "namespace", "=", "None", ",", "*", "*", "extra", ")", ":", "# pylint: disable=invalid-name", "exc", "=", "None", "instancename", "=", "None", "method_name", "=", "'CreateInstance'", "if", "self", ...
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 such operations. If the operation succeeds, this method returns. Otherwise, this method raises an exceptio...
[ "Create", "an", "instance", "in", "a", "namespace", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L2986-L3126
train
28,405
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.Associators
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
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...
[ "def", "Associators", "(", "self", ",", "ObjectName", ",", "AssocClass", "=", "None", ",", "ResultClass", "=", "None", ",", "Role", "=", "None", ",", "ResultRole", "=", "None", ",", "IncludeQualifiers", "=", "None", ",", "IncludeClassOrigin", "=", "None", ...
Retrieve the instances associated to a source instance, or the classes associated to a source class. This method performs the Associators operation (see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all methods performing such operations. If the operation succeeds,...
[ "Retrieve", "the", "instances", "associated", "to", "a", "source", "instance", "or", "the", "classes", "associated", "to", "a", "source", "class", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L3199-L3436
train
28,406
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.InvokeMethod
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
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...
[ "def", "InvokeMethod", "(", "self", ",", "MethodName", ",", "ObjectName", ",", "Params", "=", "None", ",", "*", "*", "params", ")", ":", "# pylint: disable=invalid-name", "exc", "=", "None", "result_tuple", "=", "None", "if", "self", ".", "_operation_recorders...
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* methods). Static methods can be invoked on instances and on classes. Non-static methods can be invoked only on insta...
[ "Invoke", "a", "method", "on", "a", "target", "instance", "or", "on", "a", "target", "class", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L3995-L4119
train
28,407
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.ExecQuery
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
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...
[ "def", "ExecQuery", "(", "self", ",", "QueryLanguage", ",", "Query", ",", "namespace", "=", "None", ",", "*", "*", "extra", ")", ":", "# pylint: disable=invalid-name", "exc", "=", "None", "instances", "=", "None", "method_name", "=", "'ExecQuery'", "if", "se...
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 operations. If the operation succeeds, this method returns. Otherwise, this method raises an exception. ...
[ "Execute", "a", "query", "in", "a", "namespace", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L4121-L4228
train
28,408
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.OpenAssociatorInstancePaths
def OpenAssociatorInstancePaths(self, InstanceName, AssocClass=None, ResultClass=None, Role=None, ResultRole=None, FilterQueryLanguage=None, FilterQuery=None, OperationTimeout=...
python
def OpenAssociatorInstancePaths(self, InstanceName, AssocClass=None, ResultClass=None, Role=None, ResultRole=None, FilterQueryLanguage=None, FilterQuery=None, OperationTimeout=...
[ "def", "OpenAssociatorInstancePaths", "(", "self", ",", "InstanceName", ",", "AssocClass", "=", "None", ",", "ResultClass", "=", "None", ",", "Role", "=", "None", ",", "ResultRole", "=", "None", ",", "FilterQueryLanguage", "=", "None", ",", "FilterQuery", "=",...
Open an enumeration session to retrieve the instance paths of the instances associated to a source instance. *New in pywbem 0.9.* This method does not support retrieving classes. This method performs the OpenAssociatorInstancePaths operation (see :term:`DSP0200`). See :ref:`WB...
[ "Open", "an", "enumeration", "session", "to", "retrieve", "the", "instance", "paths", "of", "the", "instances", "associated", "to", "a", "source", "instance", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L7142-L7384
train
28,409
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.OpenQueryInstances
def OpenQueryInstances(self, FilterQueryLanguage, FilterQuery, namespace=None, ReturnQueryResultClass=None, OperationTimeout=None, ContinueOnError=None, MaxObjectCount=None, **extra): # pylint: disable=invalid-name """ ...
python
def OpenQueryInstances(self, FilterQueryLanguage, FilterQuery, namespace=None, ReturnQueryResultClass=None, OperationTimeout=None, ContinueOnError=None, MaxObjectCount=None, **extra): # pylint: disable=invalid-name """ ...
[ "def", "OpenQueryInstances", "(", "self", ",", "FilterQueryLanguage", ",", "FilterQuery", ",", "namespace", "=", "None", ",", "ReturnQueryResultClass", "=", "None", ",", "OperationTimeout", "=", "None", ",", "ContinueOnError", "=", "None", ",", "MaxObjectCount", "...
Open an enumeration session to execute a query in a namespace and to retrieve the instances representing the query result. *New in pywbem 0.9.* This method performs the OpenQueryInstances operation (see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all methods perf...
[ "Open", "an", "enumeration", "session", "to", "execute", "a", "query", "in", "a", "namespace", "and", "to", "retrieve", "the", "instances", "representing", "the", "query", "result", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L7883-L8115
train
28,410
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.EnumerateClasses
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
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...
[ "def", "EnumerateClasses", "(", "self", ",", "namespace", "=", "None", ",", "ClassName", "=", "None", ",", "DeepInheritance", "=", "None", ",", "LocalOnly", "=", "None", ",", "IncludeQualifiers", "=", "None", ",", "IncludeClassOrigin", "=", "None", ",", "*",...
Enumerate the subclasses of a class, or the top-level classes in a namespace. This method performs the EnumerateClasses operation (see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all methods performing such operations. If the operation succeeds, this method retur...
[ "Enumerate", "the", "subclasses", "of", "a", "class", "or", "the", "top", "-", "level", "classes", "in", "a", "namespace", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L8662-L8835
train
28,411
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.EnumerateClassNames
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
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...
[ "def", "EnumerateClassNames", "(", "self", ",", "namespace", "=", "None", ",", "ClassName", "=", "None", ",", "DeepInheritance", "=", "None", ",", "*", "*", "extra", ")", ":", "# pylint: disable=invalid-name,line-too-long", "exc", "=", "None", "classnames", "=",...
Enumerate the names of subclasses of a class, or of the top-level classes in a namespace. This method performs the EnumerateClassNames operation (see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all methods performing such operations. If the operation succeeds, th...
[ "Enumerate", "the", "names", "of", "subclasses", "of", "a", "class", "or", "of", "the", "top", "-", "level", "classes", "in", "a", "namespace", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L8837-L8969
train
28,412
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.ModifyClass
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
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. ...
[ "def", "ModifyClass", "(", "self", ",", "ModifiedClass", ",", "namespace", "=", "None", ",", "*", "*", "extra", ")", ":", "# pylint: disable=invalid-name", "exc", "=", "None", "method_name", "=", "'ModifyClass'", "if", "self", ".", "_operation_recorders", ":", ...
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. If the operation succeeds, this method returns. Otherwise, this method raises an exception. Parameters...
[ "Modify", "a", "class", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L9136-L9220
train
28,413
pywbem/pywbem
pywbem/cim_operations.py
WBEMConnection.DeleteClass
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
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...
[ "def", "DeleteClass", "(", "self", ",", "ClassName", ",", "namespace", "=", "None", ",", "*", "*", "extra", ")", ":", "# pylint: disable=invalid-name,line-too-long", "exc", "=", "None", "method_name", "=", "'DeleteClass'", "if", "self", ".", "_operation_recorders"...
Delete a class. This method performs the DeleteClass operation (see :term:`DSP0200`). See :ref:`WBEM operations` for a list of all methods performing such operations. If the operation succeeds, this method returns. Otherwise, this method raises an exception. Parameters...
[ "Delete", "a", "class", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_operations.py#L9306-L9387
train
28,414
pywbem/pywbem
attic/twisted_client.py
WBEMClient.connectionMade
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
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...
[ "def", "connectionMade", "(", "self", ")", ":", "self", ".", "factory", ".", "request_xml", "=", "str", "(", "self", ".", "factory", ".", "payload", ")", "self", ".", "sendCommand", "(", "'POST'", ",", "'/cimom'", ")", "self", ".", "sendHeader", "(", "...
Send a HTTP POST command with the appropriate CIM over HTTP headers and payload.
[ "Send", "a", "HTTP", "POST", "command", "with", "the", "appropriate", "CIM", "over", "HTTP", "headers", "and", "payload", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/twisted_client.py#L58-L88
train
28,415
pywbem/pywbem
attic/twisted_client.py
WBEMClient.handleResponse
def handleResponse(self, data): """Called when all response data has been received.""" self.factory.response_xml = data if self.status == '200': self.factory.parseErrorAndResponse(data) self.factory.deferred = None self.transport.loseConnection()
python
def handleResponse(self, data): """Called when all response data has been received.""" self.factory.response_xml = data if self.status == '200': self.factory.parseErrorAndResponse(data) self.factory.deferred = None self.transport.loseConnection()
[ "def", "handleResponse", "(", "self", ",", "data", ")", ":", "self", ".", "factory", ".", "response_xml", "=", "data", "if", "self", ".", "status", "==", "'200'", ":", "self", ".", "factory", ".", "parseErrorAndResponse", "(", "data", ")", "self", ".", ...
Called when all response data has been received.
[ "Called", "when", "all", "response", "data", "has", "been", "received", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/twisted_client.py#L90-L99
train
28,416
pywbem/pywbem
attic/twisted_client.py
WBEMClient.handleStatus
def handleStatus(self, version, status, message): """Save the status code for processing when we get to the end of the headers.""" self.status = status self.message = message
python
def handleStatus(self, version, status, message): """Save the status code for processing when we get to the end of the headers.""" self.status = status self.message = message
[ "def", "handleStatus", "(", "self", ",", "version", ",", "status", ",", "message", ")", ":", "self", ".", "status", "=", "status", "self", ".", "message", "=", "message" ]
Save the status code for processing when we get to the end of the headers.
[ "Save", "the", "status", "code", "for", "processing", "when", "we", "get", "to", "the", "end", "of", "the", "headers", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/twisted_client.py#L101-L106
train
28,417
pywbem/pywbem
attic/twisted_client.py
WBEMClient.handleHeader
def handleHeader(self, key, value): """Handle header values.""" if key == 'CIMError': self.CIMError = urllib.parse.unquote(value) if key == 'PGErrorDetail': self.PGErrorDetail = urllib.parse.unquote(value)
python
def handleHeader(self, key, value): """Handle header values.""" if key == 'CIMError': self.CIMError = urllib.parse.unquote(value) if key == 'PGErrorDetail': self.PGErrorDetail = urllib.parse.unquote(value)
[ "def", "handleHeader", "(", "self", ",", "key", ",", "value", ")", ":", "if", "key", "==", "'CIMError'", ":", "self", ".", "CIMError", "=", "urllib", ".", "parse", ".", "unquote", "(", "value", ")", "if", "key", "==", "'PGErrorDetail'", ":", "self", ...
Handle header values.
[ "Handle", "header", "values", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/twisted_client.py#L108-L114
train
28,418
pywbem/pywbem
attic/twisted_client.py
WBEMClient.handleEndHeaders
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
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...
[ "def", "handleEndHeaders", "(", "self", ")", ":", "if", "self", ".", "status", "!=", "'200'", ":", "if", "not", "hasattr", "(", "self", ",", "'cimerror'", ")", "or", "not", "hasattr", "(", "self", ",", "'errordetail'", ")", ":", "self", ".", "factory",...
Check whether the status was OK and raise an error if not using previously saved header information.
[ "Check", "whether", "the", "status", "was", "OK", "and", "raise", "an", "error", "if", "not", "using", "previously", "saved", "header", "information", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/twisted_client.py#L116-L132
train
28,419
pywbem/pywbem
attic/twisted_client.py
WBEMClientFactory.imethodcallPayload
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
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( ...
[ "def", "imethodcallPayload", "(", "self", ",", "methodname", ",", "localnsp", ",", "*", "*", "kwargs", ")", ":", "param_list", "=", "[", "pywbem", ".", "IPARAMVALUE", "(", "x", "[", "0", "]", ",", "pywbem", ".", "tocimxml", "(", "x", "[", "1", "]", ...
Generate the XML payload for an intrinsic methodcall.
[ "Generate", "the", "XML", "payload", "for", "an", "intrinsic", "methodcall", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/twisted_client.py#L158-L176
train
28,420
pywbem/pywbem
attic/twisted_client.py
WBEMClientFactory.methodcallPayload
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
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...
[ "def", "methodcallPayload", "(", "self", ",", "methodname", ",", "obj", ",", "namespace", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "obj", ",", "CIMInstanceName", ")", ":", "path", "=", "obj", ".", "copy", "(", ")", "path", ".", "ho...
Generate the XML payload for an extrinsic methodcall.
[ "Generate", "the", "XML", "payload", "for", "an", "extrinsic", "methodcall", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/twisted_client.py#L178-L249
train
28,421
pywbem/pywbem
attic/twisted_client.py
WBEMClientFactory.parseErrorAndResponse
def parseErrorAndResponse(self, data): """Parse returned XML for errors, then convert into appropriate Python objects.""" xml = fromstring(data) error = xml.find('.//ERROR') if error is None: self.deferred.callback(self.parseResponse(xml)) return ...
python
def parseErrorAndResponse(self, data): """Parse returned XML for errors, then convert into appropriate Python objects.""" xml = fromstring(data) error = xml.find('.//ERROR') if error is None: self.deferred.callback(self.parseResponse(xml)) return ...
[ "def", "parseErrorAndResponse", "(", "self", ",", "data", ")", ":", "xml", "=", "fromstring", "(", "data", ")", "error", "=", "xml", ".", "find", "(", "'.//ERROR'", ")", "if", "error", "is", "None", ":", "self", ".", "deferred", ".", "callback", "(", ...
Parse returned XML for errors, then convert into appropriate Python objects.
[ "Parse", "returned", "XML", "for", "errors", "then", "convert", "into", "appropriate", "Python", "objects", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/twisted_client.py#L251-L267
train
28,422
pywbem/pywbem
attic/irecv/irecv.py
CIMListener.start
def start(self): ''' doesn't work''' thread = threading.Thread(target=reactor.run) thread.start()
python
def start(self): ''' doesn't work''' thread = threading.Thread(target=reactor.run) thread.start()
[ "def", "start", "(", "self", ")", ":", "thread", "=", "threading", ".", "Thread", "(", "target", "=", "reactor", ".", "run", ")", "thread", ".", "start", "(", ")" ]
doesn't work
[ "doesn", "t", "work" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/irecv/irecv.py#L57-L60
train
28,423
pywbem/pywbem
attic/cim_provider2.py
CIMProvider2.MI_associatorNames
def MI_associatorNames(self, env, objectName, assocClassName, resultClassName, role, resultRole): # pylint: disable=invalid-name """Return ins...
python
def MI_associatorNames(self, env, objectName, assocClassName, resultClassName, role, resultRole): # pylint: disable=invalid-name """Return ins...
[ "def", "MI_associatorNames", "(", "self", ",", "env", ",", "objectName", ",", "assocClassName", ",", "resultClassName", ",", "role", ",", "resultRole", ")", ":", "# pylint: disable=invalid-name", "logger", "=", "env", ".", "get_logger", "(", ")", "logger", ".", ...
Return instances names associated to a given object. Implements the WBEM operation AssociatorNames in terms of the references method. A derived class will not normally override this method.
[ "Return", "instances", "names", "associated", "to", "a", "given", "object", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/cim_provider2.py#L707-L761
train
28,424
pywbem/pywbem
attic/cim_provider2.py
ProviderProxy._get_callable
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
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...
[ "def", "_get_callable", "(", "self", ",", "classname", ",", "cname", ")", ":", "callable", "=", "None", "if", "classname", "in", "self", ".", "provregs", ":", "provClass", "=", "self", ".", "provregs", "[", "classname", "]", "if", "hasattr", "(", "provCl...
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.
[ "Return", "a", "function", "or", "method", "object", "appropriate", "to", "fulfill", "a", "request" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/cim_provider2.py#L1739-L1759
train
28,425
pywbem/pywbem
attic/cim_provider2.py
ProviderProxy._reload_if_necessary
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
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...
[ "def", "_reload_if_necessary", "(", "self", ",", "env", ")", ":", "try", ":", "mod", "=", "sys", ".", "modules", "[", "self", ".", "provider_module_name", "]", "except", "KeyError", ":", "mod", "=", "None", "if", "(", "mod", "is", "None", "or", "mod", ...
Check timestamp of loaded python provider module, and if it has changed since load, then reload the provider module.
[ "Check", "timestamp", "of", "loaded", "python", "provider", "module", "and", "if", "it", "has", "changed", "since", "load", "then", "reload", "the", "provider", "module", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/cim_provider2.py#L1761-L1788
train
28,426
pywbem/pywbem
pywbem/_nocasedict.py
NocaseDict._real_key
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
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( ...
[ "def", "_real_key", "(", "self", ",", "key", ")", ":", "if", "key", "is", "not", "None", ":", "try", ":", "return", "key", ".", "lower", "(", ")", "except", "AttributeError", ":", "raise", "TypeError", "(", "_format", "(", "\"NocaseDict key {0!A} must be a...
Return the normalized key to be used for the internal dictionary, from the input key.
[ "Return", "the", "normalized", "key", "to", "be", "used", "for", "the", "internal", "dictionary", "from", "the", "input", "key", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_nocasedict.py#L202-L220
train
28,427
pywbem/pywbem
pywbem/_nocasedict.py
NocaseDict.copy
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
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 ...
[ "def", "copy", "(", "self", ")", ":", "result", "=", "NocaseDict", "(", ")", "result", ".", "_data", "=", "self", ".", "_data", ".", "copy", "(", ")", "# pylint: disable=protected-access", "return", "result" ]
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 :func:`py:copy.deepcopy` can be use...
[ "Return", "a", "copy", "of", "the", "dictionary", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_nocasedict.py#L423-L438
train
28,428
pywbem/pywbem
pywbem/mof_compiler.py
t_error
def t_error(t): """ Lexer error callback from PLY Lexer with token in error. """ msg = _format("Illegal character {0!A}", t.value[0]) t.lexer.last_msg = msg t.lexer.skip(1) return t
python
def t_error(t): """ Lexer error callback from PLY Lexer with token in error. """ msg = _format("Illegal character {0!A}", t.value[0]) t.lexer.last_msg = msg t.lexer.skip(1) return t
[ "def", "t_error", "(", "t", ")", ":", "msg", "=", "_format", "(", "\"Illegal character {0!A}\"", ",", "t", ".", "value", "[", "0", "]", ")", "t", ".", "lexer", ".", "last_msg", "=", "msg", "t", ".", "lexer", ".", "skip", "(", "1", ")", "return", ...
Lexer error callback from PLY Lexer with token in error.
[ "Lexer", "error", "callback", "from", "PLY", "Lexer", "with", "token", "in", "error", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L334-L340
train
28,429
pywbem/pywbem
pywbem/mof_compiler.py
p_error
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: raise MOFParseError(msg='Unexpected end of file') ...
python
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: raise MOFParseError(msg='Unexpected end of file') ...
[ "def", "p_error", "(", "p", ")", ":", "if", "p", "is", "None", ":", "raise", "MOFParseError", "(", "msg", "=", "'Unexpected end of file'", ")", "msg", "=", "p", ".", "lexer", ".", "last_msg", "p", ".", "lexer", ".", "last_msg", "=", "None", "raise", ...
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.
[ "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",...
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L454-L466
train
28,430
pywbem/pywbem
pywbem/mof_compiler.py
_fixStringValue
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
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...
[ "def", "_fixStringValue", "(", "s", ",", "p", ")", ":", "# pylint: disable=too-many-branches", "s", "=", "s", "[", "1", ":", "-", "1", "]", "rv", "=", "''", "esc", "=", "False", "i", "=", "-", "1", "while", "i", "<", "len", "(", "s", ")", "-", ...
Clean up string value including special characters, etc.
[ "Clean", "up", "string", "value", "including", "special", "characters", "etc", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L1200-L1258
train
28,431
pywbem/pywbem
pywbem/mof_compiler.py
_build_flavors
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
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) ...
[ "def", "_build_flavors", "(", "p", ",", "flist", ",", "qualdecl", "=", "None", ")", ":", "flavors", "=", "{", "}", "if", "(", "'disableoverride'", "in", "flist", "and", "'enableoverride'", "in", "flist", ")", "or", "(", "'restricted'", "in", "flist", "an...
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) Uses the qualdecl argument as a basis if it exists. This i...
[ "Build", "and", "return", "a", "dictionary", "defining", "the", "flavors", "from", "the", "flist", "argument", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L1336-L1384
train
28,432
pywbem/pywbem
pywbem/mof_compiler.py
_find_column
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 > 0: if input_[i] == '\n': break ...
python
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 > 0: if input_[i] == '\n': break ...
[ "def", "_find_column", "(", "input_", ",", "token", ")", ":", "i", "=", "token", ".", "lexpos", "while", "i", ">", "0", ":", "if", "input_", "[", "i", "]", "==", "'\\n'", ":", "break", "i", "-=", "1", "column", "=", "token", ".", "lexpos", "-", ...
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.
[ "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", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L1663-L1676
train
28,433
pywbem/pywbem
pywbem/mof_compiler.py
_get_error_context
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
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...
[ "def", "_get_error_context", "(", "input_", ",", "token", ")", ":", "try", ":", "line", "=", "input_", "[", "token", ".", "lexpos", ":", "input_", ".", "index", "(", "'\\n'", ",", "token", ".", "lexpos", ")", "]", "except", "ValueError", ":", "line", ...
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
[ "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"...
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L1679-L1716
train
28,434
pywbem/pywbem
pywbem/mof_compiler.py
_build
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( _format("Building LEX/YACC modules for MOF compiler in: {...
python
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( _format("Building LEX/YACC modules for MOF compiler in: {...
[ "def", "_build", "(", "verbose", "=", "False", ")", ":", "if", "verbose", ":", "print", "(", "_format", "(", "\"Building LEX/YACC modules for MOF compiler in: {0}\"", ",", "_tabdir", ")", ")", "_yacc", "(", "verbose", ")", "_lex", "(", "verbose", ")" ]
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.
[ "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", "pack...
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2548-L2560
train
28,435
pywbem/pywbem
pywbem/mof_compiler.py
_yacc
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
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...
[ "def", "_yacc", "(", "verbose", "=", "False", ")", ":", "# In yacc(), the 'debug' parameter controls the main error", "# messages to the 'errorlog' in addition to the debug messages", "# to the 'debuglog'. Because we want to see the error messages,", "# we enable debug but set the debuglog to ...
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.
[ "Return", "YACC", "parser", "object", "for", "the", "MOF", "compiler", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2563-L2582
train
28,436
pywbem/pywbem
pywbem/mof_compiler.py
_lex
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
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=...
[ "def", "_lex", "(", "verbose", "=", "False", ")", ":", "return", "lex", ".", "lex", "(", "optimize", "=", "_optimize", ",", "lextab", "=", "_lextab", ",", "outputdir", "=", "_tabdir", ",", "debug", "=", "False", ",", "# debuglog = lex.PlyLogger(sys.stdout),"...
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=True and enable the debuglog sta...
[ "Return", "LEX", "analyzer", "object", "for", "the", "MOF", "Compiler", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2585-L2601
train
28,437
pywbem/pywbem
pywbem/mof_compiler.py
MOFWBEMConnection._setns
def _setns(self, value): """ Set the default repository namespace to be used. This method exists for compatibility. Use the :attr:`default_namespace` property instead. """ if self.conn is not None: self.conn.default_namespace = value else: ...
python
def _setns(self, value): """ Set the default repository namespace to be used. This method exists for compatibility. Use the :attr:`default_namespace` property instead. """ if self.conn is not None: self.conn.default_namespace = value else: ...
[ "def", "_setns", "(", "self", ",", "value", ")", ":", "if", "self", ".", "conn", "is", "not", "None", ":", "self", ".", "conn", ".", "default_namespace", "=", "value", "else", ":", "self", ".", "__default_namespace", "=", "value" ]
Set the default repository namespace to be used. This method exists for compatibility. Use the :attr:`default_namespace` property instead.
[ "Set", "the", "default", "repository", "namespace", "to", "be", "used", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L1955-L1965
train
28,438
pywbem/pywbem
pywbem/mof_compiler.py
MOFWBEMConnection.CreateInstance
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: self....
python
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: self....
[ "def", "CreateInstance", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "inst", "=", "args", "[", "0", "]", "if", "args", "else", "kwargs", "[", "'NewInstance'", "]", "try", ":", "self", ".", "instances", "[", "self", ".", "defau...
Create a CIM instance in the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.CreateInstance`.
[ "Create", "a", "CIM", "instance", "in", "the", "local", "repository", "of", "this", "class", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2010-L2022
train
28,439
pywbem/pywbem
pywbem/mof_compiler.py
MOFWBEMConnection.GetClass
def GetClass(self, *args, **kwargs): """Retrieve a CIM class from the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.GetClass`. """ cname = args[0] if args else kwargs['ClassName'] try: cc = self.classes...
python
def GetClass(self, *args, **kwargs): """Retrieve a CIM class from the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.GetClass`. """ cname = args[0] if args else kwargs['ClassName'] try: cc = self.classes...
[ "def", "GetClass", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "cname", "=", "args", "[", "0", "]", "if", "args", "else", "kwargs", "[", "'ClassName'", "]", "try", ":", "cc", "=", "self", ".", "classes", "[", "self", ".", ...
Retrieve a CIM class from the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.GetClass`.
[ "Retrieve", "a", "CIM", "class", "from", "the", "local", "repository", "of", "this", "class", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2033-L2068
train
28,440
pywbem/pywbem
pywbem/mof_compiler.py
MOFWBEMConnection.EnumerateQualifiers
def EnumerateQualifiers(self, *args, **kwargs): """Enumerate the qualifier types in the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.EnumerateQualifiers`. """ if self.conn is not None: rv = self.conn.Enumerate...
python
def EnumerateQualifiers(self, *args, **kwargs): """Enumerate the qualifier types in the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.EnumerateQualifiers`. """ if self.conn is not None: rv = self.conn.Enumerate...
[ "def", "EnumerateQualifiers", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "conn", "is", "not", "None", ":", "rv", "=", "self", ".", "conn", ".", "EnumerateQualifiers", "(", "*", "args", ",", "*", "*", "kwarg...
Enumerate the qualifier types in the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.EnumerateQualifiers`.
[ "Enumerate", "the", "qualifier", "types", "in", "the", "local", "repository", "of", "this", "class", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2164-L2179
train
28,441
pywbem/pywbem
pywbem/mof_compiler.py
MOFWBEMConnection.GetQualifier
def GetQualifier(self, *args, **kwargs): """Retrieve a qualifier type from the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.GetQualifier`. """ qualname = args[0] if args else kwargs['QualifierName'] try: ...
python
def GetQualifier(self, *args, **kwargs): """Retrieve a qualifier type from the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.GetQualifier`. """ qualname = args[0] if args else kwargs['QualifierName'] try: ...
[ "def", "GetQualifier", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "qualname", "=", "args", "[", "0", "]", "if", "args", "else", "kwargs", "[", "'QualifierName'", "]", "try", ":", "qual", "=", "self", ".", "qualifiers", "[", "...
Retrieve a qualifier type from the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.GetQualifier`.
[ "Retrieve", "a", "qualifier", "type", "from", "the", "local", "repository", "of", "this", "class", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2181-L2196
train
28,442
pywbem/pywbem
pywbem/mof_compiler.py
MOFWBEMConnection.SetQualifier
def SetQualifier(self, *args, **kwargs): """Create or modify a qualifier type in the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.SetQualifier`. """ qual = args[0] if args else kwargs['QualifierDeclaration'] ...
python
def SetQualifier(self, *args, **kwargs): """Create or modify a qualifier type in the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.SetQualifier`. """ qual = args[0] if args else kwargs['QualifierDeclaration'] ...
[ "def", "SetQualifier", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "qual", "=", "args", "[", "0", "]", "if", "args", "else", "kwargs", "[", "'QualifierDeclaration'", "]", "try", ":", "self", ".", "qualifiers", "[", "self", ".", ...
Create or modify a qualifier type in the local repository of this class. For a description of the parameters, see :meth:`pywbem.WBEMConnection.SetQualifier`.
[ "Create", "or", "modify", "a", "qualifier", "type", "in", "the", "local", "repository", "of", "this", "class", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2198-L2211
train
28,443
pywbem/pywbem
pywbem/mof_compiler.py
MOFWBEMConnection.rollback
def rollback(self, verbose=False): """ Remove classes and instances from the underlying repository, that have been created in the local repository of this class. Limitation: At this point, only classes and instances will be removed, but not qualifiers. """ for ns...
python
def rollback(self, verbose=False): """ Remove classes and instances from the underlying repository, that have been created in the local repository of this class. Limitation: At this point, only classes and instances will be removed, but not qualifiers. """ for ns...
[ "def", "rollback", "(", "self", ",", "verbose", "=", "False", ")", ":", "for", "ns", ",", "insts", "in", "self", ".", "instances", ".", "items", "(", ")", ":", "insts", ".", "reverse", "(", ")", "for", "inst", "in", "insts", ":", "try", ":", "if"...
Remove classes and instances from the underlying repository, that have been created in the local repository of this class. Limitation: At this point, only classes and instances will be removed, but not qualifiers.
[ "Remove", "classes", "and", "instances", "from", "the", "underlying", "repository", "that", "have", "been", "created", "in", "the", "local", "repository", "of", "this", "class", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2222-L2254
train
28,444
pywbem/pywbem
pywbem/mof_compiler.py
MOFCompiler.compile_string
def compile_string(self, mof, ns, filename=None): """ Compile a string of MOF statements into a namespace of the associated CIM repository. Parameters: mof (:term:`string`): The string of MOF statements to be compiled. ns (:term:`string`): T...
python
def compile_string(self, mof, ns, filename=None): """ Compile a string of MOF statements into a namespace of the associated CIM repository. Parameters: mof (:term:`string`): The string of MOF statements to be compiled. ns (:term:`string`): T...
[ "def", "compile_string", "(", "self", ",", "mof", ",", "ns", ",", "filename", "=", "None", ")", ":", "lexer", "=", "self", ".", "lexer", ".", "clone", "(", ")", "lexer", ".", "parser", "=", "self", ".", "parser", "try", ":", "oldfile", "=", "self",...
Compile a string of MOF statements into a namespace of the associated CIM repository. Parameters: mof (:term:`string`): The string of MOF statements to be compiled. ns (:term:`string`): The name of the CIM namespace in the associated CIM repository ...
[ "Compile", "a", "string", "of", "MOF", "statements", "into", "a", "namespace", "of", "the", "associated", "CIM", "repository", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2391-L2466
train
28,445
pywbem/pywbem
pywbem/mof_compiler.py
MOFCompiler.compile_file
def compile_file(self, filename, ns): """ Compile a MOF file into a namespace of the associated CIM repository. Parameters: filename (:term:`string`): The path name of the MOF file containing the MOF statements to be compiled. ns (:term:`string`): ...
python
def compile_file(self, filename, ns): """ Compile a MOF file into a namespace of the associated CIM repository. Parameters: filename (:term:`string`): The path name of the MOF file containing the MOF statements to be compiled. ns (:term:`string`): ...
[ "def", "compile_file", "(", "self", ",", "filename", ",", "ns", ")", ":", "if", "self", ".", "parser", ".", "verbose", ":", "self", ".", "parser", ".", "log", "(", "_format", "(", "\"Compiling file {0!A}\"", ",", "filename", ")", ")", "if", "not", "os"...
Compile a MOF file into a namespace of the associated CIM repository. Parameters: filename (:term:`string`): The path name of the MOF file containing the MOF statements to be compiled. ns (:term:`string`): The name of the CIM namespace in the associated...
[ "Compile", "a", "MOF", "file", "into", "a", "namespace", "of", "the", "associated", "CIM", "repository", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2468-L2505
train
28,446
pywbem/pywbem
pywbem/mof_compiler.py
MOFCompiler.find_mof
def find_mof(self, classname): """ Find the MOF file that defines a particular CIM class, in the search path of the MOF compiler. The MOF file is found based on its file name: It is assumed that the base part of the file name is the CIM class name. Example: The class "C...
python
def find_mof(self, classname): """ Find the MOF file that defines a particular CIM class, in the search path of the MOF compiler. The MOF file is found based on its file name: It is assumed that the base part of the file name is the CIM class name. Example: The class "C...
[ "def", "find_mof", "(", "self", ",", "classname", ")", ":", "classname", "=", "classname", ".", "lower", "(", ")", "for", "search", "in", "self", ".", "parser", ".", "search_paths", ":", "for", "root", ",", "dummy_dirs", ",", "files", "in", "os", ".", ...
Find the MOF file that defines a particular CIM class, in the search path of the MOF compiler. The MOF file is found based on its file name: It is assumed that the base part of the file name is the CIM class name. Example: The class "CIM_ComputerSystem" is expected to be in a file ...
[ "Find", "the", "MOF", "file", "that", "defines", "a", "particular", "CIM", "class", "in", "the", "search", "path", "of", "the", "MOF", "compiler", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/mof_compiler.py#L2507-L2536
train
28,447
pywbem/pywbem
pywbem/_logging.py
configure_loggers_from_string
def configure_loggers_from_string(log_configuration_str, log_filename=DEFAULT_LOG_FILENAME, connection=None, propagate=False): # pylint: disable=line-too-long """ Configure the pywbem loggers and optionally activate WBEM connections for ...
python
def configure_loggers_from_string(log_configuration_str, log_filename=DEFAULT_LOG_FILENAME, connection=None, propagate=False): # pylint: disable=line-too-long """ Configure the pywbem loggers and optionally activate WBEM connections for ...
[ "def", "configure_loggers_from_string", "(", "log_configuration_str", ",", "log_filename", "=", "DEFAULT_LOG_FILENAME", ",", "connection", "=", "None", ",", "propagate", "=", "False", ")", ":", "# pylint: disable=line-too-long", "# noqa: E501", "# pylint: enable=line-too-long...
Configure the pywbem loggers and optionally activate WBEM connections for logging and setting a log detail level, from a log configuration string. This is most useful in defining the loggers from a command line tool such as pywbemcli so the complete logger configuration can be compressed into a single ...
[ "Configure", "the", "pywbem", "loggers", "and", "optionally", "activate", "WBEM", "connections", "for", "logging", "and", "setting", "a", "log", "detail", "level", "from", "a", "log", "configuration", "string", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_logging.py#L384-L506
train
28,448
pywbem/pywbem
examples/wbemcli_view_subscriptions.py
display_paths
def display_paths(instances, type_str): """Display the count and paths for the list of instances in instances.""" print('%ss: count=%s' % (type_str, len(instances),)) for path in [instance.path for instance in instances]: print('%s: %s' % (type_str, path)) if len(instances): print('')
python
def display_paths(instances, type_str): """Display the count and paths for the list of instances in instances.""" print('%ss: count=%s' % (type_str, len(instances),)) for path in [instance.path for instance in instances]: print('%s: %s' % (type_str, path)) if len(instances): print('')
[ "def", "display_paths", "(", "instances", ",", "type_str", ")", ":", "print", "(", "'%ss: count=%s'", "%", "(", "type_str", ",", "len", "(", "instances", ")", ",", ")", ")", "for", "path", "in", "[", "instance", ".", "path", "for", "instance", "in", "i...
Display the count and paths for the list of instances in instances.
[ "Display", "the", "count", "and", "paths", "for", "the", "list", "of", "instances", "in", "instances", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/wbemcli_view_subscriptions.py#L9-L15
train
28,449
pywbem/pywbem
pywbem/cim_http.py
get_default_ca_certs
def get_default_ca_certs(): """ Try to find out system path with ca certificates. This path is cached and returned. If no path is found out, None is returned. """ # pylint: disable=protected-access if not hasattr(get_default_ca_certs, '_path'): for path in get_default_ca_cert_paths(): ...
python
def get_default_ca_certs(): """ Try to find out system path with ca certificates. This path is cached and returned. If no path is found out, None is returned. """ # pylint: disable=protected-access if not hasattr(get_default_ca_certs, '_path'): for path in get_default_ca_cert_paths(): ...
[ "def", "get_default_ca_certs", "(", ")", ":", "# pylint: disable=protected-access", "if", "not", "hasattr", "(", "get_default_ca_certs", ",", "'_path'", ")", ":", "for", "path", "in", "get_default_ca_cert_paths", "(", ")", ":", "if", "os", ".", "path", ".", "exi...
Try to find out system path with ca certificates. This path is cached and returned. If no path is found out, None is returned.
[ "Try", "to", "find", "out", "system", "path", "with", "ca", "certificates", ".", "This", "path", "is", "cached", "and", "returned", ".", "If", "no", "path", "is", "found", "out", "None", "is", "returned", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_http.py#L342-L355
train
28,450
pywbem/pywbem
pywbem/cim_http.py
get_cimobject_header
def get_cimobject_header(obj): """ Return the value for the CIM-XML extension header field 'CIMObject', using the given object. This function implements the rules defined in DSP0200 section 6.3.7 "CIMObject". The format of the CIMObject value is similar but not identical to a local WBEM URI (on...
python
def get_cimobject_header(obj): """ Return the value for the CIM-XML extension header field 'CIMObject', using the given object. This function implements the rules defined in DSP0200 section 6.3.7 "CIMObject". The format of the CIMObject value is similar but not identical to a local WBEM URI (on...
[ "def", "get_cimobject_header", "(", "obj", ")", ":", "# Local namespace path", "if", "isinstance", "(", "obj", ",", "six", ".", "string_types", ")", ":", "return", "obj", "# Local class path", "if", "isinstance", "(", "obj", ",", "CIMClassName", ")", ":", "ret...
Return the value for the CIM-XML extension header field 'CIMObject', using the given object. This function implements the rules defined in DSP0200 section 6.3.7 "CIMObject". The format of the CIMObject value is similar but not identical to a local WBEM URI (one without namespace type and authority), as...
[ "Return", "the", "value", "for", "the", "CIM", "-", "XML", "extension", "header", "field", "CIMObject", "using", "the", "given", "object", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_http.py#L1011-L1044
train
28,451
pywbem/pywbem
examples/explore.py
print_profile_info
def print_profile_info(org_vm, inst): """Print the registered org, name, version for the profile defined by inst """ org = org_vm.tovalues(inst['RegisteredOrganization']) name = inst['RegisteredName'] vers = inst['RegisteredVersion'] print(" %s %s Profile %s" % (org, name, vers))
python
def print_profile_info(org_vm, inst): """Print the registered org, name, version for the profile defined by inst """ org = org_vm.tovalues(inst['RegisteredOrganization']) name = inst['RegisteredName'] vers = inst['RegisteredVersion'] print(" %s %s Profile %s" % (org, name, vers))
[ "def", "print_profile_info", "(", "org_vm", ",", "inst", ")", ":", "org", "=", "org_vm", ".", "tovalues", "(", "inst", "[", "'RegisteredOrganization'", "]", ")", "name", "=", "inst", "[", "'RegisteredName'", "]", "vers", "=", "inst", "[", "'RegisteredVersion...
Print the registered org, name, version for the profile defined by inst
[ "Print", "the", "registered", "org", "name", "version", "for", "the", "profile", "defined", "by", "inst" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/explore.py#L8-L15
train
28,452
pywbem/pywbem
examples/explore.py
explore_server
def explore_server(server_url, username, password): """ Demo of exploring a cim server for characteristics defined by the server class """ print("WBEM server URL:\n %s" % server_url) conn = WBEMConnection(server_url, (username, password), no_verification=True) se...
python
def explore_server(server_url, username, password): """ Demo of exploring a cim server for characteristics defined by the server class """ print("WBEM server URL:\n %s" % server_url) conn = WBEMConnection(server_url, (username, password), no_verification=True) se...
[ "def", "explore_server", "(", "server_url", ",", "username", ",", "password", ")", ":", "print", "(", "\"WBEM server URL:\\n %s\"", "%", "server_url", ")", "conn", "=", "WBEMConnection", "(", "server_url", ",", "(", "username", ",", "password", ")", ",", "no_...
Demo of exploring a cim server for characteristics defined by the server class
[ "Demo", "of", "exploring", "a", "cim", "server", "for", "characteristics", "defined", "by", "the", "server", "class" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/explore.py#L17-L85
train
28,453
pywbem/pywbem
pywbem/_server.py
WBEMServer.create_namespace
def create_namespace(self, namespace): """ Create the specified CIM namespace in the WBEM server and update this WBEMServer object to reflect the new namespace there. This method attempts the following approaches for creating the namespace, in order, until an approach su...
python
def create_namespace(self, namespace): """ Create the specified CIM namespace in the WBEM server and update this WBEMServer object to reflect the new namespace there. This method attempts the following approaches for creating the namespace, in order, until an approach su...
[ "def", "create_namespace", "(", "self", ",", "namespace", ")", ":", "std_namespace", "=", "_ensure_unicode", "(", "namespace", ".", "strip", "(", "'/'", ")", ")", "ws_profiles", "=", "self", ".", "get_selected_profiles", "(", "'DMTF'", ",", "'WBEM Server'", ")...
Create the specified CIM namespace in the WBEM server and update this WBEMServer object to reflect the new namespace there. This method attempts the following approaches for creating the namespace, in order, until an approach succeeds: 1. Namespace creation as described in the ...
[ "Create", "the", "specified", "CIM", "namespace", "in", "the", "WBEM", "server", "and", "update", "this", "WBEMServer", "object", "to", "reflect", "the", "new", "namespace", "there", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_server.py#L388-L531
train
28,454
pywbem/pywbem
pywbem/_server.py
WBEMServer.delete_namespace
def delete_namespace(self, namespace): """ Delete the specified CIM namespace in the WBEM server and update this WBEMServer object to reflect the removed namespace there. The specified namespace must be empty (i.e. must not contain any classes, instances, or qualifier ty...
python
def delete_namespace(self, namespace): """ Delete the specified CIM namespace in the WBEM server and update this WBEMServer object to reflect the removed namespace there. The specified namespace must be empty (i.e. must not contain any classes, instances, or qualifier ty...
[ "def", "delete_namespace", "(", "self", ",", "namespace", ")", ":", "std_namespace", "=", "_ensure_unicode", "(", "namespace", ".", "strip", "(", "'/'", ")", ")", "# Use approach 1: DeleteInstance of CIM class for namespaces", "# Refresh the list of namespaces in this object ...
Delete the specified CIM namespace in the WBEM server and update this WBEMServer object to reflect the removed namespace there. The specified namespace must be empty (i.e. must not contain any classes, instances, or qualifier types. This method attempts the following approaches...
[ "Delete", "the", "specified", "CIM", "namespace", "in", "the", "WBEM", "server", "and", "update", "this", "WBEMServer", "object", "to", "reflect", "the", "removed", "namespace", "there", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_server.py#L533-L626
train
28,455
pywbem/pywbem
pywbem/_server.py
WBEMServer._traverse
def _traverse(self, start_paths, traversal_path): """ Traverse a multi-hop traversal path from a list of start instance paths, and return the resulting list of instance paths. Parameters: start_paths (list of CIMInstanceName): Instance paths to start traversal from...
python
def _traverse(self, start_paths, traversal_path): """ Traverse a multi-hop traversal path from a list of start instance paths, and return the resulting list of instance paths. Parameters: start_paths (list of CIMInstanceName): Instance paths to start traversal from...
[ "def", "_traverse", "(", "self", ",", "start_paths", ",", "traversal_path", ")", ":", "assert", "len", "(", "traversal_path", ")", ">=", "2", "assoc_class", "=", "traversal_path", "[", "0", "]", "far_class", "=", "traversal_path", "[", "1", "]", "total_next_...
Traverse a multi-hop traversal path from a list of start instance paths, and return the resulting list of instance paths. Parameters: start_paths (list of CIMInstanceName): Instance paths to start traversal from. traversal_path (list of string): Traversal hops, where the...
[ "Traverse", "a", "multi", "-", "hop", "traversal", "path", "from", "a", "list", "of", "start", "instance", "paths", "and", "return", "the", "resulting", "list", "of", "instance", "paths", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_server.py#L1031-L1060
train
28,456
pywbem/pywbem
pywbem/_server.py
WBEMServer._validate_interop_ns
def _validate_interop_ns(self, interop_ns): """ Validate whether the specified Interop namespace exists in the WBEM server, by communicating with it. If the specified Interop namespace exists, this method sets the :attr:`interop_ns` property of this object to that namespace and ...
python
def _validate_interop_ns(self, interop_ns): """ Validate whether the specified Interop namespace exists in the WBEM server, by communicating with it. If the specified Interop namespace exists, this method sets the :attr:`interop_ns` property of this object to that namespace and ...
[ "def", "_validate_interop_ns", "(", "self", ",", "interop_ns", ")", ":", "test_classname", "=", "'CIM_Namespace'", "try", ":", "self", ".", "_conn", ".", "EnumerateInstanceNames", "(", "test_classname", ",", "namespace", "=", "interop_ns", ")", "except", "CIMError...
Validate whether the specified Interop namespace exists in the WBEM server, by communicating with it. If the specified Interop namespace exists, this method sets the :attr:`interop_ns` property of this object to that namespace and returns. Otherwise, it raises an exception. ...
[ "Validate", "whether", "the", "specified", "Interop", "namespace", "exists", "in", "the", "WBEM", "server", "by", "communicating", "with", "it", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_server.py#L1117-L1148
train
28,457
pywbem/pywbem
pywbem/_server.py
WBEMServer._determine_profiles
def _determine_profiles(self): """ Determine the WBEM management profiles advertised by the WBEM server, by communicating with it and enumerating the instances of `CIM_RegisteredProfile`. If the profiles could be determined, this method sets the :attr:`profiles` property...
python
def _determine_profiles(self): """ Determine the WBEM management profiles advertised by the WBEM server, by communicating with it and enumerating the instances of `CIM_RegisteredProfile`. If the profiles could be determined, this method sets the :attr:`profiles` property...
[ "def", "_determine_profiles", "(", "self", ")", ":", "mp_insts", "=", "self", ".", "_conn", ".", "EnumerateInstances", "(", "\"CIM_RegisteredProfile\"", ",", "namespace", "=", "self", ".", "interop_ns", ")", "self", ".", "_profiles", "=", "mp_insts" ]
Determine the WBEM management profiles advertised by the WBEM server, by communicating with it and enumerating the instances of `CIM_RegisteredProfile`. If the profiles could be determined, this method sets the :attr:`profiles` property of this object to the list of `CIM_Registe...
[ "Determine", "the", "WBEM", "management", "profiles", "advertised", "by", "the", "WBEM", "server", "by", "communicating", "with", "it", "and", "enumerating", "the", "instances", "of", "CIM_RegisteredProfile", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_server.py#L1300-L1320
train
28,458
pywbem/pywbem
pywbem/_recorder.py
_represent_undefined
def _represent_undefined(self, data): """Raises flag for objects that cannot be represented""" raise RepresenterError( _format("Cannot represent an object: {0!A} of type: {1}; " "yaml_representers: {2!A}, " "yaml_multi_representers: {3!A}", data, type(data...
python
def _represent_undefined(self, data): """Raises flag for objects that cannot be represented""" raise RepresenterError( _format("Cannot represent an object: {0!A} of type: {1}; " "yaml_representers: {2!A}, " "yaml_multi_representers: {3!A}", data, type(data...
[ "def", "_represent_undefined", "(", "self", ",", "data", ")", ":", "raise", "RepresenterError", "(", "_format", "(", "\"Cannot represent an object: {0!A} of type: {1}; \"", "\"yaml_representers: {2!A}, \"", "\"yaml_multi_representers: {3!A}\"", ",", "data", ",", "type", "(", ...
Raises flag for objects that cannot be represented
[ "Raises", "flag", "for", "objects", "that", "cannot", "be", "represented" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L133-L140
train
28,459
pywbem/pywbem
pywbem/_recorder.py
BaseOperationRecorder.open_file
def open_file(filename, file_mode='w'): """ A static convenience function that performs the open of the recorder file correctly for different versions of Python. *New in pywbem 0.10.* This covers the issue where the file should be opened in text mode but that is done di...
python
def open_file(filename, file_mode='w'): """ A static convenience function that performs the open of the recorder file correctly for different versions of Python. *New in pywbem 0.10.* This covers the issue where the file should be opened in text mode but that is done di...
[ "def", "open_file", "(", "filename", ",", "file_mode", "=", "'w'", ")", ":", "if", "six", ".", "PY2", ":", "# Open with codecs to define text mode", "return", "codecs", ".", "open", "(", "filename", ",", "mode", "=", "file_mode", ",", "encoding", "=", "'utf-...
A static convenience function that performs the open of the recorder file correctly for different versions of Python. *New in pywbem 0.10.* This covers the issue where the file should be opened in text mode but that is done differently in Python 2 and Python 3. The returned fi...
[ "A", "static", "convenience", "function", "that", "performs", "the", "open", "of", "the", "recorder", "file", "correctly", "for", "different", "versions", "of", "Python", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L352-L391
train
28,460
pywbem/pywbem
pywbem/_recorder.py
BaseOperationRecorder.reset
def reset(self, pull_op=None): """Reset all the attributes in the class. This also allows setting the pull_op attribute that defines whether the operation is to be a traditional or pull operation. This does NOT reset _conn.id as that exists through the life of the connection. ...
python
def reset(self, pull_op=None): """Reset all the attributes in the class. This also allows setting the pull_op attribute that defines whether the operation is to be a traditional or pull operation. This does NOT reset _conn.id as that exists through the life of the connection. ...
[ "def", "reset", "(", "self", ",", "pull_op", "=", "None", ")", ":", "self", ".", "_pywbem_method", "=", "None", "self", ".", "_pywbem_args", "=", "None", "self", ".", "_pywbem_result_ret", "=", "None", "self", ".", "_pywbem_result_exc", "=", "None", "self"...
Reset all the attributes in the class. This also allows setting the pull_op attribute that defines whether the operation is to be a traditional or pull operation. This does NOT reset _conn.id as that exists through the life of the connection.
[ "Reset", "all", "the", "attributes", "in", "the", "class", ".", "This", "also", "allows", "setting", "the", "pull_op", "attribute", "that", "defines", "whether", "the", "operation", "is", "to", "be", "a", "traditional", "or", "pull", "operation", ".", "This"...
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L393-L418
train
28,461
pywbem/pywbem
pywbem/_recorder.py
BaseOperationRecorder.stage_pywbem_args
def stage_pywbem_args(self, method, **kwargs): """ Set requst method and all args. Normally called before the cmd is executed to record request parameters """ # pylint: disable=attribute-defined-outside-init self._pywbem_method = method self._pywbem_args =...
python
def stage_pywbem_args(self, method, **kwargs): """ Set requst method and all args. Normally called before the cmd is executed to record request parameters """ # pylint: disable=attribute-defined-outside-init self._pywbem_method = method self._pywbem_args =...
[ "def", "stage_pywbem_args", "(", "self", ",", "method", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=attribute-defined-outside-init", "self", ".", "_pywbem_method", "=", "method", "self", ".", "_pywbem_args", "=", "kwargs" ]
Set requst method and all args. Normally called before the cmd is executed to record request parameters
[ "Set", "requst", "method", "and", "all", "args", ".", "Normally", "called", "before", "the", "cmd", "is", "executed", "to", "record", "request", "parameters" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L427-L435
train
28,462
pywbem/pywbem
pywbem/_recorder.py
BaseOperationRecorder.stage_pywbem_result
def stage_pywbem_result(self, ret, exc): """ Set Result return info or exception info""" # pylint: disable=attribute-defined-outside-init self._pywbem_result_ret = ret self._pywbem_result_exc = exc
python
def stage_pywbem_result(self, ret, exc): """ Set Result return info or exception info""" # pylint: disable=attribute-defined-outside-init self._pywbem_result_ret = ret self._pywbem_result_exc = exc
[ "def", "stage_pywbem_result", "(", "self", ",", "ret", ",", "exc", ")", ":", "# pylint: disable=attribute-defined-outside-init", "self", ".", "_pywbem_result_ret", "=", "ret", "self", ".", "_pywbem_result_exc", "=", "exc" ]
Set Result return info or exception info
[ "Set", "Result", "return", "info", "or", "exception", "info" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L437-L441
train
28,463
pywbem/pywbem
pywbem/_recorder.py
BaseOperationRecorder.stage_http_request
def stage_http_request(self, conn_id, version, url, target, method, headers, payload): """Set request HTTP information including url, headers, etc.""" # pylint: disable=attribute-defined-outside-init self._http_request_version = version self._http_request_conn_...
python
def stage_http_request(self, conn_id, version, url, target, method, headers, payload): """Set request HTTP information including url, headers, etc.""" # pylint: disable=attribute-defined-outside-init self._http_request_version = version self._http_request_conn_...
[ "def", "stage_http_request", "(", "self", ",", "conn_id", ",", "version", ",", "url", ",", "target", ",", "method", ",", "headers", ",", "payload", ")", ":", "# pylint: disable=attribute-defined-outside-init", "self", ".", "_http_request_version", "=", "version", ...
Set request HTTP information including url, headers, etc.
[ "Set", "request", "HTTP", "information", "including", "url", "headers", "etc", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L443-L453
train
28,464
pywbem/pywbem
pywbem/_recorder.py
BaseOperationRecorder.stage_http_response1
def stage_http_response1(self, conn_id, version, status, reason, headers): """Set response http info including headers, status, etc. conn_id unused here. Used in log""" # pylint: disable=attribute-defined-outside-init self._http_response_version = version self._http_response_s...
python
def stage_http_response1(self, conn_id, version, status, reason, headers): """Set response http info including headers, status, etc. conn_id unused here. Used in log""" # pylint: disable=attribute-defined-outside-init self._http_response_version = version self._http_response_s...
[ "def", "stage_http_response1", "(", "self", ",", "conn_id", ",", "version", ",", "status", ",", "reason", ",", "headers", ")", ":", "# pylint: disable=attribute-defined-outside-init", "self", ".", "_http_response_version", "=", "version", "self", ".", "_http_response_...
Set response http info including headers, status, etc. conn_id unused here. Used in log
[ "Set", "response", "http", "info", "including", "headers", "status", "etc", ".", "conn_id", "unused", "here", ".", "Used", "in", "log" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L456-L463
train
28,465
pywbem/pywbem
pywbem/_recorder.py
BaseOperationRecorder.record_staged
def record_staged(self): """Encode staged information on request and result to output""" if self.enabled: pwargs = OpArgs( self._pywbem_method, self._pywbem_args) pwresult = OpResult( self._pywbem_result_ret, self._p...
python
def record_staged(self): """Encode staged information on request and result to output""" if self.enabled: pwargs = OpArgs( self._pywbem_method, self._pywbem_args) pwresult = OpResult( self._pywbem_result_ret, self._p...
[ "def", "record_staged", "(", "self", ")", ":", "if", "self", ".", "enabled", ":", "pwargs", "=", "OpArgs", "(", "self", ".", "_pywbem_method", ",", "self", ".", "_pywbem_args", ")", "pwresult", "=", "OpResult", "(", "self", ".", "_pywbem_result_ret", ",", ...
Encode staged information on request and result to output
[ "Encode", "staged", "information", "on", "request", "and", "result", "to", "output" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L470-L492
train
28,466
pywbem/pywbem
pywbem/_recorder.py
LogOperationRecorder.set_detail_level
def set_detail_level(self, detail_levels): """ Sets the detail levels from the input dictionary in detail_levels. """ if detail_levels is None: return self.detail_levels = detail_levels if 'api' in detail_levels: self.api_detail_level = detail_lev...
python
def set_detail_level(self, detail_levels): """ Sets the detail levels from the input dictionary in detail_levels. """ if detail_levels is None: return self.detail_levels = detail_levels if 'api' in detail_levels: self.api_detail_level = detail_lev...
[ "def", "set_detail_level", "(", "self", ",", "detail_levels", ")", ":", "if", "detail_levels", "is", "None", ":", "return", "self", ".", "detail_levels", "=", "detail_levels", "if", "'api'", "in", "detail_levels", ":", "self", ".", "api_detail_level", "=", "de...
Sets the detail levels from the input dictionary in detail_levels.
[ "Sets", "the", "detail", "levels", "from", "the", "input", "dictionary", "in", "detail_levels", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L596-L611
train
28,467
pywbem/pywbem
pywbem/_recorder.py
LogOperationRecorder.stage_pywbem_args
def stage_pywbem_args(self, method, **kwargs): """ Log request method and all args. Normally called before the cmd is executed to record request parameters. This method does not support the summary detail_level because that seems to add little info to the log that is not ...
python
def stage_pywbem_args(self, method, **kwargs): """ Log request method and all args. Normally called before the cmd is executed to record request parameters. This method does not support the summary detail_level because that seems to add little info to the log that is not ...
[ "def", "stage_pywbem_args", "(", "self", ",", "method", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=attribute-defined-outside-init", "self", ".", "_pywbem_method", "=", "method", "if", "self", ".", "enabled", "and", "self", ".", "api_detail_level", "is",...
Log request method and all args. Normally called before the cmd is executed to record request parameters. This method does not support the summary detail_level because that seems to add little info to the log that is not also in the response.
[ "Log", "request", "method", "and", "all", "args", ".", "Normally", "called", "before", "the", "cmd", "is", "executed", "to", "record", "request", "parameters", ".", "This", "method", "does", "not", "support", "the", "summary", "detail_level", "because", "that"...
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L645-L677
train
28,468
pywbem/pywbem
pywbem/_recorder.py
LogOperationRecorder.stage_pywbem_result
def stage_pywbem_result(self, ret, exc): """ Log result return or exception parameter. This method provides varied type of formatting based on the detail_level parameter and the data in ret. """ def format_result(ret, max_len): """ format ret as repr while cli...
python
def stage_pywbem_result(self, ret, exc): """ Log result return or exception parameter. This method provides varied type of formatting based on the detail_level parameter and the data in ret. """ def format_result(ret, max_len): """ format ret as repr while cli...
[ "def", "stage_pywbem_result", "(", "self", ",", "ret", ",", "exc", ")", ":", "def", "format_result", "(", "ret", ",", "max_len", ")", ":", "\"\"\" format ret as repr while clipping it to max_len if\n max_len is not None.\n \"\"\"", "# Format the 'summa...
Log result return or exception parameter. This method provides varied type of formatting based on the detail_level parameter and the data in ret.
[ "Log", "result", "return", "or", "exception", "parameter", ".", "This", "method", "provides", "varied", "type", "of", "formatting", "based", "on", "the", "detail_level", "parameter", "and", "the", "data", "in", "ret", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L679-L784
train
28,469
pywbem/pywbem
pywbem/_recorder.py
LogOperationRecorder.stage_http_request
def stage_http_request(self, conn_id, version, url, target, method, headers, payload): """Log request HTTP information including url, headers, etc.""" if self.enabled and self.http_detail_level is not None and \ self.httplogger.isEnabledFor(logging.DEBUG): ...
python
def stage_http_request(self, conn_id, version, url, target, method, headers, payload): """Log request HTTP information including url, headers, etc.""" if self.enabled and self.http_detail_level is not None and \ self.httplogger.isEnabledFor(logging.DEBUG): ...
[ "def", "stage_http_request", "(", "self", ",", "conn_id", ",", "version", ",", "url", ",", "target", ",", "method", ",", "headers", ",", "payload", ")", ":", "if", "self", ".", "enabled", "and", "self", ".", "http_detail_level", "is", "not", "None", "and...
Log request HTTP information including url, headers, etc.
[ "Log", "request", "HTTP", "information", "including", "url", "headers", "etc", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L786-L811
train
28,470
pywbem/pywbem
pywbem/_recorder.py
LogOperationRecorder.stage_http_response2
def stage_http_response2(self, payload): """Log complete http response, including response1 and payload""" # required because http code uses sending all None to reset # parameters. We ignore that if not self._http_response_version and not payload: return if self.enab...
python
def stage_http_response2(self, payload): """Log complete http response, including response1 and payload""" # required because http code uses sending all None to reset # parameters. We ignore that if not self._http_response_version and not payload: return if self.enab...
[ "def", "stage_http_response2", "(", "self", ",", "payload", ")", ":", "# required because http code uses sending all None to reset", "# parameters. We ignore that", "if", "not", "self", ".", "_http_response_version", "and", "not", "payload", ":", "return", "if", "self", "...
Log complete http response, including response1 and payload
[ "Log", "complete", "http", "response", "including", "response1", "and", "payload" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_recorder.py#L822-L851
train
28,471
pywbem/pywbem
pywbem/_valuemapping.py
ValueMapping._to_int
def _to_int(self, val_str): """Conver val_str to an integer or raise ValueError""" val = _integerValue_to_int(val_str) if val is None: raise ValueError( _format("The value-mapped {0} has an invalid integer " "representation in a ValueMap entry:...
python
def _to_int(self, val_str): """Conver val_str to an integer or raise ValueError""" val = _integerValue_to_int(val_str) if val is None: raise ValueError( _format("The value-mapped {0} has an invalid integer " "representation in a ValueMap entry:...
[ "def", "_to_int", "(", "self", ",", "val_str", ")", ":", "val", "=", "_integerValue_to_int", "(", "val_str", ")", "if", "val", "is", "None", ":", "raise", "ValueError", "(", "_format", "(", "\"The value-mapped {0} has an invalid integer \"", "\"representation in a V...
Conver val_str to an integer or raise ValueError
[ "Conver", "val_str", "to", "an", "integer", "or", "raise", "ValueError" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_valuemapping.py#L468-L476
train
28,472
pywbem/pywbem
pywbem/_valuemapping.py
ValueMapping._element_str
def _element_str(self): """ Return a string that identifies the value-mapped element. """ # pylint: disable=no-else-return if isinstance(self.element, CIMProperty): return _format("property {0!A} in class {1!A} (in {2!A})", self.propname, se...
python
def _element_str(self): """ Return a string that identifies the value-mapped element. """ # pylint: disable=no-else-return if isinstance(self.element, CIMProperty): return _format("property {0!A} in class {1!A} (in {2!A})", self.propname, se...
[ "def", "_element_str", "(", "self", ")", ":", "# pylint: disable=no-else-return", "if", "isinstance", "(", "self", ".", "element", ",", "CIMProperty", ")", ":", "return", "_format", "(", "\"property {0!A} in class {1!A} (in {2!A})\"", ",", "self", ".", "propname", "...
Return a string that identifies the value-mapped element.
[ "Return", "a", "string", "that", "identifies", "the", "value", "-", "mapped", "element", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_valuemapping.py#L595-L610
train
28,473
pywbem/pywbem
pywbem/_valuemapping.py
ValueMapping.tovalues
def tovalues(self, element_value): """ Return the `Values` string for an element value, based upon this value mapping. Parameters: element_value (:term:`integer` or :class:`~pywbem.CIMInt`): The value of the CIM element (property, method, parameter). Retu...
python
def tovalues(self, element_value): """ Return the `Values` string for an element value, based upon this value mapping. Parameters: element_value (:term:`integer` or :class:`~pywbem.CIMInt`): The value of the CIM element (property, method, parameter). Retu...
[ "def", "tovalues", "(", "self", ",", "element_value", ")", ":", "if", "not", "isinstance", "(", "element_value", ",", "(", "six", ".", "integer_types", ",", "CIMInt", ")", ")", ":", "raise", "TypeError", "(", "_format", "(", "\"The value for value-mapped {0} i...
Return the `Values` string for an element value, based upon this value mapping. Parameters: element_value (:term:`integer` or :class:`~pywbem.CIMInt`): The value of the CIM element (property, method, parameter). Returns: :term:`string`: The `Values...
[ "Return", "the", "Values", "string", "for", "an", "element", "value", "based", "upon", "this", "value", "mapping", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_valuemapping.py#L690-L736
train
28,474
pywbem/pywbem
pywbem/_valuemapping.py
ValueMapping.tobinary
def tobinary(self, values_str): """ Return the integer value or values for a `Values` string, based upon this value mapping. Any returned integer value is represented as the CIM type of the element (e.g. :class:`~pywbem.Uint16`). If the `Values` string corresponds to a ...
python
def tobinary(self, values_str): """ Return the integer value or values for a `Values` string, based upon this value mapping. Any returned integer value is represented as the CIM type of the element (e.g. :class:`~pywbem.Uint16`). If the `Values` string corresponds to a ...
[ "def", "tobinary", "(", "self", ",", "values_str", ")", ":", "if", "not", "isinstance", "(", "values_str", ",", "six", ".", "string_types", ")", ":", "raise", "TypeError", "(", "_format", "(", "\"The values string for value-mapped {0} is not \"", "\"string-typed, bu...
Return the integer value or values for a `Values` string, based upon this value mapping. Any returned integer value is represented as the CIM type of the element (e.g. :class:`~pywbem.Uint16`). If the `Values` string corresponds to a single value, that single value is returned ...
[ "Return", "the", "integer", "value", "or", "values", "for", "a", "Values", "string", "based", "upon", "this", "value", "mapping", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_valuemapping.py#L738-L786
train
28,475
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager._get_server
def _get_server(self, server_id): """ Internal method to get the server object, given a server_id. Parameters: server_id (:term:`string`): The server ID of the WBEM server, returned by :meth:`~pywbem.WBEMSubscriptionManager.add_server`. Returns: ...
python
def _get_server(self, server_id): """ Internal method to get the server object, given a server_id. Parameters: server_id (:term:`string`): The server ID of the WBEM server, returned by :meth:`~pywbem.WBEMSubscriptionManager.add_server`. Returns: ...
[ "def", "_get_server", "(", "self", ",", "server_id", ")", ":", "if", "server_id", "not", "in", "self", ".", "_servers", ":", "raise", "ValueError", "(", "_format", "(", "\"WBEM server {0!A} not known by subscription manager\"", ",", "server_id", ")", ")", "return"...
Internal method to get the server object, given a server_id. Parameters: server_id (:term:`string`): The server ID of the WBEM server, returned by :meth:`~pywbem.WBEMSubscriptionManager.add_server`. Returns: server (:class:`~pywbem.WBEMServer`): ...
[ "Internal", "method", "to", "get", "the", "server", "object", "given", "a", "server_id", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L272-L297
train
28,476
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.add_server
def add_server(self, server): """ Register a WBEM server with the subscription manager. This is a prerequisite for adding listener destinations, indication filters and indication subscriptions to the server. This method discovers listener destination, indication filter, and ...
python
def add_server(self, server): """ Register a WBEM server with the subscription manager. This is a prerequisite for adding listener destinations, indication filters and indication subscriptions to the server. This method discovers listener destination, indication filter, and ...
[ "def", "add_server", "(", "self", ",", "server", ")", ":", "if", "not", "isinstance", "(", "server", ",", "WBEMServer", ")", ":", "raise", "TypeError", "(", "\"Server argument of add_server() must be a \"", "\"WBEMServer object\"", ")", "server_id", "=", "server", ...
Register a WBEM server with the subscription manager. This is a prerequisite for adding listener destinations, indication filters and indication subscriptions to the server. This method discovers listener destination, indication filter, and subscription instances in the WBEM server owne...
[ "Register", "a", "WBEM", "server", "with", "the", "subscription", "manager", ".", "This", "is", "a", "prerequisite", "for", "adding", "listener", "destinations", "indication", "filters", "and", "indication", "subscriptions", "to", "the", "server", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L299-L387
train
28,477
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.remove_server
def remove_server(self, server_id): """ Remove a registered WBEM server from the subscription manager. This also unregisters listeners from that server and removes all owned indication subscriptions, owned indication filters and owned listener destinations. Parameters: ...
python
def remove_server(self, server_id): """ Remove a registered WBEM server from the subscription manager. This also unregisters listeners from that server and removes all owned indication subscriptions, owned indication filters and owned listener destinations. Parameters: ...
[ "def", "remove_server", "(", "self", ",", "server_id", ")", ":", "# Validate server_id", "server", "=", "self", ".", "_get_server", "(", "server_id", ")", "# Delete any instances we recorded to be cleaned up", "if", "server_id", "in", "self", ".", "_owned_subscriptions"...
Remove a registered WBEM server from the subscription manager. This also unregisters listeners from that server and removes all owned indication subscriptions, owned indication filters and owned listener destinations. Parameters: server_id (:term:`string`): The se...
[ "Remove", "a", "registered", "WBEM", "server", "from", "the", "subscription", "manager", ".", "This", "also", "unregisters", "listeners", "from", "that", "server", "and", "removes", "all", "owned", "indication", "subscriptions", "owned", "indication", "filters", "...
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L389-L440
train
28,478
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.remove_all_servers
def remove_all_servers(self): """ Remove all registered WBEM servers from the subscription manager. This also unregisters listeners from these servers and removes all owned indication subscriptions, owned indication filters, and owned listener destinations. Raises: ...
python
def remove_all_servers(self): """ Remove all registered WBEM servers from the subscription manager. This also unregisters listeners from these servers and removes all owned indication subscriptions, owned indication filters, and owned listener destinations. Raises: ...
[ "def", "remove_all_servers", "(", "self", ")", ":", "for", "server_id", "in", "list", "(", "self", ".", "_servers", ".", "keys", "(", ")", ")", ":", "self", ".", "remove_server", "(", "server_id", ")" ]
Remove all registered WBEM servers from the subscription manager. This also unregisters listeners from these servers and removes all owned indication subscriptions, owned indication filters, and owned listener destinations. Raises: Exceptions raised by :class:`~pywbem.WBEMC...
[ "Remove", "all", "registered", "WBEM", "servers", "from", "the", "subscription", "manager", ".", "This", "also", "unregisters", "listeners", "from", "these", "servers", "and", "removes", "all", "owned", "indication", "subscriptions", "owned", "indication", "filters"...
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L442-L455
train
28,479
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.add_listener_destinations
def add_listener_destinations(self, server_id, listener_urls, owned=True): """ Register WBEM listeners to be the target of indications sent by a WBEM server. This function automatically creates a listener destination instance (of CIM class "CIM_ListenerDestinationCIMXML") for ea...
python
def add_listener_destinations(self, server_id, listener_urls, owned=True): """ Register WBEM listeners to be the target of indications sent by a WBEM server. This function automatically creates a listener destination instance (of CIM class "CIM_ListenerDestinationCIMXML") for ea...
[ "def", "add_listener_destinations", "(", "self", ",", "server_id", ",", "listener_urls", ",", "owned", "=", "True", ")", ":", "# server_id is validated in _create_...() method.", "# If list, recursively call this function with each list item.", "if", "isinstance", "(", "listene...
Register WBEM listeners to be the target of indications sent by a WBEM server. This function automatically creates a listener destination instance (of CIM class "CIM_ListenerDestinationCIMXML") for each specified listener URL in the Interop namespace of the specified WBEM server. ...
[ "Register", "WBEM", "listeners", "to", "be", "the", "target", "of", "indications", "sent", "by", "a", "WBEM", "server", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L457-L554
train
28,480
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.get_owned_destinations
def get_owned_destinations(self, server_id): """ Return the listener destinations in a WBEM server owned by this subscription manager. This function accesses only the local list of owned destinations; it does not contact the WBEM server. The local list of owned destinations ...
python
def get_owned_destinations(self, server_id): """ Return the listener destinations in a WBEM server owned by this subscription manager. This function accesses only the local list of owned destinations; it does not contact the WBEM server. The local list of owned destinations ...
[ "def", "get_owned_destinations", "(", "self", ",", "server_id", ")", ":", "# Validate server_id", "self", ".", "_get_server", "(", "server_id", ")", "return", "list", "(", "self", ".", "_owned_destinations", "[", "server_id", "]", ")" ]
Return the listener destinations in a WBEM server owned by this subscription manager. This function accesses only the local list of owned destinations; it does not contact the WBEM server. The local list of owned destinations is discovered from the WBEM server when the server is registe...
[ "Return", "the", "listener", "destinations", "in", "a", "WBEM", "server", "owned", "by", "this", "subscription", "manager", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L556-L582
train
28,481
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.get_all_destinations
def get_all_destinations(self, server_id): """ Return all listener destinations in a WBEM server. This function contacts the WBEM server and retrieves the listener destinations by enumerating the instances of CIM class "CIM_ListenerDestinationCIMXML" in the Interop namespace of ...
python
def get_all_destinations(self, server_id): """ Return all listener destinations in a WBEM server. This function contacts the WBEM server and retrieves the listener destinations by enumerating the instances of CIM class "CIM_ListenerDestinationCIMXML" in the Interop namespace of ...
[ "def", "get_all_destinations", "(", "self", ",", "server_id", ")", ":", "# Validate server_id", "server", "=", "self", ".", "_get_server", "(", "server_id", ")", "return", "server", ".", "conn", ".", "EnumerateInstances", "(", "DESTINATION_CLASSNAME", ",", "namesp...
Return all listener destinations in a WBEM server. This function contacts the WBEM server and retrieves the listener destinations by enumerating the instances of CIM class "CIM_ListenerDestinationCIMXML" in the Interop namespace of the WBEM server. Parameters: server...
[ "Return", "all", "listener", "destinations", "in", "a", "WBEM", "server", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L584-L613
train
28,482
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.remove_destinations
def remove_destinations(self, server_id, destination_paths): # pylint: disable=line-too-long """ Remove listener destinations from a WBEM server, by deleting the listener destination instances in the server. The listener destinations must be owned or permanent (i.e. not static)....
python
def remove_destinations(self, server_id, destination_paths): # pylint: disable=line-too-long """ Remove listener destinations from a WBEM server, by deleting the listener destination instances in the server. The listener destinations must be owned or permanent (i.e. not static)....
[ "def", "remove_destinations", "(", "self", ",", "server_id", ",", "destination_paths", ")", ":", "# pylint: disable=line-too-long", "# noqa: E501", "# Validate server_id", "server", "=", "self", ".", "_get_server", "(", "server_id", ")", "conn_id", "=", "server", ".",...
Remove listener destinations from a WBEM server, by deleting the listener destination instances in the server. The listener destinations must be owned or permanent (i.e. not static). This method verifies that there are not currently any subscriptions on the listener destinations to be ...
[ "Remove", "listener", "destinations", "from", "a", "WBEM", "server", "by", "deleting", "the", "listener", "destination", "instances", "in", "the", "server", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L615-L675
train
28,483
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.get_owned_filters
def get_owned_filters(self, server_id): """ Return the indication filters in a WBEM server owned by this subscription manager. This function accesses only the local list of owned filters; it does not contact the WBEM server. The local list of owned filters is discovered ...
python
def get_owned_filters(self, server_id): """ Return the indication filters in a WBEM server owned by this subscription manager. This function accesses only the local list of owned filters; it does not contact the WBEM server. The local list of owned filters is discovered ...
[ "def", "get_owned_filters", "(", "self", ",", "server_id", ")", ":", "# Validate server_id", "self", ".", "_get_server", "(", "server_id", ")", "return", "list", "(", "self", ".", "_owned_filters", "[", "server_id", "]", ")" ]
Return the indication filters in a WBEM server owned by this subscription manager. This function accesses only the local list of owned filters; it does not contact the WBEM server. The local list of owned filters is discovered from the WBEM server when the server is registered with the ...
[ "Return", "the", "indication", "filters", "in", "a", "WBEM", "server", "owned", "by", "this", "subscription", "manager", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L805-L831
train
28,484
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.get_all_filters
def get_all_filters(self, server_id): """ Return all indication filters in a WBEM server. This function contacts the WBEM server and retrieves the indication filters by enumerating the instances of CIM class "CIM_IndicationFilter" in the Interop namespace of the WBEM server. ...
python
def get_all_filters(self, server_id): """ Return all indication filters in a WBEM server. This function contacts the WBEM server and retrieves the indication filters by enumerating the instances of CIM class "CIM_IndicationFilter" in the Interop namespace of the WBEM server. ...
[ "def", "get_all_filters", "(", "self", ",", "server_id", ")", ":", "# Validate server_id", "server", "=", "self", ".", "_get_server", "(", "server_id", ")", "return", "server", ".", "conn", ".", "EnumerateInstances", "(", "'CIM_IndicationFilter'", ",", "namespace"...
Return all indication filters in a WBEM server. This function contacts the WBEM server and retrieves the indication filters by enumerating the instances of CIM class "CIM_IndicationFilter" in the Interop namespace of the WBEM server. Parameters: server_id (:term:`string`): ...
[ "Return", "all", "indication", "filters", "in", "a", "WBEM", "server", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L833-L861
train
28,485
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.remove_filter
def remove_filter(self, server_id, filter_path): """ Remove an indication filter from a WBEM server, by deleting the indication filter instance in the WBEM server. The indication filter must be owned or permanent (i.e. not static). This method verifies that there are not curren...
python
def remove_filter(self, server_id, filter_path): """ Remove an indication filter from a WBEM server, by deleting the indication filter instance in the WBEM server. The indication filter must be owned or permanent (i.e. not static). This method verifies that there are not curren...
[ "def", "remove_filter", "(", "self", ",", "server_id", ",", "filter_path", ")", ":", "# Validate server_id", "server", "=", "self", ".", "_get_server", "(", "server_id", ")", "conn_id", "=", "server", ".", "conn", ".", "conn_id", "if", "server", ".", "conn",...
Remove an indication filter from a WBEM server, by deleting the indication filter instance in the WBEM server. The indication filter must be owned or permanent (i.e. not static). This method verifies that there are not currently any subscriptions on the specified indication filter, in ...
[ "Remove", "an", "indication", "filter", "from", "a", "WBEM", "server", "by", "deleting", "the", "indication", "filter", "instance", "in", "the", "WBEM", "server", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L863-L913
train
28,486
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.get_owned_subscriptions
def get_owned_subscriptions(self, server_id): """ Return the indication subscriptions in a WBEM server owned by this subscription manager. This function accesses only the local list of owned subscriptions; it does not contact the WBEM server. The local list of owned subscription...
python
def get_owned_subscriptions(self, server_id): """ Return the indication subscriptions in a WBEM server owned by this subscription manager. This function accesses only the local list of owned subscriptions; it does not contact the WBEM server. The local list of owned subscription...
[ "def", "get_owned_subscriptions", "(", "self", ",", "server_id", ")", ":", "# Validate server_id", "self", ".", "_get_server", "(", "server_id", ")", "return", "list", "(", "self", ".", "_owned_subscriptions", "[", "server_id", "]", ")" ]
Return the indication subscriptions in a WBEM server owned by this subscription manager. This function accesses only the local list of owned subscriptions; it does not contact the WBEM server. The local list of owned subscriptions is discovered from the WBEM server when the server is re...
[ "Return", "the", "indication", "subscriptions", "in", "a", "WBEM", "server", "owned", "by", "this", "subscription", "manager", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L1023-L1049
train
28,487
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager.get_all_subscriptions
def get_all_subscriptions(self, server_id): """ Return all indication subscriptions in a WBEM server. This function contacts the WBEM server and retrieves the indication subscriptions by enumerating the instances of CIM class "CIM_IndicationSubscription" in the Interop namespace...
python
def get_all_subscriptions(self, server_id): """ Return all indication subscriptions in a WBEM server. This function contacts the WBEM server and retrieves the indication subscriptions by enumerating the instances of CIM class "CIM_IndicationSubscription" in the Interop namespace...
[ "def", "get_all_subscriptions", "(", "self", ",", "server_id", ")", ":", "# Validate server_id", "server", "=", "self", ".", "_get_server", "(", "server_id", ")", "return", "server", ".", "conn", ".", "EnumerateInstances", "(", "SUBSCRIPTION_CLASSNAME", ",", "name...
Return all indication subscriptions in a WBEM server. This function contacts the WBEM server and retrieves the indication subscriptions by enumerating the instances of CIM class "CIM_IndicationSubscription" in the Interop namespace of the WBEM server. Parameters: ser...
[ "Return", "all", "indication", "subscriptions", "in", "a", "WBEM", "server", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L1051-L1080
train
28,488
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager._create_destination
def _create_destination(self, server_id, dest_url, owned): """ Create a listener destination instance in the Interop namespace of a WBEM server and return that instance. In order to catch any changes the server applies, the instance is retrieved again using the instance path ret...
python
def _create_destination(self, server_id, dest_url, owned): """ Create a listener destination instance in the Interop namespace of a WBEM server and return that instance. In order to catch any changes the server applies, the instance is retrieved again using the instance path ret...
[ "def", "_create_destination", "(", "self", ",", "server_id", ",", "dest_url", ",", "owned", ")", ":", "# Validate server_id", "server", "=", "self", ".", "_get_server", "(", "server_id", ")", "# validate the URL by reconstructing it. Do not allow defaults", "host", ",",...
Create a listener destination instance in the Interop namespace of a WBEM server and return that instance. In order to catch any changes the server applies, the instance is retrieved again using the instance path returned by instance creation. Parameters: server_id (:term:`s...
[ "Create", "a", "listener", "destination", "instance", "in", "the", "Interop", "namespace", "of", "a", "WBEM", "server", "and", "return", "that", "instance", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L1128-L1205
train
28,489
pywbem/pywbem
pywbem/_subscription_manager.py
WBEMSubscriptionManager._create_subscription
def _create_subscription(self, server_id, dest_path, filter_path, owned): """ Create an indication subscription instance in the Interop namespace of a WBEM server and return that instance. In order to catch any changes the server applies, the instance is retrieved again using th...
python
def _create_subscription(self, server_id, dest_path, filter_path, owned): """ Create an indication subscription instance in the Interop namespace of a WBEM server and return that instance. In order to catch any changes the server applies, the instance is retrieved again using th...
[ "def", "_create_subscription", "(", "self", ",", "server_id", ",", "dest_path", ",", "filter_path", ",", "owned", ")", ":", "# Validate server_id", "server", "=", "self", ".", "_get_server", "(", "server_id", ")", "sub_path", "=", "CIMInstanceName", "(", "SUBSCR...
Create an indication subscription instance in the Interop namespace of a WBEM server and return that instance. In order to catch any changes the server applies, the instance is retrieved again using the instance path returned by instance creation. Parameters: server_id (:ter...
[ "Create", "an", "indication", "subscription", "instance", "in", "the", "Interop", "namespace", "of", "a", "WBEM", "server", "and", "return", "that", "instance", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_subscription_manager.py#L1301-L1362
train
28,490
pywbem/pywbem
pywbem_mock/_mockmofwbemconnection.py
_MockMOFWBEMConnection.CreateClass
def CreateClass(self, *args, **kwargs): """ Override the CreateClass method in MOFWBEMConnection For a description of the parameters, see :meth:`pywbem.WBEMConnection.CreateClass`. """ cc = args[0] if args else kwargs['NewClass'] namespace = self.getns() ...
python
def CreateClass(self, *args, **kwargs): """ Override the CreateClass method in MOFWBEMConnection For a description of the parameters, see :meth:`pywbem.WBEMConnection.CreateClass`. """ cc = args[0] if args else kwargs['NewClass'] namespace = self.getns() ...
[ "def", "CreateClass", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "cc", "=", "args", "[", "0", "]", "if", "args", "else", "kwargs", "[", "'NewClass'", "]", "namespace", "=", "self", ".", "getns", "(", ")", "try", ":", "self"...
Override the CreateClass method in MOFWBEMConnection For a description of the parameters, see :meth:`pywbem.WBEMConnection.CreateClass`.
[ "Override", "the", "CreateClass", "method", "in", "MOFWBEMConnection" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem_mock/_mockmofwbemconnection.py#L72-L145
train
28,491
pywbem/pywbem
pywbem_mock/_mockmofwbemconnection.py
_MockMOFWBEMConnection._get_class
def _get_class(self, superclass, namespace=None, local_only=False, include_qualifiers=True, include_classorigin=True): """ This method is just rename of GetClass to support same method with both MOFWBEMConnection and FakedWBEMConnection """ r...
python
def _get_class(self, superclass, namespace=None, local_only=False, include_qualifiers=True, include_classorigin=True): """ This method is just rename of GetClass to support same method with both MOFWBEMConnection and FakedWBEMConnection """ r...
[ "def", "_get_class", "(", "self", ",", "superclass", ",", "namespace", "=", "None", ",", "local_only", "=", "False", ",", "include_qualifiers", "=", "True", ",", "include_classorigin", "=", "True", ")", ":", "return", "self", ".", "GetClass", "(", "superclas...
This method is just rename of GetClass to support same method with both MOFWBEMConnection and FakedWBEMConnection
[ "This", "method", "is", "just", "rename", "of", "GetClass", "to", "support", "same", "method", "with", "both", "MOFWBEMConnection", "and", "FakedWBEMConnection" ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem_mock/_mockmofwbemconnection.py#L147-L158
train
28,492
pywbem/pywbem
pywbem/tupletree.py
xml_to_tupletree_sax
def xml_to_tupletree_sax(xml_string, meaning, conn_id=None): """ Parse an XML string into tupletree with SAX parser. Parses the string using the class CIMContentHandler and returns the root element. As a SAX parser it uses minimal memory. This is a replacement for the previous parser (xml_to_t...
python
def xml_to_tupletree_sax(xml_string, meaning, conn_id=None): """ Parse an XML string into tupletree with SAX parser. Parses the string using the class CIMContentHandler and returns the root element. As a SAX parser it uses minimal memory. This is a replacement for the previous parser (xml_to_t...
[ "def", "xml_to_tupletree_sax", "(", "xml_string", ",", "meaning", ",", "conn_id", "=", "None", ")", ":", "handler", "=", "CIMContentHandler", "(", ")", "# The following conversion to a byte string is required for two reasons:", "# 1. xml.sax.parseString() raises UnicodeEncodeErro...
Parse an XML string into tupletree with SAX parser. Parses the string using the class CIMContentHandler and returns the root element. As a SAX parser it uses minimal memory. This is a replacement for the previous parser (xml_to_tuple) which used the dom parser. Parameters: xml_string (...
[ "Parse", "an", "XML", "string", "into", "tupletree", "with", "SAX", "parser", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupletree.py#L125-L210
train
28,493
pywbem/pywbem
pywbem/tupletree.py
check_invalid_xml_chars
def check_invalid_xml_chars(xml_string, meaning, conn_id=None): """ Examine an XML string and raise a `pywbem.XMLParseError` exception if the string contains characters that cannot legally be represented as XML characters. This function is used to improve the error information raised from Python's ...
python
def check_invalid_xml_chars(xml_string, meaning, conn_id=None): """ Examine an XML string and raise a `pywbem.XMLParseError` exception if the string contains characters that cannot legally be represented as XML characters. This function is used to improve the error information raised from Python's ...
[ "def", "check_invalid_xml_chars", "(", "xml_string", ",", "meaning", ",", "conn_id", "=", "None", ")", ":", "context_before", "=", "16", "# number of chars to print before any bad chars", "context_after", "=", "16", "# number of chars to print after any bad chars", "try", "...
Examine an XML string and raise a `pywbem.XMLParseError` exception if the string contains characters that cannot legally be represented as XML characters. This function is used to improve the error information raised from Python's `xml.dom.minidom` and `xml.sax` packages and should be called only after...
[ "Examine", "an", "XML", "string", "and", "raise", "a", "pywbem", ".", "XMLParseError", "exception", "if", "the", "string", "contains", "characters", "that", "cannot", "legally", "be", "represented", "as", "XML", "characters", "." ]
e54ecb82c2211e289a268567443d60fdd489f1e4
https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupletree.py#L440-L509
train
28,494
ariovistus/pyd
dcompiler.py
wrapped_spawn
def wrapped_spawn(self, cmdElements, tag): ''' wrap spawn with unique-ish travis fold prints ''' import uuid a = uuid.uuid1() print("travis_fold:start:%s-%s" % (tag, a)) try: spawn0(self, cmdElements) finally: print("travis_fold:end:%s-%s" % (tag, a))
python
def wrapped_spawn(self, cmdElements, tag): ''' wrap spawn with unique-ish travis fold prints ''' import uuid a = uuid.uuid1() print("travis_fold:start:%s-%s" % (tag, a)) try: spawn0(self, cmdElements) finally: print("travis_fold:end:%s-%s" % (tag, a))
[ "def", "wrapped_spawn", "(", "self", ",", "cmdElements", ",", "tag", ")", ":", "import", "uuid", "a", "=", "uuid", ".", "uuid1", "(", ")", "print", "(", "\"travis_fold:start:%s-%s\"", "%", "(", "tag", ",", "a", ")", ")", "try", ":", "spawn0", "(", "s...
wrap spawn with unique-ish travis fold prints
[ "wrap", "spawn", "with", "unique", "-", "ish", "travis", "fold", "prints" ]
16421f437470b83b31c50ba962a7317ff3f64f79
https://github.com/ariovistus/pyd/blob/16421f437470b83b31c50ba962a7317ff3f64f79/dcompiler.py#L182-L192
train
28,495
projectatomic/atomic-reactor
atomic_reactor/outer.py
BuildManager._build
def _build(self, build_method): """ build image from provided build_args :return: BuildResults """ logger.info("building image '%s'", self.image) self.ensure_not_built() self.temp_dir = tempfile.mkdtemp() temp_path = os.path.join(self.temp_dir, BUILD_JSON...
python
def _build(self, build_method): """ build image from provided build_args :return: BuildResults """ logger.info("building image '%s'", self.image) self.ensure_not_built() self.temp_dir = tempfile.mkdtemp() temp_path = os.path.join(self.temp_dir, BUILD_JSON...
[ "def", "_build", "(", "self", ",", "build_method", ")", ":", "logger", ".", "info", "(", "\"building image '%s'\"", ",", "self", ".", "image", ")", "self", ".", "ensure_not_built", "(", ")", "self", ".", "temp_dir", "=", "tempfile", ".", "mkdtemp", "(", ...
build image from provided build_args :return: BuildResults
[ "build", "image", "from", "provided", "build_args" ]
fd31c01b964097210bf169960d051e5f04019a80
https://github.com/projectatomic/atomic-reactor/blob/fd31c01b964097210bf169960d051e5f04019a80/atomic_reactor/outer.py#L45-L74
train
28,496
projectatomic/atomic-reactor
atomic_reactor/outer.py
BuildManager._load_results
def _load_results(self, container_id): """ load results from recent build :return: BuildResults """ if self.temp_dir: dt = DockerTasker() # FIXME: load results only when requested # results_path = os.path.join(self.temp_dir, RESULTS_JSON) ...
python
def _load_results(self, container_id): """ load results from recent build :return: BuildResults """ if self.temp_dir: dt = DockerTasker() # FIXME: load results only when requested # results_path = os.path.join(self.temp_dir, RESULTS_JSON) ...
[ "def", "_load_results", "(", "self", ",", "container_id", ")", ":", "if", "self", ".", "temp_dir", ":", "dt", "=", "DockerTasker", "(", ")", "# FIXME: load results only when requested", "# results_path = os.path.join(self.temp_dir, RESULTS_JSON)", "# df_path = os.path.join(se...
load results from recent build :return: BuildResults
[ "load", "results", "from", "recent", "build" ]
fd31c01b964097210bf169960d051e5f04019a80
https://github.com/projectatomic/atomic-reactor/blob/fd31c01b964097210bf169960d051e5f04019a80/atomic_reactor/outer.py#L76-L99
train
28,497
projectatomic/atomic-reactor
atomic_reactor/outer.py
BuildManager.commit_buildroot
def commit_buildroot(self): """ create image from buildroot :return: """ logger.info("committing buildroot") self.ensure_is_built() commit_message = "docker build of '%s' (%s)" % (self.image, self.uri) self.buildroot_image_name = ImageName( r...
python
def commit_buildroot(self): """ create image from buildroot :return: """ logger.info("committing buildroot") self.ensure_is_built() commit_message = "docker build of '%s' (%s)" % (self.image, self.uri) self.buildroot_image_name = ImageName( r...
[ "def", "commit_buildroot", "(", "self", ")", ":", "logger", ".", "info", "(", "\"committing buildroot\"", ")", "self", ".", "ensure_is_built", "(", ")", "commit_message", "=", "\"docker build of '%s' (%s)\"", "%", "(", "self", ".", "image", ",", "self", ".", "...
create image from buildroot :return:
[ "create", "image", "from", "buildroot" ]
fd31c01b964097210bf169960d051e5f04019a80
https://github.com/projectatomic/atomic-reactor/blob/fd31c01b964097210bf169960d051e5f04019a80/atomic_reactor/outer.py#L101-L116
train
28,498
projectatomic/atomic-reactor
docs/manpage/generate_manpage.py
ManPageFormatter.create_main_synopsis
def create_main_synopsis(self, parser): """ create synopsis from main parser """ self.add_usage(parser.usage, parser._actions, parser._mutually_exclusive_groups, prefix='') usage = self._format_usage(None, parser._actions, parser._mutuall...
python
def create_main_synopsis(self, parser): """ create synopsis from main parser """ self.add_usage(parser.usage, parser._actions, parser._mutually_exclusive_groups, prefix='') usage = self._format_usage(None, parser._actions, parser._mutuall...
[ "def", "create_main_synopsis", "(", "self", ",", "parser", ")", ":", "self", ".", "add_usage", "(", "parser", ".", "usage", ",", "parser", ".", "_actions", ",", "parser", ".", "_mutually_exclusive_groups", ",", "prefix", "=", "''", ")", "usage", "=", "self...
create synopsis from main parser
[ "create", "synopsis", "from", "main", "parser" ]
fd31c01b964097210bf169960d051e5f04019a80
https://github.com/projectatomic/atomic-reactor/blob/fd31c01b964097210bf169960d051e5f04019a80/docs/manpage/generate_manpage.py#L77-L87
train
28,499