code: def context(state=True):
      """Set deferred compute state to `state` within context. Reset afterwards to previous value."""
      # Like other MXNet context manager, this bleeds state across concurrent
      # code: "Context managers that have state should use Context Variables
      # instead of threading.local() to prevent their state from bleeding to
      # other code unexpectedly, when used in concurrent code."
      # https://github.com/apache/incubator-mxnet/issues/17495#issuecomment-585461965
      val = set_deferred_compute(state)
      try:
          yield
      finally:
          set_deferred_compute(val)
  
file_path: mxnet/python/mxnet/_deferred_compute.py
imports: import ctypes
  import contextlib
  from .base import _LIB, check_call, SymbolHandle, _as_list
  from .symbol import Symbol
label_desc: Use image node_id 3 for calling a global function with example usage: context(state) without return types