'Filters library children by capa type'

def _problem_type_filter(self, library, capa_type):

    search_engine = SearchEngine.get_search_engine(index='library_index')
    if search_engine:
        filter_clause = {'library': unicode(normalize_key_for_search(library.location.library_key)), 'content_type': CapaDescriptor.INDEX_CONTENT_TYPE, 'problem_types': capa_type}
        search_result = search_engine.search(field_dictionary=filter_clause)
        results = search_result.get('results', [])
        return [LibraryUsageLocator.from_string(item['data']['id']) for item in results]
    else:
        return [key for key in library.children if self._filter_child(key, capa_type)]
