<commit_before>const https = require('https');

module.exports = (action, attr, transaction, cb) => {
  const options = {
    host: attr.lambdaAdr.host,
    port: attr.lambdaAdr.port,
    path: `${attr.lambdaAdr.basePath}${action}`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    }
  };
  //attr.context.log("requestLambda:", options);
  var req = https.request(options, function (res) {
    let reqData = ""
    res.on('data', function (data) { reqData += data });
    res.on('end', function () { cb(null, reqData); });
    res.on('error', function(err) { cb(err) });
  });
  req.on('error', function(err) { cb(err) });
  req.write(JSON.stringify(transaction), 'utf8');
  req.end();<commit_msg>* Fix a var to const<commit_after>const https = require('https');

module.exports = (action, attr, transaction, cb) => {
  const options = {
    host: attr.lambdaAdr.host,
    port: attr.lambdaAdr.port,
    path: `${attr.lambdaAdr.basePath}${action}`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    }
  };
  //attr.context.log("requestLambda:", options);
  const req = https.request(options, function (res) {
    let reqData = ""
    res.on('data', function (data) { reqData += data });
    res.on('end', function () { cb(null, reqData); });
    res.on('error', function(err) { cb(err) });
  });
  req.on('error', function(err) { cb(err) });
  req.write(JSON.stringify(transaction), 'utf8');
  req.end();
{'fraction_non_alphanumeric': 0.20409556313993174, 'fraction_numerical': 0.0013651877133105802, 'mean_word_length': 3.6392405063291138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6420374', 'n_tokens_mistral': 496, 'n_tokens_neox': 497, 'n_words': 100}