code: def create_lower_func(extern_func_map):
      """Returns a function which lowers an operation to a function call.
  
      Parameters
      ----------
      extern_func_map : map
          If lowering a Cast, extern_func_map should be a map from tuples of
          (src_bit_length, dest_bit_length) to the name of the extern "C" function to lower to.
  
          Otherwise, for unary and binary ops, it should simply be a map
          from bit_length to the name of the extern "C" function to lower to.
      """
  
      def lower(op):
          """
          Takes an op---either a Cast, Call, or a binary op (e.g. an Add) and returns a
          call to the specified external function, passing the op's argument
          or arguments. The return type of the call depends
          on the type of the op: if it is a custom type, then a uint of the same
          width as the custom type is returned. Otherwise, the type is
          unchanged."""
          dtype = op.dtype
          t = DataType(dtype)
          if get_type_registered(t.type_code):
              dtype = "uint" + str(t.bits)
              if t.lanes > 1:
                  dtype += "x" + str(t.lanes)
  
          key = t.bits
          if isinstance(op, _Cast):
              src_bits = DataType(op.value.dtype).bits
              key = (src_bits, t.bits)
  
          if key not in extern_func_map:
              raise RuntimeError(
                  f"missing key {key} in extern_func_map for {op.astext()}"
              )
  
          if isinstance(op, _Cast):
              return call_pure_extern(
                  dtype, extern_func_map[key], op.value
              )
          if isinstance(op, _FloatImm):
              return call_pure_extern(
                  dtype, extern_func_map[key], op.value
              )
          if isinstance(op, _Call):
              return call_pure_extern(
                  dtype, extern_func_map[key], *op.args
              )
          if isinstance(op, _BinaryOpExpr):
              return call_pure_extern(
                  dtype, extern_func_map[key], op.a, op.b
              )
  
          raise RuntimeError(f"lowering unsupported op: {op.astext()}")
  
      return lower
  
file_path: tvm/python/tvm/target/datatype.py
imports: import tvm
  from tvm.runtime import convert, DataType
  from tvm.tir.expr import Call, Cast, FloatImm, BinaryOpExpr
  from tvm.tir.op import call_pure_extern
  from tvm._ffi import register_func
  from tvm.tir import call_intrin
label_desc: Use image node_id 8 for calling a global function with example usage: create_lower_func(extern_func_map) and returns: lower, call_pure_extern, call_pure_extern, call_pure_extern, call_pure_extern