def prompt_bool(prompt, default=None):
    if default is None:
        prompt = "%s [yn] " % prompt
    elif default is True:
        prompt = "%s [Yn] " % prompt
    elif default is False:
        prompt = "%s [yN] " % prompt
    else:
        raise ValueError("default must be None, True, or False")

    while True:
        response = raw_input(prompt).strip()
        if default is not None and len(response) == 0:
            return default
        try:
            return bool(strtobool(response))
        except __HOLE__:
            print "Please enter y(es) or n(o)."
            continue
dataset/ETHPy150Open codalab/codalab-cli/codalab/lib/codalab_manager.py/prompt_bool