<commit_before>var Q = require('q'),
    request = require('request');

exports.search = function (category, query) {
    var deferred = Q.defer(),
        url = 'https://www.kimonolabs.com/api/';
    if (category && query)
        url += '2egu2p5g?apikey=<KEY>' + '&kimpath2=' + query + ' category:' + category;
    else if (!category.length && query)
        url += '2egu2p5g?apikey=<KEY>' + '&kimpath2=' + query;
    else if (category && !query)
        url += '7y1mi6wa?apikey=<KEY>' + '&kimpath1=' + category;
    else if (!category && !query)
        url += '7y1mi6wa?apikey=<KEY>' + '&kimpath1=new';
    request(url, function (err, resp, body) {
        if (err) {
            console.log(err);
            deferred.reject(JSON.parse(err));
        } else {
            var data = JSON.parse(body),
                files = data.results.files;
            files.forEach(function (file) {
                file.magnet.href = file.magnet.href.substring(file.magnet.href.indexOf('magnet:?xt'));
            });
            deferred.resolve(files);
        }
    });
    return deferred.promise;
}<commit_msg>Update code style for proper build<commit_after>var Q = require('q')
    , request = require('request');

exports.search = function (category, query) {
    var deferred = Q.defer()
    , url = 'https://www.kimonolabs.com/api/';
    if (category && query) {
        url += '2egu2p5g?apikey=<KEY>5' + '&kimpath2=' + query + ' category:' + category;
    } else if (!category.length && query) {
        url += '2egu2p5g?apikey=<KEY>' + '&kimpath2=' + query;
    } else if (category && !query) {
        url += '7y1mi6wa?apikey=<KEY>' + '&kimpath1=' + category;
    } else if (!category && !query) {
        url += '7y1mi6wa?apikey=<KEY>' + '&kimpath1=new';
    }
    request(url, function (err, resp, body) {
        if (err) {
            console.log(err);
            deferred.reject(JSON.parse(err));
        } else {
            var data = JSON.parse(body)
            , files = data.results.files;
            files.forEach(function (file) {
                file.magnet.href = file.magnet.href.substring(file.magnet.href.indexOf('magnet:?xt'));
            });
            deferred.resolve(files);
        }
    });
    return deferred.promise;
}
{'fraction_non_alphanumeric': 0.17279574656623836, 'fraction_numerical': 0.014621178555604785, 'mean_word_length': 2.315712187958884, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '578559', 'n_tokens_mistral': 750, 'n_tokens_neox': 745, 'n_words': 141}