code: def class_extensions():
      @staticmethod
      def available():
          """
          Ask the H2O server whether a XGBoost model can be built (depends on availability of native backends).
          :return: True if a XGBoost model can be built, or False otherwise.
  
          :examples:
  
          >>> boston = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/gbm_test/BostonHousing.csv")
          >>> predictors = boston.columns[:-1]
          >>> response = "medv"
          >>> boston['chas'] = boston['chas'].asfactor()
          >>> train, valid = boston.split_frame(ratios=[.8])
          >>> boston_xgb = H2OXGBoostEstimator(seed=1234)
          >>> boston_xgb.available()
          """
          if "XGBoost" not in h2o.cluster().list_core_extensions():
              print("Cannot build an XGBoost model - no backend found.")
              return False
          else:
              return True
  
      def convert_H2OXGBoostParams_2_XGBoostParams(self):
          """
          In order to use convert_H2OXGBoostParams_2_XGBoostParams and convert_H2OFrame_2_DMatrix, you must import
          the following toolboxes: xgboost, pandas, numpy and scipy.sparse.
  
          Given an H2OXGBoost model, this method will generate the corresponding parameters that should be used by
          native XGBoost in order to give exactly the same result, assuming that the same dataset
          (derived from h2oFrame) is used to train the native XGBoost model.
  
          Follow the steps below to compare H2OXGBoost and native XGBoost:
  
           1. Train the H2OXGBoost model with H2OFrame trainFile and generate a prediction:
  
            - h2oModelD = H2OXGBoostEstimator(\*\*h2oParamsD) # parameters specified as a dict()
            - h2oModelD.train(x=myX, y=y, training_frame=trainFile) # train with H2OFrame trainFile
            - h2oPredict = h2oPredictD = h2oModelD.predict(trainFile)
  
           2. Derive the DMatrix from H2OFrame:
  
            - nativeDMatrix = trainFile.convert_H2OFrame_2_DMatrix(myX, y, h2oModelD)
  
           3. Derive the parameters for native XGBoost:
  
            - nativeParams = h2oModelD.convert_H2OXGBoostParams_2_XGBoostParams()
  
           4. Train your native XGBoost model and generate a prediction:
  
            - nativeModel = xgb.train(params=nativeParams[0], dtrain=nativeDMatrix, num_boost_round=nativeParams[1])
            - nativePredict = nativeModel.predict(data=nativeDMatrix, ntree_limit=nativeParams[1]
  
           5. Compare the predictions h2oPredict from H2OXGBoost, nativePredict from native XGBoost.
  
          :return: nativeParams, num_boost_round
          """
          import xgboost as xgb
  
          nativeParams = self._model_json["output"]["native_parameters"]
          nativeXGBoostParams = dict()
  
          for a, keyname, keyvalue in nativeParams.cell_values:
              nativeXGBoostParams[keyname] = keyvalue
          paramsSet = self.full_parameters
  
          return (
              nativeXGBoostParams,
              paramsSet["ntrees"]["actual_value"],
          )
  
label_desc: Use image node_id 1 for calling a global function with example usage: class_extensions() and returns: nativeXGBoostParams,  paramsSet, False, True