<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait_for_service(self, interval=1):
 """ Wait for the online model to be ready for service. :param interval: check interval """

        while self.status in (OnlineModel.Status.DEPLOYING, OnlineModel.Status.UPDATING):
            time.sleep(interval)
        if self.status == OnlineModel.Status.DEPLOY_FAILED:
            raise OnlineModelError(self.last_fail_msg, self)
        elif self.status != OnlineModel.Status.SERVING:
            raise OnlineModelError('Unexpected status occurs: %s' % self.status.value, self)