code: def use_model_list(
      datasets: List[SupervisedDataset],
      botorch_model_class: Type[Model],
      allow_batched_models: bool = True,
  ) -> bool:
      if issubclass(botorch_model_class, MultiTaskGP):
          # We currently always wrap multi-task models into `ModelListGP`.
          return True
      elif issubclass(
          botorch_model_class, SaasFullyBayesianSingleTaskGP
      ):
          # SAAS models do not support multiple outcomes.
          # Use model list if there are multiple outcomes.
          return len(datasets) > 1 or datasets[0].Y.shape[-1] > 1
      elif len(datasets) == 1:
          # Just one outcome, can use single model.
          return False
      elif issubclass(
          botorch_model_class, BatchedMultiOutputGPyTorchModel
      ) and all(
          torch.equal(datasets[0].X, ds.X) for ds in datasets[1:]
      ):
          # Use batch models if allowed
          return not allow_batched_models
      # If there are multiple Xs and they are not all equal, we
      # use `ListSurrogate` and `ModelListGP`.
      return True
  
imports: import warnings
  from logging import Logger
  from typing import Any, Callable, Dict, List, Optional, OrderedDict, Tuple, Type
  import torch
  from ax.core.search_space import SearchSpaceDigest
  from ax.exceptions.core import AxError, AxWarning, UnsupportedError
  from ax.models.types import TConfig
  from ax.utils.common.constants import Keys
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import checked_cast, not_none
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.acquisition.logei import qLogNoisyExpectedImprovement
  from botorch.acquisition.multi_objective.logei import qLogNoisyExpectedHypervolumeImprovement
  from botorch.fit import fit_fully_bayesian_model_nuts, fit_gpytorch_mll
  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.gpytorch import BatchedMultiOutputGPyTorchModel, GPyTorchModel
  from botorch.models.model import Model, ModelList
  from botorch.models.multitask import MultiTaskGP
  from botorch.models.pairwise_gp import PairwiseGP
  from botorch.utils.datasets import SupervisedDataset
  from botorch.utils.transforms import is_fully_bayesian
  from gpytorch.mlls.marginal_log_likelihood import MarginalLogLikelihood
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: use_model_list(datasets, botorch_model_class, allow_batched_models) and returns: True, True, unknown, False, unknown