<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_edge (self, node):
 """Write edge from parent to node."""

        source = dotquote(self.nodes[node["parent_url"]]["label"])
        target = dotquote(node["label"])
        self.writeln(u'  "%s" -> "%s" [' % (source, target))
        self.writeln(u'    label="%s",' % dotquote(node["edge"]))
        if self.has_part("result"):
            self.writeln(u"    valid=%d," % node["valid"])
        self.writeln(u"  ];")