Retrieve the update mode from the given update message.
439071
private static UpdateMode getUpdateMode(final DmfAttributeUpdate update) {
        final DmfUpdateMode mode = update.getMode();
        if (mode != null) {
            return UpdateMode.valueOf(mode.name());
        }
        return null;
    }
545679
public void updateMode(ConnectionMode connectionMode) {
        switch (connectionMode) {
            case SEND_ONLY:
                this.rtpHandler.setReceivable(false);
                this.rtpHandler.setLoopable(false);
                audioComponent.updateMode(false, true);
                oobComponent.updateMode(false, true);
                this.rtpHandler.deactivate();
                this.transmitter.activate();
                break;
            case RECV_ONLY:
                this.rtpHandler.setReceivable(true);
                this.rtpHandler.setLoopable(false);
                audioComponent.updateMode(true, false);
                oobComponent.updateMode(true, false);
                this.rtpHandler.activate();
                this.transmitter.deactivate();
                break;
            case INACTIVE:
                this.rtpHandler.setReceivable(false);
                this.rtpHandler.setLoopable(false);
                audioComponent.updateMode(false, false);
                oobComponent.updateMode(false, false);
                this.rtpHandler.deactivate();
                this.transmitter.deactivate();
                break;
            case SEND_RECV:
            case CONFERENCE:
                this.rtpHandler.setReceivable(true);
                this.rtpHandler.setLoopable(false);
                audioComponent.updateMode(true, true);
                oobComponent.updateMode(true, true);
                this.rtpHandler.activate();
                this.transmitter.activate();
                break;
            case NETWORK_LOOPBACK:
                this.rtpHandler.setReceivable(false);
                this.rtpHandler.setLoopable(true);
                audioComponent.updateMode(false, false);
                oobComponent.updateMode(false, false);
                this.rtpHandler.deactivate();
                this.transmitter.deactivate();
                break;
            default:
                break;
        }

        boolean connectImmediately = false;
        if (this.remotePeer != null) {
            connectImmediately = udpManager.connectImmediately((InetSocketAddress) this.remotePeer);
        }

        if (udpManager.getRtpTimeout() > 0 && this.remotePeer != null && !connectImmediately) {
            if (this.rtpHandler.isReceivable()) {
                this.statistics.setLastHeartbeat(scheduler.getClock().getTime());
                scheduler.submitHeatbeat(heartBeat);
            } else {
                heartBeat.cancel();
            }
        }
    }
798642
def umode(self, nick, modes=''):
        
        with self.lock:
            if not modes:
                self.send('MODE %s' % nick)
                if self.readable():
                    msg = self._recv(expected_replies=('221',))
                    if msg[0] == '221':
                        modes = msg[2].replace('+', '').replace(':', '', 1)
                return modes

            self.send('MODE %s %s' % (nick, modes))

            if self.readable():
                msg = self._recv(expected_replies=('MODE',))
                if msg[0] == 'MODE':
                    if not self.hide_called_events:
                        self.stepback()
                    return msg[2].replace(':', '', 1)
282921
def cli(obj, name, email, password, status, text):
    """"""
    if not any([name, email, password, status, text]):
        click.echo('Nothing to update.')
        sys.exit(1)

    client = obj['client']
    try:
        r = client.update_me(name=name, email=email, password=password, status=status, attributes=None, text=text)
    except Exception as e:
        click.echo('ERROR: {}'.format(e))
        sys.exit(1)
    if r['status'] == 'ok':
        click.echo('Updated.')
    else:
        click.echo(r['message'])
2603
def _get_message(self, block=True, timeout=0.1, get_partition_info=None,
                     update_offset=True):
        
        start_at = time.time()
        while self.queue.empty():
            # We're out of messages, go grab some more.
            log.debug('internal queue empty, fetching more messages')
            with FetchContext(self, block, timeout):
                self._fetch()

            if not block or time.time() > (start_at + timeout):
                break

        try:
            partition, message = self.queue.get_nowait()

            if update_offset:
                # Update partition offset
                self.offsets[partition] = message.offset + 1

                # Count, check and commit messages if necessary
                self.count_since_commit += 1
                self._auto_commit()

            if get_partition_info is None:
                get_partition_info = self.partition_info
            if get_partition_info:
                return partition, message
            else:
                return message
        except queue.Empty:
            log.debug('internal queue empty after fetch - returning None')
            return None
25334
async def process_update(self, update: types.Update):
        
        types.Update.set_current(update)

        try:
            if update.message:
                types.User.set_current(update.message.from_user)
                types.Chat.set_current(update.message.chat)
                return await self.message_handlers.notify(update.message)
            if update.edited_message:
                types.User.set_current(update.edited_message.from_user)
                types.Chat.set_current(update.edited_message.chat)
                return await self.edited_message_handlers.notify(update.edited_message)
            if update.channel_post:
                types.Chat.set_current(update.channel_post.chat)
                return await self.channel_post_handlers.notify(update.channel_post)
            if update.edited_channel_post:
                types.Chat.set_current(update.edited_channel_post.chat)
                return await self.edited_channel_post_handlers.notify(update.edited_channel_post)
            if update.inline_query:
                types.User.set_current(update.inline_query.from_user)
                return await self.inline_query_handlers.notify(update.inline_query)
            if update.chosen_inline_result:
                types.User.set_current(update.chosen_inline_result.from_user)
                return await self.chosen_inline_result_handlers.notify(update.chosen_inline_result)
            if update.callback_query:
                if update.callback_query.message:
                    types.Chat.set_current(update.callback_query.message.chat)
                types.User.set_current(update.callback_query.from_user)
                return await self.callback_query_handlers.notify(update.callback_query)
            if update.shipping_query:
                types.User.set_current(update.shipping_query.from_user)
                return await self.shipping_query_handlers.notify(update.shipping_query)
            if update.pre_checkout_query:
                types.User.set_current(update.pre_checkout_query.from_user)
                return await self.pre_checkout_query_handlers.notify(update.pre_checkout_query)
            if update.poll:
                return await self.poll_handlers.notify(update.poll)
        except Exception as e:
            err = await self.errors_handlers.notify(update, e)
            if err:
                return err
            raise
720513
function update(message) {
	clearLine(stdout, 0); // Clear current STDOUT line
	cursorTo(stdout, 0); // Place cursor at the start
	stdout.write(message.toString());
}
269922
async def update_state(self, msg, _context):
        """"""

        name = msg.get('name')
        status = msg.get('new_status')

        await self.service_manager.update_state(name, status)
1046030
private void updateActionStatus(final Message message) {
        final DmfActionUpdateStatus actionUpdateStatus = convertMessage(message, DmfActionUpdateStatus.class);
        final Action action = checkActionExist(message, actionUpdateStatus);

        final List<String> messages = actionUpdateStatus.getMessage();

        if (isCorrelationIdNotEmpty(message)) {
            messages.add(RepositoryConstants.SERVER_MESSAGE_PREFIX + "DMF message correlation-id "
                    + message.getMessageProperties().getCorrelationId());
        }

        final Status status = mapStatus(message, actionUpdateStatus, action);
        final ActionStatusCreate actionStatus = entityFactory.actionStatus().create(action.getId()).status(status)
                .messages(messages);

        final Action addUpdateActionStatus = getUpdateActionStatus(status, actionStatus);

        if (!addUpdateActionStatus.isActive() || (addUpdateActionStatus.hasMaintenanceSchedule()
                && addUpdateActionStatus.isMaintenanceWindowAvailable())) {
            lookIfUpdateAvailable(action.getTarget());
        }
    }
907162
async function getHandoffFromUpdate (update) {
  if (!has(update, 'message.text')) {
    return
  }

  // having to do own request as watson-developer-cloud package is broken for
  // Tone analyzer
  const toneAnalyzerUrl = 'https://gateway.watsonplatform.net/tone-analyzer/api'

  const params = {
    // Get the text from the JSON file.
    text: update.message.text,
    tones: 'emotion',
    version: '2016-05-19'
  }

  const requestOptions = {
    url: `${toneAnalyzerUrl}/v3/tone`,
    method: 'GET',
    qs: params,
    auth: {
      username: TONE_ANALYSIS_USERNAME,
      password: TONE_ANALYSIS_PASSWORD
    },
    json: true
  }

  const tone = await request(requestOptions)

  if (has(tone, 'document_tone.tone_categories[0].tones')) {
    const sentiments = tone.document_tone.tone_categories[0].tones

    // return sentiment before
    const badSentimentThreshold = 0.7

    for (const sentiment of sentiments) {
      // not too sure about the ones other than anger for now tbh
      if (['Anger', 'Disgust', 'Fear', 'Sadness'].indexOf(sentiment.tone_name) > -1 &&
      sentiment.score > badSentimentThreshold) {
        return 'lowSentiment'
      }
    }
  }
}
814105
def update(self):
        """"""
        if self.client_mode == 'glances':
            return self.update_glances()
        elif self.client_mode == 'snmp':
            return self.update_snmp()
        else:
            self.end()
            logger.critical("Unknown server mode: {}".format(self.client_mode))
            sys.exit(2)
1002200
def updated(self):
        ''
        return dateutil.parser.parse(str(self.f.latestRevision.updated))
1019667
def update(message)
      case message.fetch(:type){""}
      when "error"
        logger.error message
      else
        logger.info message
      end
      exchange_out.publish(message.to_json)
    end
910564
public Observable<ComapiResult<Void>> updateMessageStatus(@NonNull final String conversationId, @NonNull final List<MessageStatusUpdate> msgStatusList) {

        final String token = getToken();

        if (sessionController.isCreatingSession()) {
            return getTaskQueue().queueUpdateMessageStatus(conversationId, msgStatusList);
        } else if (TextUtils.isEmpty(token)) {
            return Observable.error(getSessionStateErrorDescription());
        } else {
            return doUpdateMessageStatus(token, conversationId, msgStatusList);
        }
    }
344312
def update(self, message):
        
        # Firmware version < 2.2a.8.6
        if message.version == 1:
            if message.event_type == 'ALARM_PANIC':
                self._alarmdecoder._update_panic_status(True)
                
            elif message.event_type == 'CANCEL':
                self._alarmdecoder._update_panic_status(False)

        # Firmware version >= 2.2a.8.6
        elif message.version == 2:
            source = message.event_source
            if source == LRR_EVENT_TYPE.CID:
                self._handle_cid_message(message)
            elif source == LRR_EVENT_TYPE.DSC:
                self._handle_dsc_message(message)
            elif source == LRR_EVENT_TYPE.ADEMCO:
                self._handle_ademco_message(message)
            elif source == LRR_EVENT_TYPE.ALARMDECODER:
                self._handle_alarmdecoder_message(message)
            elif source == LRR_EVENT_TYPE.UNKNOWN:
                self._handle_unknown_message(message)
            else:
                pass
896094
def get_updates(self, offset=None, limit=None, timeout=None):
        
        payload = dict(offset=offset, limit=limit, timeout=timeout)
        return self._get('getUpdates', payload)
31577
private String update() {
		// If this has been done before, there is no change in checkSum and the last time notified is within GracePeriod
		if(checksum!=0 && checksum()==checksum && now < last.getTime()+graceEnds && now > last.getTime()+lastdays) {
			return null;
		} else {
			return "UPDATE authz.notify SET last = '" +
					Chrono.dateOnlyStamp(last) +
					"', checksum=" +
					current +
					" WHERE user='" +
					user + 
					"' AND type=" +
					type.getValue() +
					";";
		}
	}