def page(self, number):
        "Returns a Page object for the given 1-based page number."
        try:
            number = int(number)
        except ValueError:
            raise PageNotAnInteger('That page number is not an integer')
        bottom = (number - 1) * self.per_page
        top = bottom + self.per_page + 5
        try:
            _page = EndlessPage(list(self.object_list[bottom:top]), number, self)
        except __HOLE__:
            top = top - 5
            _page = EndlessPage(list(self.object_list[bottom:top]), number, self)

        if not _page.object_list:
            if number == 1 and self.allow_empty_first_page:
                pass
            else:
                raise EmptyPage('That page contains no results')
        return _page
dataset/ETHPy150Open dcramer/django-paging/paging/paginators.py/EndlessPaginator.page