#NEWLINE# def render( element , level = 0 ) : #NEWLINE# #INDENT# 'Renders the HTML builder `element` and it\'s children to a string.\n    Example::\n\n        >>> print(\n        ...     render(\n        ...         html.form(action=\'/search\', name=\'f\')(\n        ...             html.input(name=\'q\'),\n        ...             html.input(name=\'search_button\', type=\'submit\')\n        ...         )\n        ...     )\n        ... )\n        <form action="/search" name="f">\n          <input name="q" />\n          <input type="submit" name="search_button" />\n        </form>\n\n    The :func:`render` function accepts the following arguments:\n\n    :param element: element created through the `html` builder instance, a list\n                    of such elements, or just a string.\n    :param level: indentation level of the rendered element with a step of two\n                  spaces.  If `level` is `None`, the `element` will be rendered\n                  without indentation and new line transferring, passing the\n                  same rule to the child elements.\n    ' #NEWLINE# if hasattr ( element , 'render' ) : #NEWLINE# #INDENT# return element . render ( level ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( element , basestring ) : #NEWLINE# #INDENT# return _render_string ( element , level ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( element , '__iter__' ) : #NEWLINE# #INDENT# return _render_iteratable ( element , level ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( element is None ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# raise TypeError ( ( 'Cannot render %r' % element ) )