code: def _eeg_has_montage_information(eeg):
      try:
          from scipy.io.matlab import mat_struct
      except ImportError:  # SciPy < 1.8
          from scipy.io.matlab.mio5_params import mat_struct
      if not len(eeg.chanlocs):
          has_pos = False
      else:
          pos_fields = ["X", "Y", "Z"]
          if isinstance(eeg.chanlocs[0], mat_struct):
              has_pos = all(
                  hasattr(eeg.chanlocs[0], fld) for fld in pos_fields
              )
          elif isinstance(eeg.chanlocs[0], np.ndarray):
              # Old files
              has_pos = all(
                  fld in eeg.chanlocs[0].dtype.names
                  for fld in pos_fields
              )
          elif isinstance(eeg.chanlocs[0], dict):
              # new files
              has_pos = all(
                  fld in eeg.chanlocs[0] for fld in pos_fields
              )
          else:
              has_pos = False  # unknown (sometimes we get [0, 0])
  
      return has_pos
  
imports: import os.path
  from os import PathLike
  from pathlib import Path
  import numpy
  from mne.utils.check import _check_option
  from ..._fiff._digitization import _ensure_fiducials_head
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import create_info
  from ..._fiff.pick import _PICK_TYPES_KEYS
  from ..._fiff.utils import _find_channels, _read_segments_file
  from ...annotations import Annotations, read_annotations
  from ...channels import make_dig_montage
  from ...defaults import DEFAULTS
  from ...epochs import BaseEpochs
  from ...event import read_events
  from ...utils import Bunch, _check_fname, _check_head_radius, fill_doc, logger, verbose, warn
  from ..base import BaseRaw
  from ._eeglab import _readmat
label_desc: Use image node_id 4 for calling a global function with example usage: _eeg_has_montage_information(eeg) and returns: has_pos