code: def from_representation(self, representation):
          object_dict = {}
          failed = {}
          for name, field in self.fields.items():
              if name not in representation:
                  continue
              try:
                  if (
                      not isinstance(representation[name], (list, tuple)) and
                      field.many
                  ):
                      raise ValueError("field should be sequence")
                  source = _source(name, field)
                  value = representation[name]
                  if field.many:
                      if not field.allow_null:
                          object_dict[source] = [
                              field.from_representation(single_value)
                              for single_value in value
                          ]
                      else:
                          object_dict[source] = [
                              field.from_representation(single_value)
                              if single_value is not None else None
                              for single_value in value
                          ]
                  else:
                      if not field.allow_null:
                          object_dict[source] = field.from_representation(value)
                      else:
                          object_dict[source] = field.from_representation(
                              value) if value else None
              except ValueError as err:
                  failed[name] = str(err)
          if failed:
              try:
                  self.validate(object_dict)
                  raise DeserializationError()
              except DeserializationError as err:
                  err.failed = failed
                  raise
          return object_dict