def pagination(paginated_results):
    """Example: {%pagination polls%}"""
    current_page = paginated_results.number
    min_page = current_page - 3
    max_page = current_page + 3
    while min_page < 1:
        min_page += 1
        max_page += 1
    while max_page > paginated_results.paginator.num_pages:
        min_page -= 1
        max_page -= 1
    if min_page < 1:
        min_page = 1
    dots_before = bool(min_page > 1)
    dots_after = bool(max_page < paginated_results.paginator.num_pages)
    return {'paginated_results': paginated_results, 'min_page': min_page,
        'max_page': max_page, 'dots_before': dots_before, 'dots_after':
        dots_after}
