code: def test_limited_optional_step_matching(env_boston, feature_engineer):
      """Simplified counterpart to above :func:`test_optional_step_matching`. Tests that a Space
      containing `Categorical` Feature Engineering steps -- of which only the last ones may be
      `optional` -- matches with the expected saved Experiments. These test cases do not demonstrate
      the same bug being regression-tested by `test_optional_step_matching`. Instead, this test
      function exists to ensure that the areas close to the above bug are behaving properly and to
      help define the bug being tested by `test_optional_step_matching`. This function demonstrates
      that `optional` is not problematic when used only in the final `EngineerStep`
      """
      opt_0 = DummyOptPro(iterations=20, random_state=32)
      opt_0.forge_experiment(
          XGBRegressor, feature_engineer=feature_engineer
      )
      opt_0.go()
  
      opt_1 = ExtraTreesOptPro(iterations=20, random_state=32)
      opt_1.forge_experiment(
          XGBRegressor, feature_engineer=feature_engineer
      )
      opt_1.get_ready()
  
      # Assert `opt_1` matched with all Experiments executed by `opt_0`
      assert (
          len(opt_1.similar_experiments) == opt_0.successful_iterations
      )
  
imports: from hyperparameter_hunter import Environment, FeatureEngineer, EngineerStep, __version__
  from hyperparameter_hunter import CVExperiment, Real, Integer, Categorical
  from hyperparameter_hunter import BayesianOptPro, DummyOptPro, ExtraTreesOptPro
  from hyperparameter_hunter.utils.learning_utils import get_boston_data
  from hyperparameter_hunter.utils.version_utils import HHVersion
  from os import makedirs
  import pytest
  from shutil import rmtree
  from xgboost import XGBRegressor
label_desc: Use image node_id 15 for calling a global function with example usage: test_limited_optional_step_matching(env_boston, feature_engineer) without return types