def htmlprettify(html):
 if (not HAVE_BS4):
  return html
 with warnings.catch_warnings():
  warnings.simplefilter('ignore', lineno=182)
  return bs4.BeautifulSoup(html, 'html.parser').prettify()

def htmlprettify ( html ) : if ( not HAVE_BS4 ) : return html with warnings . catch_warnings ( ) : warnings . simplefilter ( 'ignore' , lineno = 182 ) return bs4 . BeautifulSoup ( html , 'html.parser' ) . prettify ( )
beautifies html through beautifulsoup4 .