<commit_before>"""
pagination.py

Defines a basic pagination structure that can be used when displaying
a list of search results.

Based on http://flask.pocoo.org/snippets/44/
"""

from math import ceil


class Pagination(object):
    """
    A basic pagination structure.
    """
    def __init__(self, page, per_page, total_count):
        """
        Sets up the pagination structure.

        Args:
            page: The current page number, starting at 1.
            per_page: The number of items allowed per page.
            total_count: The total number of items being paged.
        """
        self.page = page
        self.per_page = per_page
        self.total_count = total_count

    @property
    def pages(self):
        """
        Gets the total number of pages.
        """
        return int(ceil(self.total_count / float(self.per_page)))

    @property
    def has_prev(self):
        """
        Determines if there is a previous page available.
        """<commit_msg>Standardization of pagination classes<commit_after>"""
pagination.py

Defines a basic pagination structure that can be used when displaying
a list of search results.

Based on http://flask.pocoo.org/snippets/44/
"""

from math import ceil


class Pagination(object):
    """
    A basic pagination structure.
    """
    def __init__(self, page, per_page, total):
        """
        Sets up the pagination structure.

        Args:
            page: The current page number, starting at 1.
            per_page: The number of items allowed per page.
            total: The total number of items being paged.
        """
        self.page = page
        self.per_page = per_page
        self.total = total

    @property
    def pages(self):
        """
        Gets the total number of pages.
        """
        return int(ceil(self.total / float(self.per_page)))

    @property
    def has_prev(self):
        """
        Determines if there is a previous page available.
        """
{'fraction_non_alphanumeric': 0.08796764408493428, 'fraction_numerical': 0.003033367037411527, 'mean_word_length': 2.1018808777429467, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3996882', 'n_tokens_mistral': 562, 'n_tokens_neox': 541, 'n_words': 193}