def get_accessible_discussion_xblocks(course, user, include_all=False):
 all_xblocks = modulestore().get_items(course.id, qualifiers={'category': 'discussion'}, include_orphans=False)
 return [xblock for xblock in all_xblocks if (has_required_keys(xblock) and (include_all or has_access(user, 'load', xblock, course.id)))]

def get_accessible_discussion_xblocks ( course , user , include_all = False ) : all_xblocks = modulestore ( ) . get_items ( course . id , qualifiers = { 'category' : 'discussion' } , include_orphans = False ) return [ xblock for xblock in all_xblocks if ( has_required_keys ( xblock ) and ( include_all or has_access ( user , 'load' , xblock , course . id ) ) ) ]
return a list of all valid discussion xblocks in this course that are accessible to the given user .