def is_valid_html(content: str) -> bool:
    """
    Checks if the given content is a valid HTML document.
    """
    if content is None:
        return False

    if is_url(content):
        try:
            response = requests.get(content)
            if response.status_code == 200:
                html_content = response.text
                return (
                    BeautifulSoup(html_content, "html.parser").find("html") is not None
                )
            else:
                return False
        except (
            requests.exceptions.RequestException,
            requests.exceptions.ConnectionError,
        ):
            # If there is a connection error or the URL doesn't resolve, skip it
            return False

    return BeautifulSoup(content, "html.parser").find("html") is not None

    Checks if the given content is a valid HTML document.
    
llama-index-integrations/readers/llama-index-readers-wordlift/llama_index/readers/wordlift/base.py