<commit_before>(function($) {

    window.DJNesting = (typeof DJNesting == 'object') ? DJNesting : {};

    var regexQuote = function(str) {
        return (str+'').replace(/([\.\?\*\+\^\$\[\]\\\(\)\{\}\|\-])/g, "\\$1");
    };

    // Utility jQuery functions for nested inlines
    (function() {
        if (typeof($.fn.setDjangoBooleanInput) != 'function') {
            $.fn.setDjangoBooleanInput = function(boolVal) {
                var i, input;
                for (i = 0; i < this.length; i++) {
                    input = this[i];
                    if (input.nodeName != 'INPUT') {
                        continue;
                    }
                    if (input.type == 'hidden') {
                        input.value = (boolVal) ? 'True' : 'False';
                    } else if (input.type == 'checkbox') {
                        input.checked = boolVal;
                    }
                }
            };
        }

        var prefixCache = {};

        $.fn.djangoPrefixIndex = function() {
            var $this = (this.length > 1) ? this.first() : this;
            var id = $this.attr('id'),
                name = $this.attr('name'),
                forattr = $this.attr('for'),
                inlineRegex = /^(.+_set)(?:(\d)|\-(\d)\-[^\-]+|\-group)$/,
                matches = [null, undefined, undefined],
                prefix, $group, groupId, cacheKey, match;

            if ((match = prefixCache[id]) || (match = prefixCache[name]) || (match = prefixCache[forattr])) {
                return match;
            }

            if ((id && (matches = id.match(inlineRegex)))
              || (name && (matches = name.match(inlineRegex)))
              || (forattr && (matches = forattr.match(inlineRegex)))) {
                cacheKey = matches[0];
                prefix = matches[1];
                index = (typeof(matches[2]) == 'string') ? matches[2] : matches[3];
            }

            if (!prefix) {
                $group = $this.closest('.group,.grp-group');
                if (!$group.length) {
                    return null;<commit_msg>nesting: Fixed annoying curation bug. ONE LINE FIX TOOK AN HOUR!<commit_after>(function($) {

    window.DJNesting = (typeof DJNesting == 'object') ? DJNesting : {};

    var regexQuote = function(str) {
        return (str+'').replace(/([\.\?\*\+\^\$\[\]\\\(\)\{\}\|\-])/g, "\\$1");
    };

    // Utility jQuery functions for nested inlines
    (function() {
        if (typeof($.fn.setDjangoBooleanInput) != 'function') {
            $.fn.setDjangoBooleanInput = function(boolVal) {
                var i, input;
                for (i = 0; i < this.length; i++) {
                    input = this[i];
                    if (input.nodeName != 'INPUT') {
                        continue;
                    }
                    if (input.type == 'hidden') {
                        input.value = (boolVal) ? 'True' : 'False';
                    } else if (input.type == 'checkbox') {
                        input.checked = boolVal;
                    }
                }
            };
        }

        var prefixCache = {};

        $.fn.djangoPrefixIndex = function() {
            var $this = (this.length > 1) ? this.first() : this;
            var id = $this.attr('id'),
                name = $this.attr('name'),
                forattr = $this.attr('for'),
                inlineRegex = /^(.+_set)(?:(\d+)|\-(\d+)\-(?!.*_set\d)[^\-]+|\-group)$/,
                matches = [null, undefined, undefined],
                prefix, $group, groupId, cacheKey, match;

            if ((match = prefixCache[id]) || (match = prefixCache[name]) || (match = prefixCache[forattr])) {
                return match;
            }

            if ((id && (matches = id.match(inlineRegex)))
              || (name && (matches = name.match(inlineRegex)))
              || (forattr && (matches = forattr.match(inlineRegex)))) {
                cacheKey = matches[0];
                prefix = matches[1];
                index = (typeof(matches[2]) == 'string') ? matches[2] : matches[3];
            }

            if (!prefix) {
                $group = $this.closest('.group,.grp-group');
                if (!$group.length) {
                    return null;
{'fraction_non_alphanumeric': 0.17673325499412457, 'fraction_numerical': 0.0037602820211515863, 'mean_word_length': 1.3644444444444443, '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': '3001300', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1143, 'n_words': 241}