code: def test_frames_can_be_passed_as_key():
      ds = import_dataset()
  
      kw_args = [
          dict(training_frame=ds["train"].frame_id),
          dict(
              training_frame=ds["train"],
              validation_frame=ds["valid"].frame_id,
          ),
          dict(
              training_frame=ds["train"],
              blending_frame=ds["blend"].frame_id,
          ),
      ]
  
      # Constructor validation
      for kwargs in kw_args:
          H2OStackedEnsembleEstimator(base_models=[], **kwargs)
  
      # train method validation
      base_model_params = dict(
          ntrees=3,
          nfolds=3,
          seed=seed,
          keep_cross_validation_predictions=True,
      )
      for kwargs in kw_args:
          base_training_args = {
              k: v for k, v in kwargs.items() if k != "blending_frame"
          }
          base_training_args["y"] = ds["target"]
          gbm = H2OGradientBoostingEstimator(**base_model_params)
          gbm.train(**base_training_args)
          rf = H2ORandomForestEstimator(**base_model_params)
          rf.train(**base_training_args)
  
          se = H2OStackedEnsembleEstimator(base_models=[gbm, rf])
          se.train(y=ds["target"], **kwargs)
  
file_path: h2o-3/h2o-py/tests/testdir_algos/stackedensemble/pyunit_stackedensemble_validate_frames.py
imports: import h2o
  import sys
  from h2o.estimators import H2OGradientBoostingEstimator, H2ORandomForestEstimator
  from h2o.exceptions import H2OTypeError
  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: test_frames_can_be_passed_as_key() without return types