<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def with_wait_cursor(func):
 """ Show a wait cursor while the wrapped function is running. The cursor is restored as soon as the function exits. :param func: wrapped function """

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        QApplication.setOverrideCursor(
            QCursor(Qt.WaitCursor))
        try:
            ret_val = func(*args, **kwargs)
        finally:
            QApplication.restoreOverrideCursor()
        return ret_val
    return wrapper