def mpi_send_wait_key(a):
 if isinstance(a.op, (MPIRecvWait, MPISendWait)):
  return 1
 if isinstance(a.op, (MPIRecv, MPISend)):
  return (-1)
 return 0

def mpi_send_wait_key ( a ) : if isinstance ( a . op , ( MPIRecvWait , MPISendWait ) ) : return 1 if isinstance ( a . op , ( MPIRecv , MPISend ) ) : return ( - 1 ) return 0
wait as long as possible on waits .