def METHOD_NAME(
    course: CourseBlock,
    user: Optional[User],
    include_all: bool = False,
) -> List[DiscussionXBlock]:
    """
    Return a list of all valid discussion xblocks in this course that
    are accessible to the given user.
    """
    include_all = include_all or getattr(user, 'is_community_ta', False)
    return get_accessible_discussion_xblocks_by_course_id(course.id, user, include_all=include_all)