<commit_before>var smith = require('../src/smith.js'),
    fs = require('fs'),
    path = require('path'),
    assert = require('assert'),
    spriteDir = path.join(__dirname, 'test_sprites'),
    sprites = [
      path.join(spriteDir, 'sprite1.png'),
      path.join(spriteDir, 'sprite2.jpg'),
      path.join(spriteDir, 'sprite3.png')
    ];

// Attempt to smith out the sprites
// smith({'src': sprites, 'algorithm': 'right-left'}, function (err, result) {
// smith({'src': sprites, 'engine': 'gm', 'exportOpts': {'format': 'jpg'}}, function (err, result) {
smith({'src': sprites}, function (err, result) {
  if (err) {
    throw err;
  } else {
    var expectedDir = __dirname + '/expected_files';
    // DEV: Write out the result to a file
    // fs.writeFileSync(expectedDir + '/gm.png', result.image, 'binary');

    // DEV: Write out to actual_files
    // if (true) {
    if (false) {
      try { fs.mkdirSync(__dirname + '/actual_files'); } catch (e) {}
      fs.writeFileSync(__dirname + '/actual_files/sprite.png', result.image, 'binary');
      fs.writeFileSync(__dirname + '/actual_files/sprite.jpg', result.image, 'binary');
      fs.writeFileSync(__dirname + '/actual_files/sprite.tiff', result.image, 'binary');
      fs.writeFileSync(__dirname + '/actual_files/coordinates.json', JSON.stringify(result.coordinates, null, 4));
    }

    // Assert the actual image is the same expected
    var actualImage = result.image,<commit_msg>Tested out quality feature of gm -- it definitely works =X<commit_after>var smith = require('../src/smith.js'),
    fs = require('fs'),
    path = require('path'),
    assert = require('assert'),
    spriteDir = path.join(__dirname, 'test_sprites'),
    sprites = [
      path.join(spriteDir, 'sprite1.png'),
      path.join(spriteDir, 'sprite2.jpg'),
      path.join(spriteDir, 'sprite3.png')
    ];

// Attempt to smith out the sprites
// smith({'src': sprites, 'algorithm': 'right-left'}, function (err, result) {
// smith({'src': sprites, 'engine': 'gm', 'exportOpts': {'format': 'jpg', 'quality': 20}}, function (err, result) {
// smith({'src': sprites}, function (err, result) {
  if (err) {
    throw err;
  } else {
    var expectedDir = __dirname + '/expected_files';
    // DEV: Write out the result to a file
    // fs.writeFileSync(expectedDir + '/gm.png', result.image, 'binary');

    // DEV: Write out to actual_files
    if (true) {
    // if (false) {
      try { fs.mkdirSync(__dirname + '/actual_files'); } catch (e) {}
      fs.writeFileSync(__dirname + '/actual_files/sprite.png', result.image, 'binary');
      fs.writeFileSync(__dirname + '/actual_files/sprite.jpg', result.image, 'binary');
      fs.writeFileSync(__dirname + '/actual_files/sprite.tiff', result.image, 'binary');
      fs.writeFileSync(__dirname + '/actual_files/coordinates.json', JSON.stringify(result.coordinates, null, 4));
    }

    // Assert the actual image is the same expected
    var actualImage = result.image,
{'fraction_non_alphanumeric': 0.17448531893351332, 'fraction_numerical': 0.0033749578130273373, 'mean_word_length': 3.463855421686747, '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': '200369', 'n_tokens_mistral': 980, 'n_tokens_neox': 951, 'n_words': 230}