def _user_dir_get_symbol(directory_type: str, directories_table: dict,
    unexisting_msg: str) ->str:
    """
    Check that the requested directory type is defined in the selected user directories table
    and return the directory symbol corresponding to this type.

    :param directory_type: the code of some user directory
    :param directories_table: for each directory type, provides its associated symbol
    :param unexisting_msg: part of the exception message raised when directory type is not found
    :raises KeyError: when the directory type is unsupported in the selected configuration
    :returns: the directory symbol to use for this directory type
    """
    if directory_type not in directories_table:
        msg = 'User directory type "{}" is {}. Please choose one from {}.'
        raise KeyError(msg.format(directory_type, unexisting_msg,
            directories_table))
    return directories_table[directory_type]
