code: def testPrefetchCancellation(self):
      def map_py_fn(x):
          while x > -1:
              x = x * 1
          return x
  
      dataset = dataset_ops.Dataset.range(10).map(map_py_fn).prefetch(3)
      get_next = self.getNext(dataset)
  
      with self.cached_session() as sess:
          thread = self.checkedThread(
              self.assert_op_cancelled, args=(get_next(),)
          )
          thread.start()
          time.sleep(2)
          sess.close()
          thread.join()
  
imports: import time
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.experimental.ops import random_access
  from tensorflow.python.data.kernel_tests import checkpoint_test_base
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import options
  from tensorflow.python.data.ops import prefetch_op
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import errors
  from tensorflow.python.platform import test
label_desc: Use image node_id 4 for calling the PrefetchTest obj's underlying member method code with example usage: obj.testPrefetchCancellation() and returns: x