code: def test_apng_dispose_region():
      with Image.open(
          "Tests/images/apng/dispose_op_none_region.png"
      ) as im:
          im.seek(im.n_frames - 1)
          assert im.getpixel((0, 0)) == (0, 255, 0, 255)
          assert im.getpixel((64, 32)) == (0, 255, 0, 255)
  
      with Image.open(
          "Tests/images/apng/dispose_op_background_before_region.png"
      ) as im:
          im.seek(im.n_frames - 1)
          assert im.getpixel((0, 0)) == (0, 0, 0, 0)
          assert im.getpixel((64, 32)) == (0, 0, 0, 0)
  
      with Image.open(
          "Tests/images/apng/dispose_op_background_region.png"
      ) as im:
          im.seek(im.n_frames - 1)
          assert im.getpixel((0, 0)) == (0, 0, 255, 255)
          assert im.getpixel((64, 32)) == (0, 0, 0, 0)
  
      with Image.open(
          "Tests/images/apng/dispose_op_previous_region.png"
      ) as im:
          im.seek(im.n_frames - 1)
          assert im.getpixel((0, 0)) == (0, 255, 0, 255)
          assert im.getpixel((64, 32)) == (0, 255, 0, 255)
  
imports: import pytest
  from PIL import Image, ImageSequence, PngImagePlugin
label_desc: Use image node_id 4 for calling a global function with example usage: test_apng_dispose_region() without return types