def paginate_queryset(self, queryset, request_data):
        """
        Paginate the search results. This is a simplified version of
        Django's MultipleObjectMixin.paginate_queryset
        """
        paginator = self.get_paginator(queryset)
        page_kwarg = self.page_kwarg
        page = request_data.get(page_kwarg, 1)
        try:
            page_number = int(page)
        except ValueError:
            if page == 'last':
                page_number = paginator.num_pages
            else:
                raise InvalidPage(_(
                    "Page is not 'last', nor can it be converted to an int."))
        # This can also raise an InvalidPage exception.
        return paginator, paginator.page(page_number)
dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/search/search_handlers.py/SearchHandler.paginate_queryset/original