def serialize_dict(self, msg_dict):
serialized = json.dumps(msg_dict, namedtuple_as_object=False)<EOL>if PY2:<EOL><INDENT>serialized = serialized.decode("<STR_LIT:utf-8>")<EOL><DEDENT>serialized = "<STR_LIT>".format(serialized)<EOL>return serialized<EOL>
Serialize to JSON a message dictionary.