<commit_before>var rdbg = require('rdbg');

function debug(options, callback) {
  var bugger = rdbg.connect(options.debuggerPort, options.debuggerHost);

  var reattach = function() {
    bugger.targets(function(targets) {
      var target = targets.filter(function(target) {
        return target.url.search(options.url) > -1 && target.webSocketDebuggerUrl;
      })[0];

      if (target !== undefined) {
        bugger.attach(target);
      } else {
        setTimeout(autoconnect, 250);
      }
    });
  };

  if (callback) {
    bugger.on('attach', callback);
  }

  bugger.on('detatch', reattach);
  process.nextTick(reattach);

  return bugger;
}

module.exports = debug;<commit_msg>Fix reattach timeout callback<commit_after>var rdbg = require('rdbg');

function debug(options, callback) {
  var bugger = rdbg.connect(options.debuggerPort, options.debuggerHost);

  var reattach = function() {
    bugger.targets(function(targets) {
      var target = targets.filter(function(target) {
        return target.url.search(options.url) > -1 && target.webSocketDebuggerUrl;
      })[0];

      if (target !== undefined) {
        bugger.attach(target);
      } else {
        setTimeout(reattach, 250);
      }
    });
  };

  if (callback) {
    bugger.on('attach', callback);
  }

  bugger.on('detatch', reattach);
  process.nextTick(reattach);

  return bugger;
}

module.exports = debug;
{'fraction_non_alphanumeric': 0.14480286738351256, 'fraction_numerical': 0.007168458781362007, 'mean_word_length': 3.2048192771084336, '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': 2, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4063494', 'n_tokens_mistral': 462, 'n_tokens_neox': 444, 'n_words': 82}