Process the application state configuration.

        Google Alerts manages the account information and alert data through
        some custom state configuration. Not all values have been completely
        enumerated.
512021
def _process_state(self):
        
        self._log.debug("Capturing state from the request")
        response = self._session.get(url=self.ALERTS_URL, headers=self.HEADERS)
        soup = BeautifulSoup(response.content, "html.parser")
        for i in soup.findAll('script'):
            if i.text.find('window.STATE') == -1:
                continue
            state = json.loads(i.text[15:-1])
            if state != "":
                self._state = state
                self._log.debug("State value set: %s" % self._state)
        return self._state
437885
function (sectionId, state) {
        if (!module.exports.operations.validateState || module.exports.operations.validateState(state)) {
            appState.set('state[' + sectionId + ']', state);
        } else {
            log.error('Unable to update invalid state:', state, 'in section:', sectionId);
        }
    }
810887
def process(self, new_state=None):
        
        if new_state is None:
            new_state = set(self.buttons_pressed)
        old_state = self._state
        self._state = new_state

        state_diff = new_state.symmetric_difference(old_state)
        for button in state_diff:
            handler = getattr(self, 'on_' + button)

            if handler is not None:
                handler(button in new_state)

        if self.on_change is not None and state_diff:
            self.on_change([(button, button in new_state) for button in state_diff])
1274634
public void monitor(LocalStore ls) {
    int in = 0;
    EventRecord er = null;
    Environment.logInfo("Started processing log...");

    while ((er = getNext()) != null) {
      // Environment.logInfo("Processing log line:\t" + in++);
      if (er.isValid()) {
        ls.insert(er);
      }
    }

    PersistentState.updateState(file.getAbsolutePath(), firstLine, offset);
    PersistentState.writeState("conf/parsing.state");
  }
1291570
def send_alert_to_subscribed_integrations(alert):
    """"""
    valid_configured_integrations = get_valid_configured_integrations(alert)

    for configured_integration in valid_configured_integrations:
        threading.Thread(target=create_integration_alert_and_call_send, args=(alert, configured_integration)).start()
637880
def correlate_alert(self, alert, history):
        
        query = {
            'environment': alert.environment,
            'resource': alert.resource,
            '$or': [
                {
                    'event': alert.event,
                    'severity': {'$ne': alert.severity}
                },
                {
                    'event': {'$ne': alert.event},
                    'correlate': alert.event
                }],
            'customer': alert.customer
        }

        update = {
            '$set': {
                'event': alert.event,
                'severity': alert.severity,
                'status': alert.status,
                'service': alert.service,
                'value': alert.value,
                'text': alert.text,
                'createTime': alert.create_time,
                'timeout': alert.timeout,
                'rawData': alert.raw_data,
                'duplicateCount': alert.duplicate_count,
                'repeat': alert.repeat,
                'previousSeverity': alert.previous_severity,
                'trendIndication': alert.trend_indication,
                'receiveTime': alert.receive_time,
                'lastReceiveId': alert.last_receive_id,
                'lastReceiveTime': alert.last_receive_time
            },
            '$addToSet': {'tags': {'$each': alert.tags}},
            '$push': {
                'history': {
                    '$each': [h.serialize for h in history],
                    '$slice': -abs(current_app.config['HISTORY_LIMIT'])
                }
            }
        }

        # only update those attributes that are specifically defined
        attributes = {'attributes.' + k: v for k, v in alert.attributes.items()}
        update['$set'].update(attributes)

        if alert.update_time:
            update['$set']['updateTime'] = alert.update_time

        return self.get_db().alerts.find_one_and_update(
            query,
            update=update,
            return_document=ReturnDocument.AFTER
        )
1145812
void handleDataToListener(String dataId, ConsumerConfig config, ProviderInfoListener listener) {
        if (!canNotify()) {
            return;
        }
        if (lastUserData != null) {
            ComposeUserData composeUserData = composeUserAndConfigData(lastUserData, lastConfigData);
            notifyToListener(listener, composeUserData);
        }
    }
615854
function onApplyAuthSettingsChange() {
  try {
    auth.settings.appVerificationDisabledForTesting =
        $("input[name=enable-app-verification]:checked").val() == 'No';
    alertSuccess('Auth settings changed');
  } catch (error) {
    alertError('Error: ' + error.code);
  }
}
78600
private function configure()
    {
        $analyticsConfig = $this->googleServicesCore->getConfig('analytics');
        
        if (array_key_exists('viewId', $analyticsConfig)) {
            $this->viewId = $analyticsConfig['viewId'];
        }
    }
493795
protected function onReconfigure()
    {
        parent::onReconfigure();
        $this->client->resetApplication();
        $this->configureClient($this->config);
        $this->client->startApp();
    }
1088865
@Override
    public void applicationStarting(ApplicationInfo appInfo) throws StateChangeException {
        setFutureGeneratePluginTask();
        this.appsInService++;
        if (smgr != null)
            this.cookieNames.put(appInfo.getName(), smgr.getDefaultAffinityCookie());

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "application starting, add app to cookie map. app name : " + appInfo.getName() + ", cookie name : " + smgr.getDefaultAffinityCookie());
    }
632631
private function stateChanged()
    {
        if (count($this->values)) {
            $this->values = array_unique(array_values($this->values));
            sort($this->values);
        }
    }
455601
function() {
        const nextStage = this._chooseStage();
        if (!nextStage) {
            throw new Error("No incomplete flows from the server");
        }
        this._currentStage = nextStage;

        if (nextStage == 'm.login.dummy') {
            this.submitAuthDict({
                type: 'm.login.dummy',
            });
            return;
        }

        if (this._data.errcode || this._data.error) {
            this._stateUpdatedCallback(nextStage, {
                errcode: this._data.errcode || "",
                error: this._data.error || "",
            });
            return;
        }

        const stageStatus = {};
        if (nextStage == EMAIL_STAGE_TYPE) {
            stageStatus.emailSid = this._emailSid;
        }
        this._stateUpdatedCallback(nextStage, stageStatus);
    }
343063
void changeState(State state) {

        m_state = state;
        switch (state) {
            case validationRunning:
                m_cancelButton.setEnabled(false);
                m_okButton.setEnabled(false);
                clearValidationError();
                break;
            case validationFailed:
                m_okButton.setEnabled(false);
                m_cancelButton.setEnabled(true);
                break;
            case validationUnknown:
            default:
                m_cancelButton.setEnabled(true);
                m_okButton.setEnabled(true);
                clearValidationError();
                break;

        }
    }
1359382
public void configReady() {
        if (authenticationService != null) {
            JAASChangeNotifier notifier = jaasChangeNotifierService.getService();
            if (notifier != null) {
                notifier.notifyListeners();
            }
        }
    }
865505
protected void handleControlSignal() {
    if (toActivate) {
      if (!isInstanceStarted) {
        startInstance();
      }

      instance.activate();
      LOG.info("Activated instance: " + physicalPlanHelper.getMyInstanceId());

      // Reset the flag value
      toActivate = false;
    }

    if (toDeactivate) {
      instance.deactivate();
      LOG.info("Deactivated instance: " + physicalPlanHelper.getMyInstanceId());

      // Reset the flag value
      toDeactivate = false;
    }

    if (toStop) {
      instance.shutdown();
      LOG.info("Stopped instance: " + physicalPlanHelper.getMyInstanceId());

      // Reset the flag value
      toStop = false;
    }
  }
1139350
public function process()
    {
        foreach ($this->tierConfiguration->listTierConfigs(['status' => 'pending']) as $tierConfig) {
            $this->dispatchTierConfig($tierConfig);
        }

        foreach ($this->fulfillment->listRequests(['status' => 'pending']) as $request) {
            $this->dispatch($request);
        }
    }