def get_cohorted_discussions(course, course_settings):
 cohorted_course_wide_discussions = []
 cohorted_inline_discussions = []
 course_wide_discussions = [topic['id'] for (__, topic) in course.discussion_topics.items()]
 all_discussions = get_discussion_categories_ids(course, None, include_all=True)
 for cohorted_discussion_id in course_settings.cohorted_discussions:
  if (cohorted_discussion_id in course_wide_discussions):
   cohorted_course_wide_discussions.append(cohorted_discussion_id)
  elif (cohorted_discussion_id in all_discussions):
   cohorted_inline_discussions.append(cohorted_discussion_id)
 return (cohorted_course_wide_discussions, cohorted_inline_discussions)

def get_cohorted_discussions ( course , course_settings ) : cohorted_course_wide_discussions = [ ] cohorted_inline_discussions = [ ] course_wide_discussions = [ topic [ 'id' ] for ( __ , topic ) in course . discussion_topics . items ( ) ] all_discussions = get_discussion_categories_ids ( course , None , include_all = True ) for cohorted_discussion_id in course_settings . cohorted_discussions : if ( cohorted_discussion_id in course_wide_discussions ) : cohorted_course_wide_discussions . append ( cohorted_discussion_id ) elif ( cohorted_discussion_id in all_discussions ) : cohorted_inline_discussions . append ( cohorted_discussion_id ) return ( cohorted_course_wide_discussions , cohorted_inline_discussions )
returns the course-wide and inline cohorted discussion ids separately .