in function_app/src/components/doc_intelligence.py [0:0]
def get_all_barcodes(analyze_result: AnalyzeResult) -> List[DocumentBarcode]:
"""
Returns all barcodes 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 barcodes in the result.
:rtype: List[DocumentBarcode]
"""
return list(
itertools.chain.from_iterable(
page.barcodes for page in analyze_result.pages if page.barcodes
)
)