Update the state of type specified (current or target).

        Args:
            state_type(str): Type of state to update, current or target.
            value (str): New state value.

        Returns:
            timestamp, current time
438724
def _update_state(self, state_type: str, value: str) -> datetime:
        
        timestamp = datetime.utcnow()
        field = '{}_state'.format(state_type)
        old_state = DB.get_hash_value(self._key, field)
        DB.set_hash_value(self._key, field, value, pipeline=True)
        DB.set_hash_value(self._key, '{}_timestamp'.format(state_type),
                          timestamp.isoformat(), pipeline=True)
        DB.execute()

        # Publish an event to notify subscribers of the change in state
        self.publish('{}_state_updated'.format(state_type),
                     event_data=dict(state=value, old_state=old_state))

        return timestamp
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
1238161
def update_state(self):
        
        response = self.api_interface.get_device_state(self, type_override="button")
        return self._update_state_from_response(response)
1286636
def timestamps(self, use_current=True):
        
        if use_current:
            self.timestamp("created_at").use_current()
            self.timestamp("updated_at").use_current()
        else:
            self.timestamp("created_at")
            self.timestamp("updated_at")
555465
def set_state(self, updater=None, **kwargs):
        
        if callable(updater):
            state_change = updater(self)
        elif updater is not None:
            state_change = updater
        else:
            state_change = kwargs

        return [callback_result
                for k, v in state_change.items()
                for callback_result in self.set(k, v)]
159881
def update_state(self, up_to_timestamp):
        
        for stream_id in self.streams:
            self.streams[stream_id].calculated_intervals = TimeIntervals([(MIN_DATE, up_to_timestamp)])
        self.up_to_timestamp = up_to_timestamp
890743
def update(self, value=None):
        

        # Update self.value
        if value is None:
            value = self._current_value + 1
        self._current_value = value

        # Choose the appropriate environment
        if self._ipython_widget:
            try:
                self._update_ipython_widget(value)
            except RuntimeError:
                pass
        else:
            self._update_console(value)
978787
def update_row(self, value):
		
		if not self.__history_mode:
			self.__current_row = value
		else:
			self.history().update(value, self.history().position())
36872
def update_record(self, identifier, rtype=None, name=None, content=None, **kwargs):
        
        if not rtype and kwargs.get('type'):
            warnings.warn('Parameter "type" is deprecated, use "rtype" instead.',
                          DeprecationWarning)
            rtype = kwargs.get('type')

        return self._update_record(identifier, rtype=rtype, name=name, content=content)
999310
def update_status(type, state)
      @status[type] = state
      (@status_callbacks || []).each do |callback|
        begin
          callback.call(type, state)
        rescue RuntimeError => e
          ErrorTracker.log(self, "Failed status callback", e, nil, :caller)
        end
      end
      @status
    end
610512
def update(self, size):
        
        if not isinstance(size, int):
            raise ValueError('{} type can not be displayed. '
                             'Please change it to Int.'.format(type(size)))

        self.current_size += size
        self.display_queue.put((self.current_size, self.total_length))
791978
def update(self, value):
        
        self.update_internal(value)
        self.emit('changed', self.get_widget_value())
490336
def post(self, request, *args, **kwargs):
        
        return self.update_type(request, *args, **kwargs)
1235258
def update_state
      current_state.dup.tap do |s|
        src = eval_parameter :src
        s[src] = next_state s[src]
      end
    end
1014760
public void updateStatus(long time,Object currentValue){
		this.currentStatus.setTime(time);
		this.currentStatus.setLastValue(currentValue);
	}
1094330
def value(self, new_value):
        
        self._value = (datetime.now(), new_value)
        self.history_add(self._value)
663454
def update(self, dt=-1):
        
        self.library.update.argtypes = [c_double]
        self.library.update.restype = c_int
        if dt == -1:
            # use default timestep
            dt = self.get_time_step()
        result = wrap(self.library.update)(dt)
        return result