code: def test_python_generator_with_extra_test(self):
      def new_generator():
          for i in range(1, 5):
              yield i
  
      gen = new_generator()
  
      def run_loop():
          s = 0
          c = 0
  
          def body(i):
              nonlocal s, c
              s = s * 10 + i
              c += 1
  
          control_flow.for_stmt(
              gen,
              extra_test=lambda: c == 0,  # Break after first iteration
              body=body,
              get_state=None,
              set_state=None,
              symbol_names=("s", "c"),
              opts={},
          )
          return s, c
  
      self.assertEqual(run_loop(), (1, 1))
      self.assertEqual(run_loop(), (2, 1))
      self.assertEqual(run_loop(), (3, 1))
  
      self.assertEqual(next(gen), 4)
  
file_path: DALI/dali/test/python/autograph/operators/test_control_flow.py
imports: import unittest
  from nvidia.dali._autograph.operators import control_flow
label_desc: Use image node_id 2 for calling the ForLoopTest obj's underlying member method code with example usage: obj.test_python_generator_with_extra_test() and returns: s,  c