def _is_last_section_in_report(
        self, section: SECSection, toc: HTMLDocument
    ) -> bool:
        """Checks to see if the section is the last section in toc for a report types filing."""
        # Note(yuming): This method assume the section already exists in toc.
        if self.filing_type in ["10-K", "10-K/A"]:
            # try to get FORM_SUMMARY as last section, else then try to get EXHIBITS.
            if section == SECSection.FORM_SUMMARY:
                return True
            if section == SECSection.EXHIBITS:
                form_summary_section = first(
                    el
                    for el in toc.elements
                    if is_section_elem(SECSection.FORM_SUMMARY, el, self.filing_type)
                )
                # if FORM_SUMMARY is not in toc, the last section is EXHIBITS
                if form_summary_section is None:
                    return True
        if self.filing_type in ["10-Q", "10-Q/A"]:
            # try to get EXHIBITS as last section.
            if section == SECSection.EXHIBITS:
                return True
        return False
Checks to see if the section is the last section in toc for a report types filing.
llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/sec_document.py