(self, spec: SelectionSpec)
return direct_nodes, indirect_nodes
If the spec is a composite spec (a union, difference, or intersection),
        recurse into its selections and combine them. If the spec is a concrete
        selection criteria, resolve that using the given graph.
If the spec is a composite spec (a union, difference, or intersection),
        recurse into its selections and combine them. If the spec is a concrete
        selection criteria, resolve that using the given graph.
If the spec is a composite spec ( a union difference or intersection ) recurse into its selections and combine them . If the spec is a concrete selection criteria resolve that using the given graph .
def select_nodes_recursively(self, spec: SelectionSpec) -> Tuple[Set[UniqueId], Set[UniqueId]]:
        """If the spec is a composite spec (a union, difference, or intersection),
        recurse into its selections and combine them. If the spec is a concrete
        selection criteria, resolve that using the given graph.
        """
        if isinstance(spec, SelectionCriteria):
            direct_nodes, indirect_nodes = self.get_nodes_from_criteria(spec)
        else:
            bundles = [
                self.select_nodes_recursively(component)
                for component in spec
            ]

            direct_sets = []
            indirect_sets = []

            for direct, indirect in bundles:
                direct_sets.append(direct)
                indirect_sets.append(direct | indirect)

            initial_direct = spec.combined(direct_sets)
            indirect_nodes = spec.combined(indirect_sets)

            direct_nodes = self.incorporate_indirect_nodes(initial_direct, indirect_nodes)

            if spec.expect_exists:
                alert_non_existence(spec.raw, direct_nodes)

        return direct_nodes, indirect_nodes
def select_nodes_recursively ( self , spec : SelectionSpec ) -> Tuple [ Set [ UniqueId ] , Set [ UniqueId ] ] : if isinstance ( spec , SelectionCriteria ) : direct_nodes , indirect_nodes = self . get_nodes_from_criteria ( spec ) else : bundles = [ self . select_nodes_recursively ( component ) for component in spec ] direct_sets = [ ] indirect_sets = [ ] for direct , indirect in bundles : direct_sets . append ( direct ) indirect_sets . append ( direct | indirect ) initial_direct = spec . combined ( direct_sets ) indirect_nodes = spec . combined ( indirect_sets ) direct_nodes = self . incorporate_indirect_nodes ( initial_direct , indirect_nodes ) if spec . expect_exists : alert_non_existence ( spec . raw , direct_nodes ) return direct_nodes , indirect_nodes