code: def delta_minimization_order(
      all_masks, max_swap_size=100, num_passes=2
  ):
      order = np.arange(len(all_masks))
      for _ in range(num_passes):
          for length in list(range(2, max_swap_size)):
              for i in range(1, len(order) - length):
                  if (
                      _reverse_window_score_gain(
                          all_masks, order, i, length
                      )
                      > 0
                  ):
                      _reverse_window(order, i, length)
      return order
  
file_path: shap/shap/utils/_clustering.py
imports: import warnings
  import numpy
  import pandas
  import scipy.cluster
  import scipy.spatial
  import sklearn
  from numba import njit
  from ._show_progress import show_progress
label_desc: Use image node_id 4 for calling a global function with example usage: delta_minimization_order(all_masks, max_swap_size, num_passes) and returns: order