code: def _validate_input_sockets_are_connected(
      graph: networkx.MultiDiGraph, input_values: Dict[str, Any]
  ):
      """
      Make sure all the inputs nodes are receiving all the values they need, either from the Pipeline's input or from
      other nodes.
      """
      valid_inputs = find_pipeline_inputs(graph)
      for node, sockets in valid_inputs.items():
          for socket in sockets:
              inputs_for_node = input_values.get(node, {})
              missing_input_value = (
                  inputs_for_node is None
                  or not socket.name in inputs_for_node.keys()
                  or inputs_for_node.get(socket.name, None) is None
              )
              if (
                  missing_input_value
                  and socket.is_mandatory
                  and not socket.is_variadic
              ):
                  all_inputs = describe_pipeline_inputs_as_string(graph)
                  raise ValueError(
                      f"Missing input: {node}.{socket.name}\n\n{all_inputs}"
                  )
  
file_path: haystack/haystack/core/pipeline/validation.py
imports: from typing import Dict, Any
  import logging
  import networkx
  from haystack.core.errors import PipelineValidationError
  from haystack.core.component.sockets import InputSocket
  from haystack.core.pipeline.descriptions import find_pipeline_inputs, describe_pipeline_inputs_as_string
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_input_sockets_are_connected(graph, input_values) without return types