<commit_before>require 'RMagick'
include Magick

class ImageScaler
  def self.run argv
    source_dir = argv[0]
    destination_dir = argv[1]

    rescale_dir source_dir, destination_dir
  end

  def self.rescale_dir source_dir, destination_dir
    Dir.mkdir(destination_dir) unless Dir.exist?(destination_dir)

    Dir.entries(source_dir).reject{ |a| a =~ /^\.{1,2}$/ }.each do |file_name|
      source_path = File.join(source_dir, file_name)
      if File.directory?(source_path)<commit_msg>Removed regex to skip files starting with .<commit_after>require 'RMagick'
include Magick

class ImageScaler
  def self.run argv
    source_dir = argv[0]
    destination_dir = argv[1]

    rescale_dir source_dir, destination_dir
  end

  def self.rescale_dir source_dir, destination_dir
    Dir.mkdir(destination_dir) unless Dir.exist?(destination_dir)

    Dir.entries(source_dir).each do |file_name|
      next if file_name.starts_with? '.'

      source_path = File.join(source_dir, file_name)
      if File.directory?(source_path)
{'fraction_non_alphanumeric': 0.0934761441090555, 'fraction_numerical': 0.005842259006815969, 'mean_word_length': 4.14, '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': '3581618', 'n_tokens_mistral': 348, 'n_tokens_neox': 341, 'n_words': 77}