code: def to_raw(self, value, context=None):
          
          if value is None:
              return None
          res = {}
          value = value.copy()
          errors = []
          for field in list(set(value) & set(self._fields)):
              schema = self._fields.get(field)
              name = schema.get_attr('name', field)
              try:
                  res[name] = \
                      schema.to_raw(value.pop(field), context=context)
              except exceptions.ValidationErrors as ex:
                  self._update_errors_by_exception(errors, ex, name)
  
          self._raise_exception_when_errors(errors, value)
          res.update(value)
          return res
docs: Convert the value to a JSON compatible value