code: def models_are_equal(model_1, model_2, pred_1, pred_2):
      assert_equals(True, compare_frames(pred_1, pred_2, pred_1.nrows))
      for tree_id in range(model_1.ntrees):
          for output_class in model_1._model_json["output"]["domains"][
              -1
          ]:
              tree = H2OTree(
                  model=model_1,
                  tree_number=tree_id,
                  tree_class=output_class,
              )
              tree2 = H2OTree(
                  model=model_2,
                  tree_number=tree_id,
                  tree_class=output_class,
              )
              assert_list_equals(tree.predictions, tree2.predictions)
              assert_list_equals(
                  tree.thresholds, tree2.thresholds, delta=1e-50
              )  # need to specify delta to check nans
              assert_list_equals(
                  tree.decision_paths, tree2.decision_paths
              )
  
file_path: h2o-3/h2o-py/tests/testdir_algos/gbm/pyunit_gbm_reproducibility_variable_importance_different_but_same_model_large.py
imports: from builtins import range
  import sys
  import h2o
  from tests import pyunit_utils, assert_equals, compare_frames, assert_not_equal
  from h2o.estimators import H2OGradientBoostingEstimator
  from h2o.tree import H2OTree
label_desc: Use image node_id 2 for calling a global function with example usage: models_are_equal(model_1, model_2, pred_1, pred_2) without return types