code: def test_extract_outcome_constraints(self) -> None:
      outcomes = ["m1", "m2", "m3"]
      # pass no outcome constraints
      self.assertIsNone(extract_outcome_constraints([], outcomes))
  
      outcome_constraints = [
          OutcomeConstraint(
              metric=Metric("m1"), op=ComparisonOp.LEQ, bound=0
          )
      ]
      res = extract_outcome_constraints(outcome_constraints, outcomes)
      # pyre-fixme[16]: Optional type has no attribute `__getitem__`.
      self.assertEqual(res[0].shape, (1, 3))
      self.assertListEqual(list(res[0][0]), [1, 0, 0])
      self.assertEqual(res[1][0][0], 0)
  
      outcome_constraints = [
          OutcomeConstraint(
              metric=Metric("m1"), op=ComparisonOp.LEQ, bound=0
          ),
          ScalarizedOutcomeConstraint(
              metrics=[Metric("m2"), Metric("m3")],
              weights=[0.5, 0.5],
              op=ComparisonOp.GEQ,
              bound=1,
          ),
      ]
      res = extract_outcome_constraints(outcome_constraints, outcomes)
      self.assertEqual(res[0].shape, (2, 3))
      self.assertListEqual(list(res[0][0]), [1, 0, 0])
      self.assertListEqual(list(res[0][1]), [0, -0.5, -0.5])
      self.assertEqual(res[1][0][0], 0)
      self.assertEqual(res[1][1][0], -1)
  
imports: from unittest import mock
  from unittest.mock import patch
  import numpy
  from ax.core.arm import Arm
  from ax.core.data import Data
  from ax.core.generator_run import GeneratorRun
  from ax.core.metric import Metric
  from ax.core.objective import MultiObjective, Objective
  from ax.core.observation import ObservationData, ObservationFeatures
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig
  from ax.core.outcome_constraint import ObjectiveThreshold, OutcomeConstraint, ScalarizedOutcomeConstraint
  from ax.core.types import ComparisonOp
  from ax.core.utils import get_pending_observation_features
  from ax.modelbridge.modelbridge_utils import extract_objective_thresholds, extract_outcome_constraints, feasible_hypervolume, observation_data_to_array, pending_observations_as_array_list
  from ax.modelbridge.registry import Models
  from ax.utils.common.constants import Keys
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import not_none
  from ax.utils.testing.core_stubs import get_experiment, get_hierarchical_search_space_experiment
  from pyre_extensions import none_throws
label_desc: Use image node_id 2 for calling the TestModelbridgeUtils obj's underlying member method code with example usage: obj.test_extract_outcome_constraints() without return types