code: def _load_config(config_path, raise_error=False):
      """Safely load a config file."""
      with open(config_path) as fid:
          try:
              config = json.load(fid)
          except ValueError:
              # No JSON object could be decoded --> corrupt file?
              msg = (
                  "The MNE-Python config file (%s) is not a valid JSON "
                  "file and might be corrupted" % config_path
              )
              if raise_error:
                  raise RuntimeError(msg)
              warn(msg)
              config = dict()
      return config
  
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 3 for calling a global function with example usage: _load_config(config_path, raise_error) and returns: config