def collect_footnotes(self, node: Element) -> Dict[(str, List[Union[(collected_footnote, bool)]])]:

    def footnotes_under(n: Element) -> Iterator[nodes.footnote]:
        if isinstance(n, nodes.footnote):
            (yield n)
        else:
            for c in n.children:
                if isinstance(c, addnodes.start_of_file):
                    continue
                elif isinstance(c, nodes.Element):
                    (yield from footnotes_under(c))
    fnotes: Dict[(str, List[Union[(collected_footnote, bool)]])] = {}
    for fn in footnotes_under(node):
        label = cast(nodes.label, fn[0])
        num = label.astext().strip()
        fnotes[num] = [collected_footnote('', *fn.children), False]
    return fnotes
def collect_footnotes(self, node: Element) -> Dict[(str, List[Union[(collected_footnote, bool)]])]:

    def footnotes_under(n: Element) -> Iterator[nodes.footnote]:
        if isinstance(n, nodes.footnote):
            (yield n)
        else:
            for c in n.children:
                if isinstance(c, addnodes.start_of_file):
                    continue
                elif isinstance(c, nodes.Element):
                    (yield from footnotes_under(c))
    fnotes: Dict[(str, List[Union[(collected_footnote, bool)]])] = {}
    for fn in footnotes_under(node):
        label = cast(nodes.label, fn[0])
        num = label.astext().strip()
        fnotes[num] = [collected_footnote(, *fn.children), False]
    return fnotes