<commit_before>const _requestIdleCallback = function (cb) {
  return setTimeout(() => {
    const start = Date.now();
    cb({
      didTimeout: false,
      timeRemaining() {
        return Math.max(0, 50 - (Date.now() - start));
      }
    });
  }, 1);
};

const _cancelIdleCallback = function (id) {
  clearTimeout(id);
};

const requestIdleCallback = window.requestIdleCallback || _requestIdleCallback;
const cancelIdleCallback = window.cancelIdleCallback || _cancelIdleCallback;

export default requestIdleCallback;
export { cancelIdleCallback };
<commit_msg>[fix] server-side rendering<commit_after>/* global window */
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';

const _requestIdleCallback = function (cb) {
  return setTimeout(() => {
    const start = Date.now();
    cb({
      didTimeout: false,
      timeRemaining() {
        return Math.max(0, 50 - (Date.now() - start));
      }
    });
  }, 1);
};

const _cancelIdleCallback = function (id) {
  clearTimeout(id);
};

const isSupported = canUseDOM && typeof window.requestIdleCallback !== 'undefined';

const requestIdleCallback = isSupported ? window.requestIdleCallback : _requestIdleCallback;
const cancelIdleCallback = isSupported ? window.cancelIdleCallback : _cancelIdleCallback;

export default requestIdleCallback;
export { cancelIdleCallback };

{'fraction_non_alphanumeric': 0.12284644194756554, 'fraction_numerical': 0.00599250936329588, 'mean_word_length': 4.178294573643411, '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': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4541894', 'n_tokens_mistral': 399, 'n_tokens_neox': 393, 'n_words': 91}