<commit_before>require 'timeout'

module Util
  def on_persistent?
    # sometimes the disks aren't mounted; mount both disks to make sure
    system("ssh <EMAIL> -o ConnectTimeout=5 'sudo hdid /dev/disk0s2; sudo hdid /dev/disk0s3; df' | grep /Volumes/bacon")
  end

  def reboot_to(volume)
    puts("rebooting to #{volume}")
    system("ssh pivotal@bacon.flood.pivotallabs.com 'sudo hdid /dev/disk0s2; sudo hdid /dev/disk0s3'")
    system("ssh pivotal@bacon.flood.pivotallabs.com 'sudo bless --mount #{volume} --setboot'")
    system("ssh pivotal@bacon.flood.pivotallabs.com 'sudo shutdown -r now'")
  end

  def disappear_reappear
    # wait for machine to disappear
    Timeout::timeout(120) do
      if system("ssh pivotal@bacon.flood.pivotallabs.com -o ConnectTimeout=5 'true'")
        sleep 1
      end
    end

    puts "machine down"

    # wait for machine to reappear
    Timeout::timeout(120) do
      until system("ssh pivotal@bacon.flood.pivotallabs.com -o ConnectTimeout=5 'true'")
        sleep 1
      end
    end
  end

  def system!(cmd)
    if ! system(cmd)
      raise "#{cmd}: #{$?.exitstatus}"
    end
  end
end

<commit_msg>adding more troubleshooting statements<commit_after>require 'timeout'

module Util
  def on_persistent?
    # sometimes the disks aren't mounted; mount both disks to make sure
    system("ssh pivotal@bacon.flood.pivotallabs.com -o ConnectTimeout=5 'sudo hdid /dev/disk0s2; sudo hdid /dev/disk0s3; df' | grep /Volumes/bacon")
  end

  def reboot_to(volume)
    puts("rebooting to #{volume}")
    system("ssh pivotal@bacon.flood.pivotallabs.com 'sudo hdid /dev/disk0s2; sudo hdid /dev/disk0s3'")
    puts("Blessing #{volume}")
    system("ssh <EMAIL>.pivotallabs.com 'sudo bless --mount #{volume} --setboot'")
    puts("shutting down")
    system("ssh <EMAIL>.<EMAIL> 'sudo shutdown -r now'")
  end

  def disappear_reappear
    # wait for machine to disappear
    Timeout::timeout(120) do
      if system("ssh pivotal@bacon.flood.pivotallabs.com -o ConnectTimeout=5 'true'")
        sleep 1
      end
    end

    puts "machine down"

    # wait for machine to reappear
    Timeout::timeout(120) do
      until system("ssh pivotal@bacon.flood.pivotallabs.com -o ConnectTimeout=5 'true'")
        sleep 1
      end
    end
  end

  def system!(cmd)
    if ! system(cmd)
      raise "#{cmd}: #{$?.exitstatus}"
    end
  end
end


{'fraction_non_alphanumeric': 0.11878685762426285, 'fraction_numerical': 0.016006739679865205, 'mean_word_length': 3.181338028169014, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 9, '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': '5722087', 'n_tokens_mistral': 893, 'n_tokens_neox': 807, 'n_words': 223}