def __deepcopy__(self, _memo: dict) -> "SyntheticAnomalyDataset":
        """Return deep copy and prevent cleanup of original.

        Args:
            _memo: Memo dictionary used by deepcopy.

        Returns:
            Deep copy of the dataset object.
        """
        cls = self.__class__
        new = cls.__new__(cls)
        for key, value in self.__dict__.items():
            setattr(new, key, deepcopy(value))
        self._cleanup = False
        return new
Return deep copy and prevent cleanup of original.

        Args:
            _memo: Memo dictionary used by deepcopy.

        Returns:
            Deep copy of the dataset object.
        
src/anomalib/data/utils/synthetic.py