code: def test_worm_descriptor_building_two():
      """Test rebuilding two worms"""
  
      module = cellprofiler.modules.untangleworms.UntangleWorms()
      params = make_params(
          dict(
              radii_from_training=numpy.array([5, 5, 5]),
              num_control_points=3,
          )
      )
      result, _, _, _, _ = module.worm_descriptor_building(
          [
              numpy.array([[10, 15], [20, 25]]),
              numpy.array([[10, 25], [20, 15]]),
          ],
          params,
          (40, 50),
      )
      expected = numpy.zeros((40, 50), bool)
      expected[numpy.arange(10, 21), numpy.arange(15, 26)] = True
      ii, jj = numpy.mgrid[-5:6, -5:6]
      expected = scipy.ndimage.binary_dilation(
          expected, ii * ii + jj * jj <= 25
      )
      epoints = numpy.argwhere(expected)
      elabels = numpy.ones(len(epoints), int)
  
      expected = numpy.zeros((40, 50), bool)
      expected[numpy.arange(10, 21), numpy.arange(25, 14, -1)] = True
      expected = scipy.ndimage.binary_dilation(
          expected, ii * ii + jj * jj <= 25
      )
      epoints = numpy.vstack((epoints, numpy.argwhere(expected)))
      elabels = numpy.hstack(
          (elabels, numpy.ones(numpy.sum(expected), int) * 2)
      )
  
      eorder = numpy.lexsort((epoints[:, 0], epoints[:, 1]))
      rorder = numpy.lexsort((result[:, 0], result[:, 1]))
      assert len(epoints) == len(result)
      assert numpy.all(result[rorder, 2] == elabels[eorder])
      assert numpy.all(result[rorder, :2] == epoints[eorder])
  
imports: import base64
  import io
  import os
  import tempfile
  import zlib
  import imageio
  import centrosome.outline
  import numpy
  import scipy.ndimage
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.modules
  import cellprofiler.modules.untangleworms
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 30 for calling a global function with example usage: test_worm_descriptor_building_two() without return types