def make_links_absolute(root, base_url):
 def link_repl(href):
  return urljoin(base_url, href)
 rewrite_links(root, link_repl)

def make_links_absolute ( root , base_url ) : def link_repl ( href ) : return urljoin ( base_url , href ) rewrite_links ( root , link_repl )
make all links in the document absolute .