<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getEvent(self, name):
 """ Returns the named event. Removes it from the internal queue. """

        to_return = None
        for event in self._observer.caught_events:
            if event["name"] == name:
                to_return = event
                break
        if to_return:
            self._observer.caught_events.remove(to_return)
            self._observer.activate_event(to_return["name"])
        return to_return