def get_discussion_categories_ids(course, user, include_all=False):
 accessible_discussion_ids = [xblock.discussion_id for xblock in get_accessible_discussion_xblocks(course, user, include_all=include_all)]
 return (course.top_level_discussion_topic_ids + accessible_discussion_ids)

def get_discussion_categories_ids ( course , user , include_all = False ) : accessible_discussion_ids = [ xblock . discussion_id for xblock in get_accessible_discussion_xblocks ( course , user , include_all = include_all ) ] return ( course . top_level_discussion_topic_ids + accessible_discussion_ids )
returns a list of available ids of categories for the course that are accessible to the given user .