

def _set_current_page(self, current_page, last_page):
    '\n        Get the current page for the request.\n\n        :param current_page: The current page of results\n        :type current_page: int\n\n        :param last_page: The last page of results\n        :type last_page: int\n\n        :rtype: int\n        '
    if (not current_page):
        current_page = self.resolve_current_page()
    if (current_page > last_page):
        if (last_page > 0):
            return last_page
        return 1
    if (not self._is_valid_page_number(current_page)):
        return 1
    return current_page

dataset/ETHPy150Open sdispater/orator/orator/pagination/length_aware_paginator.py LengthAwarePaginator._set_current_page/original