code: def _get_golden_subgraph(graph_name, spec):
      """Retrieves a corresponding golden subgraph."""
      filename = _generate_unique_filename(spec.input_names)
      filepath = os.path.join(
          os.path.dirname(__file__), "testdata", graph_name, filename
      )
  
      graph_def = tf.compat.v1.GraphDef()
      with fileio.open(filepath, "r") as f:
          text_format.Parse(f.read(), graph_def)
      return graph_def
  
file_path: tfx/tfx/experimental/distributed_inference/graphdef_experiments/subgraph_partitioning/graph_partition_test.py
imports: import os
  import tempfile
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import create_complex_graph
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import graph_partition
  from google.protobuf import text_format
label_desc: Use image node_id 1 for calling a global function with example usage: _get_golden_subgraph(graph_name, spec) and returns: graph_def