code: def test_scoped_onxx_enable():
      class Counter(object):
          def __init__(self):
              self._count = 0
  
          def increment(self):
              self._count += 1
  
          @property
          def count(self):
              return self._count
  
      class TempBlock(gluon.HybridBlock, OnnxHandlerBlock):
          def __init__(self, counter: Counter):
              super(TempBlock, self).__init__()
              OnnxHandlerBlock.__init__(self)
              self._counter = counter
  
          def hybrid_forward(self, F, x, *args, **kwargs):
              if self._onnx:
                  self._counter.increment()
              return x
  
      counter = Counter()
      net = gluon.nn.HybridSequential()
      for _ in range(10):
          net.add(TempBlock(counter))
  
      # ONNX disabled
      net(nd.zeros((1,)))
      assert counter.count == 0
  
      # ONNX enabled
      with ScopedOnnxEnable(net):
          net(nd.zeros((1,)))
      assert counter.count == 10
  
imports: import pytest
  import mxnet
  from mxnet import nd
  import numpy
  from rl_coach.architectures.mxnet_components.utils import *
label_desc: Use image node_id 14 for calling a global function with example usage: test_scoped_onxx_enable() and returns: self, x