from bs4 import BeautifulSoup


def generate_soup_html(data):
    """Return an BeautifulSoup HTML parser document."""
    try:
        return BeautifulSoup(data, 'html5lib')
    except:
        raise TypeError(
            'Invalid data passed to BeautifulSoup')