<commit_before>require 'formula'

# Downloads the tarballs for the given formulae to the Cache

module Homebrew extend self
  def fetch
    if ARGV.include? '--deps'
      bucket = []
      ARGV.formulae.each do |f|
        bucket << f
        bucket << f.recursive_deps
      end

      bucket = bucket.flatten.uniq
    else
      bucket = ARGV.formulae
    end

    puts "Fetching: #{bucket * ', '}" if bucket.size > 1

    bucket.each do |f|
      if ARGV.include? "--force" or ARGV.include? "-f"
        where_to = f.cached_download
        FileUtils.rm_rf where_to if File.exist? where_to
      end

      the_tarball, _ = f.fetch
      next unless the_tarball.kind_of? Pathname

      previous_md5 = f.instance_variable_get(:@md5)
      previous_sha1 = f.instance_variable_get(:@sha1)
      previous_sha2 = f.instance_variable_get(:@sha2)

      puts "MD5:  #{the_tarball.md5}"
      puts "SHA1: #{the_tarball.sha1}"
      puts "SHA256: #{the_tarball.sha2}"

      unless previous_md5.nil? or previous_md5.empty? or  the_tarball.md5 == previous_md5
        opoo "Formula reports different MD5: #{previous_md5}"
      end
      unless previous_sha1.nil? or previous_sha1.empty? or the_tarball.sha1 == previous_sha1
        opoo "Formula reports different SHA1: #{previous_sha1}"
      end
      unless previous_sha2.nil? or previous_sha2.empty? or  the_tarball.sha2 == previous_sha2
        opoo "Formula reports different SHA256: #{previous_sha2}"
      end
    end
  end
end
<commit_msg>fetch: use correct sha256 instance variable<commit_after>require 'formula'

# Downloads the tarballs for the given formulae to the Cache

module Homebrew extend self
  def fetch
    if ARGV.include? '--deps'
      bucket = []
      ARGV.formulae.each do |f|
        bucket << f
        bucket << f.recursive_deps
      end

      bucket = bucket.flatten.uniq
    else
      bucket = ARGV.formulae
    end

    puts "Fetching: #{bucket * ', '}" if bucket.size > 1

    bucket.each do |f|
      if ARGV.include? "--force" or ARGV.include? "-f"
        where_to = f.cached_download
        FileUtils.rm_rf where_to if File.exist? where_to
      end

      the_tarball, _ = f.fetch
      next unless the_tarball.kind_of? Pathname

      previous_md5 = f.instance_variable_get(:@md5)
      previous_sha1 = f.instance_variable_get(:@sha1)
      previous_sha2 = f.instance_variable_get(:@sha256)

      puts "MD5:  #{the_tarball.md5}"
      puts "SHA1: #{the_tarball.sha1}"
      puts "SHA256: #{the_tarball.sha2}"

      unless previous_md5.nil? or previous_md5.empty? or  the_tarball.md5 == previous_md5
        opoo "Formula reports different MD5: #{previous_md5}"
      end
      unless previous_sha1.nil? or previous_sha1.empty? or the_tarball.sha1 == previous_sha1
        opoo "Formula reports different SHA1: #{previous_sha1}"
      end
      unless previous_sha2.nil? or previous_sha2.empty? or  the_tarball.sha2 == previous_sha2
        opoo "Formula reports different SHA256: #{previous_sha2}"
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.09503311258278145, 'fraction_numerical': 0.024834437086092714, 'mean_word_length': 2.7204433497536944, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1527795', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1013, 'n_words': 255}