code: def check_eval_metric_early_stopping(
      score_eval_metric_only=False,
      eval_metric=None,
      custom_metric_func=None,
  ):
      (train, _, _) = dataset_prostate()
      model_expected = H2OXGBoostEstimator(
          model_id="prostate_mae",
          ntrees=1000,
          max_depth=5,
          score_each_iteration=True,
          stopping_metric="mae",
          stopping_tolerance=0.1,
          stopping_rounds=3,
          seed=123,
      )
      model_expected.train(y="AGE", x=train.names, training_frame=train)
  
      model_actual = H2OXGBoostEstimator(
          model_id="prostate_custom",
          ntrees=1000,
          max_depth=5,
          score_each_iteration=True,
          score_eval_metric_only=score_eval_metric_only,
          eval_metric=eval_metric,
          custom_metric_func=custom_metric_func,
          stopping_metric="custom",
          stopping_tolerance=0.1,
          stopping_rounds=3,
          seed=123,
      )
      model_actual.train(y="AGE", x=train.names, training_frame=train)
  
      assert_same_scoring_history(
          model_actual,
          model_expected,
          "training_custom",
          "training_mae",
      )
  
      return model_actual.scoring_history()
  
file_path: h2o-3/h2o-py/tests/testdir_algos/xgboost/pyunit_xgboost_eval_metric_stopping.py
imports: import sys
  from h2o import upload_custom_metric
  from tests import pyunit_utils
  from tests.pyunit_utils import dataset_prostate
  from h2o.estimators.xgboost import H2OXGBoostEstimator
  from tests.pyunit_utils import CustomMaeFunc
label_desc: Use image node_id 3 for calling a global function with example usage: check_eval_metric_early_stopping(score_eval_metric_only, eval_metric, custom_metric_func) and returns: model_actual