code: def test_ThompsonSamplerOutcomeConstraints(self) -> None:
      generator = ThompsonSampler(min_weight=0.0)
      generator.fit(
          # pyre-fixme[6]: For 1st param expected `List[List[List[Union[None,
          #  bool, float, int, str]]]]` but got `List[List[List[int]]]`.
          Xs=self.multiple_metrics_Xs,
          # pyre-fixme[6]: For 2nd param expected `List[List[float]]` but got
          #  `List[List[int]]`.
          Ys=self.multiple_metrics_Ys,
          # pyre-fixme[6]: For 3rd param expected `List[List[float]]` but got
          #  `List[List[int]]`.
          Yvars=self.multiple_metrics_Yvars,
          # pyre-fixme[6]: For 4th param expected `List[List[Union[None, bool,
          #  float, int, str]]]` but got `List[List[int]]`.
          parameter_values=self.parameter_values,
          outcome_names=self.outcome_names,
      )
      arms, weights, _ = generator.gen(
          n=4,
          # pyre-fixme[6]: For 2nd param expected `List[List[Union[None, bool,
          #  float, int, str]]]` but got `List[List[int]]`.
          parameter_values=self.parameter_values,
          objective_weights=np.array([1, 0]),
          outcome_constraints=(
              # pass in multiples of the same constraint
              # to ensure that shapes are correct for multiple constraints
              np.array([[0, 1], [0, 1], [0, 1]]),
              np.array([[1], [1], [1]]),
          ),
      )
      self.assertEqual(arms, [[3, 3], [4, 4], [2, 2], [1, 1]])
      for weight, expected_weight in zip(
          weights, [4 * i for i in [0.4, 0.4, 0.15, 0.05]]
      ):
          self.assertAlmostEqual(weight, expected_weight, delta=0.15)
  
file_path: Ax/ax/models/tests/test_thompson.py
imports: import numpy
  from ax.exceptions.model import ModelError
  from ax.models.discrete.thompson import ThompsonSampler
  from ax.utils.common.testutils import TestCase
label_desc: Use image node_id 7 for calling the ThompsonSamplerTest obj's underlying member method code with example usage: obj.test_ThompsonSamplerOutcomeConstraints() without return types