code: def test_deprecated_kwargs(test_images):
      with pytest.raises(TypeError):
          iio.imread(
              test_images / "chelsea.png", plugin="pillow", as_gray=True
          )
  
      with pytest.warns(DeprecationWarning):
          img = iio.imread(
              test_images / "chelsea.png", plugin="pillow", pilmode="I"
          )
          assert img.shape == (300, 451)
  
      with pytest.warns(DeprecationWarning):
          iio.imread(
              test_images / "chelsea.png",
              plugin="pillow",
              exifrotate=True,
          )
  
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 39 for calling a global function with example usage: test_deprecated_kwargs(test_images) without return types