code: def test_base_cases(self) -> None:
      exp = get_experiment_with_data()
      exp.trials[0].mark_running(no_runner_required=True)
  
      gss = ImprovementGlobalStoppingStrategy(
          min_trials=2, window_size=3
      )
      stop, message = gss.should_stop_optimization(experiment=exp)
      self.assertFalse(stop)
      self.assertEqual(
          message, "There are pending trials in the experiment."
      )
  
      gss_2 = ImprovementGlobalStoppingStrategy(
          min_trials=2,
          window_size=3,
          inactive_when_pending_trials=False,
      )
      stop, message = gss_2.should_stop_optimization(experiment=exp)
      # This one should be fine with having pending trials, but is not
      # stopping due to lack of completed trials.
      self.assertFalse(stop)
      self.assertEqual(
          message,
          "There are no completed trials yet.",
      )
  
      # Insufficient trials to stop.
      exp.trials[0].mark_completed()
      stop, message = gss.should_stop_optimization(experiment=exp)
      self.assertFalse(stop)
      self.assertEqual(
          message,
          "There are not enough completed trials to "
          "make a stopping decision (completed: 1, required: 3).",
      )
  
      # Check that we properly count completed trials.
      for _ in range(4):
          checked_cast(BatchTrial, exp.trials[0]).clone()
      exp.trials[3].mark_running(
          no_runner_required=True
      ).mark_completed()
      stop, message = gss.should_stop_optimization(experiment=exp)
      self.assertFalse(stop)
      self.assertEqual(
          message,
          "There are not enough completed trials to "
          "make a stopping decision (completed: 2, required: 3).",
      )
  
      # Should raise ValueError if trying to check an invalid trial
      with self.assertRaises(ValueError):
          stop, message = gss.should_stop_optimization(
              experiment=exp, trial_to_check=4
          )
  
imports: from typing import List, Tuple
  import numpy
  import pandas
  from ax.core.arm import Arm
  from ax.core.batch_trial import BatchTrial
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.metric import Metric
  from ax.core.objective import MultiObjective, Objective
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.outcome_constraint import ObjectiveThreshold, OutcomeConstraint
  from ax.core.parameter import ParameterType, RangeParameter
  from ax.core.search_space import SearchSpace
  from ax.core.trial import Trial
  from ax.core.types import ComparisonOp
  from ax.global_stopping.strategies.improvement import constraint_satisfaction, ImprovementGlobalStoppingStrategy
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import checked_cast, not_none
  from ax.utils.testing.core_stubs import get_experiment, get_experiment_with_data
label_desc: Use image node_id 1 for calling the TestImprovementGlobalStoppingStrategy obj's underlying member method code with example usage: obj.test_base_cases() without return types