code: def has_attributions_metrics(
      metrics_specs: Iterable[config_pb2.MetricsSpec],
  ) -> bool:
      """Returns true if any of the metrics_specs have attributions metrics."""
      tfma_metric_classes = metric_types.registered_metrics()
      for metrics_spec in metrics_specs:
          for metric_config in metrics_spec.metrics:
              instance = metric_specs.metric_instance(
                  metric_config, tfma_metric_classes
              )
              if isinstance(instance, AttributionsMetric):
                  return True
      return False
  
imports: import functools
  from typing import Any, Dict, Iterable, List, Optional, Union
  import apache_beam
  import numpy
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.metrics import example_count
  from tensorflow_model_analysis.metrics import metric_specs
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 1 for calling a global function with example usage: has_attributions_metrics(metrics_specs) and returns: False, True