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

        This will load intermediate experiences if needed.
        """

        exp_idx = int(exp_idx)
        self.load_all_experiences(exp_idx)
        if exp_idx not in self._loaded_experiences:
            raise RuntimeError(f"Experience {exp_idx} has been dropped")
        return self._loaded_experiences[exp_idx]

        Gets the dataset associated to an experience.

        This will load intermediate experiences if needed.
        
avalanche/benchmarks/scenarios/deprecated/lazy_dataset_sequence.py