docstr: Return dictionary mapping node id to list of sample indexes considered by
  the feature/split decision.
docstr_tok: ["Return","dictionary","mapping","node","id","to","list","of","sample","indexes","considered","by","the","feature\/split","decision","."]
code: def get_node_samples(self):
      """
      Return dictionary mapping node id to list of sample indexes considered by
      the feature/split decision.
      """
  
      if self.node_to_samples is not None:
          return self.node_to_samples
  
      prediction_leaves = self.booster.predict(
          xgb.DMatrix(self.X_train, feature_names=self.feature_names),
          pred_leaf=True,
      )
  
      if len(prediction_leaves.shape) > 1:
          prediction_leaves = prediction_leaves[:, self.tree_index]
  
      node_to_samples = defaultdict(list)
      for sample_i, prediction_leaf in enumerate(prediction_leaves):
          prediction_path = self._get_leaf_prediction_path(
              prediction_leaf
          )
          for node_id in prediction_path:
              node_to_samples[node_id].append(sample_i)
  
      self.node_to_samples = node_to_samples
      return node_to_samples
  
imports: import json
  import math
  from collections import defaultdict
  from typing import List, Mapping
  import numpy
  from dtreeviz.models.shadow_decision_tree import VisualisationNotYetSupportedError
  from dtreeviz.models.shadow_decision_tree import ShadowDecTree
  from dtreeviz import utils
  import xgboost
  from xgboost.core import Booster
label_desc: Use image node_id 11 for calling the ShadowXGBDTree obj's underlying member method code with example usage: obj.get_node_samples() and returns: node_to_samples, self