from typing import Sequence
from typing import Dict


def _get_dict(l: Sequence[str], name_as_key: bool, starts_with: int = 1) -> Dict[str, str]:
    """
    Converts a list into a dict, where keys/values are the list indices.

    :param l: A list of categories
    :param name_as_key: Whether to return the dict with category names as key (True)
    :param starts_with: index count start
    :return: A dictionary of list indices/list elements.
    """
    if name_as_key:
        return {v: str(k) for k, v in enumerate(l, starts_with)}
    return {str(k): v for k, v in enumerate(l, starts_with)}