code: def calc_inv_contrib_ce(x_contrib, encoding, agg_columns):
      """
      Reversed contribution when category encoder and/or a dict is used.
      If category encoder create multiple columns, we use the mapping to find which contribution columns to sum.
      Else we return the contribution without aggregate.
  
      Parameters
      ----------
      x_contrib : pandas.DataFrame
          Contributions set.
      encoding : category_encoders, list, dict
          The processing apply to the original data.
      agg_columns : str (default: 'sum')
          Type of aggregation performed. For Shap we want so sum contributions of one hot encoded variables.
  
      Returns
      -------
      pandas.DataFrame
          The aggregate contributions depending on which processing is apply.
      """
      if str(type(encoding)) in dummies_category_encoder:
          if (
              str(type(encoding)) in category_encoder_binary
              and ce.__version__ <= "2.2.2"
          ):
              encoding = encoding.base_n_encoder
          drop_col = []
          for switch in encoding.mapping:
              col_in = switch.get("col")
              mod = switch.get("mapping").columns.tolist()
              insert_at = x_contrib.columns.tolist().index(mod[0])
              if agg_columns == "first":
                  x_contrib.insert(insert_at, col_in, x_contrib[mod[0]])
              else:
                  x_contrib.insert(
                      insert_at, col_in, x_contrib[mod].sum(axis=1)
                  )
              drop_col += mod
          x_contrib.drop(drop_col, axis=1, inplace=True)
          return x_contrib
      else:
          return x_contrib
  
file_path: shapash/shapash/utils/category_encoder_backend.py
imports: import pandas
  import numpy
  import category_encoders
label_desc: Use image node_id 5 for calling a global function with example usage: calc_inv_contrib_ce(x_contrib, encoding, agg_columns) and returns: x_contrib, x_contrib