<commit_before>mydir = File.expand_path(File.dirname(__FILE__))

require 'i18n'
require 'mool/version'
require 'mool/service'
require 'mool/cpu'
require 'mool/disk'
require 'mool/memory'


I18n.load_path += Dir[File.join(mydir, 'locales', '*.yml')]

module Mool
  BLOCK_SIZE = 512
  BYTES = "Bytes"
  KBYTES = "KBytes"
  MBYTES = "MBytes"
  GBYTES = "GBytes"
  PARSE_TYPES = { BYTES => 1, KBYTES => 2**10, MBYTES => 2**20, GBYTES => 2**30 }

  def self.parse_to(obj, vars, parse)
    vars.each do |var|
      value = ((obj.instance_variable_get(var).to_f * PARSE_TYPES[obj.unity]) / PARSE_TYPES[parse])
      obj.instance_variable_set(var, value)
    end
    obj.unity = parse
    obj
  end

end<commit_msg>add missing require 'load_average'<commit_after>mydir = File.expand_path(File.dirname(__FILE__))

require 'i18n'
require 'mool/version'
require 'mool/service'
require 'mool/cpu'
require 'mool/disk'
require 'mool/memory'
require 'mool/load_average'


I18n.load_path += Dir[File.join(mydir, 'locales', '*.yml')]

module Mool
  BLOCK_SIZE = 512
  BYTES = "Bytes"
  KBYTES = "KBytes"
  MBYTES = "MBytes"
  GBYTES = "GBytes"
  PARSE_TYPES = { BYTES => 1, KBYTES => 2**10, MBYTES => 2**20, GBYTES => 2**30 }

  def self.parse_to(obj, vars, parse)
    vars.each do |var|
      value = ((obj.instance_variable_get(var).to_f * PARSE_TYPES[obj.unity]) / PARSE_TYPES[parse])
      obj.instance_variable_set(var, value)
    end
    obj.unity = parse
    obj
  end

end
{'fraction_non_alphanumeric': 0.14832535885167464, 'fraction_numerical': 0.02323991797676008, 'mean_word_length': 3.9965870307167237, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1139182', 'n_tokens_mistral': 618, 'n_tokens_neox': 589, 'n_words': 120}