#NEWLINE# def classes_source( classes , indent = DEFAULT_INDENT ) : #NEWLINE# #INDENT# all_classes = set ( classes ) #NEWLINE# class_graph = CachedGraphTraverser ( ) #NEWLINE# for c in classes : #NEWLINE# #INDENT# referenced_schemas = class_graph . find_descendants ( c ) #NEWLINE# all_classes |= set ( referenced_schemas ) #NEWLINE# #UNINDENT# ordered = class_graph . get_reference_ordered_schemas ( all_classes ) #NEWLINE# return '\n\n' . join ( [ _class_source ( c , indent ) for c in ordered ] )