def classes_in_exp_range(
        self, exp_start: int, exp_end: Optional[int] = None
    ) -> List[int]:
        """
        Gets a list of classes contained in the given experiences. The
        experiences are defined by range. This means that only the classes in
        range [exp_start, exp_end) will be included.

        :param exp_start: The starting experience ID.
        :param exp_end: The final experience ID. Can be None, which means that
            all the remaining experiences will be taken.

        :returns: The classes contained in the required experience range.
        """
        # Ref: https://stackoverflow.com/a/952952
        if exp_end is None:
            return [
                item
                for sublist in self.classes_in_experience["train"][exp_start:]
                for item in sublist
            ]

        return [
            item
            for sublist in self.classes_in_experience["train"][exp_start:exp_end]
            for item in sublist
        ]

        Gets a list of classes contained in the given experiences. The
        experiences are defined by range. This means that only the classes in
        range [exp_start, exp_end) will be included.

        :param exp_start: The starting experience ID.
        :param exp_end: The final experience ID. Can be None, which means that
            all the remaining experiences will be taken.

        :returns: The classes contained in the required experience range.
        
avalanche/benchmarks/scenarios/deprecated/new_classes/nc_scenario.py