'Returns:
list of XModuleDescriptor instances for the matching items within the course with
the given course_id
NOTE: don\'t use this to look for courses
as the course_id is required. Use get_courses which is a lot faster anyway.
If you don\'t provide a value for revision, this limits the result to only ones in the
published course. Call this method on draft mongo store if you want to include drafts.
Args:
course_id (CourseKey): the course identifier
settings (dict): fields to look for which have settings scope. Follows same syntax
and rules as qualifiers below
content (dict): fields to look for which have content scope. Follows same syntax and
rules as qualifiers below.
key_revision (str): the revision of the items you\'re looking for.
MongoRevisionKey.draft - only returns drafts
MongoRevisionKey.published (equates to None) - only returns published
If you want one of each matching xblock but preferring draft to published, call this same method
on the draft modulestore with ModuleStoreEnum.RevisionOption.draft_preferred.
qualifiers (dict): what to look for within the course.
Common qualifiers are ``category`` or any field name. if the target field is a list,
then it searches for the given value in the list not list equivalence.
Substring matching pass a regex object.
For this modulestore, ``name`` is a commonly provided key (Location based stores)
This modulestore does not allow searching dates by comparison or edited_by, previous_version,
update_version info.
using_descriptor_system (CachingDescriptorSystem): The existing CachingDescriptorSystem
to add data to, and to load the XBlocks from.'

@autoretry_read()
def get_items(self, course_id, settings=None, content=None, key_revision=MongoRevisionKey.published, qualifiers=None, using_descriptor_system=None, **kwargs):

    qualifiers = (qualifiers.copy() if qualifiers else {})
    query = self._course_key_to_son(course_id)
    query['_id.revision'] = key_revision
    for field in ['category', 'name']:
        if (field in qualifiers):
            qualifier_value = qualifiers.pop(field)
            if isinstance(qualifier_value, list):
                qualifier_value = {'$in': qualifier_value}
            query[('_id.' + field)] = qualifier_value
    for (key, value) in (settings or {}).iteritems():
        query[('metadata.' + key)] = value
    for (key, value) in (content or {}).iteritems():
        query[('definition.data.' + key)] = value
    if ('children' in qualifiers):
        query['definition.children'] = qualifiers.pop('children')
    query.update(qualifiers)
    items = self.collection.find(query, sort=[SORT_REVISION_FAVOR_DRAFT])
    modules = self._load_items(course_id, list(items), using_descriptor_system=using_descriptor_system)
    return modules
