Depending on whether the user said "yes" or "no", send them to the right place.
974188
@RequirePOST
    @RequireAdminRights
    public HttpResponse doAct(StaplerRequest req) throws IOException {
        if (req.hasParameter("no")) {
            disable(true);
            return HttpResponses.redirectViaContextPath("/manage");
        } else {
            return new HttpRedirect(".");
        }
    }
730847
def confirm(statement):
    
    prompt = "{statement} [y/n]".format(statement=statement)
    answer = _ask(prompt, limited_to=["yes", "no", "y", "n"])
    return answer and answer.startswith("y")
1347422
def confirm(text='', title='', buttons=['OK', 'Cancel']):
    """"""
    retVal = messageBoxFunc(0, text, title, MB_OKCANCEL | MB_ICONQUESTION | MB_SETFOREGROUND | MB_TOPMOST)
    if retVal == 1 or len(buttons) == 1:
        return buttons[0]
    elif retVal == 2:
        return buttons[1]
    else:
        assert False, 'Unexpected return value from MessageBox: %s' % (retVal)
1235693
def is_correct(self, question_id):
        """"""
        response = self.get_response(question_id=question_id)
        if response.is_answered():
            item = self._get_item(response.get_item_id())
            return item.is_response_correct(response)
        raise errors.IllegalState()
1005851
def askyesno(title=None, message=None, **options):
    """"""
    return psidialogs.ask_yes_no(title=title, message=message)
1243394
def yesno(message, default='yes', suffix=' '):
    
    if default == 'yes':
        yesno_prompt = '[Y/n]'
    elif default == 'no':
        yesno_prompt = '[y/N]'
    else:
        raise ValueError("default must be 'yes' or 'no'.")

    if message != '':
        prompt_text = "{0} {1}{2}".format(message, yesno_prompt, suffix)
    else:
        prompt_text = "{0}{1}".format(yesno_prompt, suffix)

    while True:
        response = get_input(prompt_text).strip()
        if response == '':
            return True
        else:
            if re.match('^(y)(es)?$', response, re.IGNORECASE):
                if default == 'yes':
                    return True
                else:
                    return False
            elif re.match('^(n)(o)?$', response, re.IGNORECASE):
                if default == 'no':
                    return True
                else:
                    return False
181578
def ask(question, no_input=False):
    """"""
    if no_input:
        return True
    else:
        input_ = input('%s [Y/n] ' % question)
        input_ = input_.strip().lower()
        if input_ in ('y', 'yes', ''):
            return True
        if input_ in ('n', 'no'):
            return False
        print('Invalid selection')
1248239
def confirm(question, default=True):
    
    valid = {"": default, "yes": True, "y": True, "no": False, "n": False}
    while 1:
        choice = input(question + (" [Y/n] " if default else " [y/N] ")).lower()
        if choice in valid:
            return valid[choice]
        print("Please respond with 'y' or 'n' ")
674989
def yes?(message, *args, &block)
      defaults = { default: true }
      options  = Utils.extract_options!(args)
      options.merge!(defaults.reject { |k, _| options.key?(k) })

      question = ConfirmQuestion.new(self, options)
      question.call(message, &block)
    end
836035
def confirm(prompt, default=None, show_default=True, abort=False, input_function=None):
	'''
	'''
	valid = {
		'yes': True,
		'y': True,
		'no': False,
		'n': False
	}
	input_function = get_input_fn(input_function)
	if default not in ['yes', 'no', None]:
		default = None
	if show_default:
		prompt = '{} [{}/{}]: '.format(prompt,
				'Y' if default == 'yes' else 'y',
				'N' if default == 'no' else 'n')
	while True:
		choice = prompt_fn(input_function, prompt, default).lower()
		if choice in valid:
			if valid[choice] == False and abort:
				raise_abort()
			return valid[choice]
		else:
			echo('Please respond with "yes" or "no" (or "y" or "n").')
1196624
async function requestChoice(message, items) {
  const answerName = 'requestChoice';
  const answers = await inquirer.prompt([
    {
      message,
      name: answerName,
      type: 'list',
      choices: getChoices(items),
    },
  ]);
  return answers[answerName];
}
234251
async def right(self):
        """"""
        await self._send_commands(
            self._move('Down', 0, 50, 100),
            self._move('Move', 1, 55, 100),
            self._move('Move', 3, 60, 100),
            self._move('Move', 4, 65, 100),
            self._move('Move', 5, 70, 100),
            self._move('Move', 6, 75, 100),
            self._move('Up', 7, 75, 100))
1059464
public function askCommand(): void
    {
        $a = Interact::ask('you name is: ', '', function ($val, &$err) {
            if (!preg_match('/^\w{2,}$/', $val)) {
                $err = 'Your input must match /^\w{2,}$/';
                return false;
            }

            return true;
        });

        $this->write('Your answer is: ' . $a);
    }
696359
def yes_or_no(message):
    """"""
    while True:
        print message, '(yes/no)',
        line = raw_input()
        if line is None:
            return None
        line = line.lower()
        if line == 'y' or line == 'ye' or line == 'yes':
            return True
        if line == 'n' or line == 'no':
            return False
337311
function ask(question, validValues, message) {
  readline.setDefaultOptions({
    limit: validValues,
    limitMessage: message
  });
  return readline.question(question);
}
607122
function trySendOptionsResponse(res, methods, next) {
  try {
    sendOptionsResponse(res, methods)
  } catch (err) {
    next(err)
  }
}
952202
def boolbox(msg="Shall I continue?"
    , title=" "
    , choices=("Yes","No")
    , image=None
    ):
    
    reply = buttonbox(msg=msg, choices=choices, title=title, image=image)
    if reply == choices[0]: return 1
    else: return 0