def _check_field_names_unique(self, existing_item, patched_item):
existing_fields_by_name = {f.name: f for f in existing_item.fields}<EOL>for patched_field in patched_item.fields:<EOL><INDENT>if patched_field.name in existing_fields_by_name.keys():<EOL><INDENT>existing_field = existing_fields_by_name[patched_field.name]<EOL>raise InvalidSpec('<STR_LIT>'<EOL>.format(quote(patched_field.name),<EOL>quote(patched_item.name),<EOL>existing_field.path,<EOL>existing_field.lineno), patched_field.lineno, patched_field.path)<EOL><DEDENT><DEDENT>
Enforces that patched fields don't already exist.