<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _update_alarm_status(self, message=None, status=None, zone=None, user=None):
 """ Uses the provided message to update the alarm state. :param message: message to use to update :type message: :py:class:`~alarmdecoder.messages.Message` :param status: alarm status, overrides message bits. :type status: bool :param user: user associated with alarm event :type user: string :returns: bool indicating the new status """


        alarm_status = status
        alarm_zone = zone
        if isinstance(message, Message):
            alarm_status = message.alarm_sounding
            alarm_zone = message.parse_numeric_code()

        if alarm_status != self._alarm_status:
            self._alarm_status, old_status = alarm_status, self._alarm_status

            if old_status is not None or status is not None:
                if self._alarm_status:
                    self.on_alarm(zone=alarm_zone)
                else:
                    self.on_alarm_restored(zone=alarm_zone, user=user)

        return self._alarm_status