code: def _get_meg_system(info):
      """Educated guess for the helmet type based on channels."""
      have_helmet = True
      for ch in info["chs"]:
          if ch["kind"] == FIFF.FIFFV_MEG_CH:
              # Only take first 16 bits, as higher bits store CTF grad comp order
              coil_type = ch["coil_type"] & 0xFFFF
              nmag = np.sum(
                  [c["kind"] == FIFF.FIFFV_MEG_CH for c in info["chs"]]
              )
              if coil_type == FIFF.FIFFV_COIL_NM_122:
                  system = "122m"
                  break
              elif (
                  coil_type // 1000 == 3
              ):  # All Vectorview coils are 30xx
                  system = "306m"
                  break
              elif (
                  coil_type == FIFF.FIFFV_COIL_MAGNES_MAG
                  or coil_type == FIFF.FIFFV_COIL_MAGNES_GRAD
              ):
                  system = (
                      "Magnes_3600wh" if nmag > 150 else "Magnes_2500wh"
                  )
                  break
              elif coil_type == FIFF.FIFFV_COIL_CTF_GRAD:
                  system = "CTF_275"
                  break
              elif coil_type == FIFF.FIFFV_COIL_KIT_GRAD:
                  system = "KIT"
                  # Our helmet does not match very well, so let's just create it
                  have_helmet = False
                  break
              elif coil_type == FIFF.FIFFV_COIL_BABY_GRAD:
                  system = "BabySQUID"
                  break
              elif coil_type == FIFF.FIFFV_COIL_ARTEMIS123_GRAD:
                  system = "ARTEMIS123"
                  have_helmet = False
                  break
              elif coil_type == FIFF.FIFFV_COIL_KERNEL_OPM_MAG_GEN1:
                  system = "Kernel_Flux"
                  have_helmet = True
                  break
      else:
          system = "unknown"
          have_helmet = False
      return system, have_helmet
  
imports: import os.path
  import string
  import sys
  from collections import OrderedDict
  from copy import deepcopy
  from dataclasses import dataclass
  from functools import partial
  from pathlib import Path
  from typing import Union
  import numpy
  from scipy.io import loadmat
  from scipy.sparse import csr_matrix, lil_matrix
  from scipy.spatial import Delaunay
  from scipy.stats import zscore
  from .._fiff.constants import FIFF
  from .._fiff.meas_info import Info, MontageMixin, _merge_info, _rename_comps, _unit2human, create_info
  from .._fiff.pick import _check_excludes_includes, _pick_data_channels, _picks_by_type, _picks_to_idx, _second_rules, channel_indices_by_type, channel_type, pick_channels, pick_info, pick_types
  from .._fiff.proj import setup_proj
  from .._fiff.reference import add_reference_channels, set_eeg_reference
  from .._fiff.tag import _rename_list
  from ..bem import _check_origin
  from ..defaults import HEAD_SIZE_DEFAULT, _handle_default
  from ..utils import _check_dict_keys, _check_fname, _check_option, _check_preload, _get_stim_channel, _on_missing, _validate_type, fill_doc, legacy, logger, verbose, warn
label_desc: Use image node_id 1 for calling a global function with example usage: _get_meg_system(info) and returns: system,  have_helmet