code: def _add_eeg_pos(eeg, t, c):
      """Pick the (virtual) EEG position data."""
      if eeg is None:
          return
      if t is None or t["t_ctf_head_head"] is None:
          raise RuntimeError(
              "No coordinate transformation available for EEG "
              "position data"
          )
      eeg_assigned = 0
      if eeg["assign_to_chs"]:
          for k in range(eeg["np"]):
              # Look for a channel name match
              for ch in c["chs"]:
                  if ch["ch_name"].lower() == eeg["labels"][k].lower():
                      r0 = ch["loc"][:3]
                      r0[:] = eeg["rr"][k]
                      if (
                          eeg["coord_frame"]
                          == FIFF.FIFFV_MNE_COORD_CTF_HEAD
                      ):
                          r0[:] = apply_trans(t["t_ctf_head_head"], r0)
                      elif eeg["coord_frame"] != FIFF.FIFFV_COORD_HEAD:
                          raise RuntimeError(
                              "Illegal coordinate frame for EEG electrode "
                              "positions : %s"
                              % _coord_frame_name(eeg["coord_frame"])
                          )
                      # Use the logical channel number as an identifier
                      eeg["ids"][k] = ch["logno"]
                      eeg["kinds"][k] = FIFF.FIFFV_POINT_EEG
                      eeg_assigned += 1
                      break
  
      # Add these to the Polhemus data
      fid_count = eeg_count = extra_count = 0
      for k in range(eeg["np"]):
          d = dict(
              r=eeg["rr"][k].copy(),
              kind=eeg["kinds"][k],
              ident=eeg["ids"][k],
              coord_frame=FIFF.FIFFV_COORD_HEAD,
          )
          c["dig"].append(d)
          if eeg["coord_frame"] == FIFF.FIFFV_MNE_COORD_CTF_HEAD:
              d["r"] = apply_trans(t["t_ctf_head_head"], d["r"])
          elif eeg["coord_frame"] != FIFF.FIFFV_COORD_HEAD:
              raise RuntimeError(
                  "Illegal coordinate frame for EEG electrode "
                  "positions: %s"
                  % _coord_frame_name(eeg["coord_frame"])
              )
          if eeg["kinds"][k] == FIFF.FIFFV_POINT_CARDINAL:
              fid_count += 1
          elif eeg["kinds"][k] == FIFF.FIFFV_POINT_EEG:
              eeg_count += 1
          else:
              extra_count += 1
      if eeg_assigned > 0:
          logger.info(
              "    %d EEG electrode locations assigned to channel info."
              % eeg_assigned
          )
      for count, kind in zip(
          (fid_count, eeg_count, extra_count),
          ("fiducials", "EEG locations", "extra points"),
      ):
          if count > 0:
              logger.info(
                  "    %d %s added to Polhemus data." % (count, kind)
              )
  
imports: import os.path
  from calendar import timegm
  from time import strptime
  import numpy
  from ..._fiff.constants import FIFF
  from ..._fiff.ctf_comp import _add_kind, _calibrate_comp
  from ..._fiff.meas_info import _empty_info
  from ..._fiff.write import get_new_file_id
  from ...annotations import Annotations
  from ...transforms import _coord_frame_name, apply_trans, combine_transforms, invert_transform
  from ...utils import _clean_names, logger, warn
  from .constants import CTF
label_desc: Use image node_id 12 for calling a global function with example usage: _add_eeg_pos(eeg, t, c) without return types