docstr: Returns True if the connection goes to a mandatory input socket, False otherwise
docstr_tok: ["Returns","True","if","the","connection","goes","to","a","mandatory","input","socket",",","False","otherwise"]
code: def is_mandatory(self) -> bool:
      """
      Returns True if the connection goes to a mandatory input socket, False otherwise
      """
      if self.receiver_socket:
          return self.receiver_socket.is_mandatory
      return False
  
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 4 for calling the Connection obj's underlying member method code with example usage: obj.is_mandatory() and returns: False, self