def METHOD_NAME():
    """Test checking if datatype exists in raw data."""
    sfreq, n_points = 1024.0, int(1e6)
    rng = RandomState(99)
    info_eeg = mne.create_info(["ch1", "ch2", "ch3"], sfreq, ["eeg"] * 3)
    raw_eeg = mne.io.RawArray(rng.random((3, n_points)) * 1e-6, info_eeg)
    info_meg = mne.create_info(["ch1", "ch2", "ch3"], sfreq, ["mag"] * 3)
    raw_meg = mne.io.RawArray(rng.random((3, n_points)) * 1e-6, info_meg)
    info_ieeg = mne.create_info(["ch1", "ch2", "ch3"], sfreq, ["seeg"] * 3)
    raw_ieeg = mne.io.RawArray(rng.random((3, n_points)) * 1e-6, info_ieeg)
    # check behavior for unsupported data types
    for datatype in (None, "anat"):
        with pytest.raises(
            ValueError, match=f"The specified datatype " f"{datatype} is currently not"
        ):
            _check_datatype(raw_eeg, datatype)
    # check behavior for matching data type
    for raw, datatype in [(raw_eeg, "eeg"), (raw_meg, "meg"), (raw_ieeg, "ieeg")]:
        _check_datatype(raw, datatype)
    # check for missing data type
    for raw, datatype in [
        (raw_ieeg, "eeg"),
        (raw_meg, "eeg"),
        (raw_ieeg, "meg"),
        (raw_eeg, "meg"),
        (raw_meg, "ieeg"),
        (raw_eeg, "ieeg"),
    ]:
        with pytest.raises(
            ValueError, match=f"The specified datatype " f"{datatype} was not found"
        ):
            _check_datatype(raw, datatype)