def get_page_number(page_numbers, pos):
    """Get the page number of a token at index position `pos` in a string \
    based on a dictionary `page_numbers` that contains the index positions \
    of the page numbers in that string.

    Args:
        page_numbers (dict):
            key: index of the last character of the page number in the string
            value: page number
        pos (int): the index position of the start of a token in the string
    """
    for k in sorted(page_numbers.keys()):
        if pos < k:
            return page_numbers[k]