<commit_before>/**
 * @file Image tests helper - Helper to create images html element during testing
 * @author StefanoMagrassi <<EMAIL>>
 */

// Exports
// -------
export const IMAGE_PATH = 'http://i.telegraph.co.uk/multimedia/archive/02792/mountCook2_2792612b.jpg';

/**
 * Creates the image on which run the tests.
 * @private
 * @param  {string}   id - Image id
 * @param  {function} cb - Callback on image load
 */
export default function(id, cb) {
  let image = document.getElementById(id);

  if (image) {
    return cb.call(image);
  }

  let container = document.body.appendChild(document.createElement('div'));
  image         = document.createElement('img');
  image.id      = id;
  image.src     = IMAGE_PATH;
  image.onload  = cb;

  return container.appendChild(image);
}<commit_msg>use const<commit_after>/**
 * @file Image tests helper - Helper to create images html element during testing
 * @author StefanoMagrassi <<EMAIL>>
 */

// Exports
// -------
export const IMAGE_PATH = 'http://i.telegraph.co.uk/multimedia/archive/02792/mountCook2_2792612b.jpg';

/**
 * Creates the image on which run the tests.
 * @private
 * @param  {string}   id - Image id
 * @param  {function} cb - Callback on image load
 */
export default function(id, cb) {
  let image = document.getElementById(id);

  if (image) {
    return cb.call(image);
  }

  const container = document.body.appendChild(document.createElement('div'));
  image         = document.createElement('img');
  image.id      = id;
  image.src     = IMAGE_PATH;
  image.onload  = cb;

  return container.appendChild(image);
}
{'fraction_non_alphanumeric': 0.13944723618090452, 'fraction_numerical': 0.016331658291457288, 'mean_word_length': 3.2367021276595747, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7564845', 'n_tokens_mistral': 520, 'n_tokens_neox': 494, 'n_words': 133}