<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_branch_data(self, file, padding=" "):
 """ Writes branch data in Graphviz DOT language. """

        attrs = ['%s="%s"' % (k,v) for k,v in self.branch_attr.iteritems()]
        attr_str = ", ".join(attrs)

        for br in self.case.branches:
            file.write("%s%s -> %s [%s];\n" % \
                (padding, br.from_bus.name, br.to_bus.name, attr_str))