def register_lower_func(op_type: str) -> Callable:
        """Register lowering function for complex dialect ops."""

        def lower_func_wrapper(func):
            @functools.wraps(func)
            def wrapper_inner(*args, **kwargs):
                return func(*args, **kwargs)

            if op_type in LowerComplex._lower_map:
                raise ValueError(f"The op {op_type} already got lowering function registered.")
            LowerComplex._lower_map[op_type] = func
            return wrapper_inner

        return lower_func_wrapper
Register lowering function for complex dialect ops.
coremltools/converters/mil/mil/passes/defs/lower_complex_dialect_ops.py