def get_courseware_with_tabs(course_id):
 course = get_course_by_id(course_id)
 chapters = [chapter for chapter in course.get_children() if (not chapter.hide_from_toc)]
 courseware = [{'chapter_name': c.display_name_with_default_escaped, 'sections': [{'section_name': s.display_name_with_default_escaped, 'clickable_tab_count': (len(s.get_children()) if (type(s) == seq_module.SequenceDescriptor) else 0), 'tabs': [{'children_count': (len(t.get_children()) if (type(t) == vertical_block.VerticalBlock) else 0), 'class': t.__class__.__name__} for t in s.get_children()]} for s in c.get_children() if (not s.hide_from_toc)]} for c in chapters]
 return courseware

def get_courseware_with_tabs ( course_id ) : course = get_course_by_id ( course_id ) chapters = [ chapter for chapter in course . get_children ( ) if ( not chapter . hide_from_toc ) ] courseware = [ { 'chapter_name' : c . display_name_with_default_escaped , 'sections' : [ { 'section_name' : s . display_name_with_default_escaped , 'clickable_tab_count' : ( len ( s . get_children ( ) ) if ( type ( s ) == seq_module . SequenceDescriptor ) else 0 ) , 'tabs' : [ { 'children_count' : ( len ( t . get_children ( ) ) if ( type ( t ) == vertical_block . VerticalBlock ) else 0 ) , 'class' : t . __class__ . __name__ } for t in s . get_children ( ) ] } for s in c . get_children ( ) if ( not s . hide_from_toc ) ] } for c in chapters ] return courseware
given a course_id .