(cls, analyzer_names)
return dependency_tree
Build a dependency list of analyzers.

        Args:
            analyzer_names (list): List of analyzer names.

        Returns:
            A list of sets of analyzer names. Each set represents
            one dependency group.

        Raises:
            KeyError: if class introduces circular dependencies.
Build a dependency list of analyzers.
Build a dependency list of analyzers .
def _build_dependencies(cls, analyzer_names):
        """Build a dependency list of analyzers.

        Args:
            analyzer_names (list): List of analyzer names.

        Returns:
            A list of sets of analyzer names. Each set represents
            one dependency group.

        Raises:
            KeyError: if class introduces circular dependencies.
        """
        dependency_tree = []
        dependencies = {}

        for analyzer_name in analyzer_names:
            analyzer_class = cls.get_analyzer(analyzer_name)
            dependencies[analyzer_name] = [
                x.lower() for x in analyzer_class.DEPENDENCIES]

        while dependencies:
            dependency_list = []
            for value in iter(dependencies.values()):
                dependency_list.extend(value)

            # Find items without a dependency.
            dependency_set = set(dependency_list) - set(dependencies.keys())
            dependency_set.update(
                name for name, dep in iter(dependencies.items()) if not dep)

            if not dependency_set:
                raise KeyError((
                    'Unable to build dependency tree, there is a circular '
                    'dependency somewhere'))

            dependency_tree.append(dependency_set)

            # Let's remove the entries already in the tree and start again.
            new_dependencies = {}
            for analyzer_name, analyzer_dependencies in dependencies.items():
                if not analyzer_dependencies:
                    continue
                new_dependencies[analyzer_name] = list(
                    set(analyzer_dependencies) - dependency_set)
            dependencies = new_dependencies

        return dependency_tree
def _build_dependencies ( cls , analyzer_names ) : dependency_tree = [ ] dependencies = { } for analyzer_name in analyzer_names : analyzer_class = cls . get_analyzer ( analyzer_name ) dependencies [ analyzer_name ] = [ x . lower ( ) for x in analyzer_class . DEPENDENCIES ] while dependencies : dependency_list = [ ] for value in iter ( dependencies . values ( ) ) : dependency_list . extend ( value ) # Find items without a dependency. dependency_set = set ( dependency_list ) - set ( dependencies . keys ( ) ) dependency_set . update ( name for name , dep in iter ( dependencies . items ( ) ) if not dep ) if not dependency_set : raise KeyError ( ( 'Unable to build dependency tree, there is a circular ' 'dependency somewhere' ) ) dependency_tree . append ( dependency_set ) # Let's remove the entries already in the tree and start again. new_dependencies = { } for analyzer_name , analyzer_dependencies in dependencies . items ( ) : if not analyzer_dependencies : continue new_dependencies [ analyzer_name ] = list ( set ( analyzer_dependencies ) - dependency_set ) dependencies = new_dependencies return dependency_tree