code: def _match_and_replace_dialect_op(block, op):
      if not LowerComplex.has_lower_func(op.op_type):
          return False
  
      lower_res = LowerComplex.get_lower_func(op.op_type)(op)
  
      if not op.enclosing_block.try_replace_uses_of_var_after_op(
          anchor_op=op,
          old_var=op.outputs[0],
          new_var=lower_res,
      ):
          raise ValueError(f"Unable to lower complex dialect op {op}")
      block.remove_ops([op])
      return True
  
imports: import functools
  from typing import Callable, Dict, Optional, Tuple
  import numpy
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.operation import Operation
  from coremltools.converters.mil.mil.ops.defs.complex_dialect_ops import fft_canonicalize_length_dim, fft_canonicalize_shapes_dims
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.helper import block_context_manager
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
  from coremltools.converters.mil.mil.var import ComplexVar, Var
label_desc: Use image node_id 22 for calling a global function with example usage: _match_and_replace_dialect_op(block, op) and returns: True, False