code: def test_gray_ijv():
      workspace, module, ijv = make_workspace_ijv()
      assert isinstance(
          module,
          cellprofiler.modules.convertobjectstoimage.ConvertObjectsToImage,
      )
      module.image_mode.value = "Grayscale"
      module.run(workspace)
      pixel_data = workspace.image_set.get_image(IMAGE_NAME).pixel_data
  
      counts = scipy.sparse.coo.coo_matrix(
          (numpy.ones(ijv.shape[0]), (ijv[:, 0], ijv[:, 1]))
      ).toarray()
      assert numpy.all(pixel_data[counts == 0] == 0)
      pd_values = numpy.unique(pixel_data)
      pd_labels = numpy.zeros(pixel_data.shape, int)
      for i in range(1, len(pd_values)):
          pd_labels[pixel_data == pd_values[i]] = i
  
      dest_v = numpy.zeros(numpy.max(ijv[:, 2] + 1), int)
      dest_v[ijv[:, 2]] = pd_labels[ijv[:, 0], ijv[:, 1]]
      pd_ok = numpy.zeros(pixel_data.shape, bool)
      ok = pd_labels[ijv[:, 0], ijv[:, 1]] == dest_v[ijv[:, 2]]
      pd_ok[ijv[ok, 0], ijv[ok, 1]] = True
      assert numpy.all(pd_ok[counts > 0])
  
imports: import numpy
  import pytest
  import scipy.sparse.coo
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.module
  import cellprofiler.modules.convertobjectstoimage
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.workspace
label_desc: Use image node_id 12 for calling a global function with example usage: test_gray_ijv() without return types