def output(self, output, accepts, set_http_code, set_content_type):
graph = Decorator._get_graph(output)<EOL>if graph is not None:<EOL><INDENT>output_mimetype, output_format = self.format_selector.decide(accepts, graph.context_aware)<EOL>if output_mimetype is None:<EOL><INDENT>set_http_code("<STR_LIT>")<EOL>return ['<STR_LIT>'.encode('<STR_LIT:utf-8>')]<EOL><DEDENT>if '<STR_LIT:text>' in output_mimetype:<EOL><INDENT>output_mimetype = output_mimetype + '<STR_LIT>'<EOL><DEDENT>serialized = graph.serialize(format=output_format)<EOL>set_content_type(output_mimetype)<EOL>return [serialized]<EOL><DEDENT>else:<EOL><INDENT>return output<EOL><DEDENT>
Formats a response from a WSGI app to handle any RDF graphs
            If a view function returns a single RDF graph, serialize it based on Accept header
            If it's not an RDF graph, return it without any special handling