import urllib def inline(doc, doctype="html", mime="text/html;charset=utf-8"): if doctype == "html": mime = "text/html;charset=utf-8" elif doctype == "xhtml": mime = "application/xhtml+xml" doc = r"""