<commit_before>
module ExampleBrains
  ## This is a sample brain to MURDER ALL
  class MildlyIntelligentBrain < Brain
    # you have the option of picking from many cards, pick the best one.
    def pick(number, *cards)
      ordered = cards.flatten.map do |card|
        i = card_preference.map { |preference| card.type == preference }.index(true)
        {card: card, index: i}
      end
      ordered.sort_by { |h| h[:index] || 99 }.first(number).map {|h| h[:card] }
    end
    def card_preference
      [Card.wells_fargo_card, Card.stage_coach_card, Card.jail_card, Card.barrel_card,
        Card.beer_card, Card.indians_card, Card.gatling_card, Card.scope_card, Card.mustang_card,
        Card.missed_card, Card.bang_card, Card.revcarbine_card, Card.remington_card, Card.winchester_card,
        Card.volcanic_card, Card.panic_card, Card.cat_balou_card]<commit_msg>Update mildly_intelligent_brain.rb<commit_after>
module ExampleBrains
  ## This is a sample brain that is hopefully somewhat intelligent.
  class MildlyIntelligentBrain < Brain
    # you have the option of picking from many cards, pick the best one.
    def pick(number, *cards)
      ordered = cards.flatten.map do |card|
        i = card_preference.map { |preference| card.type == preference }.index(true)
        {card: card, index: i}
      end
      ordered.sort_by { |h| h[:index] || 99 }.first(number).map {|h| h[:card] }
    end
    def card_preference
      [Card.wells_fargo_card, Card.stage_coach_card, Card.jail_card, Card.barrel_card,
        Card.beer_card, Card.indians_card, Card.gatling_card, Card.scope_card, Card.mustang_card,
        Card.missed_card, Card.bang_card, Card.revcarbine_card, Card.remington_card, Card.winchester_card,
        Card.volcanic_card, Card.panic_card, Card.cat_balou_card]
{'fraction_non_alphanumeric': 0.10285075461151481, 'fraction_numerical': 0.0022358859698155395, 'mean_word_length': 3.61340206185567, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5518063', 'n_tokens_mistral': 620, 'n_tokens_neox': 604, 'n_words': 146}