code: def test_stop_trials(self) -> None:
      experiment = Experiment(
          name="torchx_booth_sequential_demo",
          search_space=SearchSpace(parameters=self._parameters),
          optimization_config=OptimizationConfig(
              objective=self._objective
          ),
          runner=self._runner,
          is_test=True,
          properties={Keys.IMMUTABLE_SEARCH_SPACE_AND_OPT_CONF: True},
      )
      scheduler = Scheduler(
          experiment=experiment,
          generation_strategy=(
              choose_generation_strategy(
                  search_space=experiment.search_space,
              )
          ),
          options=SchedulerOptions(),
      )
      scheduler.run(max_new_trials=3)
      trial = scheduler.running_trials[0]
      reason = self._runner.stop(trial, reason="some_reason")
      self.assertEqual(reason, {"reason": "some_reason"})
  
file_path: Ax/ax/runners/tests/test_torchx.py
imports: import os
  import shutil
  import tempfile
  from typing import List
  from ax.core import BatchTrial, Experiment, Objective, OptimizationConfig, Parameter, ParameterType, RangeParameter, SearchSpace
  from ax.metrics.torchx import TorchXMetric
  from ax.modelbridge.dispatch_utils import choose_generation_strategy
  from ax.runners.torchx import TorchXRunner
  from ax.service.scheduler import FailureRateExceededError, Scheduler, SchedulerOptions
  from ax.utils.common.constants import Keys
  from ax.utils.common.testutils import TestCase
  from torchx.components import utils
label_desc: Use image node_id 4 for calling the TorchXRunnerTest obj's underlying member method code with example usage: obj.test_stop_trials() without return types