code: def test_stackedensemble_respects_the_max_runtime_secs():
      max_runtime_secs = 1
      hyper_parameters = dict()
      hyper_parameters["ntrees"] = [1, 2, 3, 4, 5]
      params = dict(fold_assignment="modulo", nfolds=3)
  
      data = prepare_data()
  
      gs1 = H2OGridSearch(
          H2OGradientBoostingEstimator(**params),
          hyper_params=hyper_parameters,
      )
      gs1.train(data.x, data.y, data.train, validation_frame=data.train)
  
      big_blending_frame = data.train
      for i in range(15):
          big_blending_frame = big_blending_frame.rbind(
              big_blending_frame
          )
  
      se = H2OStackedEnsembleEstimator(
          base_models=gs1.model_ids,
          max_runtime_secs=max_runtime_secs,
          blending_frame=big_blending_frame,
      )
      try:
          se.train(data.x, data.y, data.train)
          assert False, "This should have failed due to time out."
      except H2OResponseError:
          pass
  
file_path: h2o-3/h2o-py/tests/testdir_algos/stackedensemble/pyunit_stackedensemble_max_runtime_secs.py
imports: import h2o
  import sys
  from h2o.exceptions import H2OResponseError
  from h2o.grid import H2OGridSearch
  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: test_stackedensemble_respects_the_max_runtime_secs() without return types