'Returns a (possibly empty) list of client-scope-expiration triples for which Account has outstanding access tokens.'

@classmethod
def _by_user(cls, account):

    refresh_tokens = {token._id: token for token in OAuth2RefreshToken._by_user(account) if token.check_valid()}
    access_tokens = [token for token in OAuth2AccessToken._by_user(account) if token.check_valid()]
    tokens = refresh_tokens.values()
    tokens.extend((token for token in access_tokens if (token.refresh_token not in refresh_tokens)))
    clients = cls._byID([token.client_id for token in tokens])
    return [(clients[token.client_id], OAuth2Scope(token.scope), ((token.date + datetime.timedelta(seconds=token._ttl)) if token._ttl else None)) for token in tokens]
