code: def test_imageio_as_gray():
      img = imread(fetch("data/color.png"), as_gray=True)
      assert img.ndim == 2
      assert img.dtype == np.float64
      img = imread(fetch("data/camera.png"), as_gray=True)
      # check that conversion does not happen for a gray image
      assert (
          np.core.numerictypes.sctype2char(img.dtype)
          in np.typecodes["AllInteger"]
      )
  
file_path: scikit-image/skimage/io/tests/test_imageio.py
imports: from tempfile import NamedTemporaryFile
  import numpy
  from skimage.io import imread, imsave, plugin_order
  from skimage._shared import testing
  from skimage._shared.testing import fetch
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_imageio_as_gray() without return types