The public API for prompting the user before navigating away from a screen.
13521
function Prompt({ message, when = true }) {
  return (
    <RouterContext.Consumer>
      {context => {
        invariant(context, "You should not use <Prompt> outside a <Router>");

        if (!when || context.staticContext) return null;

        const method = context.history.block;

        return (
          <Lifecycle
            onMount={self => {
              self.release = method(message);
            }}
            onUpdate={(self, prevProps) => {
              if (prevProps.message !== message) {
                self.release();
                self.release = method(message);
              }
            }}
            onUnmount={self => {
              self.release();
            }}
            message={message}
          />
        );
      }}
    </RouterContext.Consumer>
  );
}
715316
def user_skips(self, user_id, **kwargs):
        ""
        api_path = "/api/v2/users/{user_id}/skips.json"
        api_path = api_path.format(user_id=user_id)
        return self.call(api_path, **kwargs)
468223
function askiOSPrompt() {
  prompt.get({
    name: 'using_ios',
    description: 'Are you using iOS (y/n)',
    default: 'y'
  }, function (err, result) {
    if (err) {
      return console.log(err);
    }
    mergeConfig(result);
    askiOSPromptResult(result);
    askAndroidPrompt();
  });
}
777103
function access(cb, force){
						_this.login(function(login_result, login_accesskey){
							// console.log(login_result, login_accesskey);
							if( login_result === false && login_accesskey === false ){
								cb(null, false, 0, {});
								return;
							}
							_this.httpRequest(
								url,
								{
									'params': options ,
									'method': apiSettings.method
								},
								function(bin, status, responseHeaders){
									if( !status ){
										cb(false, false, 0, {});
										return;
									}
									try {
										bin = JSON.parse(bin);
									} catch (e) {
									}
									// console.log(bin);
									if( bin.return_code !== 0 ){
										if(force){
											cb(null, bin, status, responseHeaders);
											return;
										}
										setTimeout(function(){
											access(cb, true);
										}, 1000);
										return;
									}
									cb(bin.list, bin, status, responseHeaders);
									return;
								}
							);
						}, force);

					}
709786
public String showPrompt() {
        String prompt = isAnsiEnabled() ? ansiPrompt(PROMPT).toString() : PROMPT;
        return showPrompt(prompt);
    }
347898
public void dismissPrompt() {
        String action = "Clicking 'Cancel' on a prompt";
        String expected = "Prompt is present to be clicked";
        if (isNotPrompt(action, expected, "click")) {
            return;
        }
        dismiss(action, expected, "prompt");
    }
195292
function(pMessage, pRequest, pResponse, fNext)
		{
			var tmpSessionID = null;
			if (pRequest.UserSession)
			{
				tmpSessionID = pRequest.UserSession.SessionID;
			}

			_Log.warn('API Error: '+pMessage, {SessionID: tmpSessionID, RequestID:pRequest.RequestUUID, RequestURL:pRequest.url, Action:'APIError'}, pRequest);
			pResponse.send({Error:pMessage});

			return fNext();
		}
587235
def prompt(*args, **kwargs):
    """"""
    try:
        return click.prompt(*args, **kwargs)
    except click.Abort:
        return False
229392
async function consoleInput(prompt) {
    /* This simplifies authentication for a lot of use cases. */
    const rl = readline.createInterface(process.stdin, process.stdout);
    try { 
         return await new Promise(resolve => rl.question(prompt, resolve));
    } finally {
        rl.close();
    }   
}
145379
public void promptNotPresent(double seconds) {
        try {
            double timeTook = noPopup(seconds);
            checkPromptNotPresent(seconds, timeTook);
        } catch (TimeoutException e) {
            checkPromptNotPresent(seconds, seconds);
        }
    }
150600
function onStartAuthClick(e) {
    var elmBody = document.body;

    platform.isAuthenticated().catch(function (err) {
        // methods are registered globally for the popup to call on this main window
      window.onAuthCompleted = function() {
        // the platform SDK instance from the popup has
        // received a new auth token and saved it to the store.
        // Let's retrieve it for this instance.
        platform.refreshAuthFromStore();

        elmBody.innerHTML = compiledSuccess();
      };
      window.onAuthError = function() {
        elmBody.innerHTML = compiledError();
      };

      openPopup();
    });
  }
369157
def ask_user(prompt: str, default: str = None) -> Optional[str]:
    
    if default is None:
        prompt += ": "
    else:
        prompt += " [" + default + "]: "
    result = input(prompt)
    return result if len(result) > 0 else default
110052
def allowed_to_preview(user):
    
    if (
        user.is_authenticated and
        user.is_active and
        user.is_staff
    ):
        return True
    return False
436612
def prompt_auth(self):
        """"""
        if self.username and self.password:
            return
        sys.stdout.write("Please insert your credentials for %s\n" % self.url.base_url)
        while not self.username:
            self.username = raw_input("Username [%s]: " % getpass.getuser())

        while not self.password:
            self.password = getpass.getpass("Password: ")
545419
def onStart(self, *args, **kwarg):
        
        with transactUI(self):
            config = self.navbar.getActiveConfig()
            config.resetErrors()
            if config.isValid():
                self.clientRunner.run(self.buildCliString())
                self.showConsole()
            else:
                config.displayErrors()
                self.Layout()
240936
function () {
				BaseController.prototype.onInit.call(this);

				// manually call the handler once at startup as device API won't do this for us
				this._onOrientationChange({
					landscape: Device.orientation.landscape
				});

				this.handleDocumentationDisclaimer();
			}
1233652
def preflight(self):
        """"""
        origin = self.request.headers.get('Origin', '*')
        self.set_header('Access-Control-Allow-Origin', origin)

        headers = self.request.headers.get('Access-Control-Request-Headers')
        if headers:
            self.set_header('Access-Control-Allow-Headers', headers)

        self.set_header('Access-Control-Allow-Credentials', 'true')