docs: def get_instance_details(self, name):
          # type: (str) -> Dict[str, Any]
          """
          Retrieves a snapshot of the given component instance.
          The result dictionary has the following keys:
  
          * ``name``: The component name
          * ``factory``: The name of the component factory
          * ``bundle_id``: The ID of the bundle providing the component factory
          * ``state``: The current component state
          * ``services``: A ``{Service ID → Service reference}`` dictionary, with
            all services provided by the component
          * ``dependencies``: A dictionary associating field names with the
            following dictionary:
  
            * ``handler``: The name of the type of the dependency handler
            * ``filter`` (optional): The requirement LDAP filter
            * ``optional``: A flag indicating whether the requirement is optional
              or not
            * ``aggregate``: A flag indicating whether the requirement is a set
              of services or not
            * ``binding``: A list of the ServiceReference the component is bound
              to
  
          * ``properties``: A dictionary key → value, with all properties of the
            component. The value is converted to its string representation, to
            avoid unexpected behaviours.
  
          :param name: The name of a component instance
          :return: A dictionary of details
          :raise ValueError: Invalid component name
          """
          if not is_string(name):
              raise ValueError("Component name must be a string")
  
          with self.__instances_lock:
              if name not in self.__instances:
                  raise ValueError("Unknown component: {0}".format(name))
  
              stored_instance = self.__instances[name]
              assert isinstance(stored_instance, StoredInstance)
              with stored_instance._lock:
                  result = {}  # type: Dict[str, Any]
                  result["name"] = stored_instance.name
  
                  # Factory name
                  result["factory"] = stored_instance.factory_name
  
                  # Factory bundle
                  result[
                      "bundle_id"
                  ] = stored_instance.bundle_context.get_bundle().get_bundle_id()
  
                  # Component state
                  result["state"] = stored_instance.state
  
                  # Error details
                  result["error_trace"] = stored_instance.error_trace
  
                  # Provided service
                  result["services"] = {}
                  for handler in stored_instance.get_handlers(
                      handlers_const.KIND_SERVICE_PROVIDER
                  ):
                      svc_ref = handler.get_service_reference()
                      if svc_ref is not None:
                          svc_id = svc_ref.get_property(SERVICE_ID)
                          result["services"][svc_id] = svc_ref
  
                  # Dependencies
                  result["dependencies"] = {}
                  for dependency in stored_instance.get_handlers(
                      handlers_const.KIND_DEPENDENCY
                  ):
                      # Dependency
                      info = result["dependencies"][dependency.get_field()] = {}
                      info["handler"] = type(dependency).__name__
  
                      # Requirement
                      req = dependency.requirement
                      info["specification"] = req.specification
                      info["filter"] = str(req.filter) if req.filter else None
                      info["optional"] = req.optional
                      info["aggregate"] = req.aggregate
  
                      # Bindings
                      info["bindings"] = dependency.get_bindings()
  
                  # Properties
                  properties = stored_instance.context.properties.items()
                  result["properties"] = {
                      str(key): str(value) for key, value in properties
                  }
  
                  # All done
                  return result