def sp_msg(cmd, pipe=None, data=None):
    """Produces skypipe protocol multipart message"""
    msg = [SP_HEADER, cmd]
    if pipe is not None:
        msg.append(pipe)
    if data is not None:
        msg.append(data)
    return msg
Produces skypipe protocol multipart message