code: def test_current_generator_run_limit(self) -> None:
      NUM_INIT_TRIALS = 5
      SECOND_STEP_PARALLELISM = 3
      NUM_ROUNDS = 4
      exp = get_branin_experiment()
      sobol_gs_with_parallelism_limits = GenerationStrategy(
          steps=[
              GenerationStep(
                  model=Models.SOBOL,
                  num_trials=NUM_INIT_TRIALS,
                  min_trials_observed=3,
              ),
              GenerationStep(
                  model=Models.SOBOL,
                  num_trials=(NUM_ROUNDS - 1) * SECOND_STEP_PARALLELISM,
                  max_parallelism=SECOND_STEP_PARALLELISM,
              ),
          ]
      )
      sobol_gs_with_parallelism_limits._experiment = exp
      could_gen = self._run_GS_for_N_rounds(
          gs=sobol_gs_with_parallelism_limits,
          exp=exp,
          num_rounds=NUM_ROUNDS,
      )
  
      # Optimization should now be complete.
      (
          num_trials_to_gen,
          opt_complete,
      ) = sobol_gs_with_parallelism_limits.current_generator_run_limit()
      self.assertTrue(opt_complete)
      self.assertEqual(num_trials_to_gen, 0)
  
      # We expect trials from first generation step + trials from remaining rounds in
      # batches limited by parallelism setting in the second step.
      self.assertEqual(
          len(exp.trials),
          NUM_INIT_TRIALS + (NUM_ROUNDS - 1) * SECOND_STEP_PARALLELISM,
      )
      self.assertTrue(
          all(t.status.is_completed for t in exp.trials.values())
      )
      self.assertEqual(
          could_gen,
          [NUM_INIT_TRIALS]
          + [SECOND_STEP_PARALLELISM] * (NUM_ROUNDS - 1),
      )
  
imports: import logging
  from typing import cast, List
  from unittest import mock
  from unittest.mock import MagicMock, patch
  from ax.core.arm import Arm
  from ax.core.base_trial import TrialStatus
  from ax.core.experiment import Experiment
  from ax.core.generator_run import GeneratorRun
  from ax.core.observation import ObservationFeatures
  from ax.core.parameter import ChoiceParameter, FixedParameter, Parameter, ParameterType
  from ax.core.search_space import SearchSpace
  from ax.core.utils import get_pending_observation_features_based_on_trial_status
  from ax.exceptions.core import DataRequiredError, UnsupportedError, UserInputError
  from ax.exceptions.generation_strategy import GenerationStrategyCompleted, GenerationStrategyMisconfiguredException, GenerationStrategyRepeatedPoints, MaxParallelismReachedException
  from ax.modelbridge.discrete import DiscreteModelBridge
  from ax.modelbridge.factory import get_sobol
  from ax.modelbridge.generation_node import GenerationNode
  from ax.modelbridge.generation_strategy import GenerationStep, GenerationStrategy
  from ax.modelbridge.model_spec import ModelSpec
  from ax.modelbridge.random import RandomModelBridge
  from ax.modelbridge.registry import Cont_X_trans, MODEL_KEY_TO_MODEL_SETUP, Models
  from ax.modelbridge.torch import TorchModelBridge
  from ax.modelbridge.transition_criterion import MaxGenerationParallelism, MaxTrials, MinTrials
  from ax.models.random.sobol import SobolGenerator
  from ax.utils.common.equality import same_elements
  from ax.utils.common.mock import mock_patch_method_original
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import not_none
  from ax.utils.testing.core_stubs import get_branin_data, get_branin_experiment, get_choice_parameter, get_data, get_experiment_with_multi_objective, get_hierarchical_search_space_experiment
label_desc: Use image node_id 23 for calling the TestGenerationStrategy obj's underlying member method code with example usage: obj.test_current_generator_run_limit() without return types