code: def _check_annotation(
      raw, annot, meas_date, first_samp, start_idx, stop_idx
  ):
      """Util function to check an annotation."""
      assert meas_date == annot["orig_time"]
      if meas_date is None:
          assert np.isclose(
              raw.times[start_idx], annot["onset"], atol=1e-4
          )
          assert np.isclose(
              raw.times[stop_idx],
              annot["onset"] + annot["duration"],
              atol=1e-4,
          )
      else:
          first_time = (
              first_samp / raw.info["sfreq"]
          )  # because of meas_date
          assert np.isclose(
              raw.times[start_idx],
              annot["onset"] - first_time,
              atol=1e-4,
          )
          assert np.isclose(
              raw.times[stop_idx],
              annot["onset"] + annot["duration"] - first_time,
              atol=1e-4,
          )
  
file_path: mne-python/mne/preprocessing/tests/test_annotate_amplitude.py
imports: import datetime
  import itertools
  import re
  from pathlib import Path
  import numpy
  import pytest
  from mne import create_info
  from mne.annotations import Annotations
  from mne.datasets import testing
  from mne.io import RawArray, read_raw_fif
  from mne.preprocessing import annotate_amplitude
label_desc: Use image node_id 5 for calling a global function with example usage: _check_annotation(raw, annot, meas_date, first_samp, start_idx, stop_idx) without return types