code: def _calibrate_comp(
      comp,
      chs,
      row_names,
      col_names,
      mult_keys=("range", "cal"),
      flip=False,
  ):
      """Get row and column cals."""
      ch_names = [c["ch_name"] for c in chs]
      row_cals = np.zeros(len(row_names))
      col_cals = np.zeros(len(col_names))
      for names, cals, inv in zip(
          (row_names, col_names), (row_cals, col_cals), (False, True)
      ):
          for ii in range(len(cals)):
              p = ch_names.count(names[ii])
              if p != 1:
                  raise RuntimeError(
                      "Channel %s does not appear exactly once "
                      "in data, found %d instance%s"
                      % (names[ii], p, _pl(p))
                  )
              idx = ch_names.index(names[ii])
              val = chs[idx][mult_keys[0]] * chs[idx][mult_keys[1]]
              val = float(1.0 / val) if inv else float(val)
              val = 1.0 / val if flip else val
              cals[ii] = val
      comp["rowcals"] = row_cals
      comp["colcals"] = col_cals
      comp["data"]["data"] = (
          row_cals[:, None] * comp["data"]["data"] * col_cals[None, :]
      )
  
file_path: mne-python/mne/_fiff/ctf_comp.py
imports: from copy import deepcopy
  import numpy
  from ..utils import _pl, logger, verbose
  from .constants import FIFF
  from .matrix import _read_named_matrix, write_named_matrix
  from .tag import read_tag
  from .tree import dir_tree_find
  from .write import end_block, start_block, write_int
label_desc: Use image node_id 2 for calling a global function with example usage: _calibrate_comp(comp, chs, row_names, col_names, mult_keys, flip) without return types