def select_children(
        self, selected: Set[UniqueId], max_depth: Optional[int] = None
    ) -> Set[UniqueId]:
        """Returns all nodes which are descendants of the 'selected' set.
        Nodes in the 'selected' set are counted as children only if
        they are descendants of other nodes in the 'selected' set."""
        children: Set[UniqueId] = set()
        i = 0
        while len(selected) > 0 and (max_depth is None or i < max_depth):
            next_layer: Set[UniqueId] = set()
            for node in selected:
                next_layer.update(
                    iter(
                        e[1]
                        for e in self.graph.out_edges(node)
                        if e[1] not in children
                        and self.filter_edges_by_type(e[0], e[1], "parent_test")
                    )
                )
            children.update(next_layer)
            selected = next_layer
            i += 1

        return children
Returns all nodes which are descendants of the 'selected' set.
        Nodes in the 'selected' set are counted as children only if
        they are descendants of other nodes in the 'selected' set.
core/dbt/graph/graph.py