code: def assert_custom_metric(model, metric):
      mm_train = model.model_performance(train=True)
      metric = (
          metric if metric in mm_train._metric_json else metric.lower()
      )
      print(metric, mm_train._metric_json["custom_metric_value"])
      assert (
          mm_train._metric_json["custom_metric_name"].lower()
          == metric.lower()
      )
      assert (
          mm_train._metric_json["custom_metric_value"]
          == mm_train._metric_json[metric]
      )
  
file_path: h2o-3/h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_6160_custom_metric.py
imports: import sys
  import h2o
  from tests import pyunit_utils
  from tests.pyunit_utils import CustomMaeFunc, CustomRmseFunc, CustomLoglossFunc, dataset_prostate, dataset_iris
  from h2o.estimators.glm import H2OGeneralizedLinearEstimator
label_desc: Use image node_id 4 for calling a global function with example usage: assert_custom_metric(model, metric) without return types