code: def rank_contributions(s_df, x_df):
      """
      Function to sort contributions and input features
      by decreasing contribution absolute values
  
      Parameters
      ----------
      s_df: pandas.DataFrame
          Local contributions dataframe.
      x_df: pandas.DataFrame
          Input features.
  
      Returns
      -------
      pandas.DataFrame
          Local contributions sorted by decreasing absolute values.
      pandas.DataFrame
          Input features sorted by decreasing contributions absolute values.
      pandas.DataFrame
          Input features names sorted for each observation
          by decreasing contributions absolute values.
      """
      argsort = np.argsort(-np.abs(s_df.values), axis=1)
      sorted_contrib = np.take_along_axis(s_df.values, argsort, axis=1)
      sorted_features = np.take_along_axis(x_df.values, argsort, axis=1)
  
      contrib_col = [
          "contribution_" + str(i) for i in range(s_df.shape[1])
      ]
      col = ["feature_" + str(i) for i in range(s_df.shape[1])]
  
      s_dict = pd.DataFrame(data=argsort, columns=col, index=x_df.index)
      s_ord = pd.DataFrame(
          data=sorted_contrib, columns=contrib_col, index=x_df.index
      )
      x_ord = pd.DataFrame(
          data=sorted_features, columns=col, index=x_df.index
      )
      return [s_ord, x_ord, s_dict]
  
file_path: shapash/shapash/decomposition/contributions.py
imports: import pandas
  import numpy
  from shapash.utils.transform import preprocessing_tolist
  from shapash.utils.transform import check_transformers
  from shapash.utils.category_encoder_backend import calc_inv_contrib_ce
  from shapash.utils.columntransformer_backend import calc_inv_contrib_ct
label_desc: Use image node_id 2 for calling a global function with example usage: rank_contributions(s_df, x_df) and returns: list