code: def testFromGeneratorUsingGeneratorExpression(
      self, num_repeats, requires_initialization
  ):
      # NOTE(mrry): Generator *expressions* are not repeatable (or in general
      # reusable), because they eagerly evaluate the `for` expression as
      # `iter(range(1, 100))` and discard the means of reconstructing
      # `range(1, 100)`. Wrapping the generator expression in a `lambda` makes
      # it repeatable.
      generator = lambda: ([i] * i for i in range(1, 100))
      elem_sequence = list(generator())
      self._testFromGenerator(
          generator,
          elem_sequence,
          num_repeats=num_repeats,
          requires_initialization=requires_initialization,
      )
  
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 5 for calling the FromGeneratorTest obj's underlying member method code with example usage: obj.testFromGeneratorUsingGeneratorExpression(num_repeats, requires_initialization) without return types