code: def single_surrogate_only(f: Callable[..., T]) -> Callable[..., T]:
      """
      For use as a decorator on functions only implemented for BotorchModels with a
      single Surrogate.
      """
  
      @wraps(f)
      def impl(
          self: "BoTorchModel",
          *args: List[Any],
          **kwargs: Dict[str, Any],
      ) -> T:
          if len(self._surrogates) != 1:
              raise NotImplementedError(
                  f"{f.__name__} not implemented for multi-surrogate case. Found "
                  f"{self.surrogates=}."
              )
          return f(self, *args, **kwargs)
  
      return impl
  
imports: import dataclasses
  from copy import deepcopy
  from dataclasses import dataclass, field
  from functools import wraps
  from typing import Any, Callable, Dict, List, Mapping, Optional, OrderedDict, Tuple, Type, TypeVar
  import numpy
  import torch
  from ax.core.search_space import SearchSpaceDigest
  from ax.core.types import TCandidateMetadata, TGenMetadata
  from ax.exceptions.core import UserInputError
  from ax.models.torch.botorch import get_feature_importances_from_botorch_model, get_rounding_func
  from ax.models.torch.botorch_modular.acquisition import Acquisition
  from ax.models.torch.botorch_modular.surrogate import Surrogate
  from ax.models.torch.botorch_modular.utils import check_metric_dataset_match, choose_botorch_acqf_class, construct_acquisition_and_optimizer_options, get_subset_datasets
  from ax.models.torch.utils import _to_inequality_constraints
  from ax.models.torch_base import TorchGenResults, TorchModel, TorchOptConfig
  from ax.utils.common.base import Base
  from ax.utils.common.constants import Keys
  from ax.utils.common.docutils import copy_doc
  from ax.utils.common.typeutils import checked_cast
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.models.deterministic import FixedSingleSampleModel
  from botorch.models.model import Model
  from botorch.models.transforms.input import InputTransform
  from botorch.models.transforms.outcome import OutcomeTransform
  from botorch.utils.datasets import SupervisedDataset
  from gpytorch.kernels.kernel import Kernel
  from gpytorch.likelihoods import Likelihood
  from gpytorch.mlls.exact_marginal_log_likelihood import ExactMarginalLogLikelihood
  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: single_surrogate_only(f) and returns: impl, f