code: def test_gif(tmp_path):
      fnamebase = str(tmp_path / "test")
  
      # The not-animated gif
  
      for isfloat in (False, True):
          for crop in (0, 1, 2):
              for colors in (0, 3, 4):
                  if colors > 1 and sys.platform.startswith("darwin"):
                      continue  # quantize fails, see also png
                  fname = fnamebase + "%i.%i.%i.gif" % (
                      isfloat,
                      crop,
                      colors,
                  )
                  rim = get_ref_im(colors, crop, isfloat)
  
                  try:
                      imageio.imsave(fname, rim, format="GIF-PIL")
                  except ImportError:
                      pytest.xfail(
                          "New pillow version is no longer supported."
                      )
  
                  im = imageio.imread(fname, format="GIF-PIL")
                  mul = 255 if isfloat else 1
                  if colors not in (0, 1):
                      im = im[:, :, :3]
                      rim = rim[:, :, :3]
                  assert_close(rim * mul, im, 1.1)  # lossless
  
      # Parameter fail
      with pytest.raises(TypeError):
          imageio.imread(fname, notavalidkwarg=True, format="GIF-PIL")
  
      with pytest.raises(TypeError):
          imageio.imsave(
              fnamebase + "1.gif", im, notavalidk=True, format="GIF-PIL"
          )
  
imports: import os
  import sys
  import io
  from zipfile import ZipFile
  import numpy
  import pytest
  import imageio
  from imageio import core
  from conftest import deprecated_test
label_desc: Use image node_id 9 for calling a global function with example usage: test_gif(tmp_path) without return types