'Return an array of all of the locations for orphans in the course.'

def get_orphans(self, course_key, **kwargs):

    course_key = self.fill_in_run(course_key)
    detached_categories = [name for (name, __) in XBlock.load_tagged_classes('detached')]
    query = self._course_key_to_son(course_key)
    query['_id.category'] = {'$nin': detached_categories}
    all_items = self.collection.find(query)
    all_reachable = set()
    item_locs = set()
    for item in all_items:
        if (item['_id']['category'] != 'course'):
            item_locs.add(unicode(as_published(Location._from_deprecated_son(item['_id'], course_key.run))))
        all_reachable = all_reachable.union(item.get('definition', {}).get('children', []))
    item_locs -= all_reachable
    return [course_key.make_usage_key_from_deprecated_string(item_loc) for item_loc in item_locs]
