code: def _get_root_dir():
      """Get as close to the repo root as possible."""
      root_dir = Path(__file__).parents[1]
      up_dir = root_dir.parent
      if (up_dir / "setup.py").is_file() and all(
          (up_dir / x).is_dir() for x in ("mne", "examples", "doc")
      ):
          root_dir = up_dir
      return root_dir
  
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 10 for calling a global function with example usage: _get_root_dir() and returns: root_dir