<commit_before>module Multidb
  class << self
    delegate :use, :get, :disconnect!, to: :balancer
  end

  def self.init(config)
    activerecord_config = config.dup.with_indifferent_access
    default_adapter, configuration_hash = activerecord_config, activerecord_config.delete(:multidb)

    @balancer = Balancer.new(Configuration.new(default_adapter, configuration_hash || {}))
  end

  def self.balancer
    if @balancer
      @balancer
    else
      raise NotInitializedError, "Balancer not initialized. You need to run Multidb.setup first"
    end
  end

  def self.reset!
    @balancer = nil<commit_msg>Fix an error message. Closes #12.<commit_after>module Multidb
  class << self
    delegate :use, :get, :disconnect!, to: :balancer
  end

  def self.init(config)
    activerecord_config = config.dup.with_indifferent_access
    default_adapter, configuration_hash = activerecord_config, activerecord_config.delete(:multidb)

    @balancer = Balancer.new(Configuration.new(default_adapter, configuration_hash || {}))
  end

  def self.balancer
    if @balancer
      @balancer
    else
      raise NotInitializedError, "Balancer not initialized. You need to run Multidb.init first"
    end
  end

  def self.reset!
    @balancer = nil
{'fraction_non_alphanumeric': 0.0859437751004016, 'fraction_numerical': 0.001606425702811245, 'mean_word_length': 3.8671875, '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': '6585194', 'n_tokens_mistral': 398, 'n_tokens_neox': 376, 'n_words': 96}