<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def poll(self):
        '''check for events, returning one event'''
        if self.out_queue.qsize() <= 0:
            return None
        evt = self.out_queue.get()
        while isinstance(evt, win_layout.WinLayout):
            win_layout.set_layout(evt, self.set_layout)
            if self.out_queue.qsize() == 0:
                return None
            evt = self.out_queue.get()
        return evt