def get_links(self, nb_links=5):
        """
        Returns an array of page numbers to use in pagination links.

        nb_links The maximum number of page numbers to return
        """
        page = self.page
        last_page = self.last_page
        links = []
        tmp = page - floor(nb_links / 2)
        check = last_page - nb_links + 1
        if check > 0:
            limit = check
        else:
            limit = 1

        if tmp > 0:
            if tmp > limit:
                begin = limit
            else:
                begin = tmp
        else:
            begin = 1

        i = int(begin)
        while (i < (begin + nb_links)) and (i <= last_page):
            links.append(i)
            i += 1

        if len(links):
            self.current_max_link = links[len(links) - 1]
        else:
            self.current_max_link = 1

        return links
dataset/ETHPy150Open lightningwolf/Flask-LwAdmin/flask_lwadmin/pager.py/Pager.get_links/original