code: def _get_saver_def_or_none(
      exported_model: exported_model_pb2.ExportedModel,
  ) -> Optional[saver_pb2.SaverDef]:
      """Returns the SaverDef from ExportedModel, None otherwise.
  
      Args:
        exported_model: ExportedModel to take the SaverDef from.
  
      Returns:
        SaverDef instance if the field `saver_def` is set. None otherwise.
      """
      if exported_model.HasField("saver_def"):
          return exported_model.saver_def
      return None
  
imports: from collections.abc import Callable, Collection, Mapping, Sequence
  from typing import Optional
  from absl import logging
  from tensorflow.compiler.mlir.quantization.tensorflow import exported_model_pb2
  from tensorflow.compiler.mlir.quantization.tensorflow import quantization_options_pb2
  from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_algorithm
  from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_statistics_pb2
  from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import pywrap_calibration
  from tensorflow.compiler.mlir.quantization.tensorflow.python import pywrap_function_lib
  from tensorflow.compiler.mlir.quantization.tensorflow.python import representative_dataset
  from tensorflow.compiler.mlir.quantization.tensorflow.python import save_model
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.protobuf import saver_pb2
  from tensorflow.python.client import session
  from tensorflow.python.eager import context
  from tensorflow.python.eager import wrap_function
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_conversion
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.saved_model import load
  from tensorflow.python.saved_model import loader_impl
  from tensorflow.python.trackable import autotrackable
  from tensorflow.python.types import core
label_desc: Use image node_id 1 for calling a global function with example usage: _get_saver_def_or_none(exported_model) and returns: None, exported_model