code: def set_state(state="stop", profile_process="worker"):
      """Set up the profiler state to 'run' or 'stop'.
  
      Parameters
      ----------
      state : string, optional
          Indicates whether to run the profiler, can
          be 'stop' or 'run'. Default is `stop`.
      profile_process : string
          whether to profile kvstore `server` or `worker`.
          server can only be profiled when kvstore is of type dist.
          if this is not passed, defaults to `worker`
      """
      state2int = {"stop": 0, "run": 1}
      profile_process2int = {"worker": 0, "server": 1}
      check_call(
          _LIB.MXSetProcessProfilerState(
              ctypes.c_int(state2int[state]),
              profile_process2int[profile_process],
              profiler_kvstore_handle,
          )
      )
  
imports: import ctypes
  import contextlib
  import contextvars
  import warnings
  from .base import _LIB, check_call, c_str, ProfileHandle, c_str_array, py_str, KVStoreHandle
label_desc: Use image node_id 4 for calling a global function with example usage: set_state(state, profile_process) without return types