def validate(self):
        for dictionary, serializer in zip(self.messages, self.serializers):
            if serializer is not None:
                serializer.validate(dictionary)
            for key in dictionary:
                if not isinstance(key, unicode):
                    if isinstance(key, bytes):
                        key.decode("utf-8")
                    else:
                        raise TypeError(dictionary, "%r is not unicode" % (key,))
            if serializer is not None:
                serializer.serialize(dictionary)

            # Make sure we can be encoded with different JSON encoder, since
            # ujson has different behavior in some cases:
            fast_json.dumps(dictionary)
            slow_json.dumps(dictionary)
Validate all written messages.
dataset/ETHPy150Open ClusterHQ/eliot/eliot/_output.py/MemoryLogger.validate