def METHOD_NAME(z_events):
    """translate zmq.POLLIN/OUT/ERR event masks into IOLoop.READ/WRITE/ERROR"""
    events = 0
    if z_events & POLLIN:
        events |= IOLoop.READ
    if z_events & POLLOUT:
        events |= IOLoop.WRITE
    if z_events & POLLERR:
        events |= IOLoop.ERROR
    return events