code: 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))
docs: Serializes a dictionary into JSON.
  
          A dictionary with a single key can be passed and it can contain any
          structure.