code: def test_stacked_ensembles_are_trained_after_max_models():
      print(
          "Check that Stacked Ensembles are still trained after max models have been trained"
      )
      ds = import_dataset()
      aml = H2OAutoML(
          project_name="py_aml_SE_after_max_models",
          seed=1,
          max_models=5,
      )
      aml.train(y=ds.target, training_frame=ds.train)
  
      se = get_partitioned_model_names(aml.leaderboard).se
      assert (
          len(se) == 2
      ), "StackedEnsemble should still be trained after max models have been reached"
  
file_path: h2o-3/h2o-py/tests/testdir_algos/automl/pyunit_automl_stacked_ensembles.py
imports: import sys, os
  import h2o
  from h2o.automl import H2OAutoML, get_leaderboard
  from tests import pyunit_utils
  from _automl_utils import import_dataset, get_partitioned_model_names
label_desc: Use image node_id 1 for calling a global function with example usage: test_stacked_ensembles_are_trained_after_max_models() without return types