<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(self):
 """ Update Monit deamon and services status. """

        url = self.baseurl + '/_status?format=xml'
        response = self.s.get(url)
        response.raise_for_status()
        from xml.etree.ElementTree import XML
        root = XML(response.text)
        for serv_el in root.iter('service'):
            serv = Monit.Service(self, serv_el)
            self[serv.name] = serv
            # Pendingaction occurs when a service is stopping
            if self[serv.name].pendingaction:
                time.sleep(1)
                return Monit.update(self)
            # Monitor == 2 when service in startup
            if self[serv.name].monitorState == 2:
                time.sleep(1)
                return Monit.update(self)