def METHOD_NAME(
    df: PandasData,
    action: ActionType,
    index_name_or_columns: Union[List[str], str] = None,
):
    """
    This function is used by the deserialization function to undo any temp
    workarounds applied to the dataframe during serialization.
    Args:
        df （pd.DataFrame):
            Required. This is the dataframe to deserialize.
        action (enum.Enum):
            Required. One of [CAST_COL_NAME, CAST_ROW_NAME, CAST_CATEGORICAL]
        index_name_or_columns (Union[List[str], str]):
            Required. This is the list of index names to cast back to int
            in the case of restoring row or column indices. In the case of
            categorical columns, this is the list of column names to restore.
    """
    restored_indices = []
    if action == ActionType.CAST_COL_NAME:
        for i in range(len(df.columns)):
            if df.columns[i] == index_name_or_columns:
                restored_indices.append(int(index_name_or_columns))
            else:
                restored_indices.append(df.columns[i])
        df.columns = restored_indices
    elif action == ActionType.CAST_ROW_INDEX:
        for i in range(len(df.index)):
            if df.index[i] == index_name_or_columns:
                restored_indices.append(int(index_name_or_columns))
            else:
                restored_indices.append(df.index[i])
        df.index = restored_indices
    elif action == ActionType.CAST_CATEGORICAL:
        for column in index_name_or_columns:
            df[column] = df[column].astype("int", errors="ignore")
            df[column] = df[column].astype("category")