<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _extract_constants(self, specification):
 """ Removes attributes and computes constants """

        constants = {}

        for attribute in specification.attributes:

            if attribute.allowed_choices and len(attribute.allowed_choices) > 0:

                name = attribute.local_name.upper()

                for choice in attribute.allowed_choices:
                    constants["CONST_%s_%s" % (name, choice.upper())] = choice

        return constants