def test_windows_fixed_length_cropped(lazy_loadable_dataset):
    """Test fixed length windowing on cropped data.

    Cropping raw data changes the `first_samp` attribute of the Raw object, and
    so it is important to test this is taken into account by the windowers.
    """
    tmin, tmax = 100, 120

    ds = copy.deepcopy(lazy_loadable_dataset)
    ds.datasets[0].raw.annotations.crop(tmin, tmax)

    crop_ds = copy.deepcopy(lazy_loadable_dataset)
    crop_transform = Preprocessor("crop", tmin=tmin, tmax=tmax)
    preprocess(crop_ds, [crop_transform])

    # Extract windows
    sfreq = ds.datasets[0].raw.info["sfreq"]
    tmin_samples, tmax_samples = int(tmin * sfreq), int(tmax * sfreq)

    windows1 = create_fixed_length_windows(
        concat_ds=ds,
        start_offset_samples=tmin_samples,
        stop_offset_samples=tmax_samples,
        window_size_samples=100,
        window_stride_samples=100,
        drop_last_window=True,
    )
    windows2 = create_fixed_length_windows(
        concat_ds=crop_ds,
        start_offset_samples=0,
        stop_offset_samples=None,
        window_size_samples=100,
        window_stride_samples=100,
        drop_last_window=True,
    )
    assert (windows1[0][0] == windows2[0][0]).all()
Test fixed length windowing on cropped data.

    Cropping raw data changes the `first_samp` attribute of the Raw object, and
    so it is important to test this is taken into account by the windowers.
    
test/unit_tests/preprocessing/test_windowers.py