code: def _response_mimetype_based_on_accept_header(self):
          
          response_mimetype = None
  
          if not request.accept_mimetypes:
              response_mimetype = self.default_mimetype
          else:
              all_media_types_wildcard = '*/*'
  
              for mimetype, q in request.accept_mimetypes:
                  if mimetype == all_media_types_wildcard:
                      response_mimetype = self.default_mimetype
                      break
                  if mimetype in self.response_formatters:
                      response_mimetype = mimetype
                      break
  
          return response_mimetype
docs: Determines mimetype to response based on Accept header.
  
          If mimetype is not found, it returns ``None``.