code: def write_float_sparse(fid, kind, mat, fmt="auto"):
      """Write a single-precision floating-point sparse matrix tag."""
      if fmt == "auto":
          fmt = "csr" if isinstance(mat, csr_matrix) else "csc"
      if fmt == "csr":
          need = csr_matrix
          matrix_type = FIFF.FIFFT_SPARSE_RCS_MATRIX
      else:
          need = csc_matrix
          matrix_type = FIFF.FIFFT_SPARSE_CCS_MATRIX
      _validate_type(mat, need, "sparse")
      matrix_type = matrix_type | FIFF.FIFFT_MATRIX | FIFF.FIFFT_FLOAT
      nnzm = mat.nnz
      nrow = mat.shape[0]
      data_size = 4 * nnzm + 4 * nnzm + 4 * (nrow + 1) + 4 * 4
  
      fid.write(np.array(kind, dtype=">i4").tobytes())
      fid.write(np.array(matrix_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(mat.data, dtype=">f4").tobytes())
      fid.write(np.array(mat.indices, dtype=">i4").tobytes())
      fid.write(np.array(mat.indptr, dtype=">i4").tobytes())
  
      dims = [nnzm, mat.shape[0], mat.shape[1], 2]
      fid.write(np.array(dims, dtype=">i4").tobytes())
      check_fiff_length(fid)
  
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 35 for calling a global function with example usage: write_float_sparse(fid, kind, mat, fmt) without return types