code: def sample_categorical(
      X_hat_cat_split: List[np.ndarray],
      C_cat_split: Optional[List[np.ndarray]],
  ) -> List[np.ndarray]:
      """
      Samples categorical features according to the conditional vector. This method sample conditional according to
      the masking vector the most probable outcome.
  
      Parameters
      ----------
      X_hat_cat_split
          List of reconstructed categorical heads from the auto-encoder. The categorical columns contain logits.
      C_cat_split
          List of conditional vector for categorical heads.
  
      Returns
      -------
      X_ohe_hat_cat
          List of one-hot encoded vectors sampled according to the conditional vector.
      """
      X_ohe_hat_cat = []  # initialize the returning list
      rows = np.arange(
          X_hat_cat_split[0].shape[0]
      )  # initialize the returning list
  
      for i in range(len(X_hat_cat_split)):
          # compute probability distribution
          proba = softmax(X_hat_cat_split[i], axis=1)
          proba = (
              proba * C_cat_split[i]
              if (C_cat_split is not None)
              else proba
          )
  
          # sample the most probable outcome conditioned on the conditional vector
          cols = np.argmax(proba, axis=1)
          samples = np.zeros_like(proba)
          samples[rows, cols] = 1
          X_ohe_hat_cat.append(samples)
  
      return X_ohe_hat_cat
  
imports: from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  from scipy.special import softmax
  from sklearn.compose import ColumnTransformer
  from sklearn.preprocessing import OneHotEncoder, StandardScaler
label_desc: Use image node_id 7 for calling a global function with example usage: sample_categorical(X_hat_cat_split, C_cat_split) and returns: X_ohe_hat_cat