def METHOD_NAME(self, anchor):
    start_event = self.get_event()
    tag = start_event.tag
    if tag is None or tag == '!':
        tag = self.resolve(MappingNode, None, start_event.implicit)
    node = MappingNode(tag, [],
            start_event.start_mark, None,
            flow_style=start_event.flow_style)
    if anchor is not None:
        self.anchors[anchor] = node
    while not self.check_event(MappingEndEvent):
        #key_event = self.peek_event()
        item_key = self.compose_node(node, None)
        #if item_key in node.value:
        #    raise ComposerError("while composing a mapping", start_event.start_mark,
        #            "found duplicate key", key_event.start_mark)
        item_value = self.compose_node(node, item_key)
        #node.value[item_key] = item_value
        node.value.append((item_key, item_value))
    end_event = self.get_event()
    node.end_mark = end_event.end_mark
    return node