code: def _run_graph_for_calibration_eager_mode(
      model_dir: str,
      tags: Collection[str],
      representative_dataset_map: rd.RepresentativeDatasetMapping,
  ) -> None:
      """Runs the graph for calibration in eager mode.
  
      This function assumes _eager mode_ (enabled in TF2 by default) when running
      the graph. This step is used in order to collect the statistics in
      CustomAggregatorOp for quantization using the representative dataset for the
      actual data provided for inference.
  
      Args:
        model_dir: Path to SavedModel directory.
        tags: Collection of tags identifying the MetaGraphDef within the SavedModel.
        representative_dataset_map: A map where signature keys are mapped to
          corresponding representative datasets.
  
      Raises:
        ValueError: When running the function with the representative dataset fails.
      """
      root: autotrackable.AutoTrackable = load.load(model_dir, tags)
      for signature_key, repr_ds in representative_dataset_map.items():
          try:
              _run_function_for_calibration_eager_mode(
                  func=root.signatures[signature_key],
                  representative_dataset=repr_ds,
              )
          except Exception as ex:
              raise ValueError(
                  "Failed to run representative dataset through the "
                  f"function with the signature key: {signature_key}."
              ) from ex
  
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 11 for calling a global function with example usage: _run_graph_for_calibration_eager_mode(model_dir, tags, representative_dataset_map) without return types