code: def test_iterator():
      with Image.open("Tests/images/multipage.tiff") as im:
          i = ImageSequence.Iterator(im)
          for index in range(0, im.n_frames):
              assert i[index] == next(i)
          with pytest.raises(IndexError):
              i[index + 1]
          with pytest.raises(StopIteration):
              next(i)
  
file_path: pillow-simd/Tests/test_imagesequence.py
imports: import pytest
  from PIL import Image, ImageSequence, TiffImagePlugin
  from .helper import assert_image_equal, hopper, skip_unless_feature
label_desc: Use image node_id 2 for calling a global function with example usage: test_iterator() without return types