code: def test_model(
      model,
      x,
      target,
      train_frame,
      train_frame_clean,
      test_frame_missing,
  ):
      print("Testing: ", model.algo)
      model.train(x=x, y=target, training_frame=train_frame)
  
      # Scenario where user train model and ignore some cols but using the same frame for H statistic
      first, second, third = (
          model.h(train_frame, ["DPROS", "DCAPS"]),
          model.h(train_frame, ["DPROS", "GLEASON"]),
          model.h(train_frame, ["DCAPS", "GLEASON"]),
      )
  
      print("H stats identical frame", first, second, third)
  
      # Here we call with frame that contain only the cols used for training
      first_clean, second_clean, third_clean = (
          model.h(train_frame_clean, ["DPROS", "DCAPS"]),
          model.h(train_frame_clean, ["DPROS", "GLEASON"]),
          model.h(train_frame_clean, ["DCAPS", "GLEASON"]),
      )
  
      print(
          "H stats clean frame", first_clean, second_clean, third_clean
      )
  
      # Both H statistics must me the same, user provide everything and we pick only what we need
      assert_equals(
          first_clean,
          first,
          "H stats should be the same for both datasets",
      )
      assert_equals(
          second_clean,
          second,
          "H stats should be the same for both datasets",
      )
      assert_equals(
          third_clean,
          third,
          "H stats should be the same for both datasets",
      )
  
      try:
          # Scenario where user request H stats but forgot to provide one col (DPROS)
          model.h(test_frame_missing, ["DCAPS", "GLEASON"])
      except Exception as e:
          assert "DPROS is missing" in str(e)
  
      print("Test OK")
  
imports: import sys, os
  import h2o
  from tests import pyunit_utils, assert_equals
  from h2o.estimators import H2OGradientBoostingEstimator, H2OXGBoostEstimator
label_desc: Use image node_id 1 for calling a global function with example usage: test_model(model, x, target, train_frame, train_frame_clean, test_frame_missing) without return types