code: def scope(name="<unk>:", append_mode=True):
      """Assign the profiler scope for the GPU memory profiler.
  
      It is implicitly invoked when the Gluon API is used.
  
      Parameters
      ==========
      name : Name of the Profiler Scope
      append_mode : Whether to append the old profiler scope at the front.
  
      """
      name = name + ":" if not name.endswith(":") else name
      if append_mode and _current_scope.get() != "<unk>:":
          name = _current_scope.get() + name
      token = _current_scope.set(name)
      # Invoke the C API to propagate the profiler scope information to the
      # C++ backend.
      check_call(_LIB.MXSetProfilerScope(c_str(name)))
      yield name
      _current_scope.reset(token)
      # Invoke the C API once again to recover the previous scope information.
      check_call(_LIB.MXSetProfilerScope(c_str(_current_scope.get())))
  
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 11 for calling a global function with example usage: scope(name, append_mode) without return types