<commit_before>require "redis"

module Snowden
  class RedisBackend
    def initialize(namespace="", redis=Redis.new(:driver => :hiredis))
      @namespace = namespace
      @redis = redis
    end

    def save(key, value)
      redis.lpush(namespaced_key(key), value)
      nil
    end

    def find(key)
      redis.lrange(namespaced_key(key), 0, -1)
    end

    private
<commit_msg>Namespace the redis backend properly.<commit_after>require "redis"

module Snowden::Backends
  class RedisBackend
    def initialize(namespace="", redis=Redis.new(:driver => :hiredis))
      @namespace = namespace
      @redis = redis
    end

    def save(key, value)
      redis.lpush(namespaced_key(key), value)
      nil
    end

    def find(key)
      redis.lrange(namespaced_key(key), 0, -1)
    end

    private

{'fraction_non_alphanumeric': 0.10794044665012408, 'fraction_numerical': 0.004962779156327543, 'mean_word_length': 2.9174757281553396, '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': '4025475', 'n_tokens_mistral': 281, 'n_tokens_neox': 268, 'n_words': 62}