<commit_before>module Atheme
  class NickServ < Service

    parse :info do
      responds_with Atheme::User

      command :name do
        match(/^Information\son\s([^\s]+)/)
      end

      command :account, as: Atheme::User do
        match(/\(account\s([^\(]+)\):/)
      end

      command :registered do
        Date.parse(match(/Registered\s+:\s+(\w+ [0-9]{2} [0-9(:?)]+ [0-9]{4})/))
      end

      command :entity_id do
        match(/Entity\sID\s+:\s+([A-F0-9]+)$/)
      end

      command :vhost do
        match(/vHost\s+:\s+([^\s]+)$/)
      end

      command :real_address do
        match(/Real\saddr\s+:\s+([^\s]+)$/)
      end

      command :last_seen do
        Date.parse(match(/Last\sseen\s+:\s+(\w+ [0-9]{2} [0-9(:?)]+ [0-9]{4})/))
      end

      command :user_seen do
        Date.parse(match(/User\sseen\s+:\s+(\w+ [0-9]{2} [0-9(:?)]+ [0-9]{4})/)) rescue nil
      end

      command :nicks do
        match(/Nicks\s+:\s+([^\s]+(?:\s[^\s]+)*)$/).split rescue []
      end

      command :email do
        match(/Email\s+:\s+([^\s]+)/)
      end

      command :language do
        match(/Language\s+:\s+([\w]+)$/)
      end

      command :flags do
        match(/Flags\s+:\s+(\w+(?:\s\w+)*)$/).split rescue []
      end

      command :protected do
        match(/has\s(enabled)\snick\sprotection/) ? true : false
      end

      command :groups do
        flags = match(/Groups\s+:\s+(.+)$/)
        flags && flags.split || []
      end
    end
  end
end<commit_msg>Simplify error handling on service/entities methods if attributes don't exist; NickServ<commit_after>module Atheme
  class NickServ < Service

    parse :info do
      responds_with Atheme::User

      command :name do
        match(/^Information\son\s([^\s]+)/)
      end

      command :account, as: Atheme::User do
        match(/\(account\s([^\(]+)\):/)
      end

      command :registered do
        Date.parse(match(/Registered\s+:\s+(\w+ [0-9]{2} [0-9(:?)]+ [0-9]{4})/))
      end

      command :entity_id do
        match(/Entity\sID\s+:\s+([A-F0-9]+)$/)
      end

      command :vhost do
        match(/vHost\s+:\s+([^\s]+)$/)
      end

      command :real_address do
        match(/Real\saddr\s+:\s+([^\s]+)$/)
      end

      command :last_seen do
        Date.parse(match(/Last\sseen\s+:\s+(\w+ [0-9]{2} [0-9(:?)]+ [0-9]{4})/))
      end

      command :user_seen do
        Date.parse(match(/User\sseen\s+:\s+(\w+ [0-9]{2} [0-9(:?)]+ [0-9]{4})/)) rescue nil
      end

      command :nicks do
        match(/Nicks\s+:\s+([^\s]+(?:\s[^\s]+)*)$/).split rescue []
      end

      command :email do
        match(/Email\s+:\s+([^\s]+)/)
      end

      command :language do
        match(/Language\s+:\s+([\w]+)$/)
      end

      command :flags do
        match(/Flags\s+:\s+(.+)$/).split rescue []
      end

      command :protected do
        match(/has\s(enabled)\snick\sprotection/) ? true : false
      end

      command :groups do
        match(/Groups\s+:\s+(.+)$/).split rescue []
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.21739130434782608, 'fraction_numerical': 0.017127799736495388, 'mean_word_length': 1.8896289248334919, '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': '4645766', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1100, 'n_words': 213}