code: def _generate_codes(df: DataFrame, cat_cols: List) -> dict:
      tmp = df.copy()
      for col in cat_cols:
          tmp[col] = tmp[col].astype("category").cat.as_ordered()
  
      # list of categories for each column (always a column for None)
      return {col: list(tmp[col].cat.categories) for col in cat_cols}
  
file_path: lightning-flash/src/flash/tabular/classification/utils.py
imports: import logging
  from typing import Dict, List, Tuple
  import numpy
  from flash.core.utilities.imports import _PANDAS_AVAILABLE
label_desc: Use image node_id 4 for calling a global function with example usage: _generate_codes(df, cat_cols) and returns: unknown