<commit_before>function defaultValue(defaultValue, data) {
    if (data === undefined) {
        return defaultValue;
    } else {
        return data;
    }
}

function defaultBooleanValue(defaultValue, data) {
    if (data === undefined) {
        return defaultValue;
    } else {
        if (data === "true") {
            return true;
        }
        return false;
    }
}

function defaultNumberValue(defaultValue, data) {
    if (data === undefined) {
        return defaultValue;
    } else {
        return parseInt(data);
    }
}

function scaleToWeek(data) {
    var scaledData = [];
    var currentWeek = data[0][0].isoWeek();
    var currentWeekIndex = 0;
    $.each(data, function(index, value) {
        var week = value[0].isoWeek();
        if (week === currentWeek) {
            scaledData[currentWeekIndex] = [value[0], value[1]];
        } else {
            currentWeek = week;
            currentWeekIndex = currentWeekIndex + 1;
            scaledData[currentWeekIndex] = [value[0], value[1]];
        }

    });
    return scaledData;
}

function scaleToMonth(data) {
    var scaledData = [];
    var currentMonth = data[0][0].month();
    var currentMonthIndex = 0;
    $.each(data, function(index, value) {
        var month = value[0].month();
        if (month === currentMonth) {
            scaledData[currentMonthIndex] = [value[0], value[1]];
        } else {
            currentMonth = month;
            currentMonthIndex++;
            scaledData[currentMonthIndex] = [value[0], value[1]];
        }

    });
    return scaledData;
}

function scaleToYear(data) {
    var scaledData = [];
    var currentYear = data[0][0].year();
    var currentYearIndex = 0;
    $.each(data, function(index, value) {
        var year = value[0].year();
        if (year === currentYear) {
            scaledData[currentYearIndex] = [value[0], value[1]];
        } else {
            currentYear = year;
            currentYearIndex++;
            scaledData[currentYearIndex] = [value[0], value[1]];
        }

    });
    return scaledData;
}


function scaleTo(scale, data) {
    switch (scale) {
        case "day":
            // Keep original day scale
            return data;
        case "week":
            return scaleToWeek(data);
        case "month":
            return scaleToMonth(data);
        case "year":
            return scaleToYear(data);
    }
}<commit_msg>Removed unused code<commit_after>function defaultValue(defaultValue, data) {
    if (data === undefined) {
        return defaultValue;
    } else {
        return data;
    }
}

function defaultBooleanValue(defaultValue, data) {
    if (data === undefined) {
        return defaultValue;
    } else {
        if (data === "true") {
            return true;
        }
        return false;
    }
}

function defaultNumberValue(defaultValue, data) {
    if (data === undefined) {
        return defaultValue;
    } else {
        return parseInt(data);
    }
}
{'fraction_non_alphanumeric': 0.12858589267634155, 'fraction_numerical': 0.008437394532568343, 'mean_word_length': 2.081081081081081, 'pattern_counts': {'":': 4, '<': 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': '2615634', 'n_tokens_mistral': 867, 'n_tokens_neox': 847, 'n_words': 198}