code: def _read_annotations_brainvision(fname, sfreq="auto"):
      """Create Annotations from BrainVision vmrk/amrk.
  
      This function reads a .vmrk or .amrk file and makes an
      :class:`mne.Annotations` object.
  
      Parameters
      ----------
      fname : str | object
          The path to the .vmrk/.amrk file.
      sfreq : float | 'auto'
          The sampling frequency in the file. It's necessary
          as Annotations are expressed in seconds and vmrk/amrk
          files are in samples. If set to 'auto' then
          the sfreq is taken from the .vhdr/.ahdr file that
          has the same name (without file extension). So
          data.vmrk/amrk looks for sfreq in data.vhdr or,
          if it does not exist, in data.ahdr.
  
      Returns
      -------
      annotations : instance of Annotations
          The annotations present in the file.
      """
      onset, duration, description, date_str = _read_mrk(fname)
      orig_time = _str_to_meas_date(date_str)
  
      if sfreq == "auto":
          hdr_fname = op.splitext(fname)[0] + ".vhdr"
          # if vhdr file does not exist assume that the format is ahdr
          if not op.exists(hdr_fname):
              hdr_fname = op.splitext(fname)[0] + ".ahdr"
          logger.info(
              "Finding 'sfreq' from header file: %s" % hdr_fname
          )
          _, _, _, info = _aux_hdr_info(hdr_fname)
          sfreq = info["sfreq"]
  
      onset = np.array(onset, dtype=float) / sfreq
      duration = np.array(duration, dtype=float) / sfreq
      annotations = Annotations(
          onset=onset,
          duration=duration,
          description=description,
          orig_time=orig_time,
      )
      return annotations
  
imports: import configparser
  import os
  import os.path
  import re
  from datetime import datetime, timezone
  from io import StringIO
  import numpy
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _empty_info
  from ..._fiff.utils import _mult_cal_one, _read_segments_file
  from ...annotations import Annotations, read_annotations
  from ...channels import make_dig_montage
  from ...defaults import HEAD_SIZE_DEFAULT
  from ...transforms import _sph_to_cart
  from ...utils import _DefaultEventParser, fill_doc, logger, verbose, warn
  from ..base import BaseRaw
label_desc: Use image node_id 3 for calling a global function with example usage: _read_annotations_brainvision(fname, sfreq) and returns: annotations