<commit_before>require 'tyrant_manager/command'
class TyrantManager
  module Commands
    #
    # List the stats about one or more instances
    #
    class Stats < Command
      def run
        manager.each_instance( options['instances'] ) do |instance|
          puts "Instance #{instance.name} at #{instance.home_dir}"
          stats = instance.stat
          stats.keys.sort.each do |k|
            lhs = k.ljust(10, ".")
            puts "    #{lhs} #{stats[k]}"
          end
          puts
        end
      end
    end
  end
end<commit_msg>adjust number of trailing .. according to maximum width of stat names<commit_after>require 'tyrant_manager/command'
class TyrantManager
  module Commands
    #
    # List the stats about one or more instances
    #
    class Stats < Command
      def run
        manager.each_instance( options['instances'] ) do |instance|
          puts "Instance #{instance.name} at #{instance.home_dir}"
          stats = instance.stat
          max_width = stats.keys.collect { |k| k.length }.sort.last + 2
          stats.keys.sort.each do |k|
            lhs = k.ljust(max_width, ".")
            puts "    #{lhs} #{stats[k]}"
          end
          puts
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09813463098134631, 'fraction_numerical': 0.0024330900243309003, 'mean_word_length': 1.9241706161137442, 'pattern_counts': {'":': 0, '<': 5, '<?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': '392856', 'n_tokens_mistral': 363, 'n_tokens_neox': 364, 'n_words': 105}