<commit_before>class PNG
  module Decode
    def self.included(base)
      base.send :include, InstanceMethods
      base.extend ClassMethods
    end

    module ClassMethods
      def decode(infile, outfile)
        self.new(ChunkyPNG::Image.from_file(infile)).decode(outfile)
      end
    end

    module InstanceMethods
      def decode(outfile)
        output = []
        @data.pixels.each do |b|
          output << b
        end

        File.write(outfile, output.pack("C#{output.size}"))
      end
    end
  end
end<commit_msg>Ensure a file descriptor is returned<commit_after>class PNG
  module Decode
    def self.included(base)
      base.send :include, InstanceMethods
      base.extend ClassMethods
    end

    module ClassMethods
      def decode(infile, outfile)
        self.new(ChunkyPNG::Image.from_file(infile)).decode(outfile)
      end
    end

    module InstanceMethods
      def decode(outfile)
        output = []
        @data.pixels.each do |b|
          output << b
        end

        file = File.new(outfile, 'wb')
        file.write(output.pack("C#{output.size}"))
        return file
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09067131647776809, 'fraction_numerical': 0.0, 'mean_word_length': 2.1712707182320443, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5596467', 'n_tokens_mistral': 354, 'n_tokens_neox': 350, 'n_words': 82}