def index(self, doc_type, sources):  
if not MockSearchEngine._disabled:<EOL><INDENT>doc_ids = [s["<STR_LIT:id>"] for s in sources if "<STR_LIT:id>" in s]<EOL>MockSearchEngine.remove_documents(self.index_name, doc_type, doc_ids)<EOL>MockSearchEngine.add_documents(self.index_name, doc_type, sources)<EOL><DEDENT>
Add/update documents of given type to the index