<commit_before>class Orc::AnsiStatusRenderer
  def render(statuses)
    buffer =""
    keys = [:host,:application,:group,:present,:version,:participating,:health]
    lengths = {}
    keys.each do |key|
      lengths[key] = key.to_s.length
    end

    statuses.each do |status|
      keys.each do |key|
         len = status[key].to_s.length
         if lengths[key] < len
           lengths[key] = len
         end
      end
    end

    header_buffer = ""
    keys.each do |key|
      header_buffer << "#{key}"
      rem = lengths[key] - key.to_s.length + 1
      (1..rem).to_a.each { |x| header_buffer << " "}
    end

    buffer << Color.new(:text=>header_buffer).header().display()

    statuses.each do |status|
      color = status[:group]
      present = status[:present]
      status_buffer = ""
      keys.each do |key|
        status_buffer << "#{status[key]}"
        rem = lengths[key] - status[key].to_s.length + 1
        (1..rem).to_a.each { |x| status_buffer << " "}
      end
      status_buffer << "\n "
      buffer << Color.new(:text=>status_buffer).color(color).highlight(present).display()
    end

    return buffer
  end

  class Color
    def initialize args
      @text=args[:text]
      @colors= {"blue"=>34,"green"=>32}
    end
<commit_msg>agibbins/dellis: downcase app names in status<commit_after>class Orc::AnsiStatusRenderer
  def render(statuses)
    buffer =""
    keys = [:host,:application,:group,:present,:version,:participating,:health]
    lengths = {}
    keys.each do |key|
      lengths[key] = key.to_s.length
    end

    statuses.each do |status|
      keys.each do |key|
         len = status[key].to_s.length
         if lengths[key] < len
           lengths[key] = len
         end
      end
    end

    header_buffer = ""
    keys.each do |key|
      header_buffer << "#{key}"
      rem = lengths[key] - key.to_s.length + 1
      (1..rem).to_a.each { |x| header_buffer << " "}
    end

    buffer << Color.new(:text=>header_buffer).header().display()

    statuses.each do |status|
      color = status[:group]
      present = status[:present]
      status_buffer = ""
      keys.each do |key|
        value = status[key].nil? ? nil.to_s : status[key].to_s.downcase
        status_buffer << "#{value}"
        rem = lengths[key] - value.length + 1
        (1..rem).to_a.each { |x| status_buffer << " "}
      end
      status_buffer << "\n "
      buffer << Color.new(:text=>status_buffer).color(color).highlight(present).display()
    end

    return buffer
  end

  class Color
    def initialize args
      @text=args[:text]
      @colors= {"blue"=>34,"green"=>32}
    end

{'fraction_non_alphanumeric': 0.14883897982489533, 'fraction_numerical': 0.006090597639893415, 'mean_word_length': 2.3649167733674776, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 11, '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': '5876803', 'n_tokens_mistral': 887, 'n_tokens_neox': 867, 'n_words': 177}