def _extract_constants(self, specification):
constants = {}<EOL>for attribute in specification.attributes:<EOL><INDENT>if attribute.allowed_choices and len(attribute.allowed_choices) > <NUM_LIT:0>:<EOL><INDENT>name = attribute.local_name<EOL>name = name[:<NUM_LIT:1>].upper() + name[<NUM_LIT:1>:]<EOL>for choice in attribute.allowed_choices:<EOL><INDENT>constants["<STR_LIT>" % (self._class_prefix, specification.entity_name, name, choice.upper())] = choice<EOL><DEDENT><DEDENT><DEDENT>return constants<EOL>
Removes attributes and computes constants