code: def test_get_data_reject():
      """Test if reject_by_annotation is working correctly."""
      fs = 256
      ch_names = ["C3", "Cz", "C4"]
      info = create_info(ch_names, sfreq=fs)
      raw = RawArray(np.zeros((len(ch_names), 10 * fs)), info)
      raw.set_annotations(
          Annotations(onset=[2, 4], duration=[3, 2], description="bad")
      )
  
      with catch_logging() as log:
          data = raw.get_data(reject_by_annotation="omit", verbose=True)
          msg = (
              "Omitting 1024 of 2560 (40.00%) samples, retaining 1536"
              + " (60.00%) samples."
          )
          assert log.getvalue().strip() == msg
      assert data.shape == (len(ch_names), 1536)
      with catch_logging() as log:
          data = raw.get_data(reject_by_annotation="nan", verbose=True)
          msg = (
              "Setting 1024 of 2560 (40.00%) samples to NaN, retaining 1536"
              + " (60.00%) samples."
          )
          assert log.getvalue().strip() == msg
      assert data.shape == (len(ch_names), 2560)  # shape doesn't change
      assert np.isnan(data).sum() == 3072
  
imports: import math
  import os
  import re
  from contextlib import redirect_stdout
  from io import StringIO
  from os import path
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_array_less
  import mne
  from mne import Annotations, concatenate_raws, create_info, pick_types
  from mne._fiff._digitization import DigPoint, _dig_kind_dict
  from mne._fiff.constants import FIFF
  from mne._fiff.meas_info import Info, _get_valid_units, _writing_info_hdf5
  from mne._fiff.pick import _ELECTRODE_CH_TYPES, _FNIRS_CH_TYPES_SPLIT
  from mne._fiff.proj import Projection
  from mne._fiff.utils import _mult_cal_one
  from mne.fixes import _numpy_h5py_dep
  from mne.io import BaseRaw, RawArray, read_raw_fif
  from mne.io.base import _get_scaling
  from mne.transforms import Transform
  from mne.utils import _import_h5io_funcs, _raw_annot, _stamp_to_dt, _TempDir, catch_logging, check_version, object_diff
label_desc: Use image node_id 11 for calling a global function with example usage: test_get_data_reject() without return types