def irc_split(data):
    prefix = ''
    buf = data
    trailing = None
    command = None

    if buf.startswith(':'):
        try:
            prefix, buf = buf[1:].split(DELIM, 1)
        except ValueError:
            pass
    try:
        command, buf = buf.split(DELIM, 1)
    except __HOLE__:
        raise ProtocolViolationError('no command received: %r' % buf)
    try:
        buf, trailing = buf.split(DELIM + ':', 1)
    except ValueError:
        pass
    params = buf.split(DELIM)
    if trailing is not None:
        params.append(trailing)
    return prefix, command, params
dataset/ETHPy150Open gwik/geventirc/lib/geventirc/message.py/irc_split