def add_namespaces(metadata, namespaces):<EOL>
for key, value in metadata.items():<EOL><INDENT>if key not in namespaces:<EOL><INDENT>namespaces[key] = value<EOL><DEDENT>elif namespaces[key] != value:<EOL><INDENT>raise validate.ValidationException(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(key, namespaces[key], value))<EOL><DEDENT><DEDENT>
Collect the provided namespaces, checking for conflicts.