def apply(self, doc):
if not isinstance(doc, Document):<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>for figure in doc.figures:<EOL><INDENT>if self.types is None or any(<EOL>figure.url.lower().endswith(type) for type in self.types<EOL>):<EOL><INDENT>yield TemporaryFigureMention(figure)<EOL><DEDENT><DEDENT>
Generate MentionFigures from a Document by parsing all of its Figures.

:param doc: The ``Document`` to parse.
:type doc: ``Document``
:raises TypeError: If the input doc is not of type ``Document``.