code: def read_str(fid, count=1):
      """Read string from a binary file in a python version compatible way."""
      dtype = np.dtype(">S%i" % count)
      string = fid.read(dtype.itemsize)
      data = np.frombuffer(string, dtype=dtype)[0]
      bytestr = b"".join(
          [data[0 : data.index(b"\x00") if b"\x00" in data else count]]
      )
  
      return str(bytestr.decode("ascii"))
  
file_path: mne-python/mne/_fiff/utils.py
imports: import os
  import os.path
  import numpy
  from .constants import FIFF
  from .meas_info import _get_valid_units
label_desc: Use image node_id 7 for calling a global function with example usage: read_str(fid, count) and returns: str