def make_response(self, rv):
status_or_headers = headers = None<EOL>if isinstance(rv, tuple):<EOL><INDENT>rv, status_or_headers, headers = rv + (None,) * (<NUM_LIT:3> - len(rv))<EOL><DEDENT>if rv is None:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if isinstance(status_or_headers, (dict, list)):<EOL><INDENT>headers, status_or_headers = status_or_headers, None<EOL><DEDENT>D = json.loads(extract_raw_data_request(request))<EOL>if type(D) is list:<EOL><INDENT>raise InvalidRequestError('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>response_obj = self.empty_response(version=D['<STR_LIT>'])<EOL>response_obj['<STR_LIT:id>'] = D['<STR_LIT:id>']<EOL>response_obj['<STR_LIT:result>'] = rv<EOL>response_obj.pop('<STR_LIT:error>', None)<EOL>rv = jsonify(response_obj)<EOL><DEDENT>if status_or_headers is not None:<EOL><INDENT>if isinstance(status_or_headers, string_types):<EOL><INDENT>rv.status = status_or_headers<EOL><DEDENT>else:<EOL><INDENT>rv.status_code = status_or_headers<EOL><DEDENT><DEDENT>if headers:<EOL><INDENT>rv.headers.extend(headers)<EOL><DEDENT>return rv<EOL>
Converts the return value from a view function to a real
        response object that is an instance of :attr:`response_class`.