code: def register_app(_app):
      global app_map
  
      app_id = _app_id_context_var.get()
  
      if app_id in app_map:
          app = app_map[app_id]
          app.blocks.close()
  
      app_map[app_id] = _app
  
file_path: gradio/gradio/wasm_utils.py
imports: from __future__ import annotations
  import sys
  from contextlib import contextmanager
  from contextvars import ContextVar
label_desc: Use image node_id 2 for calling a global function with example usage: register_app(_app) without return types