def METHOD_NAME(self, key):
    """Verify a key. Raises an exception if the key is invalid or expired."""
    try:
        u, expiry = self._requests[key]
    except KeyError:
        raise InvalidRequestError
    if self.expired(expiry):
        raise ExpiredRequestError
    if not self.getValidUser(u):
        raise InvalidRequestError("No such user")