<commit_before>require 'cinch'
require 'string-utility'

module Plugins
  module Commands
    class WikiStatistics
      include Cinch::Plugin
      using StringUtility

      VALID_PROPERTIES = %w(pages articles edits images users activeusers admins).freeze

      match(/stats$/i, method: :get_all)
      match(/stats (.+)/i, method: :get_one)

      DOC = 'Gives wiki stats. 1 optionl arg: $stats <type>, where type is ' \
            "'pages', 'articles', 'edits', 'images', 'users', 'admins', or 'activeusers'.".freeze
      Variables::NonConstants.add_command('stats', doc)

      # Gets all statistics for the wiki, including number of pages, articles,
      #   edits, images, users, admins, and active users.
      # @param msg [Cinch::Message]<commit_msg>:bug: Fix NameError in WikiStatistics<commit_after>require 'cinch'
require 'string-utility'

module Plugins
  module Commands
    class WikiStatistics
      include Cinch::Plugin
      using StringUtility

      VALID_PROPERTIES = %w(pages articles edits images users activeusers admins).freeze

      match(/stats$/i, method: :get_all)
      match(/stats (.+)/i, method: :get_one)

      DOC = 'Gives wiki stats. 1 optionl arg: $stats <type>, where type is ' \
            "'pages', 'articles', 'edits', 'images', 'users', 'admins', or 'activeusers'.".freeze
      Variables::NonConstants.add_command('stats', DOC)

      # Gets all statistics for the wiki, including number of pages, articles,
      #   edits, images, users, admins, and active users.
      # @param msg [Cinch::Message]
{'fraction_non_alphanumeric': 0.11969111969111969, 'fraction_numerical': 0.001287001287001287, 'mean_word_length': 3.3557422969187676, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3095943', 'n_tokens_mistral': 483, 'n_tokens_neox': 450, 'n_words': 147}