code: def dump(finished=True, profile_process="worker"):
      """Dump profile and stop profiler. Use this to save profile
      in advance in case your program cannot exit normally.
  
      Parameters
      ----------
      finished : boolean
          Indicates whether to stop statistic output (dumping) after this dump.
          Default is True
      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`
      """
      fin = 1 if finished is True else 0
      profile_process2int = {"worker": 0, "server": 1}
      check_call(
          _LIB.MXDumpProcessProfile(
              fin,
              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 6 for calling a global function with example usage: dump(finished, profile_process) without return types