code: def test_hierarchical_search_space(self) -> None:
      experiment = get_hierarchical_search_space_experiment()
      self.assertTrue(experiment.search_space.is_hierarchical)
      self.sobol_GS.gen(experiment=experiment)
      for _ in range(10):
          # During each iteration, check that all transformed observation features
          # contain all parameters of the flat search space.
          with patch.object(
              RandomModelBridge, "_fit"
          ) as mock_model_fit, patch.object(RandomModelBridge, "gen"):
              self.sobol_GS.gen(experiment=experiment)
              mock_model_fit.assert_called_once()
              observations = mock_model_fit.call_args[1].get(
                  "observations"
              )
              all_parameter_names = (
                  # pyre-fixme[16]: `SearchSpace` has no attribute
                  #  `_all_parameter_names`.
                  experiment.search_space._all_parameter_names.copy()
              )
              # One of the parameter names is modified by transforms (because it's
              # one-hot encoded).
              all_parameter_names.remove("model")
              all_parameter_names.add("model_OH_PARAM_")
              for obs in observations:
                  for p_name in all_parameter_names:
                      self.assertIn(p_name, obs.features.parameters)
  
          trial = (
              experiment.new_trial(
                  generator_run=self.sobol_GS.gen(experiment=experiment)
              )
              .mark_running(no_runner_required=True)
              .mark_completed()
          )
          experiment.attach_data(
              get_data(
                  metric_name="m1",
                  trial_index=trial.index,
                  num_non_sq_arms=1,
                  include_sq=False,
              )
          )
          experiment.attach_data(
              get_data(
                  metric_name="m2",
                  trial_index=trial.index,
                  num_non_sq_arms=1,
                  include_sq=False,
              )
          )
  
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 25 for calling the TestGenerationStrategy obj's underlying member method code with example usage: obj.test_hierarchical_search_space() without return types