def _check_filepath(self, filepath):
        """Raises an error if a filepath is invalid."""
        base_dir = utils.vfs_construct_path(
            '/', self.impl.exploration_id, 'assets')
        absolute_path = utils.vfs_construct_path(base_dir, filepath)
        normalized_path = utils.vfs_normpath(absolute_path)

        # This check prevents directory traversal.
        if not normalized_path.startswith(base_dir):
            raise IOError(filepath % 'Invalid filepath: %s')
dataset/ETHPy150Open oppia/oppia/core/domain/fs_domain.py/AbstractFileSystem._check_filepath/swapped operands of `%`