code: def _check_preload(inst, msg):
      """Ensure data are preloaded."""
      from ..epochs import BaseEpochs
      from ..evoked import Evoked
      from ..time_frequency import _BaseTFR
      from ..time_frequency.spectrum import BaseSpectrum
  
      if isinstance(inst, (_BaseTFR, Evoked, BaseSpectrum)):
          pass
      else:
          name = "epochs" if isinstance(inst, BaseEpochs) else "raw"
          if not inst.preload:
              raise RuntimeError(
                  "By default, MNE does not load data into main memory to "
                  "conserve resources. "
                  + msg
                  + " requires %s data to be "
                  "loaded. Use preload=True (or string) in the constructor or "
                  "%s.load_data()." % (name, name)
              )
          if name == "epochs":
              inst._handle_empty("raise", msg)
  
imports: import numbers
  import operator
  import os
  import re
  from builtins import input
  from difflib import get_close_matches
  from importlib import import_module
  from pathlib import Path
  import numpy
  from ..defaults import HEAD_SIZE_DEFAULT, _handle_default
  from ..fixes import _compare_version, _median_complex
  from ._logging import _record_warnings, _verbose_safe_false, logger, verbose, warn
label_desc: Use image node_id 14 for calling a global function with example usage: _check_preload(inst, msg) without return types