def _no_duplicates_constructor(loader, node, deep=False):
mapping = {}<EOL>for key_node, value_node in node.value:<EOL><INDENT>key = loader.construct_object(key_node, deep=deep)<EOL>value = loader.construct_object(value_node, deep=deep)<EOL>if key in mapping:<EOL><INDENT>raise ConstructorError("<STR_LIT>",<EOL>node.start_mark,<EOL>"<STR_LIT>" % key,<EOL>key_node.start_mark)<EOL><DEDENT>mapping[key] = value<EOL><DEDENT>return loader.construct_mapping(node, deep)<EOL>
Check for duplicate keys.