def normalize_datum(self, datum):
        if datum is None:
            return datum
        if isinstance(datum, self.PACKABLE_TYPES):
            return datum
        if isinstance(datum, uuid.UUID):
            datum = str(datum)
        if isinstance(datum, bytearray):
            datum = bytes(datum)
        if isinstance(datum, memoryview):
            datum = datum.tobytes()
        if hasattr(datum, 'isoformat'):
            datum = datum.isoformat()
        if isinstance(datum, (bytes, str)):
            return datum
        if isinstance(datum, (collections.Sequence, collections.Set)):
            return [self.normalize_datum(item) for item in datum]
        if isinstance(datum, collections.Mapping):
            out = {}
            for k, v in datum.items():
                out[k] = self.normalize_datum(v)
            return out
        raise TypeError(
            '{} is not msgpackable'.format(datum.__class__.__name__))