<commit_before>class Hand < Array
  def filter_suit(suit)
    cards = select { |card| card.suit == suit }
    Hand.new(cards)
  end

  def filter_rank(rank)
    cards = select { |card| card.rank == rank }
    Hand.new(cards)
  end
end
<commit_msg>Refactor pull up common select behaviours into private method<commit_after>class Hand < Array
  def filter_suit(suit)
    select_from_hand { |card| card.suit == suit }
  end

  def filter_rank(rank)
    select_from_hand { |card| card.rank == rank }
  end

  private

  def select_from_hand(&block)
    cards = select(&block)
    Hand.new(cards)
  end
end

{'fraction_non_alphanumeric': 0.10299003322259136, 'fraction_numerical': 0.0, 'mean_word_length': 3.369565217391304, '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': '6396213', 'n_tokens_mistral': 206, 'n_tokens_neox': 200, 'n_words': 55}