code: def test_weights_column_is_propagated_to_metalearner():
      train = h2o.import_file(
          pu.locate("smalldata/iris/iris_train.csv")
      )
      train["weights"] = 1
      x = train.columns
      y = "species"
      x.remove(y)
  
      nfolds = 2
      gbm = H2OGradientBoostingEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
          weights_column="weights",
      )
      gbm.train(x=x, y=y, training_frame=train)
  
      rf = H2ORandomForestEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
          weights_column="weights",
      )
      rf.train(x=x, y=y, training_frame=train)
  
      se = H2OStackedEnsembleEstimator(
          training_frame=train,
          base_models=[gbm.model_id, rf.model_id],
          weights_column="weights",
      )
      se.train(x=x, y=y, training_frame=train)
  
      assert (
          se.metalearner().actual_params["weights_column"][
              "column_name"
          ]
          == "weights"
      )
  
file_path: h2o-3/h2o-py/tests/testdir_algos/stackedensemble/pyunit_stackedensemble_weights_column.py
imports: import h2o
  import sys
  import warnings
  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 1 for calling a global function with example usage: test_weights_column_is_propagated_to_metalearner() without return types