code: def create(graph_json_str, libmod, device, dump_root=None):
      """Create a runtime executor module given a graph and module.
  
      Parameters
      ----------
      graph_json_str : str
          The graph to be deployed in json format output by graph compiler.
          The graph can contain operator(tvm_op) that points to the name
          of PackedFunc in the libmod.
  
      libmod : tvm.Module
          The module of the corresponding function.
  
      device : Device
          The device to deploy the module, can be local or remote.
  
      dump_root : str
          To select which folder the outputs should be kept.
          None will make a temp folder in /tmp/tvmdbg<rand_string> and does the dumping
      Returns
      -------
      graph_module : GraphModuleDebug
          Debug Runtime graph module that can be used to execute the graph.
      """
      assert isinstance(graph_json_str, string_types)
  
      try:
          dev, num_rpc_dev, device_type_id = graph_executor.get_device(
              libmod, device
          )
          if num_rpc_dev == len(dev):
              fcreate = dev[0]._rpc_sess.get_function(
                  "tvm.graph_executor_debug.create"
              )
          else:
              fcreate = tvm._ffi.get_global_func(
                  "tvm.graph_executor_debug.create"
              )
      except ValueError:
          raise ValueError(
              "Please set '(USE_PROFILER ON)' in "
              "config.cmake and rebuild TVM to enable debug mode"
          )
      func_obj = fcreate(graph_json_str, libmod, *device_type_id)
      gmod = GraphModuleDebug(func_obj, dev, graph_json_str, dump_root)
  
      # Automatically set params if they can be extracted from the libmod
      try:
          params = libmod["get_graph_params"]()
      except (AttributeError, tvm.error.RPCError):
          # Params can not be extracted from the libmod and must be set somewhere else manually
          # Do not set params during RPC communication
          pass
      else:
          gmod.set_input(**params)
  
      return gmod
  
imports: import logging
  import os
  import shutil
  import struct
  import tempfile
  import tvm._ffi
  from tvm._ffi.base import string_types
  from tvm.contrib import graph_executor
  from tvm.runtime.module import BenchmarkResult
  from ...runtime.profiling import Report
  from .None import debug_result
label_desc: Use image node_id 1 for calling a global function with example usage: create(graph_json_str, libmod, device, dump_root) and returns: gmod