<commit_before>require 'shellwords'

module Travis
  module Shell
    class Generator
      class Bash
        module Helpers
          ANSI = {
            green: '\033[33;1m',
            red:   '\033[31;1m',
            reset: '\033[0m'
          }

          def ansi(string, keys)
            keys = Array(keys)
            prefix = keys.map { |key| ANSI[key] }
            suffix = ANSI[:reset] if keys.any?

            lines = string.split("\n").map do |line|
              line.strip.empty? ? line : [prefix, line, suffix].compact.flatten.join
            end
            lines.join("\n")
          end

          def escape(code)
            Shellwords.escape(code.to_s)
          end<commit_msg>add :yellow as an ansi color<commit_after>require 'shellwords'

module Travis
  module Shell
    class Generator
      class Bash
        module Helpers
          ANSI = {
            green: '\033[33;1m',
            red:   '\033[31;1m',
            yellow:'\033[33;1m',
            reset: '\033[0m'
          }

          def ansi(string, keys)
            keys = Array(keys)
            prefix = keys.map { |key| ANSI[key] }
            suffix = ANSI[:reset] if keys.any?

            lines = string.split("\n").map do |line|
              line.strip.empty? ? line : [prefix, line, suffix].compact.flatten.join
            end
            lines.join("\n")
          end

          def escape(code)
            Shellwords.escape(code.to_s)
          end
{'fraction_non_alphanumeric': 0.11643835616438356, 'fraction_numerical': 0.026027397260273973, 'mean_word_length': 1.3950819672131147, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7309101', 'n_tokens_mistral': 460, 'n_tokens_neox': 427, 'n_words': 101}