code: def _read_comp_coeff(fid, d):
      """Read compensation coefficients."""
      # Read the coefficients and initialize
      d["ncomp"] = _read_int2(fid)
      d["comp"] = list()
      # Read each record
      dt = np.dtype(
          [
              ("sensor_name", "S32"),
              ("coeff_type", ">i4"),
              ("d0", ">i4"),
              ("ncoeff", ">i2"),
              (
                  "sensors",
                  "S%s" % CTF.CTFV_SENSOR_LABEL,
                  CTF.CTFV_MAX_BALANCING,
              ),
              ("coeffs", ">f8", CTF.CTFV_MAX_BALANCING),
          ]
      )
      comps = np.fromfile(fid, dt, d["ncomp"])
      for k in range(d["ncomp"]):
          comp = dict()
          d["comp"].append(comp)
          comp["sensor_name"] = (
              comps["sensor_name"][k].split(b"\x00")[0].decode("utf-8")
          )
          comp["coeff_type"] = comps["coeff_type"][k].item()
          comp["ncoeff"] = comps["ncoeff"][k].item()
          comp["sensors"] = [
              s.split(b"\x00")[0].decode("utf-8")
              for s in comps["sensors"][k][: comp["ncoeff"]]
          ]
          comp["coeffs"] = comps["coeffs"][k][: comp["ncoeff"]]
          comp["scanno"] = d["ch_names"].index(comp["sensor_name"])
  
file_path: mne-python/mne/io/ctf/res4.py
imports: import os.path
  import numpy
  from ...utils import logger
  from .constants import CTF
label_desc: Use image node_id 9 for calling a global function with example usage: _read_comp_coeff(fid, d) without return types