code: def comparison_test():
      if sys.version.startswith("2"):
          print("native XGBoost tests only supported on python3")
          return
      import xgboost as xgb
  
      assert H2OXGBoostEstimator.available() is True
      ret = h2o.cluster()
      if len(ret.nodes) == 1:
          runSeed = 1
          dataSeed = 17
          ntrees = 17
          maxdepth = 5
          nrows = 10000
          ncols = 12
          factorL = 20
          numCols = 11
          enumCols = ncols - numCols
          responseL = 4
          # CPU Backend is forced for the results to be comparable
          h2oParamsD = {
              "ntrees": ntrees,
              "max_depth": maxdepth,
              "seed": runSeed,
              "learn_rate": 0.7,
              "col_sample_rate_per_tree": 0.9,
              "min_rows": 5,
              "score_tree_interval": ntrees + 1,
              "tree_method": "exact",
              "backend": "cpu",
          }
  
          trainFile = pyunit_utils.genTrainFrame(
              nrows,
              numCols,
              enumCols=enumCols,
              enumFactors=factorL,
              responseLevel=responseL,
              miscfrac=0.01,
              randseed=dataSeed,
          )
          myX = trainFile.names
          y = "response"
          myX.remove(y)
          newNames = []
          for ind in range(0, len(myX)):
              myX[ind] = (
                  myX[ind] + "_" + str(ind)
              )  # avoid duplicated column names
              newNames.append(myX[ind])
          newNames.append(y)
          trainFile.set_names(newNames)
  
          h2oModelD = H2OXGBoostEstimator(**h2oParamsD)
          # gather, print and save performance numbers for h2o model
          h2oModelD.train(x=myX, y=y, training_frame=trainFile)
          h2oPredictD = h2oModelD.predict(trainFile)
  
          # derive native XGBoost parameter and DMatrx from h2oXGBoost model and H2OFrame
          nativeXGBoostParam = (
              h2oModelD.convert_H2OXGBoostParams_2_XGBoostParams()
          )
          nativeXGBoostInput = trainFile.convert_H2OFrame_2_DMatrix(
              myX, y, h2oModelD
          )
  
          nativeModel = xgb.train(
              params=nativeXGBoostParam[0],
              dtrain=nativeXGBoostInput,
              num_boost_round=nativeXGBoostParam[1],
          )
          nativePred = nativeModel.predict(
              data=nativeXGBoostInput, ntree_limit=nativeXGBoostParam[1]
          )
          pyunit_utils.summarizeResult_multinomial(
              h2oPredictD, nativePred, -1, -1, -1, -1, tolerance=1e-6
          )
      else:
          print(
              "********  Test skipped.  This test cannot be performed in multinode environment."
          )
  
label_desc: Use image node_id 1 for calling a global function with example usage: comparison_test() without return types