def revoke(client_id, client_secret,
        client_email=None, private_key=None,
        access_token=None, refresh_token=None,
        identity=None, prefix=None, suffix=None):

    if client_email and private_key:
        raise ValueError('Two-legged OAuth does not use revokable tokens.')
    
    credentials = oauth.Credentials.find(
        complete=True,
        interactive=False,
        identity=identity,
        client_id=client_id,
        client_secret=client_secret,
        access_token=access_token,
        refresh_token=refresh_token,
        prefix=prefix,
        suffix=suffix,
        )

    retval = credentials.revoke()
    keyring.delete(credentials.identity)
    return retval
Test setting, getting state at the lowest level
dataset/ETHPy150Open debrouwere/google-analytics/googleanalytics/auth/__init__.py/revoke--crossover with--dataset/ETHPy150Open duerrp/pyexperiment/tests/test_state.py/TestBasicState.test_set_get_first_level