<commit_before>module Fog
  module Compute
    class VMXFile

      def self.load(filename)
        data = {}
        File.open(filename).each do |line|
          parts = line.split('=')
          data[parts[0].strip] = parts[1].strip.gsub!(/^"(.*?)"$/,'\1')
        end
        data
      end

      def self.write(filename, data)
        File.open(filename, 'w') do |f|
          data.each do |k,v|
            f.puts "#{k} = \"#{v}\""
          end
        end
      end

      def self.with_vmx_data(filename, &block)
        data = load(filename)
        block.call(data)
        write(filename, data)
      end

    end
  end
end<commit_msg>Do not try to parse shebang in vmx files<commit_after>module Fog
  module Compute
    class VMXFile

      def self.load(filename)
        data = {}
        File.open(filename).each do |line|
          next if line =~ Regexp.new(Regexp.quote("#!/usr/bin/vmware"))
          parts = line.split('=')
          data[parts[0].strip] = parts[1].strip.gsub!(/^"(.*?)"$/,'\1')
        end
        data
      end

      def self.write(filename, data)
        File.open(filename, 'w') do |f|
          data.each do |k,v|
            f.puts "#{k} = \"#{v}\""
          end
        end
      end

      def self.with_vmx_data(filename, &block)
        data = load(filename)
        block.call(data)
        write(filename, data)
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.1457286432160804, 'fraction_numerical': 0.004307250538406317, 'mean_word_length': 1.6653919694072659, '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': '7294041', 'n_tokens_mistral': 477, 'n_tokens_neox': 463, 'n_words': 105}