def dotty(self, fd):
        if self.parent is None:
            print >>fd, 'digraph G {\n'

        print >>fd, '"%s" [shape=record, label="{%s|{Namespace|%s}' \
            '|{Constraints|%s}}"]' % (
            id(self), self.prim['name'] if self.prim else 'ROOT',
            '\\n'.join(['%s = %s' % (
                        x, self.ns[x]) for x in self.ns]).replace('"', '\\"'),
            '\\n'.join(['%s' % (
                        x,) for x in self.constraints]).replace('"', '\\"'))
        for child in self.children:
            print >>fd, '"%s" -> "%s"' % (id(self), id(child))
            child.dotty(fd)

        if self.parent is None:
            print >>fd, '}\n'

    # solves any args not necessary for meeting constraints,
    # but otherwise required (or optional)
    #
    # returns (solvable, msg, choices | selected choice)
    #
    # so... (False, "Cannot find interface 'chef-server'", None)
    # or... (False, "Choose interface 'chef-server'", [2,3])
    # or... (True, None, 2)
    #
    # It is up to the caller to decide whether unsolvability
    # of these args is a fatal or non-fatal condition
    #
dataset/ETHPy150Open rcbops/opencenter/opencenter/webapp/solver.py/Solver.dotty/original