def METHOD_NAME(
    wxr: WiktextractContext,
    node: Union[WikiNode, str],
    target_section: Union[str, List[str]],
) -> Optional[WikiNode]:
    if isinstance(node, WikiNode):
        if node.kind in LEVEL_KINDS:
            section_title = clean_node(wxr, None, node.largs)
            if (
                isinstance(target_section, str)
                and section_title == target_section
            ):
                return node
            if (
                isinstance(target_section, list)
                and section_title in target_section
            ):
                return node
        for child in node.children:
            returned_node = METHOD_NAME(wxr, child, target_section)
            if returned_node is not None:
                return returned_node
    return None