Exit admin mode
@param ctx       Internal parameter. Not user-accessible.
@return          Standard STATUS table.
971296
public VoltTable[] run(SystemProcedureExecutionContext ctx) {
        // Choose the lowest site ID on this host to actually flip the bit
        VoltDBInterface voltdb = VoltDB.instance();
        OperationMode opMode = voltdb.getMode();

        if (ctx.isLowestSiteId()) {
            ZooKeeper zk = voltdb.getHostMessenger().getZK();
            try {
                Stat stat;
                OperationMode zkMode = null;
                Code code;
                do {
                    stat = new Stat();
                    code = Code.BADVERSION;
                    try {
                        byte [] data = zk.getData(VoltZK.operationMode, false, stat);
                        zkMode = data == null ? opMode : OperationMode.valueOf(data);
                        if (zkMode == RUNNING) {
                            break;
                        }
                        stat = zk.setData(VoltZK.operationMode, RUNNING.getBytes(), stat.getVersion());
                        code = Code.OK;
                        zkMode = RUNNING;
                        break;
                    } catch (BadVersionException ex) {
                        code = ex.code();
                    }
                } while (zkMode != RUNNING && code == Code.BADVERSION);

                m_stat = stat;
                voltdb.getHostMessenger().unpause();
                voltdb.setMode(RUNNING);
                // for snmp
                SnmpTrapSender snmp = voltdb.getSnmpTrapSender();
                if (snmp != null) {
                    snmp.resume("Cluster resumed.");
                }
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        VoltTable t = new VoltTable(VoltSystemProcedure.STATUS_SCHEMA);
        t.addRow(VoltSystemProcedure.STATUS_OK);
        return new VoltTable[] {t};
    }
815344
public static void endContext(ControlContainerContext context)
    {
        Stack<ControlContainerContext> contextStack = _threadContexts.get();
        if (contextStack == null || contextStack.size() == 0)
            throw new IllegalStateException("No context started for current thread");

        if (contextStack.peek() != context)
            throw new IllegalStateException("Context is not the current active context");

        contextStack.pop();
    }
244666
def context(self, name, ctx):
        
        self.enter_context(name, ctx)
        try:
            yield
        finally:
            self.exit_context(name)
1196105
public static final void exit(TraceComponent tc, String methodName, Object obj) {
        com.ibm.websphere.ras.Tr.exit(tc, methodName, obj);
    }
606294
function _quitAltGrMode() {
        _enabled = true;
        _ctrlDown = CtrlDownStates.NOT_YET_DETECTED;
        _altGrDown = false;
        _lastTimeStamp = null;
        _lastKeyIdentifier = null;
        $(window).off("keyup", _onCtrlUp);
    }
1216205
@SuppressWarnings("unused") // Public API
    public Settings setExitEnabled(boolean enabled) {
        exitType = enabled ? ExitType.ALL : ExitType.NONE;
        return this;
    }
293568
private Exit exit(final Exit exit) {
        final long start = System.currentTimeMillis();
        final long max = this.options.lifetime();
        return new Exit.Or(
            exit,
            new Lifetime(start, max)
        );
    }
591192
@Override
    public void handle(CommandContext ctx, String commandLine) {
        String[] commands = commandLine.split(" ");
        if (commands.length != 1) {
            ctx.printLine("Invalid command.");
            return;
        }

        ctx.terminateSession();
    }
394174
@FFDCIgnore(NamingException.class)
    public void releaseDirContext(TimedDirContext ctx) throws WIMSystemException {
        final String METHODNAME = "releaseDirContext";
        if (iContextPoolEnabled) {

            //Get the lock for the current domain
            synchronized (iLock) {
                // If the DirContextTTL is 0, no need to put it back to pool
                // If the size of the pool is larger than minimum size or total dirContexts larger than max size
                // If context URL no longer matches active URL, then discard
                if (iContexts.size() >= iPrefPoolSize || (iMaxPoolSize != 0 && iLiveContexts > iMaxPoolSize)
                    || ctx.getCreateTimestamp() < iPoolCreateTimestampSeconds
                    || !getProviderURL(ctx).equalsIgnoreCase(getActiveURL())) {
                    try {
                        iLiveContexts--; //PM95697
                        ctx.close();
                    } catch (NamingException e) {
                        String msg = Tr.formatMessage(tc, WIMMessageKey.NAMING_EXCEPTION, WIMMessageHelper.generateMsgParms(e.toString(true)));
                        throw new WIMSystemException(WIMMessageKey.NAMING_EXCEPTION, msg, e);
                    }

                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, METHODNAME + " Context is discarded.");
                    }
                } else {
                    if (iContexts != null && iContexts.size() > 0 && iContexts.contains(ctx)) {
                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, METHODNAME + " Context already present in Context pool. No need to add it again to context pool.  ContextPool: total=" + iLiveContexts
                                         + ", poolSize=" + iContexts.size());
                        }
                    } else {
                        if (iContexts != null)
                            iContexts.add(ctx);
                        if (iPoolTimeOut > 0) {
                            ctx.setPoolTimeStamp(roundToSeconds(System.currentTimeMillis()));
                        }

                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, METHODNAME + " Before Notifying the waiting threads and Context is back to pool.  ContextPool: total=" + iLiveContexts
                                         + ", poolSize=" + iContexts.size());
                        }
                    }
                    iLock.notifyAll();
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, METHODNAME + " Context is back to pool.");
                    }

                }
            }
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, METHODNAME + " ContextPool: total=" + iLiveContexts + ", poolSize=" + iContexts.size());
            }
        } else {
            try {
                ctx.close();
            } catch (NamingException e) {
                String msg = Tr.formatMessage(tc, WIMMessageKey.NAMING_EXCEPTION, WIMMessageHelper.generateMsgParms(e.toString(true)));
                throw new WIMSystemException(WIMMessageKey.NAMING_EXCEPTION, msg, e);
            }
        }
    }
154807
public ExitStatus run()
	{
		synchronized (DebuggerReader.class) // Only one console!
		{
			println("Stopped " + breakpoint);
			println(interpreter.getSourceLine(breakpoint.location));

			try
			{
				interpreter.setDefaultName(breakpoint.location.getModule());
			} catch (Exception e)
			{
				throw new InternalException(52, "Cannot set default name at breakpoint");
			}

			ExitStatus status = super.run(new Vector<File>());

			return status;
		}
	}
713634
public static boolean isSystemBarOnBottom(Context ctx) {
        WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics metrics = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(metrics);
        Configuration cfg = ctx.getResources().getConfiguration();
        boolean canMove = (metrics.widthPixels != metrics.heightPixels &&
                cfg.smallestScreenWidthDp < 600);

        return (!canMove || metrics.widthPixels < metrics.heightPixels);
    }
709245
def exit_config_mode(self, exit_config="exit configuration-mode"):
        """"""
        output = ""
        if self.check_config_mode():
            output = self.send_command_timing(
                exit_config, strip_prompt=False, strip_command=False
            )
            # if 'Exit with uncommitted changes?' in output:
            if "uncommitted changes" in output:
                output += self.send_command_timing(
                    "yes", strip_prompt=False, strip_command=False
                )
            if self.check_config_mode():
                raise ValueError("Failed to exit configuration mode")
        return output
1237072
@Override
  public void exitQuery(GDLParser.QueryContext ctx) {
    for(Vertex v : vertices) {
      addPredicates(Predicate.fromGraphElement(v, getDefaultVertexLabel()));
    }
    for(Edge e : edges) {
      addPredicates(Predicate.fromGraphElement(e, getDefaultEdgeLabel()));
    }
  }
516458
public static WsLocationAdminImpl createLocations(final BundleContext ctx) {
        if (instance.get() == null) {
            SymbolRegistry.getRegistry().clear();
            Callable<WsLocationAdminImpl> initializer = new Callable<WsLocationAdminImpl>() {
                @Override
                public WsLocationAdminImpl call() throws Exception {
                    return new WsLocationAdminImpl(new BundleContextMap(ctx));
                }
            };
            instance = StaticValue.mutateStaticValue(instance,initializer);
        }

        return instance.get();
    }
243535
def exit_with_mapped_status(http_status):
    
    # get the mapping by looking up the state and getting the mapping attr
    mapping = click.get_current_context().ensure_object(CommandState).http_status_map

    # if there is a mapped exit code, exit with that. Otherwise, exit 1
    if http_status in mapping:
        sys.exit(mapping[http_status])
    else:
        sys.exit(1)
857730
public VoltTable[] run(SystemProcedureExecutionContext ctx) {
        // Choose the lowest site ID on this host to actually flip the bit

        if (ctx.isLowestSiteId()) {
            VoltDBInterface voltdb = VoltDB.instance();
            OperationMode opMode = voltdb.getMode();
            if (LOG.isDebugEnabled()) {
                LOG.debug("voltdb opmode is " + opMode);
            }
            ZooKeeper zk = voltdb.getHostMessenger().getZK();
            try {
                Stat stat;
                OperationMode zkMode = null;
                Code code;
                do {
                    stat = new Stat();
                    code = Code.BADVERSION;
                    try {
                        byte [] data = zk.getData(VoltZK.operationMode, false, stat);
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("zkMode is " + (zkMode == null ? "(null)" : OperationMode.valueOf(data)));
                        }
                        zkMode = data == null ? opMode : OperationMode.valueOf(data);
                        if (zkMode == PAUSED) {
                            if (LOG.isDebugEnabled()) {
                                LOG.debug("read node at version " + stat.getVersion() + ", txn " + ll(stat.getMzxid()));
                            }
                            break;
                        }
                        stat = zk.setData(VoltZK.operationMode, PAUSED.getBytes(), stat.getVersion());
                        code = Code.OK;
                        zkMode = PAUSED;
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("!WROTE! node at version " + stat.getVersion() + ", txn " + ll(stat.getMzxid()));
                        }
                        break;
                    } catch (BadVersionException ex) {
                        code = ex.code();
                    }
                } while (zkMode != PAUSED && code == Code.BADVERSION);

                m_stat = stat;
                voltdb.getHostMessenger().pause();
                voltdb.setMode(PAUSED);

             // for snmp
                SnmpTrapSender snmp = voltdb.getSnmpTrapSender();
                if (snmp != null) {
                    snmp.pause("Cluster paused.");
                }

            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        // Force a tick so that stats will be updated.
        // Primarily added to get latest table stats for DR pause and empty db check.
        ctx.getSiteProcedureConnection().tick();

        VoltTable t = new VoltTable(VoltSystemProcedure.STATUS_SCHEMA);
        t.addRow(VoltSystemProcedure.STATUS_OK);
        return (new VoltTable[] {t});
    }
519607
protected void deactivate(ComponentContext context) {
        destinationRef.deactivate(context);
        bootstrapContextRef.deactivate(context);
        rrsXAResFactorySvcRef.deactivate(context);
    }