<commit_before>var tracking = [];

function isVisible(elm) {
  var rect = elm.getBoundingClientRect();

  return rect.bottom > 0 &&
    rect.right > 0 &&
    rect.left < (window.innerWidth || document.documentElement.clientWidth) &&
    rect.top < (window.innerHeight || document.documentElement.clientHeight);
}

function _onScroll() {
  window.requestAnimationFrame(_checkForVisibleElements);
}

function _handleVisible(elm, options) {
  untrack(elm);

  if (options.handler !== void 0) {
    options.handler(elm);
  }
}

function _trackNewElement(elm, options) {
  if (isVisible(elm)) {
    return _handleVisible(elm, options);
  }

  tracking.push({elm: elm, options: options});
}

function _checkForVisibleElements() {
  tracking.forEach((v) => {
    if (isVisible(v.elm)) {
      _handleVisible(v.elm, v.options);
    }
  });

  if (tracking.length === 0) {
    window.removeEventListener('scroll', _onScroll);
  }
}

function track(elm, options) {
  window.requestAnimationFrame(_trackNewElement.bind(this, elm, options));

  if (tracking.length === 0) {
    window.addEventListener('scroll', _onScroll);
  }
}

function untrackAll() {
  tracking = [];
}

function untrack(elm) {
  var elmIndex = -1;

  tracking.some((v, i) => {<commit_msg>:violin: get rid of bind trickery<commit_after>var tracking = [];

function isVisible(elm) {
  var rect = elm.getBoundingClientRect();

  return rect.bottom > 0 &&
    rect.right > 0 &&
    rect.left < (window.innerWidth || document.documentElement.clientWidth) &&
    rect.top < (window.innerHeight || document.documentElement.clientHeight);
}

function _onScroll() {
  window.requestAnimationFrame(_checkForVisibleElements);
}

function _handleVisible(elm, options) {
  untrack(elm);

  if (options.handler !== void 0) {
    options.handler(elm);
  }
}

function _trackNewElement(elm, options) {
  if (isVisible(elm)) {
    return _handleVisible(elm, options);
  }

  tracking.push({elm: elm, options: options});
}

function _checkForVisibleElements() {
  tracking.forEach((v) => {
    if (isVisible(v.elm)) {
      _handleVisible(v.elm, v.options);
    }
  });

  if (tracking.length === 0) {
    window.removeEventListener('scroll', _onScroll);
  }
}

function track(elm, options) {
  window.requestAnimationFrame(() => _trackNewElement(elm, options));

  if (tracking.length === 0) {
    window.addEventListener('scroll', _onScroll);
  }
}

function untrackAll() {
  tracking = [];
}

function untrack(elm) {
  var elmIndex = -1;

  tracking.some((v, i) => {
{'fraction_non_alphanumeric': 0.15292712066905614, 'fraction_numerical': 0.0047789725209080045, 'mean_word_length': 4.105691056910569, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 12, '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': '2506530', 'n_tokens_mistral': 836, 'n_tokens_neox': 809, 'n_words': 155}