code: def testFromGeneratorWithTwoArgs(self):
      def flat_map_fn(elem, message):
          def generator_with_arg(n, msg):
              for i in range(n):
                  yield i, msg
  
          return dataset_ops.Dataset.from_generator(
              generator_with_arg,
              output_types=(dtypes.int64, dtypes.string),
              output_shapes=((), ()),
              args=(elem, message),
          )
  
      dataset = dataset_ops.Dataset.zip(
          (
              dataset_ops.Dataset.range(5),
              dataset_ops.Dataset.from_tensors("Hi!").repeat(None),
          )
      ).flat_map(flat_map_fn)
  
      self.assertDatasetProduces(
          dataset,
          expected_output=[
              (0, b"Hi!"),
              (0, b"Hi!"),
              (1, b"Hi!"),
              (0, b"Hi!"),
              (1, b"Hi!"),
              (2, b"Hi!"),
              (0, b"Hi!"),
              (1, b"Hi!"),
              (2, b"Hi!"),
              (3, b"Hi!"),
          ],
      )
  
imports: import threading
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import from_generator_op
  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 sparse_tensor
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.ops import script_ops
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import test
label_desc: Use image node_id 18 for calling the FromGeneratorTest obj's underlying member method code with example usage: obj.testFromGeneratorWithTwoArgs() and returns: dataset_ops