from typing import Sequence
from typing import Tuple
from typing import Dict


def _parse_record(
    record: Sequence[str], entry_map: Sequence[Tuple[int, str]]
) -> Dict[str, int]:
    """Parses a list of string fields into a dictionary of integers."""

    if not record:
        return {}

    try:
        return {key: int(record[idx]) for idx, key in entry_map}
    except IndexError:
        return {}