class_docstr: Used to wrap RandomlyShapedDataIterator to add iteration counts and finite data size
class_docstr_tok: ["Used","to","wrap","RandomlyShapedDataIterator","to","add","iteration","counts","and","finite","data","size"]
code: def __next__(self):
      if self.i > self.iter_limit:
          raise StopIteration()
      result = next(self.iterator)
      for i, elem in enumerate(result):
          assert len(elem.shape) == (
              2
          ), f"Got unexpected shape {elem.shape}"
          assert (
              elem.shape[1] >= 2
          ), f"Got unexpected shape {elem.shape}"
          elem[0][0] = i
          elem[0][1] = self.i
      self.i += 1
      return result
  
imports: import copy
  import numpy
  import nvidia.dali.plugin.tf
  import tensorflow
  from nvidia.dali import Pipeline, fn
  from test_utils import RandomlyShapedDataIterator
label_desc: Use image node_id 3 for calling the FiniteIterator obj's underlying member method code with example usage: obj.__next__() and returns: result