code: def sort_inds(partition_tree, leaf_values, pos=None, inds=None):
      if inds is None:
          inds = []
  
      if pos is None:
          partition_tree = fill_internal_max_values(
              partition_tree, leaf_values
          )
          pos = partition_tree.shape[0] - 1
  
      M = partition_tree.shape[0] + 1
  
      if pos < 0:
          inds.append(pos + M)
          return
  
      left = int(partition_tree[pos, 0]) - M
      right = int(partition_tree[pos, 1]) - M
  
      left_val = (
          partition_tree[left, 3]
          if left >= 0
          else leaf_values[left + M]
      )
      right_val = (
          partition_tree[right, 3]
          if right >= 0
          else leaf_values[right + M]
      )
  
      if left_val < right_val:
          tmp = right
          right = left
          left = tmp
  
      sort_inds(partition_tree, leaf_values, left, inds)
      sort_inds(partition_tree, leaf_values, right, inds)
  
      return inds
  
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 9 for calling a global function with example usage: sort_inds(partition_tree, leaf_values, pos, inds) and returns: inds