code: def test_optional_SEs_trained_in_non_reproducible_mode():
      ds = import_dataset()
      aml = H2OAutoML(
          project_name="py_SEs_non_reproducible_mode",
          seed=1,
          max_runtime_secs=30,
          include_algos=["StackedEnsemble", "GLM", "DRF"],
      )  # 1 base model in each group: 1, 2, 3
      aml.train(y=ds.target, training_frame=ds.train)
      lb = get_leaderboard(aml, ["provider", "step"]).as_data_frame()
      print(lb)
      steps_SE = lb.query(
          "provider == 'StackedEnsemble'"
      ).step.to_list()
      assert len(steps_SE) > 2
      assert (
          "best_of_family_1" not in steps_SE
      ), "no SE should be built for first group (1 base nodel only)"
      assert (
          "best_of_family_2" in steps_SE
      ), "SE best_of_family from group 2 is missing"
      assert (
          "best_of_family_3" in steps_SE
      ), "SE best_of_family from group 3 is missing"
      assert (
          "best_of_family_4" not in steps_SE
      ), "all other SEs should be optional ones"
      assert (
          "all_1" not in steps_SE
      ), "all other SEs should be optional ones"
      assert (
          "all_2" not in steps_SE
      ), "all other SEs should be optional ones"
      assert (
          "all_3" not in steps_SE
      ), "all other SEs should be optional ones"
      assert (
          "best_of_family_gbm" in steps_SE
      ), "optional SE best_of_family should have been trained"
  
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 3 for calling a global function with example usage: test_optional_SEs_trained_in_non_reproducible_mode() without return types