code: def find_pipeline_outputs(
      graph: networkx.MultiDiGraph,
  ) -> Dict[str, List[OutputSocket]]:
      """
      Collect components that have disconnected output sockets. They define the pipeline output.
      """
      return {
          name: [
              socket
              for socket in data.get("output_sockets", {}).values()
              if not socket.receivers
          ]
          for name, data in graph.nodes(data=True)
      }
  
file_path: haystack/haystack/core/pipeline/descriptions.py
imports: from typing import List, Dict
  import logging
  import networkx
  from haystack.core.type_utils import _type_name
  from haystack.core.component.sockets import InputSocket, OutputSocket
label_desc: Use image node_id 2 for calling a global function with example usage: find_pipeline_outputs(graph) and returns: unknown