'Decode the value to the required type.'

def Decode(self, attribute, value):

    required_type = self._attribute_types.get(attribute, 'bytes')
    if (required_type in ('integer', 'unsigned_integer')):
        return structs.VarintReader(value, 0)[0]
    elif (required_type == 'string'):
        return utils.SmartUnicode(value)
    else:
        return value
