code: def test_get_polytope_samples(self):
      tkwargs = {"device": self.device}
      for dtype in (torch.float, torch.double):
          tkwargs["dtype"] = dtype
          bounds = torch.zeros(2, 4, **tkwargs)
          bounds[1] = 1
          inequality_constraints = [
              (
                  torch.tensor(
                      [3], dtype=torch.int64, device=self.device
                  ),
                  torch.tensor([-4], **tkwargs),
                  -3,
              )
          ]
          equality_constraints = [
              (
                  torch.tensor(
                      [0], dtype=torch.int64, device=self.device
                  ),
                  torch.tensor([1], **tkwargs),
                  0.5,
              )
          ]
          dense_equality_constraints = sparse_to_dense_constraints(
              d=4, constraints=equality_constraints
          )
          with manual_seed(0):
              samps = get_polytope_samples(
                  n=5,
                  bounds=bounds,
                  inequality_constraints=inequality_constraints,
                  equality_constraints=equality_constraints,
                  seed=0,
                  thinning=3,
                  n_burnin=2,
              )
          (A, b) = sparse_to_dense_constraints(
              d=4, constraints=inequality_constraints
          )
          dense_inequality_constraints = (-A, -b)
          with manual_seed(0):
              expected_samps = HitAndRunPolytopeSampler(
                  bounds=bounds,
                  inequality_constraints=dense_inequality_constraints,
                  equality_constraints=dense_equality_constraints,
                  n_burnin=2,
              ).draw(15, seed=0)[::3]
          self.assertTrue(torch.equal(samps, expected_samps))
  
          # test no equality constraints
          with manual_seed(0):
              samps = get_polytope_samples(
                  n=5,
                  bounds=bounds,
                  inequality_constraints=inequality_constraints,
                  seed=0,
                  thinning=3,
                  n_burnin=2,
              )
          with manual_seed(0):
              expected_samps = HitAndRunPolytopeSampler(
                  bounds=bounds,
                  inequality_constraints=dense_inequality_constraints,
                  n_burnin=2,
              ).draw(15, seed=0)[::3]
          self.assertTrue(torch.equal(samps, expected_samps))
  
          # test no inequality constraints
          with manual_seed(0):
              samps = get_polytope_samples(
                  n=5,
                  bounds=bounds,
                  equality_constraints=equality_constraints,
                  seed=0,
                  thinning=3,
                  n_burnin=2,
              )
          with manual_seed(0):
              expected_samps = HitAndRunPolytopeSampler(
                  bounds=bounds,
                  equality_constraints=dense_equality_constraints,
                  n_burnin=2,
              ).draw(15, seed=0)[::3]
          self.assertTrue(torch.equal(samps, expected_samps))
  
imports: from __future__ import annotations
  import itertools
  import warnings
  from typing import Any, Dict, Type
  from unittest import mock
  import numpy
  import torch
  from botorch.exceptions.errors import BotorchError
  from botorch.models.gp_regression import SingleTaskGP
  from botorch.sampling.pathwise import draw_matheron_paths
  from botorch.utils.sampling import _convert_bounds_to_inequality_constraints, batched_multinomial, DelaunayPolytopeSampler, draw_sobol_samples, find_interior_point, get_polytope_samples, HitAndRunPolytopeSampler, manual_seed, normalize_linear_constraints, optimize_posterior_samples, PolytopeSampler, sample_hypersphere, sample_simplex, sparse_to_dense_constraints
  from botorch.utils.testing import BotorchTestCase
label_desc: Use image node_id 10 for calling the TestSampleUtils obj's underlying member method code with example usage: obj.test_get_polytope_samples() without return types