code: def test_custom_leaderboard_as_method():
      ds = import_dataset("binary")
      aml = H2OAutoML(
          project_name="py_aml_custom_lb_method_test",
          max_models=5,
          seed=42,
      )
      aml.train(y=ds.target, training_frame=ds.train)
  
      assert_frame_equal(
          aml.get_leaderboard().as_data_frame(),
          aml.leaderboard.as_data_frame(),
      )
      lb_ext = get_leaderboard(aml, extra_columns="ALL")
      assert_frame_equal(
          aml.get_leaderboard("ALL").as_data_frame(),
          lb_ext.as_data_frame(),
      )
  
      aml2 = get_automl(aml.project_name)
      assert_frame_equal(
          aml2.get_leaderboard().as_data_frame(),
          aml.leaderboard.as_data_frame(),
      )
      assert_frame_equal(
          aml2.get_leaderboard("ALL").as_data_frame(),
          lb_ext.as_data_frame(),
      )
  
imports: import os
  import sys
  from pandas.util.testing import assert_frame_equal
  from h2o.automl import H2OAutoML, get_automl, get_leaderboard
  from tests import pyunit_utils
  from _automl_utils import import_dataset
label_desc: Use image node_id 2 for calling a global function with example usage: test_custom_leaderboard_as_method() without return types