code: def create_ordered_path(
      feature_path, average_yhats_index, type, order
  ):
      if order is None:
          # sort impacts and look for most importants elements
          if type == "2d":
              feature_path = feature_path.iloc[
                  np.argsort(feature_path["adiff_norm"])[::-1], :
              ]
          else:
              feature_path = feature_path.iloc[
                  np.argsort(feature_path["diff"])[::-1], :
              ]
      elif np.issubdtype(order.dtype, int):
          # case when permutation
          feature_path = feature_path.iloc[order, :]
  
      elif np.isin(order, average_yhats_index).all():
          # case when character
          feature_path = feature_path.loc[order, :]
      else:
          raise ValueError("Wrong order!")
  
      return feature_path
  
file_path: DALEX/python/dalex/dalex/predict_explanations/_break_down/utils.py
imports: from copy import deepcopy
  import numpy
  import pandas
label_desc: Use image node_id 4 for calling a global function with example usage: create_ordered_path(feature_path, average_yhats_index, type, order) and returns: feature_path