def get_experience_if_loaded(self, exp_idx: int) -> Optional[TCLDataset]:
        """
        Gets the dataset associated to an experience.

        Differently from `__getitem__`, this will return None if the experience
        has not been (lazily) loaded yet.

        :param exp_idx: The ID of the experience.
        :return: The dataset associated to the experience or None if the
            experience has not been loaded yet or if it has been dropped.
        """
        exp_idx = int(exp_idx)  # Handle single element tensors
        if exp_idx >= len(self):
            raise IndexError(f"The stream doesn't contain {exp_idx+1}" f"experiences")

        return self._loaded_experiences.get(exp_idx, None)

        Gets the dataset associated to an experience.

        Differently from `__getitem__`, this will return None if the experience
        has not been (lazily) loaded yet.

        :param exp_idx: The ID of the experience.
        :return: The dataset associated to the experience or None if the
            experience has not been loaded yet or if it has been dropped.
        
avalanche/benchmarks/scenarios/deprecated/lazy_dataset_sequence.py