class_docstr: A lazily initialized sequence of datasets.
  
  This class provides a way to lazily generate and store the datasets
  linked to each experience. This class uses a generator to get the sequence
  of datasets but it can also be used with a more classic statically
  initialized Sequence (like a list).
  
  This class will also keep track of the targets and task labels field of the
  generated datasets.
docstr: Gets the dataset associated to an experience.
  
  :param exp_idx: The ID of the experience.
  :return: The dataset associated to the experience.
docstr_tok: ["Gets","the","dataset","associated","to","an","experience",".",":","param","exp_idx",":","The","ID","of","the","experience",".",":","return",":","The","dataset","associated","to","the","experience","."]
code: def __getitem__(
      self, exp_idx: Union[int, slice]
  ) -> Union[TCLDataset, Sequence[TCLDataset]]:
      """
      Gets the dataset associated to an experience.
  
      :param exp_idx: The ID of the experience.
      :return: The dataset associated to the experience.
      """
      # A lot of unuseful lines needed for MyPy -_-
      indexing_collate: Callable[
          [Iterable[TCLDataset]], Sequence[TCLDataset]
      ] = lambda x: list(x)
      result = manage_advanced_indexing(
          exp_idx,
          self._get_experience_and_load_if_needed,
          len(self),
          indexing_collate,
      )
      return result
  
file_path: avalanche/avalanche/benchmarks/scenarios/deprecated/lazy_dataset_sequence.py
imports: from collections import defaultdict
  from typing import Callable, Sequence, Iterable, Dict, Optional, Iterator, TypeVar, Union
  from typing_extensions import overload
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from avalanche.benchmarks.utils.dataset_utils import manage_advanced_indexing
label_desc: Use image node_id 5 for calling the LazyDatasetSequence obj's underlying member method code with example usage: obj.__getitem__(exp_idx) and returns: result