def _is_scopes_present_in_program(prog: Program) -> bool:
        """
        Return True is any op already has the scopes info.
        """

        def _is_scopes_present_in_block(block: Block) -> bool:
            for op in block.operations:
                for b in op.blocks:
                    if _is_scopes_present_in_block(b):
                        return True
                if len(op.scopes) > 0:
                    return True

        for func in prog.functions.values():
            if _is_scopes_present_in_block(func):
                return True

        Return True is any op already has the scopes info.
        
coremltools/converters/mil/testing_utils.py