code: def _read_dig_montage_egi(
      fname,
      _scaling,
      _all_data_kwargs_are_none,
  ):
      if not _all_data_kwargs_are_none:
          raise ValueError(
              "hsp, hpi, elp, point_names, fif must all be "
              "None if egi is not None"
          )
      _check_fname(fname, overwrite="read", must_exist=True)
      defusedxml = _soft_import("defusedxml", "reading EGI montages")
      root = defusedxml.ElementTree.parse(fname).getroot()
      ns = root.tag[root.tag.index("{") : root.tag.index("}") + 1]
      sensors = root.find(f"{ns}sensorLayout/{ns}sensors")
      fids = dict()
      dig_ch_pos = dict()
  
      fid_name_map = {
          "Nasion": "nasion",
          "Right periauricular point": "rpa",
          "Left periauricular point": "lpa",
      }
  
      for s in sensors:
          name, number, kind = s[0].text, int(s[1].text), int(s[2].text)
          coordinates = np.array(
              [float(s[3].text), float(s[4].text), float(s[5].text)]
          )
  
          coordinates *= _scaling
  
          # EEG Channels
          if kind == 0:
              dig_ch_pos["EEG %03d" % number] = coordinates
          # Reference
          elif kind == 1:
              dig_ch_pos[
                  "EEG %03d" % (len(dig_ch_pos.keys()) + 1)
              ] = coordinates
          # Fiducials
          elif kind == 2:
              fid_name = fid_name_map[name]
              fids[fid_name] = coordinates
          # Unknown
          else:
              warn(
                  "Unknown sensor type %s detected. Skipping sensor..."
                  "Proceed with caution!" % kind
              )
  
      return Bunch(
          # EGI stuff
          nasion=fids["nasion"],
          lpa=fids["lpa"],
          rpa=fids["rpa"],
          ch_pos=dig_ch_pos,
          coord_frame="unknown",
      )
  
imports: import numpy
  from ..utils import Bunch, _check_fname, _soft_import, warn
label_desc: Use image node_id 1 for calling a global function with example usage: _read_dig_montage_egi(fname, _scaling, _all_data_kwargs_are_none) and returns: Bunch