code: def test_BotorchModelConstraints(self) -> None:
      (
          Xs1,
          Ys1,
          Yvars1,
          bounds,
          tfs,
          feature_names,
          metric_names,
      ) = get_torch_test_data(
          dtype=torch.float, cuda=False, constant_noise=True
      )
      Xs2, Ys2, Yvars2, _, _, _, _ = get_torch_test_data(
          dtype=torch.float, cuda=False, constant_noise=True
      )
      # make infeasible
      Xs2[0] = -1 * Xs2[0]
      objective_weights = torch.tensor(
          [-1.0, 1.0], dtype=torch.float, device=torch.device("cpu")
      )
      n = 3
      model = BotorchModel()
      search_space_digest = SearchSpaceDigest(
          feature_names=feature_names,
          bounds=bounds,
          task_features=tfs,
      )
      with mock.patch(FIT_MODEL_MO_PATH) as _mock_fit_model:
          model.fit(
              datasets=[
                  SupervisedDataset(
                      X=Xs1[0],
                      Y=Ys1[0],
                      Yvar=Yvars1[0],
                      feature_names=feature_names,
                      outcome_names=metric_names,
                  ),
                  SupervisedDataset(
                      X=Xs2[0],
                      Y=Ys2[0],
                      Yvar=Yvars2[0],
                      feature_names=feature_names,
                      outcome_names=metric_names,
                  ),
              ],
              metric_names=metric_names,
              search_space_digest=search_space_digest,
          )
          _mock_fit_model.assert_called_once()
  
      # because there are no feasible points:
      with self.assertRaises(ValueError):
          model.gen(
              n,
              search_space_digest=search_space_digest,
              torch_opt_config=TorchOptConfig(objective_weights),
          )
  
imports: import dataclasses
  from itertools import chain, product
  from typing import Any, cast, Dict
  from unittest import mock
  import numpy
  import torch
  from ax.core.search_space import SearchSpaceDigest
  from ax.exceptions.core import DataRequiredError
  from ax.models.torch.botorch import BotorchModel, get_feature_importances_from_botorch_model, get_rounding_func
  from ax.models.torch.botorch_defaults import get_and_fit_model, get_chebyshev_scalarization, recommend_best_out_of_sample_point
  from ax.models.torch.utils import sample_simplex
  from ax.models.torch_base import TorchOptConfig
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.mock import fast_botorch_optimize
  from ax.utils.testing.torch_stubs import get_torch_test_data
  from botorch.acquisition.utils import get_infeasible_cost
  from botorch.models import ModelListGP, SingleTaskGP
  from botorch.models.transforms.input import Warp
  from botorch.utils.datasets import SupervisedDataset
  from botorch.utils.objective import get_objective_weights_transform
  from gpytorch.likelihoods import _GaussianLikelihoodBase
  from gpytorch.likelihoods.gaussian_likelihood import FixedNoiseGaussianLikelihood
  from gpytorch.mlls import ExactMarginalLogLikelihood, LeaveOneOutPseudoLikelihood
  from gpytorch.priors import GammaPrior
  from gpytorch.priors.lkj_prior import LKJCovariancePrior
label_desc: Use image node_id 8 for calling the BotorchModelTest obj's underlying member method code with example usage: obj.test_BotorchModelConstraints() without return types