code: def iterator_next_with_catching_stop_iteration(ds, cond):
      # This is the only instance when the use of TF iterators does not work as
      # intended. In graph mode, the `except` below will never catch, and the
      # tf.function will raise the error instead.
      # TODO(b/132311724): The error should be friendlier here.
      # Note: b/132298783 covers actually supporting this pattern.
      itr = iter(ds)
      try:
          while cond:
              next(itr)
      except StopIteration:
          pass
  
imports: import tensorflow
  from tensorflow.python.autograph.tests import reference_test_base
label_desc: Use image node_id 16 for calling a global function with example usage: iterator_next_with_catching_stop_iteration(ds, cond) without return types