code: def _write(fid, data, kind, data_size, FIFFT_TYPE, dtype):
      """Write data."""
      if isinstance(data, np.ndarray):
          data_size *= data.size
  
      # XXX for string types the data size is used as
      # computed in ``write_string``.
  
      fid.write(np.array(kind, dtype=">i4").tobytes())
      fid.write(np.array(FIFFT_TYPE, dtype=">i4").tobytes())
      fid.write(np.array(data_size, dtype=">i4").tobytes())
      fid.write(np.array(FIFF.FIFFV_NEXT_SEQ, dtype=">i4").tobytes())
      fid.write(np.array(data, dtype=dtype).tobytes())
  
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 1 for calling a global function with example usage: _write(fid, data, kind, data_size, FIFFT_TYPE, dtype) without return types