<commit_before>var _ = require('lodash');
var moment = require('moment');

var isIndividuValid = exports.isIndividuValid = function(individu, situation) {
    var age = moment(situation.dateDeValeur).diff(moment(individu.dateDeNaissance), 'years');
    var handicap = _.find(individu.situationsPro, { situation: 'handicap' });
    return individu.role != 'enfant' || age <= 25 || handicap;
};

exports.getEnfants= function(situation) {
    var enfants = _.filter(situation.individus, function(individu) {
        return isIndividuValid(individu, situation) && individu.role == 'enfant';
    });
    return _.pluck(enfants, '_id');
};<commit_msg>Name functions in mapping/common.js<commit_after>var _ = require('lodash');
var moment = require('moment');

exports.isIndividuValid = isIndividuValid;
exports.getEnfants = getEnfants;

function isIndividuValid(individu, situation) {
    var age = moment(situation.dateDeValeur).diff(moment(individu.dateDeNaissance), 'years');
    var handicap = _.find(individu.situationsPro, { situation: 'handicap' });
    return individu.role != 'enfant' || age <= 25 || handicap;
};

function getEnfants(situation) {
    var enfants = _.filter(situation.individus, function(individu) {
        return isIndividuValid(individu, situation) && individu.role == 'enfant';
    });
    return _.pluck(enfants, '_id');
};
{'fraction_non_alphanumeric': 0.1476261127596439, 'fraction_numerical': 0.002967359050445104, 'mean_word_length': 5.104072398190045, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7648193', 'n_tokens_mistral': 472, 'n_tokens_neox': 447, 'n_words': 83}