1from__future__importannotations 2 3frompprintimportpformat 4fromtypingimportAny,NoReturn 5 6frommarkupsafeimportMarkup,escape 7 8fromplain.httpimportResponse 9fromplain.views.exceptionsimportResponseException101112defdd(*objs:Any)->NoReturn:13"""14 Dump and die.1516 Dump the object and raise a ResponseException with the dump as the response content.17 """1819print_objs="\n".join([pformat(obj)forobjinobjs])20print(f"Dumping objects:\n{print_objs}")2122html_objs=[23Markup("<pre><code>")+escape(pformat(obj))+Markup("</code></pre>")24forobjinobjs25]26combined_dump_str=Markup("\n\n").join(html_objs)2728response=Response()29response.status_code=50030response.content=combined_dump_str31response.headers["Content-Type"]="text/html"32raiseResponseException(response)