code: def testSideEffect(self):
      counter_var = variables.Variable(0)
  
      def increment_fn(x):
          counter_var.assign_add(1)
          return x
  
      def dataset_fn():
          return dataset_ops.Dataset.range(1).map(increment_fn)
  
      @def_function.function
      def fn():
          _ = dataset_fn().get_single_element()
          return "hello"
  
      self.evaluate(counter_var.initializer)
      self.assertEqual(self.evaluate(fn()), b"hello")
      self.assertEqual(self.evaluate(counter_var), 1)
  
file_path: tensorflow/tensorflow/python/data/kernel_tests/get_single_element_test.py
imports: from absl.testing import parameterized
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the GetSingleElementTest obj's underlying member method code with example usage: obj.testSideEffect() and returns: x, dataset_ops, str