def callback_for(h, fd, flag, *default):
    try:
        if flag & READ:
            return h.readers[fd]
        if flag & WRITE:
            if fd in h.consolidate:
                return h.consolidate_callback
            return h.writers[fd]
    except __HOLE__:
        if default:
            return default[0]
        raise
dataset/ETHPy150Open celery/kombu/kombu/async/debug.py/callback_for