in function_app/src/components/doc_intelligence.py [0:0]
def get_all_formulas(analyze_result: AnalyzeResult) -> List[DocumentFormula]:
"""
Returns all formulas from the Document Intelligence result.
:param analyze_result: AnalyzeResult object returned by the
`begin_analyze_document` method.
:type analyze_result: AnalyzeResult
:return: A list of all formulas in the result.
:rtype: List[DocumentFormula]
"""
return list(
itertools.chain.from_iterable(
page.formulas for page in analyze_result.pages if page.formulas
)
)