code: def apply(self, doc):
          
          if not isinstance(doc, Document):
              raise TypeError(
                  "Input Contexts to MentionSections.apply() must be of type Document"
              )
  
          for section in doc.sections:
              yield TemporarySectionMention(section)
docs: Generate MentionSections from a Document by parsing all of its Sections.
  
          :param doc: The ``Document`` to parse.
          :type doc: ``Document``
          :raises TypeError: If the input doc is not of type ``Document``.