code: def test_categories():
      workspace, module = make_workspace(
          numpy.zeros((10, 10)), numpy.zeros((10, 10), int)
      )
      assert isinstance(
          module, cellprofiler.modules.measuretexture.MeasureTexture
      )
      for has_category, object_name in (
          (True, "Image"),
          (True, INPUT_OBJECTS_NAME),
          (False, "Foo"),
      ):
          categories = module.get_categories(
              workspace.pipeline, object_name
          )
          if has_category:
              assert len(categories) == 1
              assert (
                  categories[0]
                  == cellprofiler.modules.measuretexture.TEXTURE
              )
          else:
              assert len(categories) == 0
      module.images_or_objects.value = (
          cellprofiler.modules.measuretexture.IO_IMAGES
      )
      categories = module.get_categories(workspace.pipeline, "Image")
      assert len(categories) == 1
      categories = module.get_categories(
          workspace.pipeline, INPUT_OBJECTS_NAME
      )
      assert len(categories) == 0
      module.images_or_objects.value = (
          cellprofiler.modules.measuretexture.IO_OBJECTS
      )
      categories = module.get_categories(workspace.pipeline, "Image")
      assert len(categories) == 0
      categories = module.get_categories(
          workspace.pipeline, INPUT_OBJECTS_NAME
      )
      assert len(categories) == 1
  
imports: import io
  import numpy
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler.modules.measuretexture
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
label_desc: Use image node_id 6 for calling a global function with example usage: test_categories() without return types