def to_string(self):
        """Return string representation of edge in DOT language."""
        src = self.parse_node_ref(self.get_source())
        dst = self.parse_node_ref(self.get_destination())

        if isinstance(src, frozendict):
            edge = [Subgraph(obj_dict=src).to_string()]
        elif isinstance(src, int):
            edge = [str(src)]
        else:
            edge = [src]

        if (
            self.get_parent_graph()
            and self.get_parent_graph().get_top_graph_type()
            and self.get_parent_graph().get_top_graph_type() == "digraph"
        ):
            edge.append("->")

        else:
            edge.append("--")

        if isinstance(dst, frozendict):
            edge.append(Subgraph(obj_dict=dst).to_string())
        elif isinstance(dst, int):
            edge.append(str(dst))
        else:
            edge.append(dst)

        edge_attr = list()

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

        edge_attr = ", ".join(edge_attr)

        if edge_attr:
            edge.append(" [" + edge_attr + "]")

        return " ".join(edge) + ";"
Return string representation of edge in DOT language.
python/aitemplate/utils/visualization/pydot.py