human
Complete the below
@requires_application()
def test_event_order():

    ''''Test event order'
    '''
 Give me a the Python program you requested?
assistant
#Here is the Python program you requested.
    x = list()
    class MyCanvas(Canvas, ):
        def on_initialize(self, event):
            x.append('init')
        def on_draw(self, event):
            sz = (True if (self.size is not None) else False)
            x.append(('draw    size=%s    show=%s' % (sz, show)))
        def on_close(self, event):
            x.append('close')
    for show in (False, True):
        while x:
            x.pop()
        with MyCanvas(show=show) as c:
            c.update()
            c.app.process_events()
        print x
        assert_true((len(x) >= 3))
        assert_equal(x[0], 'init')
        assert_in('draw    size=True', x[1])
        assert_in('draw    size=True', x[(-2)])
        assert_equal(x[(-1)], 'close')