<commit_before>#!./chorus_installation/bin/ruby

require_relative 'chorus_installation/packaging/install/version_detector'
require_relative 'chorus_installation/packaging/install/chorus_logger'
require_relative 'chorus_installation/packaging/install/installer_io'
require_relative 'chorus_installation/packaging/install/chorus_executor'
require_relative 'chorus_installation/packaging/install/chorus_installer'

if __FILE__ == $0
  begin
    silent = ARGV.include?('-a')
    debug = ARGV.include?('--debug')
    logger = ChorusLogger.new({:debug => debug})
    installer = ChorusInstaller.new({
        installer_home: File.dirname(__FILE__),
        version_detector: VersionDetector.new,
        logger: logger,
        io: InstallerIO.new(silent),
        executor: ChorusExecutor.new({:logger => logger, :debug => debug})
    })

    installer.install
    installer.startup

    puts "Installation completed."
    unless installer.upgrade_existing?
      puts "To start Chorus, run the following commands:"
      puts "source #{installer.destination_path}/chorus_path.sh"
      puts "chorus_control.sh start"
    end
  rescue InstallerErrors::InstallationFailed => e
    puts "An error has occurred. Trying to back out and restore previous state.."
    installer.remove_and_restart_previous!
    exit 1
  rescue => e
    File.open("install.log", "a") { |f| f.puts "#{e.class}: #{e.message}" }
    puts "Failed to start chorus back up"
    exit 1
  end
end<commit_msg>[#41045891] remove arguments from ARGV so ruby doesn't think they're files<commit_after>#!./chorus_installation/bin/ruby

require_relative 'chorus_installation/packaging/install/version_detector'
require_relative 'chorus_installation/packaging/install/chorus_logger'
require_relative 'chorus_installation/packaging/install/installer_io'
require_relative 'chorus_installation/packaging/install/chorus_executor'
require_relative 'chorus_installation/packaging/install/chorus_installer'

if __FILE__ == $0
  begin
    silent = !!ARGV.delete('-a')
    debug = !!ARGV.delete('--debug')
    logger = ChorusLogger.new({:debug => debug})
    installer = ChorusInstaller.new({
        installer_home: File.dirname(__FILE__),
        version_detector: VersionDetector.new,
        logger: logger,
        io: InstallerIO.new(silent),
        executor: ChorusExecutor.new({:logger => logger, :debug => debug})
    })

    installer.install
    installer.startup

    puts "Installation completed."
    unless installer.upgrade_existing?
      puts "To start Chorus, run the following commands:"
      puts "source #{installer.destination_path}/chorus_path.sh"
      puts "chorus_control.sh start"
    end
  rescue InstallerErrors::InstallationFailed => e
    puts "An error has occurred. Trying to back out and restore previous state.."
    installer.remove_and_restart_previous!
    exit 1
  rescue => e
    File.open("install.log", "a") { |f| f.puts "#{e.class}: #{e.message}" }
    puts "Failed to start chorus back up"
    exit 1
  end
end
{'fraction_non_alphanumeric': 0.10822510822510822, 'fraction_numerical': 0.004662004662004662, 'mean_word_length': 4.082910321489002, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '5590315', 'n_tokens_mistral': 946, 'n_tokens_neox': 931, 'n_words': 203}