def _coerce_properties(self):
        """Force properties to be set to the correct data type"""
        for key, value in self.properties.items():
            _type = specification.Basic.Properties.type(key)
            if self.properties[key] is None:
                continue
            if _type == 'shortstr':
                if not utils.is_string(value):
                    LOGGER.warning('Coercing property %s to bytes', key)
                    value = str(value)
                self.properties[key] = utils.maybe_utf8_encode(value)
            elif _type == 'octet' and not isinstance(value, int):
                LOGGER.warning('Coercing property %s to int', key)
                try:
                    self.properties[key] = int(value)
                except __HOLE__ as error:
                    LOGGER.warning('Could not coerce %s: %s', key, error)
            elif _type == 'table' and not isinstance(value, dict):
                LOGGER.warning('Resetting invalid value for %s to None', key)
                self.properties[key] = {}
            if key == 'timestamp':
                self.properties[key] = self._as_datetime(value)
dataset/ETHPy150Open gmr/rabbitpy/rabbitpy/message.py/Message._coerce_properties