<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def links(self, base_link, current_page) -> dict:
 """ Return JSON paginate links """

        max_pages = self.max_pages - 1 if \
            self.max_pages > 0 else self.max_pages
        base_link = '/%s' % (base_link.strip("/"))
        self_page = current_page
        prev = current_page - 1 if current_page is not 0 else None
        prev_link = '%s/page/%s/%s' % (base_link, prev, self.limit) if \
            prev is not None else None
        next = current_page + 1 if current_page < max_pages else None
        next_link = '%s/page/%s/%s' % (base_link, next, self.limit) if \
            next is not None else None
        first = 0
        last = max_pages
        return {
            'self': '%s/page/%s/%s' % (base_link, self_page, self.limit),
            'prev': prev_link,
            'next': next_link,
            'first': '%s/page/%s/%s' % (base_link, first, self.limit),
            'last': '%s/page/%s/%s' % (base_link, last, self.limit),
        }