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

def run(self):
        '''Run until there are no events to be processed.'''
        # We left-append rather than emit (right-append) because some message
        # may have been already queued for execution before the director runs.
        global_event_queue.appendleft((INITIATE, self, (), {}))
        while global_event_queue:
            self.process_event(global_event_queue.popleft())