<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_deletion(self, interval=1):
 """ Wait for the online model to be deleted. :param interval: check interval """

        deleted = False
        while True:
            try:
                if self.status != OnlineModel.Status.DELETING:
                    break
            except errors.NoSuchObject:
                deleted = True
                break
            time.sleep(interval)

        if not deleted:
            if self.status == OnlineModel.Status.DELETE_FAILED:
                raise OnlineModelError(self.last_fail_msg, self)
            else:
                raise OnlineModelError('Unexpected status occurs: %s' % self.status.value, self)