<commit_before>module Ruboty
  module Karma
    module Actions
      class List < Ruboty::Actions::Base
        def call
          key = 'karma-list'
          brain = message.robot.brain
          brain.data[key] ||= []
          lists = brain.data[key].map do |user|
            [user, brain.data["karma-@#{user}"]]
          end
          sorted = lists.sort_by { |e| -e[1] }
          text = sorted.map { |e|
            e.last = quiet_name(e.last) if quiet?
            e.join(': ')
          }.join("\n")
          message.reply(text)
        end

        def args
          message['args'] ? message['args'].split(/\s+/) : []
        end

        def quiet?
          args.include?('-q') || args.include?('--quiet')
        end

        def quiet_name(name)
          name.split('').join(' ')
        end
      end
    end
  end
end<commit_msg>bug fix<commit_after>module Ruboty
  module Karma
    module Actions
      class List < Ruboty::Actions::Base
        def call
          key = 'karma-list'
          brain = message.robot.brain
          brain.data[key] ||= []
          lists = brain.data[key].map do |user|
            [user, brain.data["karma-@#{user}"]]
          end
          sorted = lists.sort_by { |e| -e[1] }
          text = sorted.map { |e|
            e[0] = quiet_name(e[0]) if quiet?
            e.join(': ')
          }.join("\n")
          message.reply(text)
        end

        def args
          message['args'] ? message['args'].split(/\s+/) : []
        end

        def quiet?
          args.include?('-q') || args.include?('--quiet')
        end

        def quiet_name(name)
          name.split('').join(' ')
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.1524822695035461, 'fraction_numerical': 0.002364066193853428, 'mean_word_length': 1.4324712643678161, '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': '2468764', 'n_tokens_mistral': 543, 'n_tokens_neox': 530, 'n_words': 112}