code: def test_annot_meas_date_first_samp_crop(meas_date, first_samp):
      """Test yet another meas_date / first_samp issue."""
      sfreq = 1000.0
      info = mne.create_info(1, sfreq, "eeg")
      raw = mne.io.RawArray(
          np.random.RandomState(0).randn(1, 3000),
          info,
          first_samp=first_samp,
      )
      raw.set_meas_date(meas_date)
      onset = np.array([0, 1, 2], float)
      if meas_date is not None:
          onset += first_samp / sfreq
      annot = mne.Annotations(
          onset=onset,
          duration=[0.1, 0.2, 0.3],
          description=["a", "b", "c"],
          orig_time=raw.info["meas_date"],
      )
      assert len(annot) == 3
      raw.set_annotations(annot)
      assert len(raw.annotations) == 3
      raw_crop = raw.copy().crop(0, 1.5, verbose="debug")
      assert len(raw_crop.annotations) == 2
      assert_array_equal(
          raw_crop.annotations.description, annot.description[:2]
      )
      assert_array_equal(
          raw_crop.annotations.duration, annot.duration[:2]
      )
      # these two should be the equivalent
      raw_crop = raw.copy().crop(2, 2.5, verbose="debug")
      raw_crop_2 = raw.copy().crop(1, None).crop(1, 1.5)
      assert_allclose(raw_crop.get_data(), raw_crop_2.get_data())
      assert raw_crop.first_samp == raw_crop_2.first_samp
      want_onset = onset[2:]
      if meas_date is None:
          want_onset = want_onset + raw.first_time
      for this_raw in (raw_crop, raw_crop_2):
          assert len(this_raw.annotations) == 1
          assert_allclose(this_raw.annotations.onset, want_onset)
          assert_allclose(
              this_raw.annotations.duration, annot.duration[2:]
          )
  
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 49 for calling a global function with example usage: test_annot_meas_date_first_samp_crop(meas_date, first_samp) without return types