code: def _extract_constants(self, specification):
          
          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
docs: Removes attributes and computes constants