code: def testSleepCancellation(self):
      sleep_microseconds = int(1e6) * 1000
      ds = dataset_ops.Dataset.range(1)
      ds = ds.apply(testing.sleep(sleep_microseconds))
      ds = ds.prefetch(1)
      get_next = self.getNext(ds, requires_initialization=True)
  
      with self.cached_session() as sess:
          thread = self.checkedThread(
              self.assert_op_cancelled, args=(get_next(),)
          )
          thread.start()
          time.sleep(0.2)
          sess.close()
          thread.join()
  
file_path: tensorflow/tensorflow/python/data/experimental/kernel_tests/sleep_test.py
imports: import time
  from absl.testing import parameterized
  from tensorflow.python.data.experimental.ops import testing
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import errors
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the SleepTest obj's underlying member method code with example usage: obj.testSleepCancellation() without return types