def METHOD_NAME():
    """Test stockwell functions."""
    raw = read_raw_fif(raw_fname)
    event_id, tmin, tmax = 1, -0.2, 0.5
    event_name = base_dir / "test-eve.fif"
    events = read_events(event_name)
    epochs = Epochs(
        raw,
        events,  # XXX pick 2 has epochs of zeros.
        event_id,
        tmin,
        tmax,
        picks=[0, 1, 3],
    )
    for fmin, fmax in [(None, 50), (5, 50), (5, None)]:
        power, itc = tfr_stockwell(epochs, fmin=fmin, fmax=fmax, return_itc=True)
        if fmax is not None:
            assert power.freqs.max() <= fmax
        power_evoked = tfr_stockwell(
            epochs.average(), fmin=fmin, fmax=fmax, return_itc=False
        )
        # for multitaper these don't necessarily match, but they seem to
        # for stockwell... if this fails, this maybe could be changed
        # just to check the shape
        assert_array_almost_equal(power_evoked.data, power.data)
    assert isinstance(power, AverageTFR)
    assert isinstance(itc, AverageTFR)
    assert_equal(power.data.shape, itc.data.shape)
    assert itc.data.min() >= 0.0
    assert itc.data.max() <= 1.0
    assert np.log(power.data.max()) * 20 <= 0.0
    assert np.log(power.data.max()) * 20 <= 0.0
    with pytest.raises(TypeError, match="ndarray"):
        tfr_array_stockwell("foo", 1000.0)
    data = np.random.RandomState(0).randn(1, 1024)
    with pytest.raises(ValueError, match="3D with shape"):
        tfr_array_stockwell(data, 1000.0)
    data = data[np.newaxis]
    power, itc, freqs = tfr_array_stockwell(data, 1000.0, return_itc=True)
    assert_allclose(itc, np.ones_like(itc))
    assert power.shape == (1, len(freqs), data.shape[-1])
    assert_array_less(0, power)