code: def _modify_execution_specs_for_input_validity(
      specs: List[execution_spec.ExecutionSpec],
  ) -> None:
      """Modifies the execution specs to ensure that all inputs are valid.
  
      Ensure inputs have been outputted by previous specs. Sometimes an input
      of a spec may be a node from a previous spec but not one of the outputs.
      We'd like to add it to previous spec's outputs.
  
      Args:
        specs: A list of ExecutionSpecs, where order of the list represents the
          order of the execution.
      """
      for current_spec_index, current_spec in enumerate(specs):
          for previous_spec in specs[:current_spec_index]:
              if previous_spec.is_remote_op:
                  continue
              _add_current_spec_input_to_previous_spec_output(
                  current_spec, previous_spec
              )
  
imports: import collections
  from typing import Dict, List, Mapping, Set
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import execution_spec
label_desc: Use image node_id 18 for calling a global function with example usage: _modify_execution_specs_for_input_validity(specs) without return types