<commit_before>// Load in dependencies
var assert = require('assert');
var concat = require('concat-stream');
var ndarray = require('ndarray');
var ndarrayFill = require('ndarray-fill');
var savePixels = require('save-pixels');

// Define our canvas constructor
function Canvas(width, height) {
  // Calculate and save dimensions/data for later
  var len = width * height * 4;
  this.width = width;
  this.height = height;
  this.data = new global.Uint8ClampedArray(len);
  this.ndarray = new ndarray(this.data, [width, height, 4]);

  // Create a store for images
  this.images = [];
}
// TODO: Don't forget to ditch `format` coercion in engines for doing it in `spritesmith`
Canvas.supportedExtensions = ['jpeg', 'png', 'gif'];
Canvas.prototype = {
  addImage: function (img, x, y) {
    // Save the image for later
    this.images.push({
      img: img,
      x: x,
      y: y
    });
  },
  'export': function (options, cb) {
    // Determine the export extension
    var format = options.format;
    assert(format, '`options.format` wasn\'t provided to `pixelsmith`. Please provide a format to export');
    assert(Canvas.supportedExtensions.indexOf(format) !== -1,
      '`pixelsmith` doesn\'t support exporting "' + format + '". Please use "jpeg", "png", or "gif"');
<commit_msg>Removed completed TODO<commit_after>// Load in dependencies
var assert = require('assert');
var concat = require('concat-stream');
var ndarray = require('ndarray');
var ndarrayFill = require('ndarray-fill');
var savePixels = require('save-pixels');

// Define our canvas constructor
function Canvas(width, height) {
  // Calculate and save dimensions/data for later
  var len = width * height * 4;
  this.width = width;
  this.height = height;
  this.data = new global.Uint8ClampedArray(len);
  this.ndarray = new ndarray(this.data, [width, height, 4]);

  // Create a store for images
  this.images = [];
}
Canvas.supportedExtensions = ['jpeg', 'png', 'gif'];
Canvas.prototype = {
  addImage: function (img, x, y) {
    // Save the image for later
    this.images.push({
      img: img,
      x: x,
      y: y
    });
  },
  'export': function (options, cb) {
    // Determine the export extension
    var format = options.format;
    assert(format, '`options.format` wasn\'t provided to `pixelsmith`. Please provide a format to export');
    assert(Canvas.supportedExtensions.indexOf(format) !== -1,
      '`pixelsmith` doesn\'t support exporting "' + format + '". Please use "jpeg", "png", or "gif"');

{'fraction_non_alphanumeric': 0.1469289441991168, 'fraction_numerical': 0.003211561621838619, 'mean_word_length': 3.6148148148148147, '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': '6907527', 'n_tokens_mistral': 771, 'n_tokens_neox': 747, 'n_words': 244}