<commit_before>
module.exports = exports = configure

/**
 * Module dependencies.
 */

var path = require('path')
  , win = process.platform == 'win32'

exports.usage = 'Generates ' + (win ? 'MSVS project files' : 'a Makefile') + ' for the current platform'

function configure (gyp, argv, callback) {

  //console.error(gyp.opts)
  //console.error(argv)
  //console.error(gyp.argv)

  // TODO: Really detect the latest version
  if (!gyp.opts.target) {
    gyp.opts.target = 0.7
  }

  // TODO: Don't always install, check if this version is installed first
  gyp.commands.install([gyp.opts.target], go)

  function go (err) {
    if (err) return callback(err)

    // TODO: Detect and add support for a "current" dev version,
    //       so `target` would be implicit.
    var target = String(gyp.opts.target)
      , devDir = path.join(process.env.HOME, '.node-gyp', target)
      , gyp_addon = path.join(devDir, 'tools', 'gyp_addon')

    // Force the 'make' target for non-Windows
    if (!win) {
      argv.unshift('make')
      argv.unshift('-f')
    }

    var cp = gyp.spawn(gyp_addon, argv)

    cp.on('exit', function (code, signal) {
      if (code !== 0) {
        callback(new Error('`gyp_addon` failed with exit code: ' + code))
      } else {
        callback()
      }
    })

  }

}<commit_msg>Invoke python directly, for Windows.<commit_after>
module.exports = exports = configure

/**
 * Module dependencies.
 */

var path = require('path')
  , win = process.platform == 'win32'

exports.usage = 'Generates ' + (win ? 'MSVS project files' : 'a Makefile') + ' for the current platform'

function configure (gyp, argv, callback) {

  var python = gyp.opts.python || 'python'

  // TODO: Really detect the latest version
  if (!gyp.opts.target) {
    gyp.opts.target = 0.7
  }

  // TODO: Don't always install, check if this version is installed first
  gyp.commands.install([gyp.opts.target], go)

  function go (err) {
    if (err) return callback(err)

    // TODO: Detect and add support for a "current" dev version,
    //       so `target` would be implicit.
    var target = String(gyp.opts.target)
      , devDir = path.join(process.env.HOME, '.node-gyp', target)
      , gyp_addon = path.join(devDir, 'tools', 'gyp_addon')

    // Force the 'make' target for non-Windows
    if (!win) {
      argv.unshift('make')
      argv.unshift('-f')
    }

    argv.unshift(gyp_addon)
    var cp = gyp.spawn(python, argv)

    cp.on('exit', function (code, signal) {
      if (code !== 0) {
        callback(new Error('`gyp_addon` failed with exit code: ' + code))
      } else {
        callback()
      }
    })

  }

}
{'fraction_non_alphanumeric': 0.14827455441789913, 'fraction_numerical': 0.0037921880925293893, 'mean_word_length': 2.6638888888888888, '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': '2174888', 'n_tokens_mistral': 903, 'n_tokens_neox': 875, 'n_words': 242}