code: def test_annotation_duration_from_stim_groups():
      """Test annotation durations extracted correctly from stim group."""
      raw = read_raw_snirf(snirf_nirsport2_20219, preload=True)
      # Specify the expected SNIRF stim durations.
      # We can verify these values should be 10 by using the official
      # SNIRF package pysnirf2 and running the following script.
      # You will see that the print statement shows the middle column,
      # which represents duration, will be all 10s.
      # from snirf import Snirf
      # a = Snirf(snirf_nirsport2_20219, "r+"); print(a.nirs[0].stim[0].data)
      expected_durations = np.full((10,), 10.0)
      assert_equal(expected_durations, raw.annotations.duration)
  
imports: import shutil
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_almost_equal, assert_equal
  from mne._fiff.constants import FIFF
  from mne.datasets.testing import data_path, requires_testing_data
  from mne.io import read_raw_nirx, read_raw_snirf
  from mne.io.tests.test_raw import _test_raw_reader
  from mne.preprocessing.nirs import _reorder_nirx, beer_lambert_law, optical_density, short_channels, source_detector_distances
  from mne.transforms import _get_trans, apply_trans
  from mne.utils import catch_logging
label_desc: Use image node_id 14 for calling a global function with example usage: test_annotation_duration_from_stim_groups() without return types