<commit_before>from django import template

register = template.Library()

# http://djangosnippets.org/snippets/2763/
LEADING_PAGE_RANGE_DISPLAYED = TRAILING_PAGE_RANGE_DISPLAYED = 8
LEADING_PAGE_RANGE = TRAILING_PAGE_RANGE = 6
NUM_PAGES_OUTSIDE_RANGE = 2
ADJACENT_PAGES = 2

@register.assignment_tag(takes_context=True)
def foundation_paginator(context):
    ctx = _get_pagination_context(context)
    if not ctx:
        return ''
    return template.loader.get_template("foundation_paginator.html").render(ctx)

def _get_pagination_context(context):
    page_obj = context['page']
    try:
        paginator = page_obj.paginator
    except AttributeError:<commit_msg>assignment_tag is deprecated, switch it out<commit_after>from django import template

register = template.Library()

# http://djangosnippets.org/snippets/2763/
LEADING_PAGE_RANGE_DISPLAYED = TRAILING_PAGE_RANGE_DISPLAYED = 8
LEADING_PAGE_RANGE = TRAILING_PAGE_RANGE = 6
NUM_PAGES_OUTSIDE_RANGE = 2
ADJACENT_PAGES = 2

@register.simple_tag(takes_context=True)
def foundation_paginator(context):
    ctx = _get_pagination_context(context)
    if not ctx:
        return ''
    return template.loader.get_template("foundation_paginator.html").render(ctx)

def _get_pagination_context(context):
    page_obj = context['page']
    try:
        paginator = page_obj.paginator
    except AttributeError:
{'fraction_non_alphanumeric': 0.0841874084919473, 'fraction_numerical': 0.01171303074670571, 'mean_word_length': 5.328703703703703, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4543532', 'n_tokens_mistral': 482, 'n_tokens_neox': 464, 'n_words': 78}