code: def get_or_create_user(
      identifier: str, is_local_user=False, **kwargs
  ) -> User:
      user_key = UserIndex.get(identifier)
  
      if not user_key:
          kwargs.update({"identifier": identifier})
          p = project.Project(labml_token=utils.gen_token())
          u = User(**kwargs)
          u.is_local_user = is_local_user
          u.projects.append(p.key)
  
          u.save()
          p.save()
  
          UserIndex.set(u.identifier, u.key)
          project.ProjectIndex.set(p.labml_token, p.key)
  
      else:
          u = user_key.load()
  
      if is_local_user:
          u.tokens["local"] = float("inf")
          u.session_token_owners["local"] = u.session_token_owners.get(
              "local", {"local"}
          )
          u.session_tokens["local"] = float("inf")
          UserTokenIndex.set("local", u.key)
          UserSessionTokenIndex.set("local", u.key)
          u.save()
  
      return u
  
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 2 for calling a global function with example usage: get_or_create_user(identifier, is_local_user) and returns: u