code: def component_from_dict(
      cls: Type[object], data: Dict[str, Any]
  ) -> Any:
      """
      The unmarshaller used by the Pipeline. If a `from_dict` method is present in the
      component instance, that will be used instead of the default method.
      """
      if hasattr(cls, "from_dict"):
          return cls.from_dict(data)
  
      return default_from_dict(cls, data)
  
imports: import inspect
  from typing import Type, Dict, Any
  from haystack.core.errors import DeserializationError, SerializationError
label_desc: Use image node_id 2 for calling a global function with example usage: component_from_dict(cls, data) and returns: default_from_dict, cls