code: def test_modeling_steps():
      ds = import_dataset()
      aml = H2OAutoML(
          project_name="py_modeling_steps",
          max_models=5,
          modeling_plan=[
              "DRF",
              dict(
                  name="GBM",
                  steps=[
                      dict(id="def_3", group=2),
                      dict(id="grid_1", weight=77),
                  ],
              ),
              ("GLM", "defaults"),
              ("StackedEnsemble", "defaults"),
          ],
          seed=1,
      )
      aml.train(y=ds.target, training_frame=ds.train)
      print(aml.leaderboard)
      # we should now see the detailed steps sorted in their execution order.
      print(aml.modeling_steps)
      assert aml.modeling_steps == [
          {
              "name": "DRF",
              "steps": [
                  {"id": "def_1", "group": 1, "weight": 10},
                  {"id": "XRT", "group": 1, "weight": 10},
              ],
          },
          {
              "name": "GLM",
              "steps": [{"id": "def_1", "group": 1, "weight": 10}],
          },
          {
              "name": "StackedEnsemble",
              "steps": [
                  {"id": "best_of_family_1", "group": 1, "weight": 10}
              ],
          },  # no all_1 as XRT is interpreted as not being of the same family as DRF (legacy decision).
          {
              "name": "GBM",
              "steps": [
                  {"id": "def_3", "group": 2, "weight": 10},
                  {"id": "grid_1", "group": 2, "weight": 77},
              ],
          },  # grids are 2nd group by default
          {
              "name": "StackedEnsemble",
              "steps": [
                  {"id": "best_of_family_2", "group": 2, "weight": 10},
                  {"id": "all_2", "group": 2, "weight": 10},
              ],
          },
      ]
  
      new_aml = H2OAutoML(
          project_name="py_reinject_modeling_steps",
          max_models=5,
          modeling_plan=aml.modeling_steps,
          seed=1,
      )
      new_aml.train(y=ds.target, training_frame=ds.train)
      print(new_aml.leaderboard)
      assert aml.modeling_steps == new_aml.modeling_steps
  
file_path: h2o-3/h2o-py/tests/testdir_algos/automl/pyunit_automl_modeling_plan.py
imports: import sys, os
  import h2o
  import h2o.exceptions
  from h2o.automl import H2OAutoML
  from tests import pyunit_utils
  from _automl_utils import import_dataset, get_partitioned_model_names
label_desc: Use image node_id 6 for calling a global function with example usage: test_modeling_steps() without return types