code: def test_train_returns_leader_model():
      ds = import_dataset()
      aml = H2OAutoML(
          max_models=3, project_name="py_aml_rain_result", seed=42
      )
      model = aml.train(y=ds.target, training_frame=ds.train)
  
      assert isinstance(model, ModelBase)
      assert model.key == aml.leader.key
      model.predict(ds.test)
  
imports: import os
  import sys
  from h2o.automl import H2OAutoML
  from h2o.model import ModelBase
  from tests import pyunit_utils
  from _automl_utils import import_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: test_train_returns_leader_model() without return types