code: def _parse_input_graph_proto(
      input_graph: str, input_binary: bool
  ) -> graph_pb2.GraphDef:
      """Parses input tensorflow graph into GraphDef proto."""
      if not gfile.Exists(input_graph):
          raise IOError(
              "Input graph file '" + input_graph + "' does not exist!"
          )
      input_graph_def = graph_pb2.GraphDef()
      mode = "rb" if input_binary else "r"
      with gfile.GFile(input_graph, mode) as f:
          if input_binary:
              input_graph_def.ParseFromString(f.read())
          else:
              text_format.Merge(f.read(), input_graph_def)
      return input_graph_def
  
imports: import argparse
  import re
  import sys
  from typing import List, Optional, Union
  from absl import app
  from google.protobuf import text_format
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.protobuf import saver_pb2
  from tensorflow.python.checkpoint import checkpoint_management
  from tensorflow.python.client import session
  from tensorflow.python.framework import convert_to_constants
  from tensorflow.python.framework import importer
  from tensorflow.python.platform import gfile
  from tensorflow.python.saved_model import loader
  from tensorflow.python.saved_model import tag_constants
  from tensorflow.python.tools import saved_model_utils
  from tensorflow.python.training import py_checkpoint_reader
  from tensorflow.python.training import saver
label_desc: Use image node_id 3 for calling a global function with example usage: _parse_input_graph_proto(input_graph, input_binary) and returns: input_graph_def