def get_page_number_from_request(
        request, querystring_key=PAGE_LABEL, default=1):
    """Retrieve the current page number from *GET* or *POST* data.

    If the page does not exists in *request*, or is not a number,
    then *default* number is returned.
    """
    try:
        return int(request.REQUEST[querystring_key])
    except (KeyError, TypeError, __HOLE__):
        return default
dataset/ETHPy150Open frankban/django-endless-pagination/endless_pagination/utils.py/get_page_number_from_request