docs: def collectNodesInTree(treeRoot: LNode, reducibleChildren: Set[LNode]):
      """
      Collect nodes which will be reduced and input nodes of tree for tree of nodes.
  
      :param treeRoot: root node of tree
      :param reducibleChildren: members of tree
      :return: Tuple[reducedNodes, inputEdges] where reducedNodes is List[LNode]
          and inputEdges is List[Tuple[LNode, LPort, LEdge]]
      """
      # List[Tuple[LNode, LPort, LEdge]]
      inputEdges = []
      # List[LNode]
      reducedNodes = []
      # Set[LNode]
      reducedNodesSet = set()
      # An iterative process to print preorder traveral of tree
      # List[Typle[LNode, LPort, LEdge]]
      nodeStack = []
      nodeStack.append((treeRoot, None, None))
  
      # collect nodes in tree and input edges
      while nodeStack:
          # pop the node from stack and try to find it's children
          node, p, e = nodeStack.pop()
          if node in reducibleChildren and node not in reducedNodesSet:
              reducedNodes.append(node)
              reducedNodesSet.add(node)
              # walk inputs and add child nodes to stack
              for _p in node.west:
                  for _e in _p.iterEdges():
                      # assert len(e.srcs) == 1 and len(e.dsts) == 1
                      nodeStack.append((_e.srcs[0].parentNode, _p, _e))
          else:
              inputEdges.append((node, p, e))
  
      return reducedNodes, inputEdges