Requests confirmation from the user.

@param {string} message The prompt message.
@param {boolean} defaultAnswer The default answer.
177695
async function requestConfirmation(message, defaultAnswer = false) {
  const answerName = 'requestConfirmation';
  const answers = await inquirer.prompt([
    {
      message,
      name: answerName,
      type: 'confirm',
      default: defaultAnswer,
    },
  ]);
  return answers[answerName];
}
925512
public static function confirm($message, $default = true)
    {
        echo $message . ' (yes|no) [' . ($default ? 'yes' : 'no') . ']:';
        $input = trim(static::stdin());

        return empty($input) ? $default : !strncasecmp($input, 'y', 1);
    }
85480
function yes( message ) {
      return function() {
        if (options.silent === false) {
          grunt.log.ok('\n');
          var resp = readlinesync.question(message);//);
          if ( resp.toLowerCase() !== 'y' ) {
            throw new Error(format('Process stopped by user.\nMessage: [%s].\nUser answered: [%s]', message, resp));
          }
        }
        return true;
      };
    }
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' ")
154987
function( result, message ) {
            message = message || ( result ? "okay" : "failed, expected argument to be truthy, was: " +
            QUnit.dump.parse( result ) );
            if ( !!result ) {
                this.push( true, result, true, message );
            } else {
                this.test.pushFailure( message, null, result );
            }
        }
111170
public function ask($message, $secret = false, $default = '')
    {
        $message = is_array($message) ? call_user_func_array('sprintf', $message) : $message;

        $this->send($message);
        $answer = $this->readline($secret);
        
        return $answer === '' ? $default : $answer;
    }
134062
function (message) {
    var that = this;
    console.assert(this !== undefined, '[SDK] this !== undefined');

    if (that.__chancelList.length === 0) {
      console.warn(logCord$1, 'You maybe add one chancel');
    }

    lodash.each(that.__chancelList, function (chancel) {
      chancel.server.sendMessage(message);
    });
    that._traceLogEventsCount(TypeMsg.OnNoticeToServer);
    that.mc.trigger(TypeMsg.OnNoticeToServer, message);
    return that
  }
585336
function(title, message) {
            if (!message) {
                message = title;
                title = null;
            }

            return Dialogs.open(null, {
                "title": title,
                "message": message,
                "dialog": "confirm"
            });
        }
706041
function(message) {
        this._resetRestartTimeout(this.get('heartbeatTimeout'));
        if (!this._lastHeart) {
            this._isStartingUp = false;
            this._firstHeart = Date.now();
            logger.info('App started.');

            if (this.get('postLaunchCommand')) {
                spawn(this.get('postLaunchCommand'), null, null, function(err, output) {
                    console.log(err, output);
                });
            }

            if (this._startupCallback) {
                this._startupCallback();
                this._startupCallback = null;
            }
        }

        this._lastHeart = Date.now();
        this.trigger('heart');
    }
300844
function (message) {

            // forward the message to the local promise,
            // which will return a response promise
            var local = getLocal(message.to).promise;
            var response = local.dispatch(message.op, decode(message.args));
            var envelope;

            // connect the local response promise with the
            // remote response promise:

            // if the value is ever resolved, send the
            // fulfilled value across the wire
            response.then(function (resolution) {
                try {
                    resolution = encode(resolution);
                } catch (exception) {
                    try {
                        resolution = {"!": encode(exception)};
                    } catch (_exception) {
                        resolution = {"!": null};
                    }
                }
                envelope = JSON.stringify({
                    "type": "resolve",
                    "to": message.from,
                    "resolution": resolution
                });
                connection.put(envelope);
            }, function (reason) {
                try {
                    reason = encode(reason);
                } catch (exception) {
                    try {
                        reason = encode(exception);
                    } catch (_exception) {
                        reason = null;
                    }
                }
                envelope = JSON.stringify({
                    "type": "resolve",
                    "to": message.from,
                    "resolution": {"!": reason}
                });
                connection.put(envelope);
            }, function (progress) {
                try {
                    progress = encode(progress);
                    envelope = JSON.stringify({
                        "type": "notify",
                        "to": message.from,
                        "resolution": progress
                    });
                } catch (exception) {
                    try {
                        progress = {"!": encode(exception)};
                    } catch (_exception) {
                        progress = {"!": null};
                    }
                    envelope = JSON.stringify({
                        "type": "resolve",
                        "to": message.from,
                        "resolution": progress
                    });
                }
                connection.put(envelope);
            })
            .done();

        }
1240901
def global_confirm(question, default=True):
    
    if env.abort_on_prompts:
        return True
    original_parallel = env.parallel
    env.parallel = False
    result = confirm(question, default)
    env.parallel = original_parallel
    return result
1171580
function prompt (data, key, prompt, done) {
  // skip prompts whose when condition is not met
  if (prompt.when && !evaluate(prompt.when, data)) {
    return done()
  }

  var promptDefault = prompt.default
  if (typeof prompt.default === 'function') {
    promptDefault = function () {
      return prompt.default.bind(this)(data)
    }
  }

  inquirer.prompt([{
    type: promptMapping[prompt.type] || prompt.type,
    name: key,
    message: prompt.message || prompt.label || key,
    default: promptDefault,
    choices: prompt.choices || [],
    validate: prompt.validate || function () { return true }
  }], function (answers) {
    if (Array.isArray(answers[key])) {
      data[key] = {}
      answers[key].forEach(function (multiChoiceAnswer) {
        data[key][multiChoiceAnswer] = true
      })
    } else if (typeof answers[key] === 'string') {
      data[key] = answers[key].replace(/"/g, '\\"')
    } else {
      data[key] = answers[key]
    }
    done()
  })
}
1080695
@Override
  public void sendUserAuthorizationAnswer(JUserAuthorizationAnswer answer) throws InternalException, IllegalDiameterStateException, RouteException,
      OverloadException {
    send(Event.Type.SEND_MESSAGE, null, answer);
  }
834648
function RAgent_onResponse(message) {
  var reqID = message.id

  if (!this._requestCBs.has(reqID)) return

  var cb = this._requestCBs.get(reqID)
  this._requestCBs.delete(reqID)

  if (message.error) {
    var err = new Error(message.error)
    return cb(err, message.body)
  }

  cb(null, message.body)
}
576086
function(message) {
		var stack, e = new Error(
			gui.GreatSpirit.DENIAL + (message ? ": " + message : "")
		);
		if (!gui.Client.isExplorer && (stack = e.stack)) {
			if (gui.Client.isWebKit) {
				stack = stack.replace(/^[^\(]+?[\n$]/gm, "").
				replace(/^\s+at\s+/gm, "").
				replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@").
				split("\n");
			} else {
				stack = stack.split("\n");
			}
			stack.shift();
			stack.shift(); // @TODO: shift one more now?
			console.warn(e.message + "\n" + stack);
		} else {
			console.warn(e.message);
		}
	}
951757
def ask(message='Are you sure? [y/N]'):
    """"""
    agree = False
    answer = raw_input(message).lower()
    if answer.startswith('y'):
        agree = True
    return agree
752506
def ask_confirmation():
    
    while True:
        print("Do you want to restart these brokers? ", end="")
        choice = input().lower()
        if choice in ['yes', 'y']:
            return True
        elif choice in ['no', 'n']:
            return False
        else:
            print("Please respond with 'yes' or 'no'")