code: def test_interactive_loop(self) -> None:
      def _elicit(
          parameterization_with_trial_index: Tuple[
              TParameterization, int
          ]
      ) -> Optional[Tuple[int, TEvaluationOutcome]]:
          (
              parameterization,
              trial_index,
          ) = parameterization_with_trial_index
          x = np.array(
              [parameterization.get(f"x{i+1}") for i in range(6)]
          )
  
          return (
              trial_index,
              {
                  "hartmann6": (hartmann6(x), 0.0),
                  "l2norm": (np.sqrt((x**2).sum()), 0.0),
              },
          )
  
      def _aborted_elicit(
          parameterization_with_trial_index: Tuple[
              TParameterization, int
          ]
      ) -> Optional[Tuple[int, TEvaluationOutcome]]:
          return None
  
      ax_client = AxClient()
      ax_client.create_experiment(
          name="hartmann_test_experiment",
          # pyre-fixme[6]
          parameters=[
              {
                  "name": f"x{i}",
                  "type": "range",
                  "bounds": [0.0, 1.0],
              }
              for i in range(1, 7)
          ],
          objective_name="hartmann6",
          tracking_metric_names=["l2norm"],
          minimize=True,
      )
  
      optimization_completed = interactive_optimize_with_client(
          ax_client=ax_client,
          num_trials=15,
          candidate_queue_maxsize=3,
          # pyre-fixme[6]
          elicitation_function=_elicit,
      )
  
      self.assertTrue(optimization_completed)
      self.assertEqual(len(ax_client.experiment.trials), 15)
  
      # test failed experiment
      optimization_completed = interactive_optimize_with_client(
          ax_client=ax_client,
          num_trials=15,
          candidate_queue_maxsize=3,
          # pyre-fixme[6]
          elicitation_function=_aborted_elicit,
      )
      self.assertFalse(optimization_completed)
  
file_path: Ax/ax/service/tests/test_interactive_loop.py
imports: import functools
  import time
  from logging import WARN
  from typing import Optional, Tuple
  import numpy
  from ax.core.types import TEvaluationOutcome
  from ax.modelbridge.generation_strategy import GenerationStep, GenerationStrategy
  from ax.modelbridge.registry import Models
  from ax.service.ax_client import AxClient, TParameterization
  from ax.service.interactive_loop import interactive_optimize_with_client
  from ax.utils.common.testutils import TestCase
  from ax.utils.measurement.synthetic_functions import hartmann6
  from ax.utils.testing.mock import fast_botorch_optimize
label_desc: Use image node_id 2 for calling the TestInteractiveLoop obj's underlying member method code with example usage: obj.test_interactive_loop() and returns: trial_index,  dict, None