<commit_before>var _ = require('lodash');

module.exports = function (node, depth, color) {
  var best = {node: null, score: -Infinity}
    , color = color || -1
    , depth = depth || 10
    , self = this;

  // negamax algorithm taken from http://wikipedia.org/wiki/Negamax
  function getScore(node, depth, alpha, beta, color) {
    var bestValue = -Infinity;

    if (depth === 0 || node.isTerminal()) {
      return color * node.value();
    }

    _.each(node.children(), function (child) {
      var value = -getScore(child, depth - 1, -beta, -alpha, -color);<commit_msg>change to options parameter<commit_after>var _ = require('lodash');

module.exports = function (node, options) {
  var best = {node: null, score: -Infinity}
    , options = options || {}
    , color = options.color || -1
    , depth = options.depth || 10;

  // negamax algorithm taken from http://wikipedia.org/wiki/Negamax
  function getScore(node, depth, alpha, beta, color) {
    var bestValue = -Infinity;

    if (depth === 0 || node.isTerminal()) {
      return color * node.value();
    }

    _.each(node.children(), function (child) {
      var value = -getScore(child, depth - 1, -beta, -alpha, -color);
{'fraction_non_alphanumeric': 0.15869017632241814, 'fraction_numerical': 0.008396305625524769, 'mean_word_length': 2.9866220735785953, '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': '2303737', 'n_tokens_mistral': 390, 'n_tokens_neox': 373, 'n_words': 107}