code: def context_scope(ctx):
      """
      Context as Python context.
  
      .. code-block:: python
  
          import nnabla as nn
          import nnabla.functions as F
          x = nn.Variable([2, 3 ,4])
          ctx = nnabla_ext.cuda.context('0')
          with context_scope(ctx):
              # Inside with scope, the specified context is used.
              with parameter_scope('w1'):
                  l1 = F.relu(F.affine(x, 64))
              with parameter_scope('w2'):
                  l2 = F.relu(F.affine(x, 64))
  
      """
      global current_ctx
      global context_level
      context_level += 1
      prev_context = current_ctx
      current_ctx = ctx
      try:
          yield
      finally:
          context_level -= 1
          current_ctx = prev_context
  
imports: from __future__ import absolute_import
  from contextlib import contextmanager
  from .variable import Context
label_desc: Use image node_id 1 for calling a global function with example usage: context_scope(ctx) without return types