'Deletes any login tokens that might have expired.
Also removes expired events'

def __invalidate_expired_tokens(self):

    timenow = time.time()
    for token in self.token_cache.keys():
        (tokentime, user) = self.token_cache[token]
        if (timenow > (tokentime + self.api.settings().auth_token_expiration)):
            self._log('expiring    token', token=token, debug=True)
            del self.token_cache[token]
    for oid in self.object_cache.keys():
        (tokentime, entry) = self.object_cache[oid]
        if (timenow > (tokentime + CACHE_TIMEOUT)):
            del self.object_cache[oid]
    for tid in self.events.keys():
        (eventtime, name, status, who) = self.events[tid]
        if (timenow > (eventtime + EVENT_TIMEOUT)):
            del self.events[tid]
