<commit_before>module Snowden
  module Backends
    #@api private
    SNOWDEN_BACKEND_HASH = {}

    class HashBackend
      #Creates a new redis backend
      #
      # @param namespace [String] the string this backend is namespaced under.
      # @param hash     [Hash] a Hash object instance to save values in.
      def initialize(namespace="", hash=SNOWDEN_BACKEND_HASH)
        @namespace = namespace
        @hash      = hash
      end

      #Saves a value in this index
      #
      # @param key   [String] the string key to save the value under.
      # @param value [String] the value to save.
      def save(key, value)
        @hash[namespaced_key(key)] ||= []
        @hash[namespaced_key(key)] << value
        nil
      end

      #Finds a value in this index
      #
      # @param key [String] the string key to search the index for.
      # @return [ [String] ] a list of strings that matched the namespaced key.
      def find(key)
        @hash.fetch(namespaced_key(key), [])
      end

      private

      def namespaced_key(key)
        [@namespace, key]<commit_msg>correct typo on the hash backend class<commit_after>module Snowden
  module Backends
    #@api private
    SNOWDEN_BACKEND_HASH = {}

    class HashBackend
      #Creates a new hash backend
      #
      # @param namespace [String] the string this backend is namespaced under.
      # @param hash     [Hash] a Hash object instance to save values in.
      def initialize(namespace="", hash=SNOWDEN_BACKEND_HASH)
        @namespace = namespace
        @hash      = hash
      end

      #Saves a value in this index
      #
      # @param key   [String] the string key to save the value under.
      # @param value [String] the value to save.
      def save(key, value)
        @hash[namespaced_key(key)] ||= []
        @hash[namespaced_key(key)] << value
        nil
      end

      #Finds a value in this index
      #
      # @param key [String] the string key to search the index for.
      # @return [ [String] ] a list of strings that matched the namespaced key.
      def find(key)
        @hash.fetch(namespaced_key(key), [])
      end

      private

      def namespaced_key(key)
        [@namespace, key]
{'fraction_non_alphanumeric': 0.08522212148685404, 'fraction_numerical': 0.0, 'mean_word_length': 2.184704184704185, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2254146', 'n_tokens_mistral': 662, 'n_tokens_neox': 633, 'n_words': 229}