code: def test_as_grey(tmpdir):
      fname = tmpdir.join("mahotas_test.png")
      colour = np.arange(16 * 16 * 3).reshape((16, 16, 3))
      freeimage.imsave(fname, colour.astype(np.uint8))
      c2 = freeimage.imread(fname, as_grey=True)
      assert len(c2.shape) == 2
      assert c2.shape == colour.shape[:-1]
  
file_path: mahotas/mahotas/tests/test_freeimage.py
imports: import numpy
  from os import path
label_desc: Use image node_id 2 for calling a global function with example usage: test_as_grey(tmpdir) without return types