<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def page_response(self, title='', body=''):
 """ Helper to render an html page with dynamic content """

        f = StringIO()
        f.write('<!DOCTYPE html>\n')
        f.write('<html>\n')
        f.write('<head><title>{}</title><head>\n'.format(title))
        f.write('<body>\n<h2>{}</h2>\n'.format(title))
        f.write('<div class="content">{}</div>\n'.format(body))
        f.write('</body>\n</html>\n')
        length = f.tell()
        f.seek(0)
        self.send_response(200)
        encoding = sys.getfilesystemencoding()
        self.send_header("Content-type", "text/html; charset=%s" % encoding)
        self.send_header("Content-Length", str(length))
        self.end_headers()
        self.copyfile(f, self.wfile)
        f.close()