def normalize_page_number(page_number, page_range):
    try:
        return page_range[page_number]
    except IndexError:
        return page_range[0]
Handle a negative *page_number*.
dataset/ETHPy150Open frankban/django-endless-pagination/endless_pagination/utils.py/normalize_page_number