code: def _find_kit_layout(info, n_grads):
      """Determine the KIT layout.
  
      Parameters
      ----------
      %(info_not_none)s
      n_grads : int
          Number of KIT-gradiometers in the info.
  
      Returns
      -------
      kit_layout : str | None
          String naming the detected KIT layout or ``None`` if layout is missing.
      """
      from ..io.kit.constants import KIT_LAYOUT
  
      if info["kit_system_id"] is not None:
          # avoid circular import
          return KIT_LAYOUT.get(info["kit_system_id"])
      elif n_grads == 160:
          return "KIT-160"
      elif n_grads == 125:
          return "KIT-125"
      elif n_grads > 157:
          return "KIT-AD"
  
      # channels which are on the left hemisphere for NY and right for UMD
      test_chs = (
          "MEG  13",
          "MEG  14",
          "MEG  15",
          "MEG  16",
          "MEG  25",
          "MEG  26",
          "MEG  27",
          "MEG  28",
          "MEG  29",
          "MEG  30",
          "MEG  31",
          "MEG  32",
          "MEG  57",
          "MEG  60",
          "MEG  61",
          "MEG  62",
          "MEG  63",
          "MEG  64",
          "MEG  73",
          "MEG  90",
          "MEG  93",
          "MEG  95",
          "MEG  96",
          "MEG 105",
          "MEG 112",
          "MEG 120",
          "MEG 121",
          "MEG 122",
          "MEG 123",
          "MEG 124",
          "MEG 125",
          "MEG 126",
          "MEG 142",
          "MEG 144",
          "MEG 153",
          "MEG 154",
          "MEG 155",
          "MEG 156",
      )
      x = [
          ch["loc"][0] < 0
          for ch in info["chs"]
          if ch["ch_name"] in test_chs
      ]
      if np.all(x):
          return "KIT-157"  # KIT-NY
      elif np.all(np.invert(x)):
          raise NotImplementedError(
              "Guessing sensor layout for legacy UMD "
              "files is not implemented. Please convert "
              "your files using MNE-Python 0.13 or "
              "higher."
          )
      else:
          raise RuntimeError(
              "KIT system could not be determined for data"
          )
  
imports: import logging
  from collections import defaultdict
  from itertools import combinations
  from pathlib import Path
  import numpy
  from scipy.spatial.distance import pdist, squareform
  from .._fiff.constants import FIFF
  from .._fiff.meas_info import Info
  from .._fiff.pick import _FNIRS_CH_TYPES_SPLIT, _picks_to_idx, pick_types
  from ..transforms import _cart_to_sph, _pol_to_cart
  from ..utils import _check_ch_locs, _check_fname, _check_option, _check_sphere, _clean_names, fill_doc, logger, warn
  from ..viz.topomap import plot_layout
  from .channels import _get_ch_info
label_desc: Use image node_id 7 for calling a global function with example usage: _find_kit_layout(info, n_grads) and returns: KIT_LAYOUT, str, str, str, str