<commit_before>OnlineChecker.PING_URL = 'http://clients3.google.com';
OnlineChecker.CHECK_INTERVAL_MS = 15 * 60 * 1000;
OnlineChecker.PING_TIMEOUT_MS = 30 * 1000;
OnlineChecker.USE_FRAMEWORK_API = true;

function OnlineChecker() {
  // Assume online at first.
  this.isPingSucceeded = true;
  this.timeoutTimer = null;
  this.pingTimer = null;
  this.ping();
}

OnlineChecker.prototype.isOnline = function() {
  if (OnlineChecker.USE_FRAMEWORK_API) {
    if (framework.system.network.online) {
      this.isPingSucceeded = true;

      return true;
    }
  }

  return this.isPingSucceeded;
};

OnlineChecker.prototype.ping = function() {
  var interval = OnlineChecker.CHECK_INTERVAL_MS;
  var fuzz = interval / 5;
  fuzz *= Math.random();
  fuzz = Math.floor(fuzz)
  interval += fuzz;
  this.pingTimer = view.setTimeout(this.makePing(), interval);

  if (OnlineChecker.USE_FRAMEWORK_API) {
    if (framework.system.network.online) {
      this.isPingSucceeded = true;

      return;
    }
  }

  var request = new XMLHttpRequest();
  request.open('GET', OnlineChecker.PING_URL, true);
  this.timeoutTimer = view.setTimeout(
      this.makeOnTimeout(),
      OnlineChecker.PING_TIMEOUT_MS);
  request.onreadystatechange = this.makeOnReadyStateChange(request);

  debug.info('Sending ping.');
  request.send();
};

OnlineChecker.prototype.onTimeout = function() {
  debug.info('Ping timed out.');
  this.isPingSucceeded = false;
};

OnlineChecker.prototype.onReadyStateChange = function(request) {
  if (request.readyState != 4) {<commit_msg>forgot a semicolon.<commit_after>OnlineChecker.PING_URL = 'http://clients3.google.com';
OnlineChecker.CHECK_INTERVAL_MS = 15 * 60 * 1000;
OnlineChecker.PING_TIMEOUT_MS = 30 * 1000;
OnlineChecker.USE_FRAMEWORK_API = true;

function OnlineChecker() {
  // Assume online at first.
  this.isPingSucceeded = true;
  this.timeoutTimer = null;
  this.pingTimer = null;
  this.ping();
}

OnlineChecker.prototype.isOnline = function() {
  if (OnlineChecker.USE_FRAMEWORK_API) {
    if (framework.system.network.online) {
      this.isPingSucceeded = true;

      return true;
    }
  }

  return this.isPingSucceeded;
};

OnlineChecker.prototype.ping = function() {
  var interval = OnlineChecker.CHECK_INTERVAL_MS;
  var fuzz = interval / 5;
  fuzz *= Math.random();
  fuzz = Math.floor(fuzz);
  interval += fuzz;
  this.pingTimer = view.setTimeout(this.makePing(), interval);

  if (OnlineChecker.USE_FRAMEWORK_API) {
    if (framework.system.network.online) {
      this.isPingSucceeded = true;

      return;
    }
  }

  var request = new XMLHttpRequest();
  request.open('GET', OnlineChecker.PING_URL, true);
  this.timeoutTimer = view.setTimeout(
      this.makeOnTimeout(),
      OnlineChecker.PING_TIMEOUT_MS);
  request.onreadystatechange = this.makeOnReadyStateChange(request);

  debug.info('Sending ping.');
  request.send();
};

OnlineChecker.prototype.onTimeout = function() {
  debug.info('Ping timed out.');
  this.isPingSucceeded = false;
};

OnlineChecker.prototype.onReadyStateChange = function(request) {
  if (request.readyState != 4) {
{'fraction_non_alphanumeric': 0.1268197994176642, 'fraction_numerical': 0.010999676480103526, 'mean_word_length': 4.052287581699346, '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': '2437683', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1045, 'n_words': 180}