<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __yield_handlers(self, event_type):
 """ Yield all the handlers registered for the given event type. """

        if event_type not in self.event_types:
            raise ValueError("%r not found in %r.event_types == %r" % (event_type, self, self.event_types))

        # Search handler stack for matching event handlers
        for frame in list(self._event_stack):
            if event_type in frame:
                yield frame[event_type]

        # Check instance for an event handler
        if hasattr(self, event_type):
            yield getattr(self, event_type)