code: def testAutomaticControlDependencies(self):
      counter_var = variables.Variable(1)
  
      def increment_fn(x):
          counter_var.assign(counter_var + 1)
          return x
  
      def multiply_fn(x):
          counter_var.assign(counter_var * 2)
          return x
  
      def dataset1_fn():
          return dataset_ops.Dataset.range(1).map(increment_fn)
  
      def dataset2_fn():
          return dataset_ops.Dataset.range(1).map(multiply_fn)
  
      @def_function.function
      def fn():
          _ = dataset1_fn().get_single_element()
          _ = dataset2_fn().get_single_element()
          return "hello"
  
      self.evaluate(counter_var.initializer)
      self.assertEqual(self.evaluate(fn()), b"hello")
      self.assertEqual(self.evaluate(counter_var), 4)
  
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 4 for calling the GetSingleElementTest obj's underlying member method code with example usage: obj.testAutomaticControlDependencies() and returns: x, x, dataset_ops, dataset_ops, str