code: def _partition_one_graph(
      graph_def: tf.compat.v1.GraphDef, output_names: List[str]
  ) -> List[execution_spec.ExecutionSpec]:
      """Partitions one graph.
  
      Args:
        graph_def: A `GraphDef` proto for that graph.
        output_names: A list of graph's output node names.
  
      Returns:
        A list of ExecutionSpecs.
      """
      graph = _get_graph(graph_def)
      node_name_to_node_def = _get_node_name_to_node_def(graph_def)
  
      remote_op_to_immediate_dep = _get_remote_op_to_immediate_dep(
          node_name_to_node_def
      )
  
      specs = _get_execution_specs(
          graph_def,
          output_names,
          graph,
          node_name_to_node_def,
          remote_op_to_immediate_dep,
      )
  
      _modify_execution_specs_for_input_validity(specs)
  
      return specs
  
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 4 for calling a global function with example usage: _partition_one_graph(graph_def, output_names) and returns: specs