<commit_before>module HashObject
  def to_have_key(key)
    return true if self.should_be_hash && @object.keys.include?(key)
    @errors << "Expected key #{key.inspect} to be present. Not found."
    return yield(self) if block_given?
    false
  end

  def should_be_hash
    return true if @object.is_a? Hash
    @errors << "Expected Hash. Found #{@object.class}."
    false
  end
end<commit_msg>Use has_key? to find out if key is present or not<commit_after>module HashObject
  def to_have_key(key)
    return true if self.should_be_hash && @object.has_key?(key)
    @errors << "Expected key #{key.inspect} to be present. Not found."
    return yield(self) if block_given?
    false
  end

  def should_be_hash
    return true if @object.is_a? Hash
    @errors << "Expected Hash. Found #{@object.class}."
    false
  end
end
{'fraction_non_alphanumeric': 0.10399032648125756, 'fraction_numerical': 0.0, 'mean_word_length': 3.4516129032258065, 'pattern_counts': {'":': 0, '<': 11, '<?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': '5186258', 'n_tokens_mistral': 276, 'n_tokens_neox': 273, 'n_words': 87}