def valid(cls, token, **kwargs):
        """
        Check if a token exists and has not expired

        :param token: the token
        :return: bool
        """
        try:
            token = yield cls.get(token)
        except couch.NotFound:
            raise Return(False)

        raise Return(token.ttl >= datetime.utcnow())
def valid ( cls , token , ** kwargs ) : try : token = yield cls . get ( token ) except couch . NotFound : raise Return ( False ) raise Return ( token . ttl >= datetime . utcnow ( ) )
Check if a token exists and has not expired

        :param token: the token
        :return: bool