def write_classes(self, diagram):
<EOL>for i, obj in enumerate(sorted(diagram.objects, key=lambda x: x.title)):<EOL><INDENT>self.printer.emit_node(i, **self.get_values(obj))<EOL>obj.fig_id = i<EOL><DEDENT>for rel in diagram.get_relationships("<STR_LIT>"):<EOL><INDENT>self.printer.emit_edge(<EOL>rel.from_object.fig_id, rel.to_object.fig_id, **self.inh_edges<EOL>)<EOL><DEDENT>for rel in diagram.get_relationships("<STR_LIT>"):<EOL><INDENT>self.printer.emit_edge(<EOL>rel.from_object.fig_id, rel.to_object.fig_id, **self.imp_edges<EOL>)<EOL><DEDENT>for rel in diagram.get_relationships("<STR_LIT>"):<EOL><INDENT>self.printer.emit_edge(<EOL>rel.from_object.fig_id,<EOL>rel.to_object.fig_id,<EOL>label=rel.name,<EOL>**self.association_edges<EOL>)<EOL><DEDENT>
write a class diagram