def METHOD_NAME(self, parent, index):
    if self.check_event(AliasEvent):
        event = self.get_event()
        anchor = event.anchor
        if anchor not in self.anchors:
            raise ComposerError(None, None, "found undefined alias %r"
                    % anchor, event.start_mark)
        return self.anchors[anchor]
    event = self.peek_event()
    anchor = event.anchor
    if anchor is not None:
        if anchor in self.anchors:
            raise ComposerError("found duplicate anchor %r; first occurrence"
                    % anchor, self.anchors[anchor].start_mark,
                    "second occurrence", event.start_mark)
    self.descend_resolver(parent, index)
    if self.check_event(ScalarEvent):
        node = self.compose_scalar_node(anchor)
    elif self.check_event(SequenceStartEvent):
        node = self.compose_sequence_node(anchor)
    elif self.check_event(MappingStartEvent):
        node = self.compose_mapping_node(anchor)
    self.ascend_resolver()
    return node