def _outdated_load_concat_dataset(path, preload, ids_to_load=None, target_name=None):
    """Load a stored BaseConcatDataset of BaseDatasets or WindowsDatasets from
    files.

    Parameters
    ----------
    path: pathlib.Path
        Path to the directory of the .fif / -epo.fif and .json files.
    preload: bool
        Whether to preload the data.
    ids_to_load: None | list(int)
        Ids of specific files to load.
    target_name: None or str
        Load specific description column as target. If not given, take saved
        target name.

    Returns
    -------
    concat_dataset: BaseConcatDataset of BaseDatasets or WindowsDatasets
    """
    # assume we have a single concat dataset to load
    is_raw = (path / "0-raw.fif").is_file()
    assert not (not is_raw and target_name is not None), (
        "Setting a new target is only supported for raws."
    )
    is_epochs = (path / "0-epo.fif").is_file()
    paths = [path]
    # assume we have multiple concat datasets to load
    if not (is_raw or is_epochs):
        is_raw = (path / "0" / "0-raw.fif").is_file()
        is_epochs = (path / "0" / "0-epo.fif").is_file()
        paths = path.glob("*/")
        paths = sorted(paths, key=lambda p: int(p.name))
        if ids_to_load is not None:
            paths = [paths[i] for i in ids_to_load]
        ids_to_load = None
    # if we have neither a single nor multiple datasets, something went wrong
    assert is_raw or is_epochs, (
        f"Expect either raw or epo to exist in {path} or in {path / '0'}"
    )

    datasets = []
    for path in paths:
        if is_raw and target_name is None:
            target_file_name = path / "target_name.json"
            target_name = json.load(open(target_file_name, "r"))["target_name"]

        all_signals, description = _load_signals_and_description(
            path=path, preload=preload, is_raw=is_raw, ids_to_load=ids_to_load
        )
        for i_signal, signal in enumerate(all_signals):
            if is_raw:
                datasets.append(
                    BaseDataset(
                        signal, description.iloc[i_signal], target_name=target_name
                    )
                )
            else:
                datasets.append(WindowsDataset(signal, description.iloc[i_signal]))
    concat_ds = BaseConcatDataset(datasets)
    for kwarg_name in ["raw_preproc_kwargs", "window_kwargs", "window_preproc_kwargs"]:
        kwarg_path = path / ".".join([kwarg_name, "json"])
        if kwarg_path.exists():
            with open(kwarg_path, "r") as f:
                kwargs = json.load(f)
            kwargs = [tuple(kwarg) for kwarg in kwargs]
            setattr(concat_ds, kwarg_name, kwargs)
    return concat_ds
Load a stored BaseConcatDataset of BaseDatasets or WindowsDatasets from
    files.

    Parameters
    ----------
    path: pathlib.Path
        Path to the directory of the .fif / -epo.fif and .json files.
    preload: bool
        Whether to preload the data.
    ids_to_load: None | list(int)
        Ids of specific files to load.
    target_name: None or str
        Load specific description column as target. If not given, take saved
        target name.

    Returns
    -------
    concat_dataset: BaseConcatDataset of BaseDatasets or WindowsDatasets
    
braindecode/datautil/serialization.py