<commit_before>var rpc = require('..')();

rpc.handle('square', function (num, callback) {
    setTimeout(function () {
        callback(Math.pow(num, 2));
    }, Math.random() * 1000);
});

function printSquare(num) {
    rpc.call('square', num, function (res) {
        console.log('The square of %d is', num, res);
    });
}

[1, 2, 3, 4, 5].forEach(printSquare);
<commit_msg>Update square.js<commit_after>var rpc = require('..')();

rpc.handle('square', function (num, callback) {
    setTimeout(function () {
        callback(null, Math.pow(num, 2));
    }, Math.random() * 1000);
});

function printSquare(num) {
    rpc.call('square', num, function (err, res) {
        console.log('The square of %d is', num, res);
    });
}

[1, 2, 3, 4, 5].forEach(printSquare);

{'fraction_non_alphanumeric': 0.20854922279792745, 'fraction_numerical': 0.025906735751295335, 'mean_word_length': 3.468208092485549, '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': '2923597', 'n_tokens_mistral': 288, 'n_tokens_neox': 269, 'n_words': 63}