code: def _encode_categorical_columns(
      self, data: DataFrame, stage: str
  ) -> DataFrame:
      if stage != "fit":
          # Inference
          return self.categorical_encoder.transform(data)
      # Fit
      logger.debug("Encoding Categorical Columns using OrdinalEncoder")
      self.categorical_encoder = OrdinalEncoder(
          cols=self.config.categorical_cols,
          handle_unseen=(
              "impute"
              if self.config.handle_unknown_categories
              else "error"
          ),
          handle_missing="impute"
          if self.config.handle_missing_values
          else "error",
      )
      data = self.categorical_encoder.fit_transform(data)
      return data
  
imports: import re
  import warnings
  from enum import Enum
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Tuple, Union
  import joblib
  import numpy
  import pandas
  import pytorch_lightning
  import torch
  from omegaconf import DictConfig
  from pandas import DataFrame, DatetimeTZDtype, to_datetime
  from pandas.tseries import offsets
  from pandas.tseries.frequencies import to_offset
  from sklearn.base import TransformerMixin, copy
  from sklearn.preprocessing import FunctionTransformer, LabelEncoder, PowerTransformer, QuantileTransformer, StandardScaler
  from torch.utils.data import DataLoader, Dataset
  from pytorch_tabular.config import InferredConfig
  from pytorch_tabular.utils import get_logger
  from .categorical_encoders import OrdinalEncoder
label_desc: Use image node_id 17 for calling the TabularDatamodule obj's underlying member method code with example usage: obj._encode_categorical_columns(data, stage) and returns: data, self