code: def sample(
      X_hat_split: List[np.ndarray],
      X_ohe: np.ndarray,
      C: Optional[np.ndarray],
      category_map: Dict[int, List[str]],
      stats: Dict[int, Dict[str, float]],
  ) -> List[np.ndarray]:
      """
      Samples an instance from the given reconstruction according to the conditional vector and
      the dictionary of statistics.
  
      Parameters
      ----------
      X_hat_split
          List of reconstructed columns from the auto-encoder. The categorical columns contain logits.
      X_ohe
          One-hot encoded representation of the input.
      C
          Conditional vector.
      category_map
          Dictionary of category mapping. The keys are column indexes and the values are lists containing the possible
          values for a feature.
      stats
          Dictionary of statistic of the training data. Contains the minimum and maximum value of each numerical
          feature in the training set. Each key is an index of the column and each value is another dictionary
          containing ``'min'`` and ``'max'`` keys.
  
      Returns
      -------
      X_ohe_hat_split
          Most probable reconstruction sample according to the auto-encoder, sampled according to the conditional vector
          and the dictionary of statistics. This method assumes that the input array, `X_ohe` , has the first columns
          corresponding to the numerical features, and the rest are one-hot encodings of the categorical columns.
      """
      X_ohe_num_split, X_ohe_cat_split = split_ohe(X_ohe, category_map)
      C_num_split, C_cat_split = (
          split_ohe(C, category_map)
          if (C is not None)
          else (None, None)
      )
  
      X_ohe_hat_split = (
          []
      )  # list of sampled numerical columns and sampled categorical columns
      num_feat, cat_feat = len(X_ohe_num_split), len(X_ohe_cat_split)
  
      if num_feat > 0:
          # Sample numerical columns
          X_ohe_hat_split += sample_numerical(
              X_hat_num_split=X_hat_split[:num_feat],
              X_ohe_num_split=X_ohe_num_split,
              C_num_split=C_num_split,
              stats=stats,
          )
  
      if cat_feat > 0:
          # Sample categorical columns
          X_ohe_hat_split += sample_categorical(
              X_hat_cat_split=X_hat_split[-cat_feat:],
              C_cat_split=C_cat_split,
          )
  
      return X_ohe_hat_split
  
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 8 for calling a global function with example usage: sample(X_hat_split, X_ohe, C, category_map, stats) and returns: X_ohe_hat_split