@internationalizeDocstring
    def lart(self, irc, msg, args, channel, id, text):
        """[<channel>] [<id>] <who|what> [for <reason>]

        Uses the Luser Attitude Readjustment Tool on <who|what> (for <reason>,
        if given).  If <id> is given, uses that specific lart.  <channel> is
        only necessary if the message isn't sent in the channel itself.
        """
        if ' for ' in text:
            (target, reason) = list(map(str.strip, text.split(' for ', 1)))
        else:
            (target, reason) = (text, '')
        if id is not None:
            try:
                lart = self.db.get(channel, id)
            except __HOLE__:
                irc.error(format(_('There is no lart with id #%i.'), id))
                return
        else:
            lart = self.db.random(channel)
            if not lart:
                irc.error(format(_('There are no larts in my database '
                                 'for %s.'), channel))
                return
        text = lart.text
        if ircutils.strEqual(target, irc.nick):
            target = msg.nick
            reason = self._replaceFirstPerson(_('trying to dis me'), irc.nick)
        else:
            target = self._replaceFirstPerson(target, msg.nick)
            reason = self._replaceFirstPerson(reason, msg.nick)
        if target.endswith('.'):
            target = target.rstrip('.')
        text = text.replace('$who', target)
        if reason:
            text += _(' for ') + reason
        if self.registryValue('showIds', channel):
            text += format(' (#%i)', lart.id)
        irc.reply(text, action=True)
dataset/ETHPy150Open ProgVal/Limnoria/plugins/Lart/plugin.py/Lart.lart