<commit_before>module LazyConst

  CACHE = {}

  def lazy_const(name, &block)
    raise Error("lazy_const requires a block") unless block_given?
    LazyConst::CACHE["#{self.name}.#{name}"] = nil
    define_singleton_method name do
      LazyConst::CACHE["#{self.name}.#{name}"] ||= block.call
    end
  end

  def self.preload
    self.clear
    LazyConst::CACHE.keys.each do |class_dot_name|
      klass, name = class_dot_name.split('.')
      m = klass.constantize.public_send name.to_sym
    end
  end

  def self.clear
    LazyConst::CACHE.keys.each do |k|
      LazyConst::CACHE[k] = nil
    end
  end

end
<commit_msg>Make tests pass again<commit_after>module LazyConst

  CACHE = {}

  def lazy_const(name, &block)
    raise Error("lazy_const requires a block") unless block_given?
    LazyConst::CACHE["#{self.name}.#{name}"] = nil
    define_singleton_method name do
      LazyConst::CACHE["#{self.name}.#{name}"] ||= block.call
    end
  end

  def self.preload
    self.clear
    LazyConst::CACHE.keys.each do |class_dot_name|
      klass, name = class_dot_name.split('.')
      m = const_get(klass.to_sym).public_send name.to_sym
    end
  end

  def self.clear
    LazyConst::CACHE.keys.each do |k|
      LazyConst::CACHE[k] = nil
    end
  end

end

{'fraction_non_alphanumeric': 0.1281645569620253, 'fraction_numerical': 0.0, 'mean_word_length': 3.1887417218543046, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1827807', 'n_tokens_mistral': 453, 'n_tokens_neox': 454, 'n_words': 95}