<commit_before>/* global self, global, window */
function ifDefined(o) {
  return typeof o !== 'undefined' ? o : false;
}

var GlobalContext = ifDefined(self) || ifDefined(global) || ifDefined(window);

if (!GlobalContext) {
  throw new Error('no global: `self` nor `global` nor `window` was found');
}

export default GlobalContext;
<commit_msg>[BUGFIX] Fix ReferenceError in global context detection<commit_after>var GlobalContext;

/* global self */
if (typeof self === 'object') {
  GlobalContext = self;

/* global global */
} else if (typeof global === 'object') {
  GlobalContext = global;

/* global window */
} else if (typeof window === 'object') {
  GlobalContext = window;
} else {
  throw new Error('no global: `self`, `global` nor `window` was found');
}

export default GlobalContext;

{'fraction_non_alphanumeric': 0.1475, 'fraction_numerical': 0.0, 'mean_word_length': 4.680851063829787, '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': '1974027', 'n_tokens_mistral': 240, 'n_tokens_neox': 239, 'n_words': 82}