def __search(tree, target_node_name):
    """
    Searches for the target node in BFS order.
    :param tree: Tree
    :param target_node_name: synset / word-sense
    :return: parent node or None if it could not find node with target_node_name
    """
    q = [tree.root]
    while len(q) > 0:
        node = q.pop()
        for child in node.children:
            if child.word == target_node_name:
                return child
            q.insert(0, child)
    return None