def get_single_node(self):
    self.get_event()
    document = None
    if (not self.check_event(StreamEndEvent)):
        document = self.compose_document()
    if (not self.check_event(StreamEndEvent)):
        event = self.get_event()
        raise ComposerError('expected a single document in the stream', document.start_mark, 'but found another document', event.start_mark)
    self.get_event()
    return document
def get_single_node(self):
    self.get_event()
    document = None
    if (not self.check_event(StreamEndEvent)):
        document = self.compose_document()
    if (not self.check_event(StreamEndEvent)):
        event = self.get_event()
        raise ComposerError('expected a single document in the stream', document.start_mark, 'but found another document', event.start_mark)
    self.get_event()
    return document