def _create_category_mappings(
        untransformed_stat_covs: np.ndarray,
        transformer_cat,
        mask_cat: np.ndarray,
        cols_cat: Sequence[str],
    ):
        """
        Returns mapping from names of untransformed categorical static covariates names
        and names of transformed categorical static covariate names (i.e. `col_map_cat`), as well
        as a mapping from the transformed categorical static covariate names to the untransformed
        ones (i.e. `inv_col_map_cat`).

        These mappings will be many-to-one/one-to-many if a transformation that generates
        multiple components from a single categorical variable is being used (e.g. one-hot
        encoding).
        """
        if mask_cat.any():
            # check how many features the transformer generates
            n_cat_out = transformer_cat.transform(
                np.expand_dims(untransformed_stat_covs[0, mask_cat], 0)
            ).shape[-1]
            # transformer generates same number of features -> make a 1-1 column map
            if n_cat_out == sum(mask_cat):
                col_map_cat = inv_col_map_cat = OrderedDict({
                    col: [col] for col in cols_cat
                })
            # transformer generates more features (i.e. OneHotEncoder) -> create a 1-many column map
            else:
                col_map_cat = OrderedDict()
                inv_col_map_cat = OrderedDict()
                for col, categories in zip(cols_cat, transformer_cat.categories_):
                    col_map_cat_i = []
                    for cat in categories:
                        col_map_cat_i.append(str(col) + "_" + str(cat))
                        inv_col_map_cat[str(col) + "_" + str(cat)] = [col]
                    col_map_cat[col] = col_map_cat_i
        # If we don't have any categorical static covariates, don't need to generate mapping:
        else:
            col_map_cat = {}
            inv_col_map_cat = {}
        return col_map_cat, inv_col_map_cat

        Returns mapping from names of untransformed categorical static covariates names
        and names of transformed categorical static covariate names (i.e. `col_map_cat`), as well
        as a mapping from the transformed categorical static covariate names to the untransformed
        ones (i.e. `inv_col_map_cat`).

        These mappings will be many-to-one/one-to-many if a transformation that generates
        multiple components from a single categorical variable is being used (e.g. one-hot
        encoding).
        
darts/dataprocessing/transformers/static_covariates_transformer.py