<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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:`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: InstanceName (:class:`~pywbem.CIMInstanceName`):
 The instance path of the instance to be retrieved. If this object does not specify a namespace, the default namespace of the connection is used. Its `host` attribute will be ignored. LocalOnly (:class:`py:bool`):
 Controls the exclusion of inherited properties from the returned instance, as follows: * If `False`, inherited properties are not excluded. * If `True`, inherited properties are basically excluded, but the behavior may be WBEM server specific. * If `None`, this parameter is not passed to the WBEM server, and causes the server-implemented default to be used. :term:`DSP0200` defines that the server-implemented default is `True`. This parameter has been deprecated in :term:`DSP0200` and should be set to `False` by the caller. IncludeQualifiers (:class:`py:bool`):
 Indicates that qualifiers are to be included in the returned instance, as follows: * If `False`, qualifiers are not included. * If `True`, qualifiers are included if the WBEM server implements support for this parameter. * If `None`, this parameter is not passed to the WBEM server, and causes the server-implemented default to be used. :term:`DSP0200` defines that the server-implemented default is `False`. This parameter has been deprecated in :term:`DSP0200`. Clients cannot rely on qualifiers to be returned in this operation. IncludeClassOrigin (:class:`py:bool`):
 Indicates that class origin information is to be included on each property in the returned instance, as follows: * If `False`, class origin information is not included. * If `True`, class origin information is included. * If `None`, this parameter is not passed to the WBEM server, and causes the server-implemented default to be used. :term:`DSP0200` defines that the server-implemented default is `False`. This parameter has been deprecated in :term:`DSP0200`. WBEM servers may either implement this parameter as specified, or may treat any specified value as `False`. PropertyList (:term:`string` or :term:`py:iterable` of :term:`string`):
 An iterable specifying the names of the properties (or a string that defines a single property) to be included in the returned instance (case independent). An empty iterable indicates to include no properties. If `None`, all properties are included. **extra : Additional keyword arguments are passed as additional operation parameters to the WBEM server. Note that :term:`DSP0200` does not define any additional parameters for this operation. Returns: A :class:`~pywbem.CIMInstance` object that is a representation of the retrieved instance. Its `path` attribute is a :class:`~pywbem.CIMInstanceName` object with its attributes set as follows: * `classname`: Name of the creation class of the instance. * `keybindings`: Keybindings of the instance. * `namespace`: Name of the CIM namespace containing the instance. * `host`: `None`, indicating the WBEM server is unspecified. Raises: Exceptions described in :class:`~pywbem.WBEMConnection`. """
  # noqa: E501

        exc = None
        instance = None
        method_name = 'GetInstance'

        if self._operation_recorders:
            self.operation_recorder_reset()
            self.operation_recorder_stage_pywbem_args(
                method=method_name,
                InstanceName=InstanceName,
                LocalOnly=LocalOnly,
                IncludeQualifiers=IncludeQualifiers,
                IncludeClassOrigin=IncludeClassOrigin,
                PropertyList=PropertyList,
                **extra)

        try:

            stats = self.statistics.start_timer(method_name)
            # Strip off host and namespace to make this a "local" object
            namespace = self._iparam_namespace_from_objectname(
                InstanceName, 'InstanceName')
            instancename = self._iparam_instancename(InstanceName)
            PropertyList = _iparam_propertylist(PropertyList)

            result = self._imethodcall(
                method_name,
                namespace,
                InstanceName=instancename,
                LocalOnly=LocalOnly,
                IncludeQualifiers=IncludeQualifiers,
                IncludeClassOrigin=IncludeClassOrigin,
                PropertyList=PropertyList,
                **extra)

            if result is None:
                raise CIMXMLParseError(
                    "Expecting a child element below IMETHODRESPONSE, "
                    "got no child elements", conn_id=self.conn_id)
            result = result[0][2]  # List of children of IRETURNVALUE

            if not result:
                raise CIMXMLParseError(
                    "Expecting a child element below IRETURNVALUE, "
                    "got no child elements", conn_id=self.conn_id)
            instance = result[0]  # CIMInstance object

            if not isinstance(instance, CIMInstance):
                raise CIMXMLParseError(
                    _format("Expecting CIMInstance object in result, got {0} "
                            "object", instance.__class__.__name__),
                    conn_id=self.conn_id)

            # The GetInstance CIM-XML operation returns the instance as an
            # INSTANCE element, which does not contain an instance path. We
            # want to return the instance with a path, so we set it to the
            # input path. Because the namespace in the input path is optional,
            # we set it to the effective target namespace (on a copy of the
            # input path).
            instance.path = instancename.copy()
            instance.path.namespace = namespace

            return instance

        except (CIMXMLParseError, XMLParseError) as exce:
            exce.request_data = self.last_raw_request
            exce.response_data = self.last_raw_reply
            exc = exce
            raise
        except Exception as exce:
            exc = exce
            raise
        finally:
            self._last_operation_time = stats.stop_timer(
                self.last_request_len, self.last_reply_len,
                self.last_server_response_time, exc)
            if self._operation_recorders:
                self.operation_recorder_stage_result(instance, exc)