def _very_fast_search(self, node, key, max_depth, with_links, crun):
if key in self._links_count:<EOL><INDENT>return<EOL><DEDENT>parent_full_name = node.v_full_name<EOL>starting_depth = node.v_depth<EOL>candidate_dict = self._get_candidate_dict(key, crun)<EOL>if with_links:<EOL><INDENT>upper_bound = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>upper_bound = FAST_UPPER_BOUND<EOL><DEDENT>if len(candidate_dict) > upper_bound:<EOL><INDENT>raise pex.TooManyGroupsError('<STR_LIT>')<EOL><DEDENT>result_node = None<EOL>for goal_name in candidate_dict:<EOL><INDENT>if goal_name.startswith(parent_full_name):<EOL><INDENT>candidate = candidate_dict[goal_name]<EOL>if candidate.v_depth - starting_depth <= max_depth:<EOL><INDENT>if result_node is not None:<EOL><INDENT>raise pex.NotUniqueNodeError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>% (key, goal_name, result_node.v_full_name))<EOL><DEDENT>result_node = candidate<EOL><DEDENT><DEDENT><DEDENT>if result_node is not None:<EOL><INDENT>return result_node, result_node.v_depth<EOL><DEDENT>
Fast search for a node in the tree.

        The tree is not traversed but the reference dictionaries are searched.

        :param node:

            Parent node to start from

        :param key:

            Name of node to find

        :param max_depth:

            Maximum depth.

        :param with_links:

            If we work with links than we can only be sure to found the node in case we
            have a single match. Otherwise the other match might have been linked as well.

        :param crun:

            If given only nodes belonging to this particular run are searched and the rest
            is blinded out.

        :return: The found node and its depth

        :raises:

            TooManyGroupsError:

                If search cannot performed fast enough, an alternative search method is needed.

            NotUniqueNodeError:

                If several nodes match the key criterion