code: def train_stacked_ensemble(dataset, base_models, **kwargs):
      se = H2OStackedEnsembleEstimator(
          base_models=[m.model_id for m in base_models], seed=seed
      )
      se.train(
          x=dataset.x,
          y=dataset.y,
          training_frame=dataset.train,
          blending_frame=dataset.blend
          if hasattr(dataset, "blend")
          else None,
          **kwargs,
      )
      return se
  
file_path: h2o-3/h2o-py/tests/testdir_algos/stackedensemble/pyunit_stackedensemble_blending_frame.py
imports: import h2o
  import sys
  from h2o.estimators.random_forest import H2ORandomForestEstimator
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
  from h2o.estimators.stackedensemble import H2OStackedEnsembleEstimator
  from tests import pyunit_utils
label_desc: Use image node_id 3 for calling a global function with example usage: train_stacked_ensemble(dataset, base_models) and returns: se