code: def assert_correct_custom_metric(
      model, f_test, metric_name, msg=None
  ):
      # Check model performance on training data
      mm_train = model.model_performance(train=True)
      assert_metrics_equal(
          mm_train,
          metric_name,
          "custom_metric_value",
          "{}: Train metric should match custom metric".format(msg),
      )
      # Check model performance on validation data
      mm_valid = model.model_performance(valid=True)
      assert_metrics_equal(
          mm_valid,
          metric_name,
          "custom_metric_value",
          "{}: Validation metric should match custom metric".format(
              msg
          ),
      )
      # Make a new model metric
      mm_test = model.model_performance(test_data=f_test)
      assert_metrics_equal(
          mm_test,
          metric_name,
          "custom_metric_value",
          "{}: Test metric should match custom metric".format(msg),
      )
  
      # Check scoring history
      assert_scoring_history(
          model,
          "training_{}".format(metric_name),
          "training_custom",
          "{}: Scoring history for training data should match".format(
              msg
          ),
      )
      assert_scoring_history(
          model,
          "validation_{}".format(metric_name),
          "validation_custom",
          "{}: Scoring history for validation data should match".format(
              msg
          ),
      )
  
imports: import h2o
  from .None import locate
label_desc: Use image node_id 4 for calling a global function with example usage: assert_correct_custom_metric(model, f_test, metric_name, msg) without return types