code: def suite_reruns_with_different_instances_same_project_name():
      def test_rerun_with_same_data_adds_models_to_leaderboard():
          ds = import_dataset()
          aml1 = H2OAutoML(
              project_name="test_automl_rerun",
              max_models=max_models,
              seed=1,
              keep_cross_validation_predictions=True,
          )
          aml1.train(y=ds.target, training_frame=ds.train)
          lb1 = model_names(aml1.leaderboard)
          aml2 = H2OAutoML(
              project_name="test_automl_rerun",
              max_models=max_models,
              seed=1,
              keep_cross_validation_predictions=True,
          )
          aml2.train(y=ds.target, training_frame=ds.train)
          lb2 = model_names(aml2.leaderboard)
          assert aml1.project_name == aml2.project_name
          assert_extended_leaderboard(lb1, lb2, size=max_models)
  
      def test_rerun_with_different_predictors_adds_models_to_leaderboard():
          ds = import_dataset()
          aml1 = H2OAutoML(
              project_name="test_automl_rerun",
              max_models=max_models,
              seed=1,
              keep_cross_validation_predictions=True,
          )
          aml1.train(y=ds.target, training_frame=ds.train)
          lb1 = model_names(aml1.leaderboard)
          aml2 = H2OAutoML(
              project_name="test_automl_rerun",
              max_models=max_models,
              seed=1,
              keep_cross_validation_predictions=True,
          )
          aml2.train(
              x=ds.train.columns[1:],
              y=ds.target,
              training_frame=ds.train,
          )
          lb2 = model_names(aml2.leaderboard)
          assert aml1.project_name == aml2.project_name
          assert_extended_leaderboard(lb1, lb2, size=max_models)
  
      def test_rerun_with_different_training_frame_adds_models_to_leaderboard():
          ds = import_dataset()
          aml1 = H2OAutoML(
              project_name="test_automl_rerun",
              max_models=max_models,
              seed=1,
              keep_cross_validation_predictions=True,
          )
          aml1.train(y=ds.target, training_frame=ds.train)
          lb1 = model_names(aml1.leaderboard)
          aml2 = H2OAutoML(
              project_name="test_automl_rerun",
              max_models=max_models,
              seed=1,
              keep_cross_validation_predictions=True,
          )
          aml2.train(y=ds.target, training_frame=ds.train[1:])
          lb2 = model_names(aml2.leaderboard)
          assert aml1.project_name == aml2.project_name
          assert_extended_leaderboard(lb1, lb2, size=max_models)
  
      def test_rerun_with_different_target_resets_leaderboard():
          ds = import_dataset()
          aml1 = H2OAutoML(
              project_name="test_automl_rerun",
              max_models=max_models,
              seed=1,
              keep_cross_validation_predictions=True,
          )
          aml1.train(y=ds.target, training_frame=ds.train)
          lb1 = model_names(aml1.leaderboard)
          aml2 = H2OAutoML(
              project_name="test_automl_rerun",
              max_models=max_models,
              seed=1,
              keep_cross_validation_predictions=True,
          )
          aml2.train(y=ds.target_alt, training_frame=ds.train)
          lb2 = model_names(aml2.leaderboard)
          assert aml1.project_name == aml2.project_name
          assert_distinct_leaderboard(lb1, lb2, size=max_models)
  
      return [
          test_rerun_with_same_data_adds_models_to_leaderboard,
          test_rerun_with_different_predictors_adds_models_to_leaderboard,
          test_rerun_with_different_training_frame_adds_models_to_leaderboard,
          test_rerun_with_different_target_resets_leaderboard,
      ]
  
file_path: h2o-3/h2o-py/tests/testdir_algos/automl/pyunit_automl_reruns.py
imports: import os
  import sys
  import h2o
  from h2o.automl import H2OAutoML
  from tests import pyunit_utils
label_desc: Use image node_id 9 for calling a global function with example usage: suite_reruns_with_different_instances_same_project_name() and returns: list