code: def _create_schedule(
      placeholder: list,
      c_code: Union[str, io.TextIOWrapper] = "",
      use_external_conv2d_impl: bool = True,
  ):
      # How to do the same with TE
      # Add pragma TE
      # s = te.create_schedule(result.op)
      # axis = result.op.axis
      # s[result].pragma(axis[0], "import_llvm", c_to_llvm())
      # with tvm.transform.PassContext(config={"tir.add_lower_pass": [(1, my_ai_hw_conv2d_pass)]}):
      #     mod = tvm.lower(s, [ifmap, weights, result], simple_mode=True)
      #
      # llvm_mod = tvm.build(mod, [ifmap, weights, result], target=target, name="test_external_conv2d")
      # llvm_mod(ifmap_data, weight_data, result_data)
      if isinstance(c_code, io.TextIOWrapper):
          c_code_str = c_code.read()
      elif isinstance(c_code, str):
          c_code_str = c_code
      else:
          raise TypeError()
  
      assert (
          use_external_conv2d_impl
          and c_code_str != ""
          or not use_external_conv2d_impl
          and c_code_str == ""
      )
  
      def _c_to_llvm(c_code: str) -> str:
          temp = utils.tempdir()
          ll_path = temp.relpath("conv2d.ll")
          ll_code = clang.create_llvm([c_code], output=ll_path)
          return ll_code
  
      func_tir = te.create_prim_func(placeholder)
      ir_module_from_te = IRModule({"main": func_tir})
      sch_tir = tvm.tir.Schedule(ir_module_from_te)
      if use_external_conv2d_impl:
          conv2d_b = sch_tir.get_block("conv2d_nchw")
          conv2d_l = sch_tir.get_loops(conv2d_b)
          sch_tir.annotate(
              conv2d_l[0], "pragma_import_llvm", _c_to_llvm(c_code_str)
          )
      return sch_tir
  
file_path: tvm/tests/python/contrib/test_uma/test_uma_utils.py
imports: import io
  import tvm
  from tvm import topi, IRModule
  import numpy
  from tvm.contrib import utils, clang
  import tvm.testing
  from tvm import te
  from typing import Union
label_desc: Use image node_id 1 for calling a global function with example usage: _create_schedule(placeholder, c_code, use_external_conv2d_impl) and returns: sch_tir, ll_code