<commit_before>(function (env) {
    "use strict";
    
    var Games;
    
    env.ddg_spice_sports_nfl_games = function(apiResult) {

        if (!apiResult || !apiResult.data || !apiResult.data.games || !apiResult.data.games.length) {
            return Spice.failed('nfl_games');
        }
        
        DDG.require('sports', function(){
            Games = env.ddg_spice_sports_games;
            
            Games.init(NFLInit);
        });
        
        var NFLInit = function () {
                Spice.add({
                    id: 'nfl_games',
                    name: 'NFL Games',

                    data: Games.transformGameData(apiResult.data),

                    from: apiResult.from,
                    signal: apiResult.signal,

                    meta: $.extend(Games.META, {
                        sourceUrl:  apiResult.url || "http://www.bleacherreport.com/nfl",
                        selectedItem: apiResult.data.most_relevant_game_id,
                    }),

                    templates: $.extend(Games.TEMPLATES, {
                        options: {
                            content: Spice.sports_nfl_games.nfl_score
                        }
                    }),
                    
                    normalize: NFLGameData
                });
            },
        
            NFLGameData = function(attrs) {
                attrs.canExpand = false;
                attrs.relativeDay = Games.getRelativeDay(attrs.start_time);
                
                // Game Finished/In-Progress
                if (attrs.has_started) {
                    attrs.canExpand = true;
                        
                    if (attrs.has_ended) {
                        attrs.textTotal = l("Final");
                    } else {
                        attrs.is_playing = true;
                        attrs.textTotal = l("Score");
                        attrs.textLastUpdate = l("As of %s", Handlebars.helpers.momentTime(attrs.updated));

                        attrs.score = Games.fillBoxscore(attrs.score, {
                            current: attrs.score.quarter,
                            counter: "quarter",
                            name: "scoring",
                            min: 4,
                            obj: {
                                points: Games.PLACEHOLDER
                            }
                        });

                        // set possession on the relevant team object
                        if (attrs.score.possession.team === attrs.home_team.api_id) {
                            attrs.home_team.has_ball = true;
                        } else {
                            attrs.away_team.has_ball = true;
                        }
                        
                    }
                }
                
                return attrs;
            };
    }

}(this));
<commit_msg>(nfl) halftime/overtime checks for better labels<commit_after>(function (env) {
    "use strict";
    
    var Games;
    
    env.ddg_spice_sports_nfl_games = function(apiResult) {

        if (!apiResult || !apiResult.data || !apiResult.data.games || !apiResult.data.games.length) {
            return Spice.failed('nfl_games');
        }
        
        DDG.require('sports', function(){
            Games = env.ddg_spice_sports_games;
            
            Games.init(NFLInit);
        });
        
        var NFLInit = function () {
                Spice.add({
                    id: 'nfl_games',
                    name: 'NFL Games',

                    data: Games.transformGameData(apiResult.data),

                    from: apiResult.from,
                    signal: apiResult.signal,

                    meta: $.extend(Games.META, {
                        sourceUrl:  apiResult.url || "http://www.bleacherreport.com/nfl",
                        selectedItem: apiResult.data.most_relevant_game_id,
                    }),

                    templates: $.extend(Games.TEMPLATES, {
                        options: {
                            content: Spice.sports_nfl_games.nfl_score
                        }
                    }),
                    
                    normalize: NFLGameData
                });
            },
        
            NFLGameData = function(attrs) {
                attrs.canExpand = false;
                attrs.relativeDay = Games.getRelativeDay(attrs.start_time);
                
                // Game Finished/In-Progress
                if (attrs.has_started) {
                    attrs.canExpand = true;

                     // Game is Finished
                    if (attrs.has_ended) {
                        attrs.textTotal = l("Final");

                    // Game is in-progress
                    } else {
                        attrs.is_playing = true;
                        attrs.textTotal = l("Score");
                        attrs.textLastUpdate = l("As of %s", Handlebars.helpers.momentTime(attrs.updated));

                        attrs.score = Games.fillBoxscore(attrs.score, {
                            current: attrs.score.quarter,
                            counter: "quarter",
                            name: "scoring",
                            min: 4,
                            obj: {
                                points: Games.PLACEHOLDER
                            }
                        });

                        // set possession on the relevant team object
                        if (attrs.score.possession.team === attrs.home_team.api_id) {
                            attrs.home_team.has_ball = true;
                        } else {
                            attrs.away_team.has_ball = true;
                        }
                    }

                    // halftime/OT check
                    if (attrs.score.quarter == "2" && attrs.score.clock == ":00") {
                        attrs.has_interesting_status = true;
                        attrs.status = l("Halftime");
                    } else if (attrs.score.quarter == "5") {
                        attrs.score.home.scoring[4].quarter = "OT";
                    }

                }
              
                return attrs;
            };
    }

}(this));

{'fraction_non_alphanumeric': 0.09341010876519514, 'fraction_numerical': 0.0011196417146513116, 'mean_word_length': 0.8965726417955717, 'pattern_counts': {'":': 1, '<': 3, '<?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': '818735', 'n_tokens_mistral': 1590, 'n_tokens_neox': 1457, 'n_words': 240}