<commit_before><commit_msg>new server_util js<commit_after>var os = require("os");

var getAddress = function() {
  var address = "172.16.31.10";
  var interfaces = os.networkInterfaces();
  for (name in interfaces) {
    for (ip in interfaces[name]) {
      var address = interfaces[name][ip];
      if (address.family == "IPv4" && !address.internal) {
        address = address.address;
        return address;
      }
    }
  }
  return address;
};

// Implement String Object's replaceAll
var funcFormatToString = function() {
  var index = 0;
  var string = (typeof(this) == "function" && !(index++))? arguments[0]:this;
  for (; index < arguments.length; index++)
    string = string.replace(/\{\d+?\}/, arguments[index]);
  return string;
};

exports.getAddress = getAddress;
exports.funcFormatToString = funcFormatToString;
{'fraction_non_alphanumeric': 0.15403128760529483, 'fraction_numerical': 0.01444043321299639, 'mean_word_length': 3.6741573033707864, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '5606569', 'n_tokens_mistral': 264, 'n_tokens_neox': 252, 'n_words': 64}