code: def test_check_metric_dataset_match(self) -> None:
      ds = self.fixed_noise_datasets[0]
      # Simple test with one metric & dataset.
      for exact_match in (True, False):
          self.assertIsNone(
              check_metric_dataset_match(
                  metric_names=ds.outcome_names,
                  datasets=[ds],
                  exact_match=exact_match,
              )
          )
      # Error with duplicate metric names.
      with self.assertRaisesRegex(AxError, "duplicate metric names"):
          check_metric_dataset_match(
              metric_names=["y", "y"], datasets=[ds], exact_match=False
          )
      ds2 = self.supervised_datasets[0]
      # Error with duplicate outcomes in datasets.
      with self.assertRaisesRegex(AxError, "duplicate outcomes"):
          check_metric_dataset_match(
              metric_names=["y", "y2"],
              datasets=[ds, ds2],
              exact_match=False,
          )
      ds2.outcome_names = ["y2"]
      # Simple test with two metrics & datasets.
      for exact_match in (True, False):
          self.assertIsNone(
              check_metric_dataset_match(
                  metric_names=["y", "y2"],
                  datasets=[ds, ds2],
                  exact_match=exact_match,
              )
          )
      # Exact match required but too many datasets provided.
      with self.assertRaisesRegex(
          AxError, "must correspond to an outcome"
      ):
          check_metric_dataset_match(
              metric_names=["y"],
              datasets=[ds, ds2],
              exact_match=True,
          )
      # The same check passes if we don't require exact match.
      self.assertIsNone(
          check_metric_dataset_match(
              metric_names=["y"],
              datasets=[ds, ds2],
              exact_match=False,
          )
      )
      # Error if metric doesn't exist in the datasets.
      for exact_match in (True, False):
          with self.assertRaisesRegex(
              AxError, "but the datasets model"
          ):
              check_metric_dataset_match(
                  metric_names=["z"],
                  datasets=[ds, ds2],
                  exact_match=exact_match,
              )
  
imports: import warnings
  from typing import OrderedDict
  import numpy
  import torch
  from ax.core.search_space import SearchSpaceDigest
  from ax.exceptions.core import AxError, AxWarning, UnsupportedError
  from ax.models.torch.botorch_modular.utils import _get_shared_rows, _tensor_difference, check_metric_dataset_match, choose_botorch_acqf_class, choose_model_class, construct_acquisition_and_optimizer_options, convert_to_block_design, get_subset_datasets, subset_state_dict, use_model_list
  from ax.models.torch.utils import _to_inequality_constraints
  from ax.utils.common.constants import Keys
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import checked_cast, not_none
  from ax.utils.testing.torch_stubs import get_torch_test_data
  from botorch.acquisition import qLogNoisyExpectedImprovement
  from botorch.acquisition.multi_objective.logei import qLogNoisyExpectedHypervolumeImprovement
  from botorch.models.fully_bayesian import SaasFullyBayesianSingleTaskGP
  from botorch.models.gp_regression import SingleTaskGP
  from botorch.models.gp_regression_fidelity import SingleTaskMultiFidelityGP
  from botorch.models.gp_regression_mixed import MixedSingleTaskGP
  from botorch.models.model_list_gp_regression import ModelListGP
  from botorch.models.multitask import MultiTaskGP
  from botorch.utils.datasets import SupervisedDataset
label_desc: Use image node_id 13 for calling the BoTorchModelUtilsTest obj's underlying member method code with example usage: obj.test_check_metric_dataset_match() without return types