<commit_before>(function(env) {     
    env.ddg_spice_plos = function(api_result) {
        "use strict";

        if (!api_result) {
            return Spice.failed('plos');
        }

        // Grab number of results.
        var numFound = api_result.response.numFound;

        // if no results, don't show spice.
        if (numFound < 1) {
            return;
        }

        // Get query, exclude the trigger, and exclude preceding/trailing white space.
        var script = $('[src*="/js/spice/plos/"]')[0],
          source = $(script).attr("src"),
          query = source.match(/plos\/([^\/]+)/)[1];

        Spice.add({
            id: "plos",
            name: "Research",
            data: api_result.response.docs,
            meta: {
                itemType: "Papers",
                sourceName: "PLOS",
                sourceUrl: 'http://www.plosone.org/search/advanced?unformattedQuery=' + query
            }, 
            normalize: function(item) {
                var authors = item.author_display || [],
                  subtitle = authors.length ? authors.join(", ") : "",
                  title = DDG.strip_html(item.title_display),
                  journalName = item.journal ? item.journal + ' ' : '',
                  issueNumber = item.issue ? 'Issue ' + item.issue : '';

                return {
                    url: "http://dx.doi.org/" + item.id,
                    title: title,
                    subtitle: subtitle,
                    description: title,
                    issue: journalName + issueNumber,
                    publicationDate: item.publication_date,
                };
            },
            templates: {
                group: 'text',
                options: {
                    footer: Spice.plos.footer,<commit_msg>PLOS: Remove trailing commas in the JS.<commit_after>(function(env) {     
    env.ddg_spice_plos = function(api_result) {
        "use strict";

        if (!api_result) {
            return Spice.failed('plos');
        }

        // Grab number of results.
        var numFound = api_result.response.numFound;

        // if no results, don't show spice.
        if (numFound < 1) {
            return;
        }

        // Get query, exclude the trigger, and exclude preceding/trailing white space.
        var script = $('[src*="/js/spice/plos/"]')[0],
          source = $(script).attr("src"),
          query = source.match(/plos\/([^\/]+)/)[1];

        Spice.add({
            id: "plos",
            name: "Research",
            data: api_result.response.docs,
            meta: {
                itemType: "Papers",
                sourceName: "PLOS",
                sourceUrl: 'http://www.plosone.org/search/advanced?unformattedQuery=' + query
            }, 
            normalize: function(item) {
                var authors = item.author_display || [],
                  subtitle = authors.length ? authors.join(", ") : "",
                  title = DDG.strip_html(item.title_display),
                  journalName = item.journal ? item.journal + ' ' : '',
                  issueNumber = item.issue ? 'Issue ' + item.issue : '';

                return {
                    url: "http://dx.doi.org/" + item.id,
                    title: title,
                    subtitle: subtitle,
                    description: title,
                    issue: journalName + issueNumber,
                    publicationDate: item.publication_date
                };
            },
            templates: {
                group: 'text',
                options: {
                    footer: Spice.plos.footer
{'fraction_non_alphanumeric': 0.12762430939226518, 'fraction_numerical': 0.0016574585635359116, 'mean_word_length': 1.309311224489796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3274306', 'n_tokens_mistral': 1011, 'n_tokens_neox': 939, 'n_words': 197}