code: def partition_delta_indexes(partition_tree, all_masks):
      """Return an delta index encoded array of all the masks possible while following the given partition tree."""
  
      # convert the masks to delta index format
      mask = np.zeros(all_masks.shape[1], dtype=bool)
      delta_inds = []
      for i in range(len(all_masks)):
          inds = np.where(mask ^ all_masks[i, :])[0]
  
          for j in inds[:-1]:
              delta_inds.append(
                  -j - 1
              )  # negative + (-1) means we have more inds still to change...
          if len(inds) == 0:
              delta_inds.append(MaskedModel.delta_mask_noop_value)
          else:
              delta_inds.extend(inds[-1:])
          mask = all_masks[i, :]
  
      return np.array(delta_inds)
  
file_path: shap/shap/explainers/_exact.py
imports: import logging
  import numpy
  from numba import njit
  from ..None import links
  from ..models import Model
  from ..utils import MaskedModel, delta_minimization_order, make_masks, shapley_coefficients
  from ._explainer import Explainer
label_desc: Use image node_id 3 for calling a global function with example usage: partition_delta_indexes(partition_tree, all_masks) and returns: np