def prompt_option(text, choices, default=NO_DEFAULT):
    """ Prompt the user to choose one of a list of options """
    while True:
        for i, msg in enumerate(choices):
            print "[%d] %s" % (i + 1, msg)
        response = prompt(text, default=default)
        try:
            idx = int(response) - 1
            return choices[idx]
        except (ValueError, __HOLE__):
            print "Invalid choice\n"
dataset/ETHPy150Open mathcamp/pypicloud/pypicloud/scripts.py/prompt_option