code: def _custom_objects(
      metrics: Dict[str, List[tf.keras.metrics.Metric]]
  ) -> List[Tuple[str, str]]:
      """Returns list of (module, class_name) tuples for custom objects."""
      custom_objects = []
      for metric_list in metrics.values():
          for metric in metric_list:
              if (
                  metric.__class__.__module__
                  != tf.keras.metrics.__name__
                  and metric.__class__.__module__
                  != tf.keras.losses.__name__
              ):
                  custom_objects.append(
                      (
                          metric.__class__.__module__,
                          metric.__class__.__name__,
                      )
                  )
      return custom_objects
  
imports: import collections
  import importlib
  import itertools
  from typing import Any, Dict, Iterable, List, Optional, Type, Tuple, Union
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.metrics import binary_confusion_matrices
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.metrics import tf_metric_accumulators
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
label_desc: Use image node_id 9 for calling a global function with example usage: _custom_objects(metrics) and returns: custom_objects