<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def image_undo():
 """ Undoes the last coarsen or smooth command. """

    if len(image_undo_list) <= 0:
        print("no undos in memory")
        return

    [image, Z] = image_undo_list.pop(-1)
    image.set_array(Z)
    _pylab.draw()