def on_read(self, data):
        data = data.strip('\r\n')
        if not data:
            return

        log.debug('\x1B[0;31m<< %s\x1B[0m' % repr(data)[1:-1])

        # Decode it straight away.
        data = decode(data)

        try:
            prefix, command, raw = COMMAND.match(data).groups()
        except Exception:
            log.warning('Invalid IRC command %r.' % data)
            return

        if prefix:
            nick, user, host = NETMASK.match(prefix).groups()
            if not nick and not '.' in host:
                nick = host
                host = ''
        else:
            nick, user, host = '', '', ''

        args = ARGS.findall(raw)
        if args:
            if args[-1].startswith(':'):
                args[-1] = args[-1][1:]

        # If it's PING, handle it.
        if command == 'PING':
            self.send_command('PONG', *args)
            return

        # Handle the command.
        self.on_command(command, args, nick, user, host)

###############################################################################
# IRCClient Class & Channel Class
###############################################################################
Returns all translatable strings from a :class:`frappe.core.doctype.Report`
dataset/ETHPy150Open ecdavis/pants/pants/contrib/irc.py/BaseIRC.on_read--crossover with--dataset/ETHPy150Open frappe/frappe/frappe/translate.py/get_messages_from_report