code: def convert_ordering(ordering, shap_values):
      if issubclass(type(ordering), OpChain):
          ordering = ordering.apply(Explanation(shap_values))
      if issubclass(type(ordering), Explanation):
          if "argsort" in [op["name"] for op in ordering.op_history]:
              ordering = ordering.values
          else:
              ordering = ordering.argsort.flip.values
      return ordering
  
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 2 for calling a global function with example usage: convert_ordering(ordering, shap_values) and returns: ordering