def create_xref(self):
        # this code probably needs cleanup
        depgraph = {}
        importedby = {}
        for name, value in self._depgraph.items():
            depgraph[name] = list(value)
            for needs in value:
                importedby.setdefault(needs, set()).add(name)

        names = self._types.keys()
        names.sort()

        fd, htmlfile = tempfile.mkstemp(".html")
        ofi = open(htmlfile, "w")
        os.close(fd)
        print >> ofi, "<html><title>py2exe cross reference for %s</title><body>" % sys.argv[0]

        print >> ofi, "<h1>py2exe cross reference for %s</h1>" % sys.argv[0]

        for name in names:
            if self._types[name] in (imp.PY_SOURCE, imp.PKG_DIRECTORY):
                print >> ofi, '<a name="%s"><b><tt>%s</tt></b></a>' % (name, name)
                if name == "__main__":
                    for fname in self._scripts:
                        path = urllib.pathname2url(os.path.abspath(fname))
                        print >> ofi, '<a target="code" href="%s" type="text/plain"><tt>%s</tt></a> ' \
                              % (path, fname)
                    print >> ofi, '<br>imports:'
                else:
                    fname = urllib.pathname2url(self.modules[name].__file__)
                    print >> ofi, '<a target="code" href="%s" type="text/plain"><tt>%s</tt></a><br>imports:' \
                          % (fname, self.modules[name].__file__)
            else:
                fname = self.modules[name].__file__
                if fname:
                    print >> ofi, '<a name="%s"><b><tt>%s</tt></b></a> <tt>%s</tt><br>imports:' \
                          % (name, name, fname)
                else:
                    print >> ofi, '<a name="%s"><b><tt>%s</tt></b></a> <i>%s</i><br>imports:' \
                          % (name, name, TYPES[self._types[name]])

            if name in depgraph:
                needs = depgraph[name]
                for n in needs:
                    print >>  ofi, '<a href="#%s"><tt>%s</tt></a> ' % (n, n)
            print >> ofi, "<br>\n"

            print >> ofi, 'imported by:'
            if name in importedby:
                for i in importedby[name]:
                    print >> ofi, (i, i) % '<a href="#%s"><tt>%s</tt></a> '

            print >> ofi, "<br>\n"

            print >> ofi, "<br>\n"

        print >> ofi, "</body></html>"
        ofi.close()
        os.startfile(htmlfile)
        # how long does it take to start the browser?
        import threading
        threading.Timer(5, os.remove, args=[htmlfile])
dataset/ETHPy150Open fogleman/FeedNotifier/patch/mf.py/ModuleFinder.create_xref/swapped operands of `%`