<commit_before>/**
 * Created by zhouyong on 15-1-8.
 */
function Cart(barCodes){
    this.barCodes = barCodes;
}<commit_msg>add method parse_bar_code_to_commodities in Cart<commit_after>/**
 * Created by zhouyong on 15-1-8.
 */
function Cart(barCodes){
    this.barCodes = barCodes;
}

Cart.prototype = {
    parse_bar_codes_to_commodities : function(){
        var barCodes = this.barCodes;
        return _.map(barCodes,function(barCode){
            for(var i in barCode){
                var commodity = _.where(get_commodities(),{barCode:i});
                commodity.num = barCode[i];
                return commodity;
            }
        });
    }
};
{'fraction_non_alphanumeric': 0.12254160363086233, 'fraction_numerical': 0.012102874432677761, 'mean_word_length': 2.4123711340206184, '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': '4967246', 'n_tokens_mistral': 220, 'n_tokens_neox': 219, 'n_words': 43}