code: def get_or_create(
      token_id: str, is_local_user: bool = False
  ) -> AppToken:
      if not token_id:
          token_id = gen_token_id()
  
      app_token_key = AppTokenIndex.get(token_id)
  
      if not app_token_key:
          app_token = AppToken(
              token_id=token_id,
              expiration=gen_expiration(),
              is_local_user=is_local_user,
          )
          app_token.save()
          AppTokenIndex.set(app_token.token_id, app_token.key)
  
          return app_token
  
      return app_token_key.load()
  
file_path: labml/app/server/labml_app/db/app_token.py
imports: import time
  from uuid import uuid4
  from labml_db import Model, Key, Index
  from .None import user
label_desc: Use image node_id 3 for calling a global function with example usage: get_or_create(token_id, is_local_user) and returns: app_token_key, app_token