@register.assignment_tag(takes_context=True)
def paginate(context, items):
    """
    Paginates the provided items.
    """
    try:
        num = int(context['request'].GET['page']) if 'page' in context['request'].GET else 1
        return Paginator(items, 12).page(num)
    except:
        raise Http404
dataset/ETHPy150Open 2buntu/2buntu-blog/twobuntu/articles/templatetags/pagination.py/paginate/original