<commit_before>Spec::Matchers.define :have_tuples_matching_predicate do
  match do |actual|
    actual.all? { |tuple| predicate.call(tuple) }
  end

  failure_message_for_should do |actual|
    "expected that #{actual.inspect} would only have tuples matching #{predicate.inspect}"
  end

  failure_message_for_should_not do |actual|
    "expected that #{actual.inspect} would not only have tuples matching #{predicate.inspect}"
  end

  description do
    "have tuples that match the predicate #{predicate.inspect}"
  end

  def predicate
    @expected.first || @actual.predicate
  end
end<commit_msg>Updated spec matcher helper method to use methods rather than ivars<commit_after>Spec::Matchers.define :have_tuples_matching_predicate do
  match do |actual|
    actual.all? { |tuple| predicate.call(tuple) }
  end

  failure_message_for_should do |actual|
    "expected that #{actual.inspect} would only have tuples matching #{predicate.inspect}"
  end

  failure_message_for_should_not do |actual|
    "expected that #{actual.inspect} would not only have tuples matching #{predicate.inspect}"
  end

  description do
    "have tuples that match the predicate #{predicate.inspect}"
  end

  def predicate
    expected.first || actual.predicate
  end
end
{'fraction_non_alphanumeric': 0.08452950558213716, 'fraction_numerical': 0.0, 'mean_word_length': 4.4803493449781655, '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': '7307531', 'n_tokens_mistral': 387, 'n_tokens_neox': 370, 'n_words': 115}