'Returns:
list of XModuleDescriptor instances for the matching items within the course with
the given course_locator
NOTE: don\'t use this to look for courses as the course_locator is required. Use get_courses.
Args:
course_locator (CourseLocator): 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.
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.
For substring matching pass a regex object.
For split,
you can search by ``edited_by``, ``edited_on`` providing a function testing limits.
include_orphans (boolean): Returns all items in a course, including orphans if present.
True - This would return all items irrespective of course in tree checking. It may fetch orphans
if present in the course.
False - if we want only those items which are in the course tree. This would ensure no orphans are
fetched.'

def get_items(self, course_locator, settings=None, content=None, qualifiers=None, include_orphans=True, **kwargs):

    if ((not isinstance(course_locator, CourseKey)) or course_locator.deprecated):
        return []
    course = self._lookup_course(course_locator)
    items = []
    qualifiers = (qualifiers.copy() if qualifiers else {})
    def _block_matches_all(block_data):
        '\n                                                Check    that    the    block    matches    all    the    criteria\n                                                '
        if (self._block_matches(block_data, qualifiers) and self._block_matches(block_data.fields, settings)):
            if content:
                definition_block = self.get_definition(course_locator, block_data.definition)
                return self._block_matches(definition_block['fields'], content)
            else:
                return True
    if (settings is None):
        settings = {}
    if ('name' in qualifiers):
        block_name = qualifiers.pop('name')
        block_ids = []
        for (block_id, block) in course.structure['blocks'].iteritems():
            if isinstance(block_name, six.string_types):
                name_matches = (block_id.id == block_name)
            else:
                name_matches = (block_id.id in block_name)
            if (name_matches and _block_matches_all(block)):
                block_ids.append(block_id)
        return self._load_items(course, block_ids, **kwargs)
    if ('category' in qualifiers):
        qualifiers['block_type'] = qualifiers.pop('category')
    if ('children' in qualifiers):
        settings['children'] = qualifiers.pop('children')
    path_cache = None
    parents_cache = None
    if (not include_orphans):
        path_cache = {}
        parents_cache = self.build_block_key_to_parents_mapping(course.structure)
    for (block_id, value) in course.structure['blocks'].iteritems():
        if _block_matches_all(value):
            if (not include_orphans):
                if ((block_id.type in DETACHED_XBLOCK_TYPES) or self.has_path_to_root(block_id, course, path_cache, parents_cache)):
                    items.append(block_id)
            else:
                items.append(block_id)
    if (len(items) > 0):
        return self._load_items(course, items, depth=0, **kwargs)
    else:
        return []
