<commit_before>(function(console) {
  'use strict';

  console.image = function image (url, callback) {
    var img = new Image;
    var canvas = document.createElement('canvas');
    var ctx = canvas.getContext('2d');

    img.onload = function () {
      var width = canvas.width = img.width;
      var height = canvas.height = img.height;

      ctx.drawImage(img, 0, 0);

      var data = ctx.getImageData(0, 0, width, height).data;
      var text_shadow = 'text-shadow:';

      for (var x = 0; x < width; x++) {
        for (var y = 0; y < height; y++) {
          var offset = y * width * 4 + x * 4;
          // text_shadow += `${x}px ${y}px 0 rgba(${data[offset]},${data[offset + 1]},${data[offset + 2]},${data[offset + 3]}),`;
          text_shadow += x + 'px ' + y + 'px 0 rgba(' + data[offset] + ',' + data[offset + 1] + ',' + data[offset + 2] + ',' + data[offset + 3] + '),';
        }
      }

      text_shadow = text_shadow.slice(0, -1);

      console.log('%c.', 'color:transparent;' + text_shadow);
      callback && callback();
    }

    img.src = url;
  };

})(console);
<commit_msg>Support promise<commit_after>(function(console, global) {
  'use strict';
  console.image = function image (url, callback) {
    var img = new Image;
    var canvas = document.createElement('canvas');
    var ctx = canvas.getContext('2d');
    if (global.Promise) {
      return new Promise(function (resolve, reject) {
        img.onerror = reject;
        img.onload = function () {
          var width = canvas.width = img.width;
          var height = canvas.height = img.height;

          ctx.drawImage(img, 0, 0);

          var data = ctx.getImageData(0, 0, width, height).data;
          var text_shadow = 'text-shadow:';

          for (var x = 0; x < width; x++) {
            for (var y = 0; y < height; y++) {
              var offset = y * width * 4 + x * 4;
              // text_shadow += `${x}px ${y}px 0 rgba(${data[offset]},${data[offset + 1]},${data[offset + 2]},${data[offset + 3]}),`;
              text_shadow += x + 'px ' + y + 'px 0 rgba(' + data[offset] + ',' + data[offset + 1] + ',' + data[offset + 2] + ',' + data[offset + 3] + '),';
            }
          }

          text_shadow = text_shadow.slice(0, -1);

          console.log('%c.', 'color:transparent;' + text_shadow);
          callback ? callback() : resolve();
        }
        img.src = url;
      })
    } else {
      img.onload = function () {
        var width = canvas.width = img.width;
        var height = canvas.height = img.height;

        ctx.drawImage(img, 0, 0);

        var data = ctx.getImageData(0, 0, width, height).data;
        var text_shadow = 'text-shadow:';

        for (var x = 0; x < width; x++) {
          for (var y = 0; y < height; y++) {
            var offset = y * width * 4 + x * 4;
            // text_shadow += `${x}px ${y}px 0 rgba(${data[offset]},${data[offset + 1]},${data[offset + 2]},${data[offset + 3]}),`;
            text_shadow += x + 'px ' + y + 'px 0 rgba(' + data[offset] + ',' + data[offset + 1] + ',' + data[offset + 2] + ',' + data[offset + 3] + '),';
          }
        }

        text_shadow = text_shadow.slice(0, -1);

        console.log('%c.', 'color:transparent;' + text_shadow);
        callback && callback();
      }
      img.src = url;
    }
  };

})(console, this);

{'fraction_non_alphanumeric': 0.1891891891891892, 'fraction_numerical': 0.016816816816816817, 'mean_word_length': 2.1365348399246704, 'pattern_counts': {'":': 0, '<': 9, '<?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': '7438815', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1098, 'n_words': 277}