code: def _validate_nodes_receive_only_expected_input(
      graph: networkx.MultiDiGraph, input_values: Dict[str, Any]
  ):
      """
      Make sure that every input node is only receiving input values from EITHER the pipeline's input or another node,
      but never from both.
      """
      for node, input_data in input_values.items():
          for socket_name in input_data.keys():
              if input_data.get(socket_name, None) is None:
                  continue
              if (
                  not socket_name
                  in graph.nodes[node]["input_sockets"].keys()
              ):
                  all_inputs = describe_pipeline_inputs_as_string(graph)
                  raise ValueError(
                      f"Component {node} is not expecting any input value called {socket_name}.\n\n{all_inputs}"
                  )
  
              input_socket: InputSocket = graph.nodes[node][
                  "input_sockets"
              ][socket_name]
              if input_socket.senders and not input_socket.is_variadic:
                  raise ValueError(
                      f"The input {socket_name} of {node} is already sent by: {input_socket.senders}"
                  )
  
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 3 for calling a global function with example usage: _validate_nodes_receive_only_expected_input(graph, input_values) without return types