code: def get_col_mapping_ct(encoder, x_encoded):
      """
      Get the columns mapping of a column transformer encoder.
  
      Parameters
      ----------
      encoder : ColumnTransformer
          The encoder used.
      x_encoded : pd.DataFrame
          Pandas dataframe after encoder transformations
  
      Returns
      -------
      dict_col_mapping : dict
          Dict of mapping between dataframe columns before and after encoding.
      """
      dict_col_mapping = dict()
      idx_encoded = 0
      for name, estimator, features in encoder.transformers_:
          if name != "remainder":
              if str(type(estimator)) in dummies_sklearn:
                  features_out, categories_out = get_feature_out(
                      estimator, features
                  )
                  for i, f_name in enumerate(features):
                      dict_col_mapping[name + "_" + f_name] = list()
                      for _ in categories_out[i]:
                          dict_col_mapping[name + "_" + f_name].append(
                              x_encoded.columns.to_list()[idx_encoded]
                          )
                          idx_encoded += 1
  
              elif str(type(estimator)) in no_dummies_sklearn:
                  features_out, categories_out = get_feature_out(
                      estimator, features
                  )
                  for f_name in features_out:
                      dict_col_mapping[name + "_" + f_name] = [
                          x_encoded.columns.to_list()[idx_encoded]
                      ]
                      idx_encoded += 1
  
              elif str(type(estimator)) in supported_category_encoder:
                  dict_mapping_ce = get_col_mapping_ce(estimator)
                  for f_name in dict_mapping_ce.keys():
                      dict_col_mapping[name + "_" + f_name] = list()
                      for _ in dict_mapping_ce[f_name]:
                          dict_col_mapping[name + "_" + f_name].append(
                              x_encoded.columns.to_list()[idx_encoded]
                          )
                          idx_encoded += 1
  
              else:
                  raise NotImplementedError(
                      f"Estimator not supported : {estimator}"
                  )
  
          elif estimator == "passthrough":
              try:
                  features_out = encoder.feature_names_in_[features]
              except:
                  features_out = encoder._feature_names_in[
                      features
                  ]  # for oldest sklearn version
              for f_name in features_out:
                  dict_col_mapping[f_name] = [
                      x_encoded.columns.to_list()[idx_encoded]
                  ]
                  idx_encoded += 1
  
      return dict_col_mapping
  
file_path: shapash/shapash/utils/columntransformer_backend.py
imports: import pandas
  import numpy
  from shapash.utils.category_encoder_backend import inv_transform_ordinal
  from shapash.utils.category_encoder_backend import inv_transform_ce
  from shapash.utils.category_encoder_backend import supported_category_encoder
  from shapash.utils.category_encoder_backend import dummies_category_encoder
  from shapash.utils.category_encoder_backend import category_encoder_binary
  from shapash.utils.category_encoder_backend import transform_ordinal, get_col_mapping_ce
  from shapash.utils.model_synoptic import simple_tree_model_sklearn, catboost_model, linear_model, svm_model, xgboost_model, lightgbm_model, dict_model_feature
  from shapash.utils.model import extract_features_model
label_desc: Use image node_id 10 for calling a global function with example usage: get_col_mapping_ct(encoder, x_encoded) and returns: dict_col_mapping