<commit_before>/**
 * @source : https://github.com/reyuto/Callback-Function-Creator.git
 * @author : <NAME>
 */

function createCallbackBeforeAndAfter(fn) {
    return function() {
        var callback = arguments[arguments.length - 1];
        var args = Array.prototype.slice.call(arguments, 0, arguments.length - 1);
        
        callback.before();

        var result = fn.apply(this, args);

        callback.after(result);
        return result;
    };<commit_msg>Added check for the before and after method invocations.<commit_after>/**
 * @source : https://github.com/reyuto/Callback-Function-Creator.git
 * @author : <NAME>
 */

function createCallbackBeforeAndAfter(fn) {
    return function() {
        var callback = arguments[arguments.length - 1];
        var args = Array.prototype.slice.call(arguments, 0, arguments.length - 1);
        
        callback.before && callback.before();

        var result = fn.apply(this, args);

        callback.after && callback.after(result);
        return result;
    };
{'fraction_non_alphanumeric': 0.13326848249027237, 'fraction_numerical': 0.005836575875486381, 'mean_word_length': 2.7282608695652173, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '7074444', 'n_tokens_mistral': 293, 'n_tokens_neox': 281, 'n_words': 64}