code: def testSharedResourceNestedFlatMapDataset(self):
      repeats = [[1, 2], [3, 4], [5, 0], [1, 7]]
      components = np.array(repeats, dtype=np.int64)
      iterator = dataset_ops.make_initializable_iterator(
          dataset_ops.Dataset.from_tensor_slices(components).flat_map(
              lambda x: dataset_ops.Dataset.from_tensor_slices(
                  x
              ).flat_map(
                  lambda y: dataset_ops.Dataset.from_tensors(y).repeat(
                      y
                  )
              )
          ),
          shared_name="shared_flat_map_iterator",
      )
      init_op = iterator.initializer
      get_next = iterator.get_next()
  
      # Create two concurrent sessions that share the same iterator
      # resource on the same server, and verify that a random
      # interleaving of `Session.run(get_next)` calls on the two
      # sessions yields the expected result.
      server = server_lib.Server.create_local_server()
      with session.Session(server.target) as sess1:
          with session.Session(server.target) as sess2:
              for _ in range(3):
                  sess = random.choice([sess1, sess2])
                  sess.run(init_op)
                  for row in repeats:
                      for i in row:
                          for _ in range(i):
                              sess = random.choice([sess1, sess2])
                              self.assertEqual(i, sess.run(get_next))
  
              with self.assertRaises(errors.OutOfRangeError):
                  sess = random.choice([sess1, sess2])
                  sess.run(get_next)
  
imports: import random
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.client import session
  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.framework import combinations
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import function
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops.ragged import ragged_conversion_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import test
  from tensorflow.python.training import server_lib
label_desc: Use image node_id 3 for calling the FlatMapTest obj's underlying member method code with example usage: obj.testSharedResourceNestedFlatMapDataset() without return types