<commit_before>/* global tabris:false debugClient:false WebSocket: false */
(function() {

  const FLUSH_THROTTLE_INTERVAL = 100;
  const AUTO_RECONNECT_INTERVAL = 2000;
  const MAX_RECONNECT_ATTEMPTS = 5;
  const CODE_NORMAL_CLOSURE = 1000;
  const CODE_OUTDATED_CONNECTION_CLOSURE = 4900;
  const NORMAL_CLOSURE_MESSAGE = 'Connection to debug websocket was closed.';
  const CONNECTION_PROBLEM_MESSAGE = 'Connection to debug websocket could not be established.';
  const messageTypes = Object.freeze({
    evaluate: 'evaluate',
    reloadApp: 'reload-app',
    toggleDevToolbar: 'toggle-dev-toolbar',
    clearStorage: 'clear-storage',
    loadStorage: 'load-storage',
    requestStorage: 'request-storage',
    printStorage: 'print-storage',
    printUiTree: 'print-ui-tree'
  });

  debugClient.RemoteConsole = class RemoteConsole {

    /**
     * @param {{createWebSocket: () => WebSocket}} webSocketFactory
     */
    constructor(webSocketFactory) {
      this._webSocketFactory = webSocketFactory;
      /** @type {WebSocket} */
      this._webSocket = null;
      this._reconnectScheduled = false;
      this._reconnectAttempts = 0;
      this._buffer = [];
      this._isDisposed = false;
      this._connect();
      this._throttledFlush = throttle(this._flush, FLUSH_THROTTLE_INTERVAL, {leading: false, trailing: true});
    }

    log(data) {
      this._sendBuffered('log', {level: 'log', message: data});
    }

    info(data) {
      this._sendBuffered('log', {level: 'info', message: data});
    }

    error(data) {
      this._sendBuffered('log', {level: 'error', message: data});<commit_msg>Workaround clearTimeout breakage on iOS<commit_after>/* global tabris:false debugClient:false WebSocket: false */
(function() {

  const FLUSH_THROTTLE_INTERVAL = 100;
  const AUTO_RECONNECT_INTERVAL = 2000;
  const MAX_RECONNECT_ATTEMPTS = 5;
  const CODE_NORMAL_CLOSURE = 1000;
  const CODE_OUTDATED_CONNECTION_CLOSURE = 4900;
  const NORMAL_CLOSURE_MESSAGE = 'Connection to debug websocket was closed.';
  const CONNECTION_PROBLEM_MESSAGE = 'Connection to debug websocket could not be established.';
  const messageTypes = Object.freeze({
    evaluate: 'evaluate',
    reloadApp: 'reload-app',
    toggleDevToolbar: 'toggle-dev-toolbar',
    clearStorage: 'clear-storage',
    loadStorage: 'load-storage',
    requestStorage: 'request-storage',
    printStorage: 'print-storage',
    printUiTree: 'print-ui-tree'
  });

  debugClient.RemoteConsole = class RemoteConsole {

    /**
     * @param {{createWebSocket: () => WebSocket}} webSocketFactory
     */
    constructor(webSocketFactory) {
      this._webSocketFactory = webSocketFactory;
      /** @type {WebSocket} */
      this._webSocket = null;
      this._reconnectScheduled = false;
      this._reconnectAttempts = 0;
      this._buffer = [];
      this._isDisposed = false;
      this._connect();
      this._throttledFlush = throttle(() => this._flush(), FLUSH_THROTTLE_INTERVAL, {leading: false, trailing: true});
    }

    log(data) {
      this._sendBuffered('log', {level: 'log', message: data});
    }

    info(data) {
      this._sendBuffered('log', {level: 'info', message: data});
    }

    error(data) {
      this._sendBuffered('log', {level: 'error', message: data});
{'fraction_non_alphanumeric': 0.12584407612031923, 'fraction_numerical': 0.010435850214855739, 'mean_word_length': 3.7027417027417027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '4980814', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1008, 'n_words': 216}