def _get_dialect_namespaces(self) -> Dict[str, List[Operation]]:
        """
        Return a dict which maps the dialect namespace into a list of corresponding operations.
        """
        res = defaultdict(list)

        def get_dialect_namespaces_block(block):
            for op in block.operations:
                for b in op.blocks:
                    get_dialect_namespaces_block(b)
                if hasattr(op, "_dialect_namespace"):
                    dialect_namespace = op._dialect_namespace
                    res[dialect_namespace].append(op)

        for func in self.functions.values():
            get_dialect_namespaces_block(func)
        return res

        Return a dict which maps the dialect namespace into a list of corresponding operations.
        
coremltools/converters/mil/mil/program.py