'Iterate over all events and send them to handler.
This method is not meant to be called from the interface.
Only use in tests.
Args:
events: Iterator or generator containing events to process.
raises:
EventListenerParserError when a yaml.parser.ParserError is raised.
EventError when an exception occurs during the handling of an event.'

def _HandleEvents(self, events):

    for event in events:
        try:
            self.HandleEvent(*event)
        except Exception as e:
            (event_object, loader) = event
            raise yaml_errors.EventError(e, event_object)
