code: def get_xgboost_dmatrix_properties(model):
      """
      Retrieves properties from an xgboost.sklearn.XGBModel instance that should be passed to the xgboost.core.DMatrix object before calling predict on the model
      """
      properties_to_pass = [
          "missing",
          "n_jobs",
          "enable_categorical",
          "feature_types",
      ]
      dmatrix_attributes = {}
      for attribute in properties_to_pass:
          if hasattr(model, attribute):
              dmatrix_attributes[attribute] = getattr(model, attribute)
  
      # Convert sklearn n_jobs to xgboost nthread
      if "n_jobs" in dmatrix_attributes:
          dmatrix_attributes["nthread"] = dmatrix_attributes.pop(
              "n_jobs"
          )
      return dmatrix_attributes
  
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 1 for calling a global function with example usage: get_xgboost_dmatrix_properties(model) and returns: dmatrix_attributes