code: def _fix_matplotlib_crash() -> None:
      """Set Matplotlib backend to avoid a crash.
  
      The default Matplotlib backend crashes Python on OSX when run on a thread
      that's not the main thread, so here we set a safer backend as a fix.
      Users can always disable this behavior by setting the config
      runner.fixMatplotlib = false.
  
      This fix is OS-independent. We didn't see a good reason to make this
      Mac-only. Consistency within Streamlit seemed more important.
      """
      if config.get_option("runner.fixMatplotlib"):
          try:
              # TODO: a better option may be to set
              #  os.environ["MPLBACKEND"] = "Agg". We'd need to do this towards
              #  the top of __init__.py, before importing anything that imports
              #  pandas (which imports matplotlib). Alternately, we could set
              #  this environment variable in a new entrypoint defined in
              #  setup.py. Both of these introduce additional trickiness: they
              #  need to run without consulting streamlit.config.get_option,
              #  because this would import streamlit, and therefore matplotlib.
              import matplotlib
  
              matplotlib.use("Agg")
          except ImportError:
              # Matplotlib is not installed. No need to do anything.
              pass
  
imports: import asyncio
  import os
  import signal
  import sys
  from pathlib import Path
  from typing import Any, Dict, List
  import click
  from streamlit import config, env_util, file_util, net_util, secrets, url_util, util, version
  from streamlit.config import CONFIG_FILENAMES
  from streamlit.git_util import MIN_GIT_VERSION, GitRepo
  from streamlit.logger import get_logger
  from streamlit.source_util import invalidate_pages_cache
  from streamlit.watcher import report_watchdog_availability, watch_dir, watch_file
  from streamlit.web.server import Server, server_address_is_unix_socket, server_util
label_desc: Use image node_id 3 for calling a global function with example usage: _fix_matplotlib_crash() without return types