<commit_before>if (typeof(socket) == 'undefined') socket = {};
(function (socket) {
  var ws = null,
    protocol = 1;

  socket.onopen = null;
  socket.onconnecting = null;
  socket.onupdatenodes = null;
  socket.onupdateposition = null;
  socket.onclearnodes = null;
  socket.ondrawline = null;
  socket.onaddnode = null;
  socket.onupdateleaderboard = null;
  socket.onsetborder = null;
  socket.onchatmessage = null;

  socket.connect = function (url) {
    if (ws) {
      ws.onopen = null;
      ws.onmessage = null;
      ws.onclose = null;
      try {
        this.ws.close()
      } catch (e) {
      }
      this.ws = null;
    }
    if (!config.secure && url.slice(0, 'ws://'.length) != 'ws://') {
      url = 'ws://' + url;
    } else if (config.secure && url.slice(0, 'wss://'.length) != 'wss://') {
      url = 'wss://' + url;<commit_msg>Added socket.onclose<commit_after>if (typeof(socket) == 'undefined') socket = {};
(function (socket) {
  var ws = null,
    protocol = 1;

  socket.onopen = null;
  socket.onclose = null;
  socket.onconnecting = null;
  socket.onupdatenodes = null;
  socket.onupdateposition = null;
  socket.onclearnodes = null;
  socket.ondrawline = null;
  socket.onaddnode = null;
  socket.onupdateleaderboard = null;
  socket.onsetborder = null;
  socket.onchatmessage = null;

  socket.connect = function (url) {
    if (ws) {
      ws.onopen = null;
      ws.onmessage = null;
      ws.onclose = null;
      try {
        this.ws.close()
      } catch (e) {
      }
      this.ws = null;
    }
    if (!config.secure && url.slice(0, 'ws://'.length) != 'ws://') {
      url = 'ws://' + url;
    } else if (config.secure && url.slice(0, 'wss://'.length) != 'wss://') {
      url = 'wss://' + url;
{'fraction_non_alphanumeric': 0.1728110599078341, 'fraction_numerical': 0.0034562211981566822, 'mean_word_length': 2.467065868263473, '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': '215966', 'n_tokens_mistral': 634, 'n_tokens_neox': 614, 'n_words': 132}