code: def _mean_metric(
      feature_key_path: _KeyPath,
      example_weights_key_path: _KeyPath,
      name: str,
  ) -> metric_types.MetricComputations:
      """Returns metric computation for mean metric."""
      key = metric_types.MetricKey(
          name=name,
          example_weighted=example_weights_key_path is not None,
      )
  
      include_filter = _convert_key_path_to_dict(feature_key_path)
      if example_weights_key_path:
          include_filter = util.merge_filters(
              include_filter,
              _convert_key_path_to_dict(example_weights_key_path),
          )
  
      return [
          metric_types.MetricComputation(
              keys=[key],
              preprocessors=[
                  metric_types.StandardMetricInputsPreprocessor(
                      include_filter=include_filter,
                      include_default_inputs=False,
                  )
              ],
              combiner=_MeanCombiner(
                  key, feature_key_path, example_weights_key_path
              ),
          )
      ]
  
file_path: model-analysis/tensorflow_model_analysis/metrics/stats.py
imports: import dataclasses
  from typing import Any, Dict, Iterable, Optional, Tuple, Union
  import apache_beam
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 2 for calling a global function with example usage: _mean_metric(feature_key_path, example_weights_key_path, name) and returns: list