<commit_before>iD.ui.TagReference = function(entity, tag) {
    var taginfo = iD.taginfo();

    function findLocal(docs) {
        var locale = iD.detect().locale.toLowerCase(),
            localized;

        localized = _.find(docs, function(d) {
            return d.lang.toLowerCase() === locale;
        });
        if (localized) return localized;

        // try the non-regional version of a language, like
        // 'en' if the language is 'en-US'
        if (locale.indexOf('-') !== -1) {
            var first = locale.split('-')[0];
            localized = _.find(docs, function(d) {
                return d.lang.toLowerCase() === first;
            });
            if (localized) return localized;
        }

        // finally fall back to english
        return _.find(docs, function(d) {
            return d.lang.toLowerCase() === 'en';
        });
    }

    return function(selection) {
        selection.html('');

        selection.attr('class','cf');

        taginfo.docs(tag, function(err, docs) {
            if (!err && docs) {
                docs = findLocal(docs);
            }

            if (!docs || !docs.description) {
                return selection.text(t('inspector.no_documentation_key'));
            }

            var referenceBody = selection.append('div')
                .attr('class','tag-reference-wrap');

            if (docs.image && docs.image.thumb_url_prefix) {
                referenceBody
                    .append('img')
                    .attr('class', 'wiki-image')
                    .attr('src', docs.image.thumb_url_prefix + "100" + docs.image.thumb_url_suffix);
            }

            referenceBody
                .append('p')
                .text(docs.description);

            referenceBody
                .append('a')<commit_msg>Don't overwrite existing class<commit_after>iD.ui.TagReference = function(entity, tag) {
    var taginfo = iD.taginfo();

    function findLocal(docs) {
        var locale = iD.detect().locale.toLowerCase(),
            localized;

        localized = _.find(docs, function(d) {
            return d.lang.toLowerCase() === locale;
        });
        if (localized) return localized;

        // try the non-regional version of a language, like
        // 'en' if the language is 'en-US'
        if (locale.indexOf('-') !== -1) {
            var first = locale.split('-')[0];
            localized = _.find(docs, function(d) {
                return d.lang.toLowerCase() === first;
            });
            if (localized) return localized;
        }

        // finally fall back to english
        return _.find(docs, function(d) {
            return d.lang.toLowerCase() === 'en';
        });
    }

    return function(selection) {
        selection.html('');

        selection.classed('cf', true);

        taginfo.docs(tag, function(err, docs) {
            if (!err && docs) {
                docs = findLocal(docs);
            }

            if (!docs || !docs.description) {
                return selection.text(t('inspector.no_documentation_key'));
            }

            var referenceBody = selection.append('div')
                .attr('class','tag-reference-wrap');

            if (docs.image && docs.image.thumb_url_prefix) {
                referenceBody
                    .append('img')
                    .attr('class', 'wiki-image')
                    .attr('src', docs.image.thumb_url_prefix + "100" + docs.image.thumb_url_suffix);
            }

            referenceBody
                .append('p')
                .text(docs.description);

            referenceBody
                .append('a')
{'fraction_non_alphanumeric': 0.13748627881448958, 'fraction_numerical': 0.0027442371020856204, 'mean_word_length': 1.5543097407147863, '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': '7188493', 'n_tokens_mistral': 1026, 'n_tokens_neox': 965, 'n_words': 203}