code: def testMeanPerClassAccuracy(self, distribution):
      def _metric_fn(x):
          labels = x["labels"]
          predictions = x["predictions"]
          return metrics.mean_per_class_accuracy(
              labels, predictions, num_classes=5
          )
  
      def _expected_fn(num_batches):
          mean = lambda x: sum(x) / len(x)
          return [
              mean([1.0, 1.0, 1.0, 0.0, 0.0]),
              mean([0.5, 0.5, 0.5, 0.0, 0.0]),
              mean([1.0 / 3, 1.0 / 3, 0.5, 0.0, 0.0]),
              mean([0.5, 1.0 / 3, 1.0 / 3, 0.0, 0.0]),
          ][num_batches - 1]
  
      self._test_metric(
          distribution, _labeled_dataset_fn, _metric_fn, _expected_fn
      )
  
imports: from absl.testing import parameterized
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import strategy_combinations
  from tensorflow.python.distribute import strategy_test_lib
  from tensorflow.python.eager import test
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import metrics
  from tensorflow.python.ops import variables
label_desc: Use image node_id 4 for calling the MetricsV1Test obj's underlying member method code with example usage: obj.testMeanPerClassAccuracy(distribution) and returns: metrics, list