<commit_before>module HashSafety
  refine Hash do
    def keys_contain_symbols?
      self.keys.select { |key| key.is_a? Symbol }.size > 0
    end
  end
end
<commit_msg>lib/hash_safety: Provide safe copy of hash<commit_after>module HashSafety
  refine Hash do
    def keys_contain_symbols?
      self.keys.select { |key| key.is_a? Symbol }.size > 0
    end

    def with_string_keys
      self.each_with_object({}) do |(key,value),hash|
        hash[key.to_s] = value
        hash
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.08840864440078586, 'fraction_numerical': 0.003929273084479371, 'mean_word_length': 2.7226277372262775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2327936', 'n_tokens_mistral': 190, 'n_tokens_neox': 183, 'n_words': 47}