<commit_before>module Plugin::Use
  def self.included(mod)
    if mod.is_a? Class
      mod.add_hook(:toplevel) do
        main_use_fn do
          use_common
        end
      end
    end
  end

  def main_use_fn(&block)
    __function("_#{name}_use", &block)
  end

  def use_common
    __if(__set?(root)) do |c|
      c.then do
        __call("_#{name}_reset")
      end
    end
    __export("#{name}_ROOT", args[1])
    add_to_PATH("${#{name}_ROOT}/bin")
  end
end<commit_msg>Use the root helper<commit_after>module Plugin::Use
  def self.included(mod)
    if mod.is_a? Class
      mod.add_hook(:toplevel) do
        main_use_fn do
          use_common
        end
      end
    end
  end

  def main_use_fn(&block)
    __function("_#{name}_use", &block)
  end

  def use_common
    __if(__set?(root)) do |c|
      c.then do
        __call("_#{name}_reset")
      end
    end
    __export(root(:var), args[1])
    add_to_PATH("${#{name}_ROOT}/bin")
  end
end
{'fraction_non_alphanumeric': 0.12681912681912683, 'fraction_numerical': 0.002079002079002079, 'mean_word_length': 2.390845070422535, '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': '1154283', 'n_tokens_mistral': 359, 'n_tokens_neox': 358, 'n_words': 74}