def serialize(self, data):
if data is None:<EOL><INDENT>return None<EOL><DEDENT>elif isinstance(data, dict):<EOL><INDENT>return serializer.Serializer().serialize(data)<EOL><DEDENT>else:<EOL><INDENT>raise Exception(_("<STR_LIT>") %<EOL>type(data))<EOL><DEDENT>
Serializes a dictionary into JSON.

        A dictionary with a single key can be passed and it can contain any
        structure.