def serialize(self, data):
        """Serializes a dictionary into JSON.

        A dictionary with a single key can be passed and it can contain any
        structure.
        """
        if data is None:
            return None
        elif isinstance(data, dict):
            return serializer.Serializer().serialize(data)
        else:
            raise Exception(_("Unable to serialize object of type = '%s'") %
                            type(data))
def serialize ( self , data ) : if data is None : return None elif isinstance ( data , dict ) : return serializer . Serializer ( ) . serialize ( data ) else : raise Exception ( _ ( "Unable to serialize object of type = '%s'" ) % type ( data ) )
Serializes a dictionary into JSON.

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