def five_options_around(page):
    """ Create five page numbers around current page for discovery pagination. """
    if page.number <= 3:
        return list(range(1, min(5, page.paginator.num_pages) + 1))
    elif page.number >= (page.paginator.num_pages - 2):
        return list(range(max((page.paginator.num_pages - 4), 1),
                          page.paginator.num_pages + 1))
    else:
        return list(range(max(1, (page.number - 2)),
                          min((page.number + 2), page.paginator.num_pages) + 1))