code: def printDot(self):
          
          print("digraph ModuleDependencies {")
          print("  node[shape=box];")
          allNames = set()
          nameDict = {}
          for n, module in enumerate(self.listModules()):
              module._dot_name = "mod%d" % n
              nameDict[module.modname] = module._dot_name
              print("  %s[label=\"%s\"];" % (module._dot_name,
                                             quote(module.label)))
              allNames |= module.imports
          print("  node[style=dotted];")
          if self.external_dependencies:
              myNames = set(self.modules)
              extNames = list(allNames - myNames)
              extNames.sort()
              for n, name in enumerate(extNames):
                  nameDict[name] = id = "extmod%d" % n
                  print("  %s[label=\"%s\"];" % (id, name))
          for modname, module in sorted(self.modules.items()):
              for other in sorted(module.imports):
                  if other in nameDict:
                      print("  %s -> %s;" % (nameDict[module.modname],
                                             nameDict[other]))
          print("}")
docs: Produce a dependency graph in dot format.