code: def validate(self, document, schema=None, update=False, normalize=True):
          
          self.update = update
          self._unrequired_by_excludes = set()
  
          self.__init_processing(document, schema)
          if normalize:
              self.__normalize_mapping(self.document, self.schema)
  
          for field in self.document:
              if self.ignore_none_values and self.document[field] is None:
                  continue
              definitions = self.schema.get(field)
              if definitions is not None:
                  self.__validate_definitions(definitions, field)
              else:
                  self.__validate_unknown_fields(field)
  
          if not self.update:
              self.__validate_required_fields(self.document)
  
          self.error_handler.end(self)
  
          return not bool(self._errors)
docs: Normalizes and validates a mapping against a validation-schema of
          defined rules.
  
          :param document: The document to normalize.
          :type document: any :term:`mapping`
          :param schema: The validation schema. Defaults to :obj:`None`. If not
                         provided here, the schema must have been provided at
                         class instantiation.
          :type schema: any :term:`mapping`
          :param update: If ``True``, required fields won't be checked.
          :type update: :class:`bool`
          :param normalize: If ``True``, normalize the document before validation.
          :type normalize: :class:`bool`
  
          :return: ``True`` if validation succeeds, otherwise ``False``. Check
                   the :func:`errors` property for a list of processing errors.
          :rtype: :class:`bool`