<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def visit_literal_block(self, node):
 """Visit a ``literal_block`` node. This verifies the state of each literal / code block. """

        language = node.attributes.get("language", "")
        test_type = node.attributes.get("testnodetype", "")
        if test_type != "doctest":
            if language.lower() in ("", "python"):
                msg = _LITERAL_ERR_TEMPLATE.format(
                    node.rawsource, language, test_type
                )
                raise errors.ExtensionError(msg)

        # The base classes are not new-style, so we can't use super().
        return html.HTMLTranslator.visit_literal_block(self, node)