'Returns a list of `CourseSummary` which matching any given qualifiers.
qualifiers should be a dict of keywords matching the db fields or any
legal query for mongo to use against the active_versions collection.
Note, this is to find the current head of the named branch type.
To get specific versions via guid use get_course.
:param branch: the branch for which to return courses.'

@autoretry_read()
def get_course_summaries(self, branch, **kwargs):

    def extract_course_summary(course):
        '\n                                                Extract    course    information    from    the    course    block    for    split.\n                                                '
        return {field: course.fields[field] for field in CourseSummary.course_info_fields if (field in course.fields)}
    courses_summaries = []
    for (entry, structure_info) in self._get_course_blocks_for_branch(branch, **kwargs):
        course_locator = self._create_course_locator(structure_info, branch=None)
        course_block = [block_data for (block_key, block_data) in entry['blocks'].items() if (block_key.type == 'course')]
        if (not course_block):
            raise ItemNotFoundError
        if (len(course_block) > 1):
            raise MultipleCourseBlocksFound('Expected    1    course    block    to    be    found    in    the    course,    but    found    {0}'.format(len(course_block)))
        course_summary = extract_course_summary(course_block[0])
        courses_summaries.append(CourseSummary(course_locator, **course_summary))
    return courses_summaries
