<commit_before>var S = require('string');
var _ = require('underscore');

function formatInt(code) {
    var ret = '';
    if (code < 10) ret += '0';
    return (ret += code);
}

module.exports = {
    /**
    * Send empty response according to the response format
    *
    * @param {object} res A response object
    * @param {string} type Aresponse format
    * @returns {void}
    */
    sendEmptyResponse : function (res, type) {
        if (type === 'xml') {
            var builder = require('xmlbuilder');

            var xml = builder.create('geonames', {
                'version':'1.0',
                'encoding':'UTF-8'
            });

            xml.e('totalResultsCount', '0');

            res.send(xml.end({pretty:true}));
        } else  {
             res.jsonp({geonames: {'totalResultsCount': 0}});
        }
    },
    /**
    * Construct the Elastic search connection string
    *
    * @param {string} host
    * @param {string} dbname<commit_msg>Add message on empty response<commit_after>var S = require('string');
var _ = require('underscore');

function formatInt(code) {
    var ret = '';
    if (code < 10) ret += '0';
    return (ret += code);
}

module.exports = {
    /**
    * Send empty response according to the response format
    *
    * @param {object} res A response object
    * @param {string} type Aresponse format
    * @returns {void}
    */
    sendEmptyResponse : function (res, type) {
        console.log('Empty response sent')
        if (type === 'xml') {
            var builder = require('xmlbuilder');

            var xml = builder.create('geonames', {
                'version':'1.0',
                'encoding':'UTF-8'
            });

            xml.e('totalResultsCount', '0');

            res.send(xml.end({pretty:true}));
        } else  {
             res.jsonp({geonames: {'totalResultsCount': 0}});
        }
    },
    /**
    * Construct the Elastic search connection string
    *
    * @param {string} host
    * @param {string} dbname
{'fraction_non_alphanumeric': 0.15097159940209268, 'fraction_numerical': 0.007972097658196313, 'mean_word_length': 2.037821482602118, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '4065710', 'n_tokens_mistral': 601, 'n_tokens_neox': 578, 'n_words': 152}