1frompprintimportpformat 2 3frommarkupsafeimportMarkup,escape 4 5fromplain.httpimportResponse 6fromplain.views.exceptionsimportResponseException 7 8 9defdd(*objs):10"""11 Dump and die.1213 Dump the object and raise a ResponseException with the dump as the response content.14 """1516print_objs="\n".join([pformat(obj)forobjinobjs])17print(f"Dumping objects:\n{print_objs}")1819html_objs=[20Markup("<pre><code>")+escape(pformat(obj))+Markup("</code></pre>")21forobjinobjs22]23combined_dump_str=Markup("\n\n").join(html_objs)2425response=Response()26response.status_code=50027response.content=combined_dump_str28response.content_type="text/html"29raiseResponseException(response)