code: def write_ch_info(fid, ch):
      """Write a channel information record to a fif file."""
      data_size = 4 * 13 + 4 * 7 + 16
  
      fid.write(np.array(FIFF.FIFF_CH_INFO, dtype=">i4").tobytes())
      fid.write(
          np.array(FIFF.FIFFT_CH_INFO_STRUCT, dtype=">i4").tobytes()
      )
      fid.write(np.array(data_size, dtype=">i4").tobytes())
      fid.write(np.array(FIFF.FIFFV_NEXT_SEQ, dtype=">i4").tobytes())
  
      #   Start writing fiffChInfoRec
      fid.write(np.array(ch["scanno"], dtype=">i4").tobytes())
      fid.write(np.array(ch["logno"], dtype=">i4").tobytes())
      fid.write(np.array(ch["kind"], dtype=">i4").tobytes())
      fid.write(np.array(ch["range"], dtype=">f4").tobytes())
      fid.write(np.array(ch["cal"], dtype=">f4").tobytes())
      fid.write(np.array(ch["coil_type"], dtype=">i4").tobytes())
      fid.write(
          np.array(ch["loc"], dtype=">f4").tobytes()
      )  # writing 12 values
  
      #   unit and unit multiplier
      fid.write(np.array(ch["unit"], dtype=">i4").tobytes())
      fid.write(np.array(ch["unit_mul"], dtype=">i4").tobytes())
  
      #   Finally channel name
      ch_name = ch["ch_name"][:15]
      fid.write(np.array(ch_name, dtype=">c").tobytes())
      fid.write(b"\0" * (16 - len(ch_name)))
  
imports: import os.path
  import re
  import time
  import uuid
  from contextlib import contextmanager
  from gzip import GzipFile
  import numpy
  from scipy.sparse import csc_matrix, csr_matrix
  from ..utils import _file_like, _validate_type, logger
  from ..utils.numerics import _cal_to_julian
  from .constants import FIFF
label_desc: Use image node_id 31 for calling a global function with example usage: write_ch_info(fid, ch) without return types