code: def wave_utils_error_card(
      q: Q,
      box: str,
      app_name: str,
      github: str,
      q_app: dict,
      error: Exception,
      q_user: dict,
      q_client: dict,
      q_events: dict,
      q_args: dict,
  ) -> ui.FormCard:
      """
      Card for handling crash.
      """
  
      q_app_str = (
          "### q.app\n```"
          + "\n".join(
              [
                  f"{k}: {v}"
                  for k, v in q_app.items()
                  if "_key" not in k and "_token not in k"
              ]
          )
          + "\n```"
      )
      q_user_str = (
          "### q.user\n```"
          + "\n".join(
              [
                  f"{k}: {v}"
                  for k, v in q_user.items()
                  if "_key" not in k and "_token" not in k
              ]
          )
          + "\n```"
      )
  
      q_client_str = (
          "### q.client\n```"
          + "\n".join(
              [
                  f"{k}: {v}"
                  for k, v in q_client.items()
                  if "_key" not in k and "_token" not in k
              ]
          )
          + "\n```"
      )
      q_events_str = (
          "### q.events\n```"
          + "\n".join(
              [
                  f"{k}: {v}"
                  for k, v in q_events.items()
                  if "_key" not in k and "_token" not in k
              ]
          )
          + "\n```"
      )
      q_args_str = (
          "### q.args\n```"
          + "\n".join(
              [
                  f"{k}: {v}"
                  for k, v in q_args.items()
                  if "_key" not in k and "_token" not in k
              ]
          )
          + "\n```"
      )
  
      type_, value_, traceback_ = sys.exc_info()
      stack_trace = traceback.format_exception(
          type_, value_, traceback_
      )
      git_version = subprocess.getoutput("git rev-parse HEAD")
      if not q.app.wave_utils_stack_trace_str:
          q.app.wave_utils_stack_trace_str = (
              "### stacktrace\n" + "\n".join(stack_trace)
          )
  
      card = ui.form_card(
          box=box,
          items=[
              ui.stats(
                  items=[
                      ui.stat(
                          label="",
                          value="Oops!",
                          caption="Something went wrong",
                          icon="Error",
                          icon_color="#CDDD38",
                      )
                  ],
                  justify="center",
              ),
              ui.separator(),
              ui.text_l(
                  content="<center>Apologies for the inconvenience!</center>"
              ),
              ui.buttons(
                  items=[
                      ui.button(
                          name="home", label="Restart", primary=True
                      ),
                      ui.button(
                          name="report_error",
                          label="Report",
                          primary=True,
                      ),
                  ],
                  justify="center",
              ),
              ui.separator(visible=False),
              ui.text(
                  content=f"""<center>
                      To report this error,
                      please open an issues on Github <a href={github}>{github}</a>
                      with the details below:</center>""",
                  visible=False,
              ),
              ui.text_l(
                  content=f"Report Issue: {app_name}", visible=False
              ),
              ui.text_xs(content=q_app_str, visible=False),
              ui.text_xs(content=q_user_str, visible=False),
              ui.text_xs(content=q_client_str, visible=False),
              ui.text_xs(content=q_events_str, visible=False),
              ui.text_xs(content=q_args_str, visible=False),
              ui.text_xs(
                  content=q.app.wave_utils_stack_trace_str,
                  visible=False,
              ),
              ui.text_xs(content=f"### Error\n {error}", visible=False),
              ui.text_xs(
                  content=f"### Git Version\n {git_version}",
                  visible=False,
              ),
          ],
      )
  
      return card
  
file_path: h2o-llmstudio/llm_studio/app_utils/wave_utils.py
imports: import subprocess
  import sys
  import traceback
  from typing import TypedDict
  import pandas
  from h2o_wave import Q, expando_to_dict, ui
  from h2o_wave.types import Component
  from llm_studio.app_utils.sections.common import clean_dashboard
  from .config import default_cfg
label_desc: Use image node_id 2 for calling a global function with example usage: wave_utils_error_card(q, box, app_name, github, q_app, error, q_user, q_client, q_events, q_args) and returns: card