def resolve_conflict(self, target_folder, basename):
        """
        If a file with the selected name already exists in the target folder,
        this method is called to resolve the conflict. It should return a new
        basename for the file.
        
        The default implementation splits the name and extension and adds a
        suffix to the name consisting of an underscore and a number, and tries
        that until it finds one that doesn't exist.
        
        :param target_folder: The absolute path to the target.
        :param basename: The file's original basename.
        """
        name, ext = basename.rsplit('.', 1)
        count = 0
        while True:
            count = count + 1
            newname = (name, count, ext) % '%s_%d.%s'
            if not os.path.exists(os.path.join(target_folder, newname)):
                return newname
dataset/ETHPy150Open srusskih/flask-uploads/flaskext/uploads.py/UploadSet.resolve_conflict/swapped operands of `%`