code: def fill_internal_max_values(partition_tree, leaf_values):
      """This fills the forth column of the partition tree matrix with the max leaf value in that cluster."""
      M = partition_tree.shape[0] + 1
      new_tree = partition_tree.copy()
      for i in range(new_tree.shape[0]):
          val = 0
          if new_tree[i, 0] < M:
              ind = int(new_tree[i, 0])
              val = max(val, np.abs(leaf_values[ind]))
          else:
              ind = int(new_tree[i, 0]) - M
              val = max(
                  val, np.abs(new_tree[ind, 3])
              )  # / partition_tree[ind,2])
          if new_tree[i, 1] < M:
              ind = int(new_tree[i, 1])
              val = max(val, np.abs(leaf_values[ind]))
          else:
              ind = int(new_tree[i, 1]) - M
              val = max(
                  val, np.abs(new_tree[ind, 3])
              )  # / partition_tree[ind,2])
          new_tree[i, 3] = val
      return new_tree
  
file_path: shap/shap/plots/_utils.py
imports: import matplotlib.pyplot
  import numpy
  from ..None import Explanation
  from ..utils import OpChain
  from .None import colors
label_desc: Use image node_id 7 for calling a global function with example usage: fill_internal_max_values(partition_tree, leaf_values) and returns: new_tree