code: def assign_contributions(ranked):
      """
      Turn a list of results into a dict.
  
      Parameters
      ----------
      ranked : list
          The output of rank_contributions.
  
      Returns
      -------
      dict
          Same data but rearrange into a dict with explicit names.
  
      Raises
      ------
      ValueError
          The output of rank_contributions should always be of length three.
      """
      if len(ranked) != 3:
          raise ValueError(
              "Expected lenght : 3, observed lenght : {},"
              "please check the outputs of rank_contributions.".format(
                  len(ranked)
              )
          )
      return {
          "contrib_sorted": ranked[0],
          "x_sorted": ranked[1],
          "var_dict": ranked[2],
      }
  
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 3 for calling a global function with example usage: assign_contributions(ranked) and returns: dict