<commit_before>class Spiceweasel::CookbookList
  def initialize(cookbooks = [])
    @create = @delete = ''
    @cookbooks = []
    cookbooks.each do |cookbook|
      cb = cookbook.keys.first
      if cookbook[cb] and cookbook[cb].length > 0
        version = cookbook[cb][0].to_s || ""
        args = cookbook[cb][1] || ""
      end
      STDOUT.puts "DEBUG: cookbook: #{cb} #{version}" if DEBUG
      @delete += "knife cookbook @delete #{cb} #{version} -y\n"
      if File.directory?("cookbooks")
        if version and File.directory?("cookbooks/#{cb}")
          #check metadata.rb for requested version
          metadata = File.open("cookbooks/#{cb}/metadata.rb").grep(/^version/)[0].split()[1].gsub(/"/,'').to_s
          if (metadata != version)
            raise "Invalid version #{version} of '#{cb}' requested, #{metadata} is already in the cookbooks directory."
            exit(-1)
          end
        elsif !File.directory?("cookbooks/#{cb}")
          @create += "knife cookbook site download #{cb} #{version} --file cookbooks/#{cb}.tgz #{args}\n"
          @create += "tar -C cookbooks/ -xf cookbooks/#{cb}.tgz\n"
        end
      else
        STDERR.puts "cookbooks directory not found, validation and downloading skipped"
      end
      @create += "knife cookbook upload #{cb}\n"

      @cookbooks << cb
    end
  end

  attr_reader :cookbooks, :create, :delete

  def member?(cookbook)
    cookbooks.include?(cookbook)
  end
end<commit_msg>Typo prevents you from being able to rebuild a deployment<commit_after>class Spiceweasel::CookbookList
  def initialize(cookbooks = [])
    @create = @delete = ''
    @cookbooks = []
    cookbooks.each do |cookbook|
      cb = cookbook.keys.first
      if cookbook[cb] and cookbook[cb].length > 0
        version = cookbook[cb][0].to_s || ""
        args = cookbook[cb][1] || ""
      end
      STDOUT.puts "DEBUG: cookbook: #{cb} #{version}" if DEBUG
      @delete += "knife cookbook delete #{cb} #{version} -y\n"
      if File.directory?("cookbooks")
        if version and File.directory?("cookbooks/#{cb}")
          #check metadata.rb for requested version
          metadata = File.open("cookbooks/#{cb}/metadata.rb").grep(/^version/)[0].split()[1].gsub(/"/,'').to_s
          if (metadata != version)
            raise "Invalid version #{version} of '#{cb}' requested, #{metadata} is already in the cookbooks directory."
            exit(-1)
          end
        elsif !File.directory?("cookbooks/#{cb}")
          @create += "knife cookbook site download #{cb} #{version} --file cookbooks/#{cb}.tgz #{args}\n"
          @create += "tar -C cookbooks/ -xf cookbooks/#{cb}.tgz\n"
        end
      else
        STDERR.puts "cookbooks directory not found, validation and downloading skipped"
      end
      @create += "knife cookbook upload #{cb}\n"

      @cookbooks << cb
    end
  end

  attr_reader :cookbooks, :create, :delete

  def member?(cookbook)
    cookbooks.include?(cookbook)
  end
end
{'fraction_non_alphanumeric': 0.15200539265251095, 'fraction_numerical': 0.004044489383215369, 'mean_word_length': 2.628361858190709, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4870118', 'n_tokens_mistral': 925, 'n_tokens_neox': 909, 'n_words': 240}