<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_bus_data(self, file, padding=" "):
 """ Writes bus data to file. """

        for bus in self.case.buses:
            attrs = ['%s="%s"' % (k, v) for k, v in self.bus_attr.iteritems()]
#            attrs.insert(0, 'label="%s"' % bus.name)
            attr_str = ", ".join(attrs)

            file.write("%s%s [%s];\n" % (padding, bus.name, attr_str))