def _check_return(ret, description):
 if (ret == ''):
  raise TimeoutException(description)
 elif (ret[(-1)] == OptiCAL._NACK):
  raise NACKException(description)

def _check_return ( ret , description ) : if ( ret == '' ) : raise TimeoutException ( description ) elif ( ret [ ( - 1 ) ] == OptiCAL . _NACK ) : raise NACKException ( description )
check the return value of a read .