def prompt_choices(name, choices, default=None, resolve=ascii_lowercase,
                   no_choice=('none',)):

    _choices = []
    options = []

    for choice in choices:
        if isinstance(choice, string_types):
            options.append(choice)
        else:
            options.append("%s [%s]" % (choice[1], choice[0]))
            choice = choice[0]
        _choices.append(choice)

    while True:
        rv = prompt(name + ' - (%s)' % ', '.join(options), default)
        if not rv:
            return default
        rv = resolve(rv)
        if rv in no_choice:
            return None
        if rv in _choices:
            return rv
Test if it launch the screensaver
dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/flask_script/cli.py/prompt_choices--crossover with--dataset/ETHPy150Open saltstack/salt/tests/unit/modules/mac_desktop_test.py/MacDesktopTestCase.test_screensaver