from typing import List
from typing import Optional
from typing import Dict


def _get_non_image_dict(list_channels: List[str],
                        numerical_cols: List[str],
                        categorical_cols: Optional[List[str]] = None) -> Dict[str, List[str]]:
    """
    Converts list of channels to dictionary of features to channels.
    Mimics the behavior of convert_non_image_features_channels_to_dict in ScalarConfig.
    """
    res = {}
    columns = numerical_cols.copy()
    if categorical_cols:
        columns += categorical_cols
    for col in columns:
        res[col] = list_channels
    return res