def __init__(self,root,webdir='<STR_LIT>',ident=None):
self.root = []        <EOL>self.hopNodes = []    <EOL>self.hopEdges = []    <EOL>self.added = set()    <EOL>self.max_nesting = <NUM_LIT:0>  <EOL>self.max_nodes = <NUM_LIT:1>    <EOL>self.warn = False     <EOL>self.truncated = -<NUM_LIT:1>   <EOL>try:<EOL><INDENT>for r in root:<EOL><INDENT>self.root.append(self.data.get_node(r))<EOL>self.max_nesting = max(self.max_nesting,<EOL>int(r.meta['<STR_LIT>']))<EOL>self.max_nodes = max(self.max_nodes,<EOL>int(r.meta['<STR_LIT>']))<EOL>self.warn = self.warn or (r.settings['<STR_LIT>'].lower() == '<STR_LIT:true>')<EOL><DEDENT><DEDENT>except TypeError:<EOL><INDENT>self.root.append(self.data.get_node(root))<EOL>self.max_nesting = int(root.meta['<STR_LIT>'])<EOL>self.max_nodes = max(self.max_nodes,<EOL>int(root.meta['<STR_LIT>']))<EOL>self.warn = root.settings['<STR_LIT>'].lower() == '<STR_LIT:true>'<EOL><DEDENT>self.webdir = webdir<EOL>if ident:<EOL><INDENT>self.ident = ident + '<STR_LIT>' + self.__class__.__name__<EOL><DEDENT>else:<EOL><INDENT>self.ident = root.get_dir() + '<STR_LIT>' + root.ident + '<STR_LIT>' + self.__class__.__name__<EOL><DEDENT>self.imgfile = self.ident<EOL>self.dot = Digraph(self.ident,<EOL>graph_attr={'<STR_LIT:size>':'<STR_LIT>',<EOL>'<STR_LIT>':self.RANKDIR,<EOL>'<STR_LIT>':'<STR_LIT:true>',<EOL>'<STR_LIT:id>':self.ident},<EOL>node_attr={'<STR_LIT>':'<STR_LIT>',<EOL>'<STR_LIT>':'<STR_LIT>',<EOL>'<STR_LIT>':'<STR_LIT>',<EOL>'<STR_LIT>':'<STR_LIT>',<EOL>'<STR_LIT>':'<STR_LIT>'},<EOL>edge_attr={'<STR_LIT>':'<STR_LIT>',<EOL>'<STR_LIT>':'<STR_LIT>'},<EOL>format='<STR_LIT>', engine='<STR_LIT>')<EOL>for n in self.root:<EOL><INDENT>if len(self.root) == <NUM_LIT:1>:<EOL><INDENT>self.dot.node(n.ident, label=n.name)<EOL><DEDENT>else:<EOL><INDENT>self.dot.node(n.ident, **n.attribs)<EOL><DEDENT>self.added.add(n)<EOL><DEDENT>self.add_nodes(self.root)<EOL>if graphviz_installed:<EOL><INDENT>self.svg_src = self.dot.pipe().decode('<STR_LIT:utf-8>')<EOL>self.svg_src = self.svg_src.replace('<STR_LIT>','<STR_LIT>' + re.sub('<STR_LIT>','<STR_LIT>',self.ident) + '<STR_LIT>')<EOL>w = int(WIDTH_RE.search(self.svg_src).group(<NUM_LIT:1>))<EOL>if isinstance(self,(ModuleGraph,CallGraph,TypeGraph)):<EOL><INDENT>self.scaled = (w >= <NUM_LIT>)<EOL><DEDENT>else:<EOL><INDENT>self.scaled = (w >= <NUM_LIT>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.svg_src = '<STR_LIT>'<EOL>self.scaled = False<EOL><DEDENT>
Initialize the graph, root is the object or list of objects,
for which the graph is to be constructed.
The webdir is the url where the graph should be stored, and
ident can be provided to override the default identifacation
of the graph that will be used to construct the name of the
imagefile. It has to be provided if there are multiple root
nodes.