def _parse_caption(self, node, state):
if node.tag not in ["<STR_LIT>", "<STR_LIT>"]:  <EOL><INDENT>return state<EOL><DEDENT>parent = state["<STR_LIT>"][node]<EOL>stable_id = (<EOL>f"<STR_LIT>"<EOL>f"<STR_LIT>"<EOL>f"<STR_LIT>"<EOL>f"<STR_LIT::>"<EOL>f"<STR_LIT>"<EOL>)<EOL>name = node.attrib["<STR_LIT:name>"] if "<STR_LIT:name>" in node.attrib else None<EOL>if isinstance(parent, Table):<EOL><INDENT>state["<STR_LIT>"][node] = Caption(<EOL>document=state["<STR_LIT>"],<EOL>table=parent,<EOL>figure=None,<EOL>stable_id=stable_id,<EOL>name=name,<EOL>position=state["<STR_LIT>"]["<STR_LIT>"],<EOL>)<EOL><DEDENT>elif isinstance(parent, Figure):<EOL><INDENT>state["<STR_LIT>"][node] = Caption(<EOL>document=state["<STR_LIT>"],<EOL>table=None,<EOL>figure=parent,<EOL>stable_id=stable_id,<EOL>name=name,<EOL>position=state["<STR_LIT>"]["<STR_LIT>"],<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise NotImplementedError("<STR_LIT>")<EOL><DEDENT>state["<STR_LIT>"]["<STR_LIT>"] += <NUM_LIT:1><EOL>return state<EOL>
Parse a Caption of the node.

        :param node: The lxml node to parse
        :param state: The global state necessary to place the node in context
            of the document as a whole.