def add_nodes(self, nodes, nesting=<NUM_LIT:1>):
hopNodes = set()  <EOL>hopEdges = []     <EOL>for i, n in zip(range(len(nodes)), nodes):<EOL><INDENT>r, g, b = rainbowcolour(i, len(nodes))<EOL>colour = '<STR_LIT>' % (r, g, b)<EOL>for nu in n.uses:<EOL><INDENT>if nu not in self.added:<EOL><INDENT>hopNodes.add(nu)<EOL><DEDENT>hopEdges.append((n, nu, '<STR_LIT>', colour))<EOL><DEDENT>if hasattr(n, '<STR_LIT>'):<EOL><INDENT>if n.ancestor not in self.added:<EOL><INDENT>hopNodes.add(n.ancestor)<EOL><DEDENT>hopEdges.append((n, n.ancestor, '<STR_LIT>', colour))<EOL><DEDENT><DEDENT>if self.add_to_graph(hopNodes, hopEdges, nesting):<EOL><INDENT>self.dot.attr('<STR_LIT>', size='<STR_LIT>')<EOL><DEDENT>
Adds nodes and edges for generating the graph showing the relationship
between modules and submodules listed in nodes.