def to_string(self):
        """Return string representation of node in DOT language."""
        # RMF: special case defaults for node, edge and graph properties.
        #
        node = quote_if_necessary(self.obj_dict["name"])

        node_attr = list()

        for attr in sorted(self.obj_dict["attributes"]):
            value = self.obj_dict["attributes"][attr]
            if value == "":
                value = '""'
            if value is not None:
                node_attr.append("%s=%s" % (attr, quote_if_necessary(value)))
            else:
                node_attr.append(attr)

        # No point in having nodes setting any defaults if the don't set
        # any attributes...
        #
        if node in ("graph", "node", "edge") and len(node_attr) == 0:
            return ""

        node_attr = ", ".join(node_attr)

        if node_attr:
            node += " [" + node_attr + "]"

        return node + ";"
Return string representation of node in DOT language.
python/aitemplate/utils/visualization/pydot.py