code: def _get_markers(fname):
      def consume(
          fid, predicate
      ):  # just a consumer to move around conveniently
          while predicate(fid.readline()):
              pass
  
      def parse_marker(
          string,
      ):  # XXX: there should be a nicer way to do that
          data = np.genfromtxt(
              BytesIO(string.encode()),
              dtype=[("trial", int), ("sync", float)],
          )
          return int(data["trial"]), float(data["sync"])
  
      markers = dict()
      with open(fname) as fid:
          consume(
              fid,
              lambda line: not line.startswith("NUMBER OF MARKERS:"),
          )
          num_of_markers = int(fid.readline())
  
          for _ in range(num_of_markers):
              consume(fid, lambda line: not line.startswith("NAME:"))
              label = fid.readline().strip("\n")
  
              consume(
                  fid,
                  lambda line: not line.startswith(
                      "NUMBER OF SAMPLES:"
                  ),
              )
              n_markers = int(fid.readline())
  
              consume(
                  fid,
                  lambda line: not line.startswith("LIST OF SAMPLES:"),
              )
              next(fid)  # skip the samples header
              markers[label] = [
                  parse_marker(next(fid)) for _ in range(n_markers)
              ]
  
      return markers
  
file_path: mne-python/mne/io/ctf/markers.py
imports: import os.path
  from io import BytesIO
  import numpy
  from ...annotations import Annotations
  from .info import _convert_time
  from .res4 import _read_res4
label_desc: Use image node_id 1 for calling a global function with example usage: _get_markers(fname) and returns: markers, int,  float