code: def _get_enum(self, source, bitarray):
          ''' Get enum value, based on the data in XML '''
          raw_value = self._get_raw(source, bitarray)
  
          # Find value description.
          value_desc = source.find('item', {'value': str(raw_value)}) or self._get_rangeitem(source, raw_value)
  
          return {
              source['shortcut']: {
                  'description': source.get('description'),
                  'unit': source.get('unit', ''),
                  'value': value_desc['description'].format(value=raw_value),
                  'raw_value': raw_value,
              }
          f _get_enum(self, source, bitarray):
          ''' Get enum value, based on the data in XML '''
          raw_value = self._get_raw(source, bitarray)
  
          # Find value description.
          value_desc = source.find('item', {'value': str(raw_value)}) or self._get_rangeitem(source, raw_value)
  
          return {
              source['shortcut']: {
                  'description': source.get('description'),
                  'unit': source.get('unit', ''),
                  'value': value_desc['description'].format(value=raw_value),
                  'raw_value': raw_value,
              }
          }
docs: Get enum value, based on the data in XML