def validate_token(token):
    if token is not None and not hasattr(token, "key"):
        raise ValueError("Invalid token.")
    return token
validate a token agains oauth2.Token object
dataset/ETHPy150Open benoitc/restkit/restkit/filters.py/validate_token