code: def test_SobolGeneratorFallbackToPolytopeSampler(self) -> None:
      # Ten parameters with sum less than 1. In this example, the rejection
      # sampler gives a search space exhausted error.  Testing fallback to
      # polytope sampler when encountering this error.
      generator = SobolGenerator(
          seed=0, fallback_to_sample_polytope=True
      )
      bounds = self._create_bounds(n_tunable=10, n_fixed=0)
      A = np.ones((1, 10))
      b = np.array([1]).reshape((1, 1))
      with mock.patch(
          "ax.models.random.base.logger.info"
      ) as mock_logger, mock.patch(
          "botorch.utils.sampling.sample_polytope",
          wraps=sample_polytope,
      ) as wrapped_sampler:
          generated_points, weights = generator.gen(
              n=3,
              bounds=bounds,
              linear_constraints=(
                  A,
                  b,
              ),
              rounding_func=lambda x: x,
          )
      # First call uses the original seed since no candidates are generated.
      self.assertEqual(wrapped_sampler.call_args[-1]["seed"], 0)
      self.assertTrue(
          "exceeded specified maximum draws"
          in mock_logger.call_args[0][0]
      )
      self.assertTrue(np.shape(generated_points) == (3, 10))
      self.assertTrue(np.alltrue(generated_points @ A.transpose() <= b))
  
      with mock.patch(
          "botorch.utils.sampling.sample_polytope",
          wraps=sample_polytope,
      ) as wrapped_sampler:
          generator.gen(
              n=3,
              bounds=bounds,
              linear_constraints=(
                  A,
                  b,
              ),
              rounding_func=lambda x: x,
          )
      # Second call uses seed 3 since 3 candidates are already generated.
      self.assertEqual(wrapped_sampler.call_args[-1]["seed"], 3)
  
imports: from typing import List, Tuple
  from unittest import mock
  import numpy
  from ax.exceptions.core import SearchSpaceExhausted
  from ax.models.random.sobol import SobolGenerator
  from ax.utils.common.testutils import TestCase
  from botorch.utils.sampling import sample_polytope
label_desc: Use image node_id 9 for calling the SobolGeneratorTest obj's underlying member method code with example usage: obj.test_SobolGeneratorFallbackToPolytopeSampler() without return types