def get_nodes_from_criteria(
        self, spec: SelectionCriteria
    ) -> Tuple[Set[UniqueId], Set[UniqueId]]:
        """Get all nodes specified by the single selection criteria.

        - collect the directly included nodes
        - find their specified relatives
        - perform any selector-specific expansion
        """

        nodes = self.graph.nodes()
        try:
            collected = self.select_included(nodes, spec)
        except InvalidSelectorError:
            valid_selectors = ", ".join(self.SELECTOR_METHODS)
            fire_event(
                SelectorReportInvalidSelector(
                    valid_selectors=valid_selectors, spec_method=spec.method, raw_spec=spec.raw
                )
            )
            return set(), set()

        neighbors = self.collect_specified_neighbors(spec, collected)
        selected = collected | neighbors

        # if --indirect-selection EMPTY, do not expand to adjacent tests
        if spec.indirect_selection == IndirectSelection.Empty:
            return selected, set()
        else:
            direct_nodes, indirect_nodes = self.expand_selection(
                selected=selected, indirect_selection=spec.indirect_selection
            )
            return direct_nodes, indirect_nodes
Get all nodes specified by the single selection criteria.

        - collect the directly included nodes
        - find their specified relatives
        - perform any selector-specific expansion
        
core/dbt/graph/selector.py