<commit_before>'use strict';

var _ = require('lodash');

var findPairs = require('./src/find_pairs');
var uniqueCards = require('./src/unique');


class Player {
  constructor(game_state) {
    this.VERSION = "iPlayer 2.4";
    this._gameState = game_state;

  }

  bet_request() {
    var currentPlayer = this._gameState.players[this._gameState.in_action];

    var cards = [].concat(currentPlayer.hole_cards).concat(uniqueCards(this._gameState.community_cards));
    
    var minimumBet = this._gameState.current_buy_in - currentPlayer.bet;

    var result = findPairs(cards);

    var pairs = [];
    Object.keys(result).forEach(function (key) {
      if (result[key] > 1) {
        pairs.push(key);
      }
    });

    if (this._gameState.community_cards.length === 0) {
      if (minimumBet <= this._gameState.small_blind * 6) {
        return minimumBet;
      } else {
        return 0;
      }
    }

    var shouldAllIn = false;
    pairs.forEach(function(rank) {
      if (['10', 'J', 'D', 'K', 'A'].indexOf(rank.toUpperCase()) >= 0) {
        shouldAllIn = true;
      }
    });

    if (shouldAllIn) {
      return 5000;
    } else if (pairs.length > 0) {
      return minimumBet + this._gameState.minimum_raise;
    }
    else {
      return 0;
    }
  }

  showdown() {
  }

}

module.exports = {
  VERSION: "Super iPlayer Unicorn",

  bet_request(game_state) {
      return new Player(game_state).bet_request();
  },

  showdown(game_state) {

  }

};<commit_msg>uniconrn 2<commit_after>'use strict';

var _ = require('lodash');

var findPairs = require('./src/find_pairs');
var uniqueCards = require('./src/unique');


class Player {
  constructor(game_state) {
    this.VERSION = "iPlayer 2.4";
    this._gameState = game_state;

  }

  bet_request() {
    var currentPlayer = this._gameState.players[this._gameState.in_action];

    var cards = [].concat(currentPlayer.hole_cards).concat(uniqueCards(this._gameState.community_cards));
    
    var minimumBet = this._gameState.current_buy_in - currentPlayer.bet;

    var result = findPairs(cards);

    var pairs = [];
    Object.keys(result).forEach(function (key) {
      if (result[key] > 1) {
        pairs.push(key);
      }
    });

    if (this._gameState.community_cards.length === 0) {
      var maximumBet = this._gameState.small_blind * 6;

      if (currentPlayer.stack < 500) {
        maximumBet = this._gameState.small_blind * 3;
      }

      if (minimumBet <= maximumBet) {
        return minimumBet;
      } else {
        return 0;
      }
    }

    var shouldAllIn = false;
    pairs.forEach(function(rank) {
      if (['10', 'J', 'D', 'K', 'A'].indexOf(rank.toUpperCase()) >= 0) {
        shouldAllIn = true;
      }
    });

    if (shouldAllIn) {
      return 5000;
    } else if (pairs.length > 0) {
      return minimumBet + this._gameState.minimum_raise;
    }
    else {
      return 0;
    }
  }

  showdown() {
  }

}

module.exports = {
  VERSION: "Super iPlayer Unicorn 2",

  bet_request(game_state) {
      return new Player(game_state).bet_request();
  },

  showdown(game_state) {

  }

};
{'fraction_non_alphanumeric': 0.14433322570229254, 'fraction_numerical': 0.011624152405553761, 'mean_word_length': 2.614935822637106, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 9, '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': '2577162', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1032, 'n_words': 191}