code: def test_raw_reject(first_samp):
      """Test raw data getter with annotation reject."""
      sfreq = 100.0
      info = create_info(
          ["a", "b", "c", "d", "e"], sfreq, ch_types="eeg"
      )
      raw = RawArray(np.ones((5, 15000)), info, first_samp=first_samp)
      with pytest.warns(RuntimeWarning, match="outside the data range"):
          raw.set_annotations(
              Annotations([2, 100, 105, 148], [2, 8, 5, 8], "BAD")
          )
      data, times = raw.get_data(
          [0, 1, 3, 4],
          100,
          11200,
          "omit",
          return_times=True,  # 1-112 s
      )
      bad_times = np.concatenate(
          [
              np.arange(200, 400),
              np.arange(10000, 10800),
              np.arange(10500, 11000),
          ]
      )
      expected_times = (
          np.setdiff1d(np.arange(100, 11200), bad_times) / sfreq
      )
      assert_allclose(times, expected_times)
  
      # with orig_time and complete overlap
      raw = read_raw_fif(fif_fname)
      raw.set_annotations(
          Annotations(
              onset=np.array([1, 4, 5], float) + raw._first_time,
              duration=[1, 3, 1],
              description="BAD",
              orig_time=raw.info["meas_date"],
          )
      )
      t_stop = 18.0
      assert raw.times[-1] > t_stop
      n_stop = int(round(t_stop * raw.info["sfreq"]))
      n_drop = int(round(4 * raw.info["sfreq"]))
      assert len(raw.times) >= n_stop
      data, times = raw.get_data(range(10), 0, n_stop, "omit", True)
      assert data.shape == (10, n_stop - n_drop)
      assert times[-1] == raw.times[n_stop - 1]
      assert_array_equal(
          data[:, -100:], raw[:10, n_stop - 100 : n_stop][0]
      )
  
      data, times = raw.get_data(range(10), 0, n_stop, "NaN", True)
      assert_array_equal(data.shape, (10, n_stop))
      assert times[-1] == raw.times[n_stop - 1]
      t_1, t_2 = raw.time_as_index([1, 2], use_rounding=True)
      assert np.isnan(data[:, t_1:t_2]).all()  # 1s -2s
      assert not np.isnan(data[:, :t_1].any())
      assert not np.isnan(data[:, t_2:].any())
      assert_array_equal(
          data[:, -100:], raw[:10, n_stop - 100 : n_stop][0]
      )
      assert_array_equal(raw.get_data(), raw[:][0])
  
      # Test _sync_onset
      times = np.array([10, -88, 190], float)
      onsets = _sync_onset(raw, times)
      assert_array_almost_equal(
          onsets, times - raw.first_samp / raw.info["sfreq"]
      )
      assert_array_almost_equal(times, _sync_onset(raw, onsets, True))
  
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 11 for calling a global function with example usage: test_raw_reject(first_samp) without return types