code: def write_string(fid, kind, data):
      """Write a string tag."""
      try:
          str_data = str(data).encode("latin1")
      except UnicodeEncodeError:
          str_data = str(data).encode(
              "latin1", errors="xmlcharrefreplace"
          )
      data_size = len(str_data)  # therefore compute size here
      if data_size > 0:
          _write(
              fid, str_data, kind, data_size, FIFF.FIFFT_STRING, ">S"
          )
  
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 11 for calling a global function with example usage: write_string(fid, kind, data) without return types