def expect(prompt, possibilities, recursed=False, default=None,
           acceptEmpty=False, fd=sys.stdout):
    """Prompt the user with prompt, allow them to choose from possibilities.

    If possibilities is empty, allow anything.
    """
    prompt = utils.str.normalizeWhitespace(prompt)
    originalPrompt = prompt
    if recursed:
        output(_('Sorry, that response was not an option.'))
    if useBold:
        choices = '[%s%%s%s]' % (ansi.RESET, ansi.BOLD)
    else:
        choices = '[%s]'
    if possibilities:
        prompt = (originalPrompt, choices % '/'.join(possibilities)) % '%s %s'
        if len(prompt) > 70:
            prompt = '%s %s' % (originalPrompt, choices % '/ '.join(possibilities))
    if default is not None:
        if useBold:
            prompt = '%s %s(default: %s)' % (prompt, ansi.RESET, default)
        else:
            prompt = '%s (default: %s)' % (prompt, default)
    prompt = textwrap.fill(prompt)
    prompt = prompt.replace('/ ', '/')
    prompt = prompt.strip() + ' '
    if useBold:
        prompt += ansi.RESET
        print(ansi.BOLD, end=' ', file=fd)
    if minisix.PY3:
        s = input(prompt)
    else:
        s = raw_input(prompt)
    s = s.strip()
    print(file=fd)
    if possibilities:
        if s in possibilities:
            return s
        elif not s and default is not None:
            return default
        elif not s and acceptEmpty:
            return s
        else:
            return expect(originalPrompt, possibilities, recursed=True,
                          default=default)
    else:
        if not s and default is not None:
            return default
        return s.strip()
dataset/ETHPy150Open ProgVal/Limnoria/src/questions.py/expect/swapped operands of `%`