<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
from django import template

register = template.Library()


@register.simple_tag
def jssettings(request):
    return json.dumps(request.js_settings)

register.simple_tag(jssettings)<commit_msg>Added jss_ready_actions template tage. Renamed jssettings template tag to jss_settings.<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
from django import template

register = template.Library()


@register.simple_tag
def jss_settings(request):
    return json.dumps(request.js_settings)

register.simple_tag(jss_settings)


@register.simple_tag
def jss_ready_actions(request):
    if not request.js_settings.get('ready_actions'):
        return ''

    actions = request.js_settings.get('ready_actions')

    return READY_ACTIONS.format('\r\n'.join(actions))

READY_ACTIONS = '''
<script type="text/javascript">
jQuery(document).ready(function()
{{
    {0}
}});
</script>
'''

register.simple_tag(jss_ready_actions)
{'fraction_non_alphanumeric': 0.11524163568773234, 'fraction_numerical': 0.0027881040892193307, 'mean_word_length': 5.567073170731708, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1770813', 'n_tokens_mistral': 337, 'n_tokens_neox': 332, 'n_words': 70}