code: def _mean_absolute_percentage_error_computations(
      name: Optional[str] = None,
      eval_config: Optional[config_pb2.EvalConfig] = None,
      model_name: Optional[str] = None,
      output_name: Optional[str] = None,
      example_weighted: bool = False,
      sub_key: Optional[metric_types.SubKey] = None,
      aggregation_type: Optional[metric_types.AggregationType] = None,
      class_weights: Optional[Dict[int, float]] = None,
  ) -> metric_types.MetricComputations:
      """Returns metric computations for mean absolute percentage error.
  
      Args:
        name: The name of the metric.
        eval_config: The configurations for TFMA pipeline.
        model_name: The name of the model to get predictions from.
        output_name: The name of the output under the model to get predictions from.
        example_weighted: Whether the examples have specified weights.
        sub_key: The key includes class, top-k, k information. It should only be in
          classfication problems.
        aggregation_type: The method to aggregate over classes. It should only be in
          classfication problems.
        class_weights: The weight of classes. It should only be in classfication
          problems.
      """
      key = metric_types.MetricKey(
          name=name,
          model_name=model_name,
          output_name=output_name,
          sub_key=sub_key,
          example_weighted=example_weighted,
      )
      return [
          metric_types.MetricComputation(
              keys=[key],
              preprocessors=None,
              combiner=_MeanAbsolutePercentageErrorCombiner(
                  eval_config=eval_config,
                  model_name=model_name,
                  output_name=output_name,
                  metric_key=key,
                  class_weights=class_weights,
                  aggregation_type=aggregation_type,
                  example_weighted=example_weighted,
              ),
          )
      ]
  
imports: import abc
  import dataclasses
  from typing import Iterable, Optional, Dict
  import apache_beam
  import numpy
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: _mean_absolute_percentage_error_computations(name, eval_config, model_name, output_name, example_weighted, sub_key, aggregation_type, class_weights) and returns: list