<commit_before>require 'resque'
require 'redisk'
require 'uuid'

module Resque
  class Status
    include Resque::Helpers
    extend Resque::Helpers
    
    class << self
      
      def create(message = nil)
        uuid = generate_uuid
        set(uuid, message) if message
        redis.zadd(set_key, Time.now.to_i, uuid)
        uuid
      end
      
      def get(uuid)
        val = redis.get(status_key(uuid))
        val ? Resque.decode(val) : nil
      end
      
      def set(uuid, message)
        val = Resque.encode(message)
        redis.set(status_key(uuid), val)
        val
      end
      
      def logger(uuid, options = {})
        Redisk::Logger.new(logger_key(uuid), options)
      end
      
      def statuses(num = -1)
        h = {}
        status_ids(num).each do |id|
          h[id] = get(id)
        end
        h
      end
      
      def status_ids(num = -1)
        redis.zrevrange set_key, 0, num
      end
      
      def status_key(uuid)
        "status:#{uuid}"
      end
      
      def set_key
        "_statuses"
      end
      
      def logger_key(uuid)
        "_log:#{uuid}"
      end
      
      def generate_uuid
        UUID.generate(:compact)
      end
      
    end
    
  end
end<commit_msg>Helpers are included now<commit_after>require 'resque'
require 'redisk'
require 'uuid'

module Resque
  class Status
    include Resque::Helpers
    extend Resque::Helpers
    
    class << self
      
      def create(message = nil)
        uuid = generate_uuid
        set(uuid, message) if message
        redis.zadd(set_key, Time.now.to_i, uuid)
        uuid
      end
      
      def get(uuid)
        val = redis.get(status_key(uuid))
        val ? decode(val) : nil
      end
      
      def set(uuid, message)
        val = encode(message)
        redis.set(status_key(uuid), val)
        val
      end
      
      def logger(uuid, options = {})
        Redisk::Logger.new(logger_key(uuid), options)
      end
      
      def statuses(num = -1)
        h = {}
        status_ids(num).each do |id|
          h[id] = get(id)
        end
        h
      end
      
      def status_ids(num = -1)
        redis.zrevrange set_key, 0, num
      end
      
      def status_key(uuid)
        "status:#{uuid}"
      end
      
      def set_key
        "_statuses"
      end
      
      def logger_key(uuid)
        <KEY>
      end
      
      def generate_uuid
        UUID.generate(:compact)
      end
      
    end
    
  end
end
{'fraction_non_alphanumeric': 0.08995983935742972, 'fraction_numerical': 0.0024096385542168677, 'mean_word_length': 1.4469548133595285, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 4, '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': '3352788', 'n_tokens_mistral': 801, 'n_tokens_neox': 805, 'n_words': 186}