<commit_before>require 'term/ansicolor'

module SSHKit

  module Formatter

    class Pretty < Abstract

      def write(obj)
        return if obj.verbosity < SSHKit.config.output_verbosity
        case obj
        when SSHKit::Command    then write_command(obj)
        when SSHKit::LogMessage then write_log_message(obj)
        else
          original_output << c.black(c.on_yellow("Output formatter doesn't know how to handle #{obj.class}\n"))
        end
      end
      alias :<< :write

      private

      def write_command(command)
        unless command.started?
          original_output << level(command.verbosity) + uuid(command) + "Running #{c.yellow(c.bold(String(command)))} on #{c.blue(command.host.to_s)}\n"
          if SSHKit.config.output_verbosity == Logger::DEBUG
            original_output << level(Logger::DEBUG) + uuid(command) + "Command: #{c.blue(command.to_command)}" + "\n"
          end
        end

        if SSHKit.config.output_verbosity == Logger::DEBUG
          unless command.stdout.empty?
            command.stdout.lines.each do |line|
              original_output << level(Logger::DEBUG) + uuid(command) + c.green("\t" + line)
              original_output << "\n" unless unless line[-1] == "\n"
            end
          end

          unless command.stderr.empty?
            command.stderr.lines.each do |line|
              original_output << level(Logger::DEBUG) + uuid(command) + c.red("\t" + line)
              original_output << "\n" unless unless line[-1] == "\n"
            end
          end
        end
<commit_msg>Quick fix for my quick fir for borked line output<commit_after>require 'term/ansicolor'

module SSHKit

  module Formatter

    class Pretty < Abstract

      def write(obj)
        return if obj.verbosity < SSHKit.config.output_verbosity
        case obj
        when SSHKit::Command    then write_command(obj)
        when SSHKit::LogMessage then write_log_message(obj)
        else
          original_output << c.black(c.on_yellow("Output formatter doesn't know how to handle #{obj.class}\n"))
        end
      end
      alias :<< :write

      private

      def write_command(command)
        unless command.started?
          original_output << level(command.verbosity) + uuid(command) + "Running #{c.yellow(c.bold(String(command)))} on #{c.blue(command.host.to_s)}\n"
          if SSHKit.config.output_verbosity == Logger::DEBUG
            original_output << level(Logger::DEBUG) + uuid(command) + "Command: #{c.blue(command.to_command)}" + "\n"
          end
        end

        if SSHKit.config.output_verbosity == Logger::DEBUG
          unless command.stdout.empty?
            command.stdout.lines.each do |line|
              original_output << level(Logger::DEBUG) + uuid(command) + c.green("\t" + line)
              original_output << "\n" unless line[-1] == "\n"
            end
          end

          unless command.stderr.empty?
            command.stderr.lines.each do |line|
              original_output << level(Logger::DEBUG) + uuid(command) + c.red("\t" + line)
              original_output << "\n" unless line[-1] == "\n"
            end
          end
        end

{'fraction_non_alphanumeric': 0.11861198738170348, 'fraction_numerical': 0.0012618296529968455, 'mean_word_length': 2.1901408450704225, 'pattern_counts': {'":': 0, '<': 39, '<?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': '102279', 'n_tokens_mistral': 920, 'n_tokens_neox': 891, 'n_words': 211}