<commit_before>"""
Manager to handle buitlin template tags and filters.
"""
from django.conf import settings
from django.template import base, TemplateSyntaxError
from ..locals import thread_locals


BUILTIN_LIBRARIES = getattr(settings, 'TEMPLATION_BUILTIN_LIBRARIES', {
    'django.template.defaultfilters': {},
    'django.template.defaulttags': {},
    'django.template.loader_tags': {},
})

base.builtins = []


class exclusion_filter(object):
    def __init__(self, function):
        self.function = function

    def __call__(self, *args, **kwargs):
        if thread_locals.resource:
            raise TemplateSyntaxError('{} is not a valid tag/filter to use in templation'.format(self.function.__name__))
        return self.function(*args, **kwargs)


for k, v in BUILTIN_LIBRARIES.items():
    base.add_to_builtins(k)
    if 'exclude' in v:<commit_msg>fix TypeError in templates/base:627 args_check<commit_after>"""
Manager to handle buitlin template tags and filters.
"""
from django.conf import settings
from django.template import base, TemplateSyntaxError
from ..locals import thread_locals


BUILTIN_LIBRARIES = getattr(settings, 'TEMPLATION_BUILTIN_LIBRARIES', {
    'django.template.defaultfilters': {},
    'django.template.defaulttags': {},
    'django.template.loader_tags': {},
})

base.builtins = []


class exclusion_filter(object):
    def __init__(self, function):
        self._decorated_function = function

    def __call__(self, *args, **kwargs):
        if thread_locals.resource:
            raise TemplateSyntaxError('{} is not a valid tag/filter to use in templation'.format(self._decorated_function.__name__))
        return self._decorated_function(*args, **kwargs)


for k, v in BUILTIN_LIBRARIES.items():
    base.add_to_builtins(k)
    if 'exclude' in v:
{'fraction_non_alphanumeric': 0.11371237458193979, 'fraction_numerical': 0.0016722408026755853, 'mean_word_length': 4.248538011695906, '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': '6864989', 'n_tokens_mistral': 557, 'n_tokens_neox': 538, 'n_words': 135}