code: def test_ComputeDiagnostics(self) -> None:
      # Construct CVResults
      result = []
      for i, obs in enumerate(self.training_data):
          result.append(
              CVResult(observed=obs, predicted=self.observation_data[i])
          )
      # Compute diagnostics
      diag = compute_diagnostics(result=result)
      for v in diag.values():
          self.assertEqual(set(v.keys()), {"a", "b"})
      # Check for correct computation, relative to manually computed result
      self.assertAlmostEqual(diag["MAPE"]["a"], 0.4984126984126984)
      self.assertAlmostEqual(diag["MAPE"]["b"], 0.8312499999999999)
      self.assertAlmostEqual(
          diag["wMAPE"]["a"],
          sum([0.0, 1.0, 4.0, 5.0, 7.0]) / sum([2, 3, 6, 7, 9]),
      )
      self.assertAlmostEqual(
          diag["wMAPE"]["b"],
          sum([3.0, 4.0, 7.0, 9.0]) / sum([4, 5, 8, 10]),
      )
      self.assertAlmostEqual(diag["Total raw effect"]["a"], 3.5)
      self.assertAlmostEqual(diag["Total raw effect"]["b"], 1.5)
      self.assertAlmostEqual(
          diag["Log likelihood"]["a"], -50.09469266602336
      )
      self.assertAlmostEqual(
          diag["Log likelihood"]["b"], -25.82334285505847
      )
  
imports: from typing import List
  from unittest import mock
  import numpy
  from ax.core.metric import Metric
  from ax.core.objective import MultiObjective, Objective
  from ax.core.observation import Observation, ObservationData, ObservationFeatures
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.outcome_constraint import OutcomeConstraint
  from ax.core.types import ComparisonOp
  from ax.modelbridge.cross_validation import assess_model_fit, compute_diagnostics, cross_validate, cross_validate_by_trial, CVDiagnostics, CVResult, has_good_opt_config_model_fit, SingleDiagnosticBestModelSelector
  from ax.modelbridge.registry import Models
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_branin_experiment
label_desc: Use image node_id 6 for calling the CrossValidationTest obj's underlying member method code with example usage: obj.test_ComputeDiagnostics() without return types