code: def _partition_masks_recurse(
      index,
      m00,
      ind00,
      ind11,
      inds_lists,
      mask_matrix,
      partition_tree,
      M,
      all_masks,
  ):
      if index < 0:
          inds_lists[index + M][0].append(ind00)
          inds_lists[index + M][1].append(ind11)
          return
  
      # get our children indexes
      left_index = int(partition_tree[index, 0] - M)
      right_index = int(partition_tree[index, 1] - M)
  
      # build more refined masks
      m10 = (
          m00.copy()
      )  # we separate the copy from the add so as to not get converted to a matrix
      m10[:] += mask_matrix[left_index + M, :]
      m01 = m00.copy()
      m01[:] += mask_matrix[right_index + M, :]
  
      # record the new masks we made
      ind01 = len(all_masks)
      all_masks.append(m01)
      ind10 = len(all_masks)
      all_masks.append(m10)
  
      # inds_stack.append(len(all_masks) - 2)
      # inds_stack.append(len(all_masks) - 1)
  
      # recurse left and right with both 1 (True) and 0 (False) contexts
      _partition_masks_recurse(
          left_index,
          m00,
          ind00,
          ind10,
          inds_lists,
          mask_matrix,
          partition_tree,
          M,
          all_masks,
      )
      _partition_masks_recurse(
          right_index,
          m10,
          ind10,
          ind11,
          inds_lists,
          mask_matrix,
          partition_tree,
          M,
          all_masks,
      )
      _partition_masks_recurse(
          left_index,
          m01,
          ind01,
          ind11,
          inds_lists,
          mask_matrix,
          partition_tree,
          M,
          all_masks,
      )
      _partition_masks_recurse(
          right_index,
          m00,
          ind00,
          ind01,
          inds_lists,
          mask_matrix,
          partition_tree,
          M,
          all_masks,
      )
  
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 5 for calling a global function with example usage: _partition_masks_recurse(index, m00, ind00, ind11, inds_lists, mask_matrix, partition_tree, M, all_masks) without return types