code: def test_get_subset_datasets(self) -> None:
      ds = self.fixed_noise_datasets[0]
      ds2 = self.supervised_datasets[0]
      ds2.outcome_names = ["y2"]
      ds3 = SupervisedDataset(
          X=torch.zeros(1, 2),
          Y=torch.ones(1, 2),
          feature_names=["x1", "x2"],
          outcome_names=["y3", "y4"],
      )
      # Test with single dataset.
      self.assertEqual(
          [ds],
          get_subset_datasets(datasets=[ds], subset_metric_names=["y"]),
      )
      # Edge case of empty metric list.
      self.assertEqual(
          [], get_subset_datasets(datasets=[ds], subset_metric_names=[])
      )
      # Multiple datasets, single metric.
      self.assertEqual(
          [ds],
          get_subset_datasets(
              datasets=[ds, ds2, ds3], subset_metric_names=["y"]
          ),
      )
      self.assertEqual(
          [ds2],
          get_subset_datasets(
              datasets=[ds, ds2, ds3], subset_metric_names=["y2"]
          ),
      )
      # Multi-output dataset, 1 metric -- not allowed.
      with self.assertRaisesRegex(
          UnsupportedError, "multi-outcome dataset"
      ):
          get_subset_datasets(
              datasets=[ds, ds2, ds3], subset_metric_names=["y3"]
          )
      # Multiple datasets, multiple metrics -- datasets in the same order as metrics.
      self.assertEqual(
          [ds2, ds],
          get_subset_datasets(
              datasets=[ds, ds2, ds3], subset_metric_names=["y2", "y"]
          ),
      )
      self.assertEqual(
          [ds3, ds],
          get_subset_datasets(
              datasets=[ds, ds2, ds3],
              subset_metric_names=["y3", "y", "y4"],
          ),
      )
  
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 14 for calling the BoTorchModelUtilsTest obj's underlying member method code with example usage: obj.test_get_subset_datasets() without return types