code: def _connections_status(
      sender_node: str,
      receiver_node: str,
      sender_sockets: List[OutputSocket],
      receiver_sockets: List[InputSocket],
  ):
      """
      Lists the status of the sockets, for error messages.
      """
      sender_sockets_entries = []
      for sender_socket in sender_sockets:
          sender_sockets_entries.append(
              f" - {sender_socket.name}: {_type_name(sender_socket.type)}"
          )
      sender_sockets_list = "\n".join(sender_sockets_entries)
  
      receiver_sockets_entries = []
      for receiver_socket in receiver_sockets:
          if receiver_socket.senders:
              sender_status = (
                  f"sent by {','.join(receiver_socket.senders)}"
              )
          else:
              sender_status = "available"
          receiver_sockets_entries.append(
              f" - {receiver_socket.name}: {_type_name(receiver_socket.type)} ({sender_status})"
          )
      receiver_sockets_list = "\n".join(receiver_sockets_entries)
  
      return f"'{sender_node}':\n{sender_sockets_list}\n'{receiver_node}':\n{receiver_sockets_list}"
  
file_path: haystack/haystack/core/component/connection.py
imports: import itertools
  from typing import Optional, List, Tuple
  from dataclasses import dataclass
  from haystack.core.component.sockets import InputSocket, OutputSocket
  from haystack.core.type_utils import _type_name, _types_are_compatible
  from haystack.core.errors import PipelineConnectError
label_desc: Use image node_id 1 for calling a global function with example usage: _connections_status(sender_node, receiver_node, sender_sockets, receiver_sockets) and returns: str, sender_node, str, sender_sockets_list, str, receiver_node, str, receiver_sockets_list