<commit_before>'use strict';

var BRp = {};

BRp.getCachedImage = function( url, onLoad ){
  var r = this;
  var imageCache = r.imageCache = r.imageCache || {};

  if( imageCache[ url ] && imageCache[ url ].image ){
    return imageCache[ url ].image;
  }

  var cache = imageCache[ url ] = imageCache[ url ] || {};

  var image = cache.image = new Image();
  image.addEventListener( 'load', onLoad );
  image.src = url;

  return image;
};

module.exports = BRp;<commit_msg>Prevent tainted canvas<commit_after>'use strict';

var BRp = {};

BRp.getCachedImage = function( url, onLoad ){
  var r = this;
  var imageCache = r.imageCache = r.imageCache || {};

  if( imageCache[ url ] && imageCache[ url ].image ){
    return imageCache[ url ].image;
  }

  var cache = imageCache[ url ] = imageCache[ url ] || {};

  var image = cache.image = new Image();
  image.addEventListener('load', onLoad);
  image.crossOrigin = 'Anonymous'; // prevent tainted canvas
  image.src = url;

  return image;
};

module.exports = BRp;
{'fraction_non_alphanumeric': 0.15422396856581533, 'fraction_numerical': 0.0, 'mean_word_length': 3.488986784140969, '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': '3090774', 'n_tokens_mistral': 340, 'n_tokens_neox': 331, 'n_words': 95}