def dataset_list_from_benchmark(benchmark: CLScenario) -> List[AvalancheDataset]:
    """
    Traverse a benchmark and obtain the dataset of each experience.

    This will traverse all streams in alphabetical order.

    :param benchmark: The benchmark to traverse.
    :return: The list of datasets.
    """
    single_datasets = OrderedDict()
    for stream_name in sorted(benchmark.streams.keys()):
        stream = benchmark.streams[stream_name]
        for experience in stream:
            dataset: AvalancheDataset = experience.dataset
            if dataset not in single_datasets:
                single_datasets[dataset] = dataset

    return list(single_datasets.keys())

    Traverse a benchmark and obtain the dataset of each experience.

    This will traverse all streams in alphabetical order.

    :param benchmark: The benchmark to traverse.
    :return: The list of datasets.
    
avalanche/benchmarks/utils/dataset_traversal_utils.py