def METHOD_NAME(self, path1: str, path2: Optional[str], mode):
    if path1 is None and path2 is not None:
        raise ValueError(
            "When giving paths for paired-end files, only providing the second"
            " file is not supported"
        )
    file1 = self.xopen_or_none(path1, mode)
    file2 = self.xopen_or_none(path2, mode)
    return file1, file2