def check_applied(result):
 try:
  applied = result.was_applied
 except Exception:
  applied = True
 if (not applied):
  raise LWTException(result[0])

def check_applied ( result ) : try : applied = result . was_applied except Exception : applied = True if ( not applied ) : raise LWTException ( result [ 0 ] )
raises lwtexception if it looks like a failed lwt request .