code: def with_accelerators(self):
      old_accelerators = _accelerator.get_routine_accelerators()
      if self.enable_cub:
          _accelerator.set_routine_accelerators(["cub"])
      else:
          _accelerator.set_routine_accelerators([])
      yield
      _accelerator.set_routine_accelerators(old_accelerators)
  
imports: import sys
  import warnings
  import numpy
  import pytest
  import cupy
  from cupy.cuda import runtime
  from cupy import testing
  from cupy import _util
  from cupy._core import _accelerator
  import cupyx.scipy.ndimage
label_desc: Use image node_id 1 for calling the TestMeasurementsSelect obj's underlying member method code with example usage: obj.with_accelerators() without return types