<commit_before>import os
import warnings

from django import dispatch
from jinja2 import Environment, loaders
from jinja2 import defaults as jinja2_defaults
from coffin.template import Library as CoffinLibrary

__all__ = ('env',)

env = None

_JINJA_I18N_EXTENSION_NAME = 'jinja2.ext.i18n'

class CoffinEnvironment(Environment):
    def __init__(self, filters={}, globals={}, tests={}, loader=None, extensions=[], **kwargs):
        from django.conf import settings
        if not loader:
            loader = loaders.ChoiceLoader(self._get_loaders())
        all_ext = self._get_all_extensions()

        extensions.extend(all_ext['extensions'])
        super(CoffinEnvironment, self).__init__(
            extensions=extensions,
            loader=loader,
            auto_reload=settings.DEBUG,
            **kwargs
        )
        # Note: all_ext already includes Jinja2's own builtins (with
        # the proper priority), so we want to assign to these attributes.
        self.filters = all_ext['filters'].copy()
        self.filters.update(filters)
        self.globals = all_ext['globals'].copy()<commit_msg>This, too, got pulled in my a merge, but it causes the behavior to be different than Django's own default, so remove it.<commit_after>import os
import warnings

from django import dispatch
from jinja2 import Environment, loaders
from jinja2 import defaults as jinja2_defaults
from coffin.template import Library as CoffinLibrary

__all__ = ('env',)

env = None

_JINJA_I18N_EXTENSION_NAME = 'jinja2.ext.i18n'

class CoffinEnvironment(Environment):
    def __init__(self, filters={}, globals={}, tests={}, loader=None, extensions=[], **kwargs):
        from django.conf import settings
        if not loader:
            loader = loaders.ChoiceLoader(self._get_loaders())
        all_ext = self._get_all_extensions()

        extensions.extend(all_ext['extensions'])
        super(CoffinEnvironment, self).__init__(
            extensions=extensions,
            loader=loader,
            **kwargs
        )
        # Note: all_ext already includes Jinja2's own builtins (with
        # the proper priority), so we want to assign to these attributes.
        self.filters = all_ext['filters'].copy()
        self.filters.update(filters)
        self.globals = all_ext['globals'].copy()
{'fraction_non_alphanumeric': 0.09596178897090751, 'fraction_numerical': 0.007815892314372557, 'mean_word_length': 3.235294117647059, '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': '715826', 'n_tokens_mistral': 656, 'n_tokens_neox': 637, 'n_words': 186}