<|file_name|>navclass.py<|end_file_name|><｜fim▁begin｜>from django.template import Library, Node, resolve_variable, TemplateSyntaxError
from django.core.urlresolvers import reverse

register = Library()
   
@register.simple_tag
def active(request, pattern):
    import re

    if re.search(pattern, request.get_full_path()):
                <|fim_middle|>

    return ''<｜fim▁end｜>
        return 'active'