def decide_mimetype(self, accepts, context_aware = False):
mimetype = None<EOL>if accepts is None or accepts.strip() == '<STR_LIT>':<EOL><INDENT>mimetype = self.get_default_mimetype()<EOL>return mimetype<EOL><DEDENT>if context_aware:<EOL><INDENT>mimetype = mimeparse.best_match(all_mimetypes + self.all_mimetypes + [WILDCARD], accepts)<EOL><DEDENT>else:<EOL><INDENT>mimetype = mimeparse.best_match(ctxless_mimetypes + self.ctxless_mimetypes + [WILDCARD], accepts)<EOL><DEDENT>if mimetype == '<STR_LIT>':<EOL><INDENT>mimetype = None<EOL><DEDENT>if mimetype == WILDCARD:<EOL><INDENT>mimetype = self.get_wildcard_mimetype()<EOL><DEDENT>return mimetype<EOL>
Returns what mimetype the client wants to receive
            Parses the given Accept header and returns the best one that
            we know how to output
            An empty Accept will default to application/rdf+xml
            An Accept with */* use rdf+xml unless a better match is found
            An Accept that doesn't match anything will return None