docstr: 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).
docstr_tok: ["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",")","."]
code: 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(cat)
                      if len(categories) > 1:
                          cat_col_name = str(col) + "_" + str(cat)
                          inv_col_map_cat[cat_col_name] = [col]
                      else:
                          inv_col_map_cat[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
  
imports: from collections import OrderedDict
  from typing import Any, Dict, List, Optional, Sequence, Tuple
  import numpy
  import pandas
  from scipy.sparse import csr_matrix
  from sklearn.preprocessing import MinMaxScaler, OrdinalEncoder
  from darts.logging import get_logger, raise_log
  from darts.timeseries import TimeSeries
  from .fittable_data_transformer import FittableDataTransformer
  from .invertible_data_transformer import InvertibleDataTransformer
label_desc: Use image node_id 5 for calling the StaticCovariatesTransformer obj's underlying member method code with example usage: obj._create_category_mappings(untransformed_stat_covs, transformer_cat, mask_cat, cols_cat) and returns: col_map_cat,  inv_col_map_cat