code: def test_gif_loop_and_duration(test_images, tmp_path):
      # Note: I think this test tests pillow kwargs, not imageio functionality
      # maybe we should drop it?
  
      im = iio.imread(
          test_images / "newtonscradle.gif",
          plugin="pillow",
          mode="RGBA",
      )
  
      with iio.imopen(
          tmp_path / "test.gif", "w", plugin="pillow"
      ) as file:
          for frame in im:
              file.write(
                  frame, palettesize=100, duration=0.00005, loop=2
              )
  
imports: import io
  import os
  from pathlib import Path
  import imageio.v3
  import numpy
  import pytest
  from imageio.core.request import InitializationError, Request
  from imageio.core.v3_plugin_api import PluginV3
  from imageio.plugins.pillow import PillowPlugin
  from PIL import Image, ImageSequence, ImageOps, __version__
label_desc: Use image node_id 16 for calling a global function with example usage: test_gif_loop_and_duration(test_images, tmp_path) without return types