code: def write_sample_image(tmpdir):
      im = utils.array_to_img(np.random.rand(1, 1, 3))
      path = str(tmpdir / "sample_image.png")
      utils.save_img(path, im)
      return path
  
file_path: keras-preprocessing/tests/image/utils_test.py
imports: import io
  import resource
  from pathlib import Path
  import numpy
  import PIL
  import pytest
  from keras_preprocessing.image import utils
label_desc: Use image node_id 5 for calling a global function with example usage: write_sample_image(tmpdir) and returns: path