code: def testFlatMap(self):
      test_cases = [
          {"tensor": 0, "shape": tensor_shape.TensorShape([])},
          {
              "tensor": np.array([1, 2, 3]),
              "shape": tensor_shape.TensorShape([3]),
          },
          {
              "tensor": np.array([[1, 2, 3]]),
              "shape": tensor_shape.TensorShape([1, 3]),
          },
      ]
  
      for test_case in test_cases:
          with ops.Graph().as_default() as g:
              dataset = dataset_ops.Dataset.range(42)
  
              def make_dataset(tensor):
                  def dataset_fn(n):
                      return dataset_ops.Dataset.from_tensors(
                          tensor
                      ).repeat(n)
  
                  return dataset_fn
  
              dataset = dataset.flat_map(
                  make_dataset(test_case["tensor"])
              )
              iterator = dataset_ops.make_one_shot_iterator(dataset)
              get_next = iterator.get_next()
              train_op = ops.get_collection_ref(ops.GraphKeys.TRAIN_OP)
              train_op.append(get_next)
              mg = meta_graph.create_meta_graph_def(graph=g)
              grappler_item = item.Item(mg)
              op_properties = grappler_item.GetOpProperties()
              self.assertEqual(
                  test_case["shape"],
                  op_properties["IteratorGetNext"][0].shape,
              )
  
imports: import numpy
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import iterator_ops
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import meta_graph
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.grappler import item
  from tensorflow.python.ops import array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 18 for calling the GrapplerTest obj's underlying member method code with example usage: obj.testFlatMap() and returns: dataset_fn, dataset_ops