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

        if (!api_result || api_result.error || api_result.length === 0 || !api_result.name) {
            return Spice.failed('first_robotics_teams');
        }
        
        // Remove the space for a website if one isn't provided
        var template_options = {
            content: 'record',
            moreAt: true
        };

        if (api_result.website && api_result.website != null) {
            template_options.moreText = {
                text: 'Team website',
                href: api_result.website
            };
        }
        
        // Get the last year the team competed from a different API call
        $.getJSON('/js/spice/first_robotics/years_competed/' + api_result.team_number, 
                  
            // Only call Spice.add() once the second API call is returned
            function(data) {

                Spice.add({
                    id: 'first_robotics',
                    name: 'Reference',
                    data: api_result,
                    meta: {
                        sourceName: 'The Blue Alliance',
                        sourceUrl: 'https://www.thebluealliance.com/team/' + api_result.team_number
                    },
                    normalize: function(item) {
                        var team_data = {
                            'Full name': item.name,
                            'Location': item.location,
                            'Rookie year': item.rookie_year
                        };
                        
                        // Only show the last year competed if there is an array of years
                        if (data && data.length != 0 && !data.error) {
                            team_data['Last competed'] = data[data.length - 1];
                        }

                        // Ditto for motto
                        if (item.motto && item.motto != null) {
                            team_data['Motto'] = item.motto;
                        }

                        return {
                            title: 'FIRST Robotics Competition Team ' + item.team_number,
                            subtitle: item.nickname,
                            record_data: team_data
                        };<commit_msg>Only show the rookie year if it exists in the JSON<commit_after>(function (env) {
    
    "use strict";
    
    env.ddg_spice_first_robotics_team_info = function(api_result) {

        if (!api_result || api_result.error || api_result.length === 0 || !api_result.name) {
            return Spice.failed('first_robotics_teams');
        }
        
        // Remove the space for a website if one isn't provided
        var template_options = {
            content: 'record',
            moreAt: true
        };

        if (api_result.website && api_result.website != null) {
            template_options.moreText = {
                text: 'Team website',
                href: api_result.website
            };
        }
        
        // Get the last year the team competed from a different API call
        $.getJSON('/js/spice/first_robotics/years_competed/' + api_result.team_number, 
                  
            // Only call Spice.add() once the second API call is returned
            function(data) {

                Spice.add({
                    id: 'first_robotics',
                    name: 'Reference',
                    data: api_result,
                    meta: {
                        sourceName: 'The Blue Alliance',
                        sourceUrl: 'https://www.thebluealliance.com/team/' + api_result.team_number
                    },
                    normalize: function(item) {
                        var team_data = {
                            'Full name': item.name,
                            'Location': item.location,
                        };
                        
                        // Only show rookie year if it exists
                        if (item.rookie_year && item.rookie_year != null) {
                            team_data['Rookie year'] = item.rookie_year;
                        }
                        
                        // Ditto for last year competed
                        if (data && data.length != 0 && !data.error) {
                            team_data['Last competed'] = data[data.length - 1];
                        }

                        
                        // And motto
                        if (item.motto && item.motto != null) {
                            team_data['Motto'] = item.motto;
                        }

                        return {
                            title: 'FIRST Robotics Competition Team ' + item.team_number,
                            subtitle: item.nickname,
                            record_data: team_data
                        };
{'fraction_non_alphanumeric': 0.08677184466019418, 'fraction_numerical': 0.0012135922330097086, 'mean_word_length': 1.0208418471597875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5325017', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1144, 'n_words': 280}