code: def test_scipy_imread_compat(test_images):
      # https://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.imread.html
      # https://github.com/scipy/scipy/blob/41a3e69ca3141d8bf996bccb5eca5fc7bbc21a51/scipy/misc/pilutil.py#L111
  
      fname = test_images / "chelsea.png"
  
      im = imageio.imread(fname)
      assert im.shape == (300, 451, 3) and im.dtype == "uint8"
  
      # Scipy users may default to using "mode", but our getreader() already has
      # a "mode" argument, so they should use pilmode instead.
      try:
          im = imageio.imread(fname, mode="L")
      except TypeError as err:
          assert "pilmode" in str(err)
  
      im = imageio.imread(fname, pilmode="RGBA", format="PNG-PIL")
      assert im.shape == (300, 451, 4) and im.dtype == "uint8"
  
      im = imageio.imread(fname, pilmode="L", format="PNG-PIL")
      assert im.shape == (300, 451) and im.dtype == "uint8"
  
      im = imageio.imread(fname, pilmode="F", format="PNG-PIL")
      assert im.shape == (300, 451) and im.dtype == "float32"
  
      im = imageio.imread(fname, as_gray=True, format="PNG-PIL")
      assert im.shape == (300, 451) and im.dtype == "float32"
  
      # Force using pillow (but really, Pillow's imageio's first choice! Except
      # for tiff)
      im = imageio.imread(fname, "PNG-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 16 for calling a global function with example usage: test_scipy_imread_compat(test_images) without return types