code: def get_xgboost_json(model):
      """This gets a JSON dump of an XGBoost model while ensuring the features names are their indexes."""
      fnames = model.feature_names
      model.feature_names = None
      json_trees = model.get_dump(with_stats=True, dump_format="json")
      model.feature_names = fnames
  
      # this fixes a bug where XGBoost can return invalid JSON
      json_trees = [
          t.replace(": inf,", ": 1000000000000.0,") for t in json_trees
      ]
      json_trees = [
          t.replace(": -inf,", ": -1000000000000.0,")
          for t in json_trees
      ]
  
      return json_trees
  
imports: import json
  import os
  import struct
  import time
  import warnings
  import numpy
  import pandas
  import scipy.sparse
  import scipy.special
  from packaging import version
  from ..None import maskers
  from .._explanation import Explanation
  from ..utils import assert_import, record_import_error, safe_isinstance
  from ..utils._exceptions import DimensionError, ExplainerError, InvalidFeaturePerturbationError, InvalidMaskerError, InvalidModelError
  from ..utils._legacy import DenseData
  from ._explainer import Explainer
label_desc: Use image node_id 2 for calling a global function with example usage: get_xgboost_json(model) and returns: json_trees