code: def invalidate_token(token: str) -> bool:
      user = get_by_token(token)
      if user:
          for session in user.session_token_owners[token]:
              UserSessionTokenIndex.delete(session)
              if session in user.session_tokens:
                  del user.session_tokens[session]
          del user.session_token_owners[token]
          del user.tokens[token]
          UserTokenIndex.delete(token)
          user.save()
          return True
  
      return False
  
imports: import time
  from labml_db import Model, Key, Index
  from typing import List, Dict, Optional, Set, Any
  from .None import project
  from ..None import utils
  from ..utils import gen_token
label_desc: Use image node_id 8 for calling a global function with example usage: invalidate_token(token) and returns: False, True