<commit_before>require 'redis/namespace'

begin
  require 'yajl'
rescue LoadError
  require 'json'
end

require 'resque/errors'

require 'resque/failure'
require 'resque/failure/base'

require 'resque/stat'
require 'resque/job'
require 'resque/worker'

module Resque
  extend self

  #
  # We need a Redis server!
  #

  def redis=(server)
    case server
    when String
      host, port = server.split(':')
      redis = Redis.new(:host => host, :port => port)
      @redis = Redis::Namespace.new(:resque, :redis => redis)
    when Redis
      @redis = Redis::Namespace.new(:resque, :redis => server)
    else
      raise "I don't know what to do with #{server.inspect}"
    end
  end

  def redis
    return @redis if @redis
    self.redis = 'localhost:6379'<commit_msg>thread safe redis to the resque<commit_after>require 'redis/namespace'

begin
  require 'yajl'
rescue LoadError
  require 'json'
end

require 'resque/errors'

require 'resque/failure'
require 'resque/failure/base'

require 'resque/stat'
require 'resque/job'
require 'resque/worker'

module Resque
  extend self

  #
  # We need a Redis server!
  #

  def redis=(server)
    case server
    when String
      host, port = server.split(':')
      redis = Redis.new(:host => host, :port => port, :thread_safe => true)
      @redis = Redis::Namespace.new(:resque, :redis => redis)
    when Redis
      @redis = Redis::Namespace.new(:resque, :redis => server)
    else
      raise "I don't know what to do with #{server.inspect}"
    end
  end

  def redis
    return @redis if @redis
    self.redis = 'localhost:6379'
{'fraction_non_alphanumeric': 0.11979823455233292, 'fraction_numerical': 0.005044136191677175, 'mean_word_length': 3.2095490716180373, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '5652000', 'n_tokens_mistral': 565, 'n_tokens_neox': 552, 'n_words': 156}