<commit_before>module Frizz
  class Local
    def initialize(root_path)
      @root_path = root_path
    end

    def files
      @files ||= begin
        Dir.chdir(root_path) do
          Dir["**/*"].map do |local_path|
            File.new(expand_path(local_path), local_path) unless ::File.directory?(local_path)
          end.compact
        end
      end
    end

    def file_for(local_path)
      ::File.open expand_path(local_path)
    end

    private

    attr_reader :root_path

    def expand_path(local_path)<commit_msg>Use File.read instead of .open to circumvent issue in qoobaa/s3 gem (#65)<commit_after>module Frizz
  class Local
    def initialize(root_path)
      @root_path = root_path
    end

    def files
      @files ||= begin
        Dir.chdir(root_path) do
          Dir["**/*"].map do |local_path|
            File.new(expand_path(local_path), local_path) unless ::File.directory?(local_path)
          end.compact
        end
      end
    end

    def file_for(local_path)
      ::File.read expand_path(local_path)
    end

    private

    attr_reader :root_path

    def expand_path(local_path)
{'fraction_non_alphanumeric': 0.0905861456483126, 'fraction_numerical': 0.0026642984014209592, 'mean_word_length': 2.3843843843843846, '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': '7204284', 'n_tokens_mistral': 374, 'n_tokens_neox': 356, 'n_words': 82}