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 KeyError:
  if default:
   return default[0]
  raise

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 KeyError : if default : return default [ 0 ] raise
return the callback used for hub+fd+flag .