def validate(self):
        """
        Ensure `self.path` has one of the extensions in `self.allowed_formats`.
        """
        assert self.path, "{} must have a path".format(self.__class__.__name__)
        ext = extract_path_ext(self.path, default_ext=self.subtitlesformat)
        if ext not in self.allowed_formats and ext not in CONVERTIBLE_FORMATS[self.get_preset()]:
            raise ValueError('Incompatible extension {} for SubtitleFile at {}'.format(ext, self.path))
Ensure `self.path` has one of the extensions in `self.allowed_formats`.