<commit_before>require 'java'
require 'weka/jars'
require 'weka/version'

module Weka
  include Jars

  def self.require_all(type)
    files = Dir[File.expand_path("../weka/#{type}/**/*.rb", __FILE__)]
    files.each { |file| require file }
  end
end

require 'weka/core'
require 'weka/classifiers'
require 'weka/filters'
require 'weka/clusterers'
require 'weka/attribute_selection'
<commit_msg>Require utils.rb first if available<commit_after>require 'java'
require 'weka/jars'
require 'weka/version'

module Weka
  include Jars

  class << self
    def require_all(type)
      files        = Dir[File.expand_path("../weka/#{type}/**/*.rb", __FILE__)]
      utils        = File.expand_path("../weka/#{type}/utils.rb", __FILE__)
      sorted_files = move_to_head(utils, files)

      sorted_files.each { |file| require file }
    end

    private

    def move_to_head(file, files)
      file_to_move = files.delete(file)
      files.unshift(file_to_move) unless file_to_move.nil?
      files
    end
  end
end

require 'weka/core'
require 'weka/classifiers'
require 'weka/filters'
require 'weka/clusterers'
require 'weka/attribute_selection'

{'fraction_non_alphanumeric': 0.12773403324584426, 'fraction_numerical': 0.0, 'mean_word_length': 3.6504065040650406, 'pattern_counts': {'":': 0, '<': 5, '<?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': '166918', 'n_tokens_mistral': 402, 'n_tokens_neox': 403, 'n_words': 86}