<commit_before>import json

from django import template
from django.utils.html import format_html, mark_safe
from django.contrib.staticfiles.storage import staticfiles_storage

register = template.Library()


def django_google_chart_js():
    chart_js_url = staticfiles_storage.url('django_google_charts/charts.js')

    autoload = json.dumps({
        'modules': [
            {
                'name': 'visualization',
                'version': '1',
                'packages': ['corechart'],
            },
        ],
    })

    return format_html(
        """
        <script type="text/javascript"
            src="https://www.google.com/jsapi?autoload={0}">
        </script>
        <script type="text/javascript" src="{1}"></script>
        """,
        mark_safe(autoload),
        chart_js_url,
    )

register.simple_tag(django_google_chart_js)
<commit_msg>Escape autoload string, it's going in quotes<commit_after>import json

from django import template
from django.utils.html import format_html, mark_safe
from django.contrib.staticfiles.storage import staticfiles_storage

register = template.Library()


def django_google_chart_js():
    chart_js_url = staticfiles_storage.url('django_google_charts/charts.js')

    autoload = json.dumps({
        'modules': [
            {
                'name': 'visualization',
                'version': '1',
                'packages': ['corechart'],
            },
        ],
    }).replace('"', '\"')

    return format_html(
        """
        <script type="text/javascript"
            src="https://www.google.com/jsapi?autoload={0}">
        </script>
        <script type="text/javascript" src="{1}"></script>
        """,
        mark_safe(autoload),
        chart_js_url,
    )

register.simple_tag(django_google_chart_js)

{'fraction_non_alphanumeric': 0.13128491620111732, 'fraction_numerical': 0.0033519553072625698, 'mean_word_length': 2.4310344827586206, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '5933304', 'n_tokens_mistral': 542, 'n_tokens_neox': 524, 'n_words': 91}