code: def test_chunk_duration(first_samp):
      """Test chunk_duration."""
      # create dummy raw
      raw = RawArray(
          data=np.empty([10, 10], dtype=np.float64),
          info=create_info(ch_names=10, sfreq=1.0),
          first_samp=first_samp,
      )
      with raw.info._unlock():
          raw.info["meas_date"] = _handle_meas_date(0)
      raw.set_annotations(
          Annotations(
              description="foo",
              onset=[0],
              duration=[10],
              orig_time=None,
          )
      )
      assert raw.annotations.orig_time == raw.info["meas_date"]
      assert_allclose(raw.annotations.onset, [first_samp])
  
      # expected_events = [[0, 0, 1], [0, 0, 1], [1, 0, 1], [1, 0, 1], ..
      #                    [9, 0, 1], [9, 0, 1]]
      expected_events = np.atleast_2d(np.repeat(range(10), repeats=2)).T
      expected_events = np.insert(expected_events, 1, 0, axis=1)
      expected_events = np.insert(expected_events, 2, 1, axis=1)
      expected_events[:, 0] += first_samp
  
      events, events_id = events_from_annotations(
          raw, chunk_duration=0.5, use_rounding=False
      )
      assert_array_equal(events, expected_events)
  
      # test chunk durations that do not fit equally in annotation duration
      expected_events = np.zeros((3, 3))
      expected_events[:, -1] = 1
      expected_events[:, 0] = np.arange(0, 9, step=3) + first_samp
      events, events_id = events_from_annotations(
          raw, chunk_duration=3.0
      )
      assert_array_equal(events, expected_events)
  
imports: import sys
  from collections import OrderedDict
  from datetime import datetime, timedelta, timezone
  from itertools import repeat
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from pytest import approx
  import mne
  from mne import Annotations, Epochs, annotations_from_events, count_annotations, create_info, events_from_annotations, read_annotations
  from mne.annotations import _handle_meas_date, _read_annotations_txt_parse_header, _sync_onset
  from mne.datasets import testing
  from mne.io import RawArray, concatenate_raws, read_raw_fif
  from mne.utils import _dt_to_stamp, _raw_annot, _record_warnings, _stamp_to_dt, assert_and_remove_boundary_annot, catch_logging, check_version
label_desc: Use image node_id 6 for calling a global function with example usage: test_chunk_duration(first_samp) without return types