code: def compare_preds(
      train, test, x, y, booster, ntrees, max_depth, max_error
  ):
      model = H2OXGBoostEstimator(
          booster=booster, seed=1, ntrees=ntrees, max_depth=max_depth
      )
      model.train(training_frame=train, x=x, y=y)
  
      mojo_name = pyunit_utils.getMojoName(model._id)
      tmp_dir = os.path.normpath(
          os.path.join(
              os.path.dirname(os.path.realpath("__file__")),
              "..",
              "results",
              mojo_name,
          )
      )
      os.makedirs(tmp_dir)
      model.download_mojo(path=tmp_dir)
  
      h2o.download_csv(test[x], os.path.join(tmp_dir, "in.csv"))
      pred_h2o = model.predict(test[x])
      h2o.download_csv(pred_h2o, os.path.join(tmp_dir, "out_h2o.csv"))
      pred_pojo = pyunit_utils.pojo_predict(model, tmp_dir, mojo_name)
      print(
          "%s: Comparing pojo %s predict and h2o predict..."
          % (model._id, booster)
      )
      pyunit_utils.compare_frames_local(
          pred_h2o, pred_pojo, 1, tol=max_error
      )
  
imports: import sys
  import os
  from h2o.estimators.xgboost import *
  from tests import pyunit_utils
label_desc: Use image node_id 1 for calling a global function with example usage: compare_preds(train, test, x, y, booster, ntrees, max_depth, max_error) without return types