def unique(enumeration):
duplicates = []<EOL>for name, member in enumeration.__members__.items():<EOL><INDENT>if name != member.name:<EOL><INDENT>duplicates.append((name, member.name))<EOL><DEDENT><DEDENT>if duplicates:<EOL><INDENT>duplicate_names = '<STR_LIT:U+002CU+0020>'.join(<EOL>["<STR_LIT>" % (alias, name) for (alias, name) in duplicates]<EOL>)<EOL>raise ValueError('<STR_LIT>' %<EOL>(enumeration, duplicate_names)<EOL>)<EOL><DEDENT>return enumeration<EOL>
Class decorator that ensures only unique members exist in an enumeration.