<commit_before>module Adapter
  module Defaults
    def fetch(key, value=nil)
      read(key) || begin
        value = block_given? ? yield(key) : value
        read(key) || value
      end
    end

    def read_multiple(*keys)
      result = {}
      keys.each { |key| result[key_for(key)] = read(key) }
      result
    end

    def key?(key)
      !read(key).nil?
    end

    def key_for(key)
      key
    end

    def encode(value)
      value
    end<commit_msg>No need for extra read in fetch.<commit_after>module Adapter
  module Defaults
    def fetch(key, value=nil)
      read(key) || begin
        if block_given?
          yield(key)
        else
          value
        end
      end
    end

    def read_multiple(*keys)
      result = {}
      keys.each { |key| result[key_for(key)] = read(key) }
      result
    end

    def key?(key)
      !read(key).nil?
    end

    def key_for(key)
      key
    end

    def encode(value)
      value
    end
{'fraction_non_alphanumeric': 0.09937888198757763, 'fraction_numerical': 0.0, 'mean_word_length': 1.762857142857143, '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': '7522000', 'n_tokens_mistral': 324, 'n_tokens_neox': 315, 'n_words': 81}