<commit_before>var SummaryPart = require('../../models/summaryPart');
var indexLevels = require('./indexLevels');

/**
    Returns a new Summary with a part inserted at given index

    @param {Summary} summary
    @param {Number} index
    @param {Part} part
    @return {Summary}
*/
function insertPart(summary, index, part) {
    part = SummaryPart(part);

    var parts = summary.getParts().insert(index, part);
    return indexLevels(summary.set('parts', parts));
}

module.exports = insertPart;<commit_msg>Tweak insertPart signature<commit_after>var SummaryPart = require('../../models/summaryPart');
var indexLevels = require('./indexLevels');

/**
    Returns a new Summary with a part inserted at given index

    @param {Summary} summary
    @param {Part} part
    @param {Number} index
    @return {Summary}
*/
function insertPart(summary, part, index) {
    part = SummaryPart(part);

    var parts = summary.getParts().insert(index, part);
    return indexLevels(summary.set('parts', parts));
}

module.exports = insertPart;
{'fraction_non_alphanumeric': 0.13886210221793635, 'fraction_numerical': 0.0, 'mean_word_length': 4.0144927536231885, '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': '3850345', 'n_tokens_mistral': 303, 'n_tokens_neox': 291, 'n_words': 87}