code: def sys_info(
      fid=None,
      show_paths=False,
      *,
      dependencies="user",
      unicode=True,
      check_version=True,
  ):
      """Print system information.
  
      This function prints system information useful when triaging bugs.
  
      Parameters
      ----------
      fid : file-like | None
          The file to write to. Will be passed to :func:`print()`. Can be None to
          use :data:`sys.stdout`.
      show_paths : bool
          If True, print paths for each module.
      dependencies : 'user' | 'developer'
          Show dependencies relevant for users (default) or for developers
          (i.e., output includes additional dependencies).
      unicode : bool
          Include Unicode symbols in output.
  
          .. versionadded:: 0.24
      check_version : bool | float
          If True (default), attempt to check that the version of MNE-Python is up to date
          with the latest release on GitHub. Can be a float to give a different timeout
          (in sec) from the default (2 sec).
  
          .. versionadded:: 1.6
      """
      _validate_type(dependencies, str)
      _check_option("dependencies", dependencies, ("user", "developer"))
      _validate_type(check_version, (bool, "numeric"), "check_version")
      ljust = 24 if dependencies == "developer" else 21
      platform_str = platform.platform()
  
      out = partial(print, end="", file=fid)
      out("Platform".ljust(ljust) + platform_str + "\n")
      out(
          "Python".ljust(ljust)
          + str(sys.version).replace("\n", " ")
          + "\n"
      )
      out("Executable".ljust(ljust) + sys.executable + "\n")
      out("CPU".ljust(ljust) + f"{platform.processor()} ")
      out(f"({multiprocessing.cpu_count()} cores)\n")
      out("Memory".ljust(ljust))
      try:
          import psutil
      except ImportError:
          out('Unavailable (requires "psutil" package)')
      else:
          out(
              f"{psutil.virtual_memory().total / float(2 ** 30):0.1f} GB\n"
          )
      out("\n")
      ljust -= 3  # account for +/- symbols
      libs = _get_numpy_libs()
      unavailable = []
      use_mod_names = (
          "# Core",
          "mne",
          "numpy",
          "scipy",
          "matplotlib",
          "pooch",
          "jinja2",
          "",
          "# Numerical (optional)",
          "sklearn",
          "numba",
          "nibabel",
          "nilearn",
          "dipy",
          "openmeeg",
          "cupy",
          "pandas",
          "",
          "# Visualization (optional)",
          "pyvista",
          "pyvistaqt",
          "vtk",
          "qtpy",
          "ipympl",
          "pyqtgraph",
          "mne-qt-browser",
          "ipywidgets",
          # "trame",  # no version, see https://github.com/Kitware/trame/issues/183
          "trame_client",
          "trame_server",
          "trame_vtk",
          "trame_vuetify",
          "",
          "# Ecosystem (optional)",
          "mne-bids",
          "mne-nirs",
          "mne-features",
          "mne-connectivity",
          "mne-icalabel",
          "mne-bids-pipeline",
          "neo",
          "",
      )
      if dependencies == "developer":
          use_mod_names += (
              "# Testing",
              "pytest",
              "nbclient",
              "numpydoc",
              "flake8",
              "pydocstyle",
              "",
              "# Documentation",
              "sphinx",
              "sphinx-gallery",
              "pydata-sphinx-theme",
              "",
          )
      try:
          unicode = unicode and (
              sys.stdout.encoding.lower().startswith("utf")
          )
      except (
          Exception
      ):  # in case someone overrides sys.stdout in an unsafe way
          unicode = False
      mne_version_good = True
      for mi, mod_name in enumerate(use_mod_names):
          # upcoming break
          if mod_name == "":  # break
              if unavailable:
                  out("└☐ " if unicode else " - ")
                  out("unavailable".ljust(ljust))
                  out(f"{', '.join(unavailable)}\n")
                  unavailable = []
              if mi != len(use_mod_names) - 1:
                  out("\n")
              continue
          elif mod_name.startswith("# "):  # header
              mod_name = mod_name.replace("# ", "")
              out(f"{mod_name}\n")
              continue
          pre = "├"
          last = use_mod_names[mi + 1] == "" and not unavailable
          if last:
              pre = "└"
          try:
              mod = import_module(mod_name.replace("-", "_"))
          except Exception:
              unavailable.append(mod_name)
          else:
              mark = "☑" if unicode else "+"
              mne_extra = ""
              if mod_name == "mne" and check_version:
                  timeout = (
                      2.0
                      if check_version is True
                      else float(check_version)
                  )
                  mne_version_good, mne_extra = _check_mne_version(
                      timeout
                  )
                  if mne_version_good is None:
                      mne_version_good = True
                  elif not mne_version_good:
                      mark = "☒" if unicode else "X"
              out(f"{pre}{mark} " if unicode else f" {mark} ")
              out(f"{mod_name}".ljust(ljust))
              if mod_name == "vtk":
                  vtk_version = mod.vtkVersion()
                  # 9.0 dev has VersionFull but 9.0 doesn't
                  for attr in ("GetVTKVersionFull", "GetVTKVersion"):
                      if hasattr(vtk_version, attr):
                          version = getattr(vtk_version, attr)()
                          if version != "":
                              out(version)
                              break
                  else:
                      out("unknown")
              else:
                  out(mod.__version__.lstrip("v"))
              if mod_name == "numpy":
                  out(f" ({libs})")
              elif mod_name == "qtpy":
                  version, api = _check_qt_version(return_api=True)
                  out(f" ({api}={version})")
              elif mod_name == "matplotlib":
                  out(f" (backend={mod.get_backend()})")
              elif mod_name == "pyvista":
                  version, renderer = _get_gpu_info()
                  if version is None:
                      out(" (OpenGL unavailable)")
                  else:
                      out(f" (OpenGL {version} via {renderer})")
              elif mod_name == "mne":
                  out(f" ({mne_extra})")
              # Now comes stuff after the version
              if show_paths:
                  if last:
                      pre = "   "
                  elif unicode:
                      pre = "│  "
                  else:
                      pre = " | "
                  out(f'\n{pre}{" " * ljust}{op.dirname(mod.__file__)}')
              out("\n")
  
      if not mne_version_good:
          out(
              "\nTo update to the latest supported release version to get bugfixes and "
              "improvements, visit "
              "https://mne.tools/stable/install/updating.html\n"
          )
  
imports: import atexit
  import json
  import multiprocessing
  import os
  import os.path
  import platform
  import shutil
  import subprocess
  import sys
  import tempfile
  from functools import lru_cache, partial
  from importlib import import_module
  from pathlib import Path
  from urllib.error import URLError
  from urllib.request import urlopen
  from packaging.version import parse
  from ._logging import logger, warn
  from .check import _check_fname, _check_option, _check_qt_version, _validate_type
  from .docs import fill_doc
  from .misc import _pl
label_desc: Use image node_id 13 for calling a global function with example usage: sys_info(fid, show_paths) without return types