<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def iter_documents(self, fileids=None, categories=None, _destroy=False):
 """ Return an iterator over corpus documents. """

        doc_ids = self._filter_ids(fileids, categories)
        for doc in imap(self.get_document, doc_ids):
            yield doc
            if _destroy:
                doc.destroy()