def _make_links_absolute(html, base_url):
    """
    Make all links absolute in the given HTML (relative to the given base_url).
    """
    from lxml.html import fromstring, tostring
    parsed = fromstring(html)
    parsed.make_links_absolute(base_url)
    return tostring(parsed)
