code: def stackensemble_delegates_to_metalearner_some_attributes_test():
      train = h2o.import_file(
          pyunit_utils.locate("smalldata/prostate/prostate.csv")
      )
      x = train.columns
      y = "CAPSULE"
      x.remove(y)
  
      nfolds = 2
      gbm = H2OGradientBoostingEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
      )
      gbm.train(x=x, y=y, training_frame=train)
      rf = H2ORandomForestEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
      )
      rf.train(x=x, y=y, training_frame=train)
      se = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=train,
          base_models=[gbm.model_id, rf.model_id],
          metalearner_nfolds=nfolds,
      )
      se.train(x=x, y=y, training_frame=train)
      assert (
          se.cross_validation_metrics_summary()._cell_values
          == se.metalearner()
          .cross_validation_metrics_summary()
          ._cell_values
      )
  
file_path: h2o-3/h2o-py/tests/testdir_algos/stackedensemble/pyunit_stackedensemble_metalearner.py
imports: import sys
  import warnings
  import h2o
  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 4 for calling a global function with example usage: stackensemble_delegates_to_metalearner_some_attributes_test() without return types