<commit_before>module.exports = function () {
  return function sse(req, resp, next){
    req.socket.setTimeout(Infinity);
    resp.writeHead(200, {
      'Content-Type': 'text/event-stream',
      'Cache-Control': 'no-cache',
      'Connection': 'keep-alive',
    });
    var messageCount = 0;
    resp.json = function(obj){
      resp.write("id: " + messageCount + "\n");
      resp.write("data: " + JSON.stringify(obj) + "\n\n");
      messageCount += 1;
    };
    next();
  };
};<commit_msg>Revert "send headers immediately"<commit_after>module.exports = function () {
  return function sse(req, resp, next){
    var message_count;
    req.socket.setTimeout(Infinity);
    resp.statusCode = 200;
    resp.setHeader('Content-Type', 'text/event-stream');
    resp.setHeader('Cache-Control', 'no-cache');
    resp.setHeader('Connection', 'keep-alive');
    message_count = 0;
    resp.json = function(obj){
      resp.write("id: " + message_count + "\n");
      resp.write("data: " + JSON.stringify(obj) + "\n\n");
      message_count += 1;
    };
    next();
  };
};
{'fraction_non_alphanumeric': 0.18709073900841908, 'fraction_numerical': 0.009354536950420954, 'mean_word_length': 3.0839694656488548, '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': '3531918', 'n_tokens_mistral': 364, 'n_tokens_neox': 354, 'n_words': 63}