def assert_valid_input(cls, tag):
        """Check if valid input tag or document."""

        # Fail on unexpected types.
        if not cls.is_tag(tag):
            raise TypeError("Expected a BeautifulSoup 'Tag', but instead recieved type {}".format(type(tag)))
def assert_valid_input ( cls , tag ) : if not cls . is_tag ( tag ) : raise TypeError ( "Expected a BeautifulSoup 'Tag', but instead recieved type {}" . format ( type ( tag ) ) )
Check if valid input tag or document.