code: def _read_locs(filepath, egi_info, channel_naming):
      """Read channel locations."""
      _soft_import("defusedxml", "reading EGI MFF data")
      from defusedxml.minidom import parse
  
      fname = op.join(filepath, "coordinates.xml")
      if not op.exists(fname):
          logger.warn(
              "File coordinates.xml not found, not setting channel locations"
          )
          ch_names = [
              channel_naming % (i + 1)
              for i in range(egi_info["n_channels"])
          ]
          return ch_names, None
      dig_ident_map = {
          "Left periauricular point": "lpa",
          "Right periauricular point": "rpa",
          "Nasion": "nasion",
      }
      numbers = np.array(egi_info["numbers"])
      coordinates = parse(fname)
      sensors = coordinates.getElementsByTagName("sensor")
      ch_pos = OrderedDict()
      hsp = list()
      nlr = dict()
      ch_names = list()
  
      for sensor in sensors:
          name_element = sensor.getElementsByTagName("name")[
              0
          ].firstChild
          num_element = sensor.getElementsByTagName("number")[
              0
          ].firstChild
          name = (
              channel_naming % int(num_element.data)
              if name_element is None
              else name_element.data
          )
          nr = num_element.data.encode()
          coords = [
              float(
                  sensor.getElementsByTagName(coord)[0].firstChild.data
              )
              for coord in "xyz"
          ]
          loc = np.array(coords) / 100  # cm -> m
          # create dig entry
          if name in dig_ident_map:
              nlr[dig_ident_map[name]] = loc
          else:
              # id_ is the index of the channel in egi_info['numbers']
              id_ = np.flatnonzero(numbers == nr)
              # if it's not in egi_info['numbers'], it's a headshape point
              if len(id_) == 0:
                  hsp.append(loc)
              # not HSP, must be a data or reference channel
              else:
                  ch_names.append(name)
                  ch_pos[name] = loc
      mon = make_dig_montage(ch_pos=ch_pos, hsp=hsp, **nlr)
      return ch_names, mon
  
imports: import datetime
  import math
  import os.path
  import re
  from collections import OrderedDict
  from pathlib import Path
  import numpy
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _empty_info, _ensure_meas_date_none_or_dt, create_info
  from ..._fiff.proj import setup_proj
  from ..._fiff.utils import _create_chs, _mult_cal_one
  from ...annotations import Annotations
  from ...channels.montage import make_dig_montage
  from ...evoked import EvokedArray
  from ...utils import _check_fname, _check_option, _soft_import, logger, verbose, warn
  from ..base import BaseRaw
  from .events import _combine_triggers, _read_events
  from .general import _block_r, _extract, _get_blocks, _get_ep_info, _get_gains, _get_signalfname
label_desc: Use image node_id 4 for calling a global function with example usage: _read_locs(filepath, egi_info, channel_naming) and returns: ch_names,  mon, ch_names,  None