def stomp_prompt(self, changed_bufs, missing_bufs, new_files, ignored, cb):

        def pluralize(arg):
            return arg != 1 and 's' or ''

        overwrite_local = ''
        overwrite_remote = ''
        missing = [buf['path'] for buf in missing_bufs]
        changed = [buf['path'] for buf in changed_bufs]

        to_upload = set(new_files + changed).difference(set(ignored))
        to_remove = missing + ignored
        to_fetch = changed + missing
        to_upload_len = len(to_upload)
        to_remove_len = len(to_remove)
        remote_len = to_remove_len + to_upload_len
        to_fetch_len = len(to_fetch)

        if not to_fetch:
            overwrite_local = 'Fetch nothing'
        elif to_fetch_len < 5:
            overwrite_local = 'Fetch %s' % ', '.join(to_fetch)
        else:
            overwrite_local = 'Fetch %s file%s' % (to_fetch_len, pluralize(to_fetch_len))

        if to_upload_len < 5:
            to_upload_str = 'upload %s' % ', '.join(to_upload)
        else:
            to_upload_str = 'upload %s' % to_upload_len

        if to_remove_len < 5:
            to_remove_str = 'remove %s' % ', '.join(to_remove)
        else:
            to_remove_str = 'remove %s' % to_remove_len

        if to_upload:
            overwrite_remote += to_upload_str
            if to_remove:
                overwrite_remote += ' and '
        if to_remove:
            overwrite_remote += to_remove_str

        if remote_len >= 5 and overwrite_remote:
            overwrite_remote += ' files'

        overwrite_remote = overwrite_remote.capitalize()

        action = 'Overwrite'
        choices = ['remote', 'local', 'cancel']
        prompt = 'The workspace is out of sync. You may:\n'
        prompt += '\t%s %s (r)emote file%s (%s)\n' % (action, remote_len, pluralize(remote_len), overwrite_remote)
        prompt += '\t%s %s (l)ocal file%s (%s)\n' % (action, to_fetch_len, pluralize(to_fetch_len), overwrite_local)
        prompt += "\t(c)ancel\n"
        choice = editor.vim_choice(prompt, choices[0], choices)
        try:
            return cb(choices.index(choice))
        except ValueError:
            return cb(-1)
dataset/ETHPy150Open Floobits/floobits-vim/plugin/floo/vim_handler.py/VimHandler.stomp_prompt/original