def validate_number(self, number):
        """
        Validates the given 1-based page number.
        """
        try:
            number = int(number)
        except (TypeError, ValueError):
            raise paginator.PageNotAnInteger('That page number is not an integer')
        if number < 1:
            raise paginator.EmptyPage('That page number is less than 1')

        return number
dataset/ETHPy150Open potatolondon/djangae/djangae/contrib/pagination/paginator.py/Paginator.validate_number/original