<commit_before># -*- coding: utf-8 -*-

module Trahald
  require 'redis'
  require 'uri'

  class RedisClient
    def initialize(url)
      uri = URI.parse url
      @redis = Redis.new(
        :host => uri.host,
        :port => uri.port
      )

      @params = Hash::new
    end

    # This method does not set data to Redis DB. To confirm, use commit! after add!.
    def add!(name, body)
      @params[name] = body
    end

    def body(name)
      @redis.get name
    end

    # message is not used.
    def commit!(message)<commit_msg>Modify.<commit_after># -*- coding: utf-8 -*-

module Trahald
  require 'redis'
  require 'uri'

  class RedisClient < BackendBase
    def initialize(url)
      uri = URI.parse url
      @redis = Redis.new(
        :host => uri.host,
        :port => uri.port
      )

      @params = Hash::new
    end

    # This method does not set data to Redis DB. To confirm, use commit! after add!.
    def add!(name, body)
      @params[name] = body
    end

    def body(name)
      @redis.get name
    end

    # message is not used.
    def commit!(message)
{'fraction_non_alphanumeric': 0.11355311355311355, 'fraction_numerical': 0.0018315018315018315, 'mean_word_length': 2.0027472527472527, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, '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': '6171927', 'n_tokens_mistral': 368, 'n_tokens_neox': 354, 'n_words': 114}