code: def _check_comp_ch(cch, kind, desired=None):
      if desired is None:
          desired = cch["grad_order_no"]
      if cch["grad_order_no"] != desired:
          raise RuntimeError(
              "%s channel with inconsistent compensation "
              "grade %s, should be %s"
              % (kind, cch["grad_order_no"], desired)
          )
      return desired
  
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 5 for calling a global function with example usage: _check_comp_ch(cch, kind, desired) and returns: desired