code: def test_get_all_paths_recur_many():
      module = cellprofiler.modules.untangleworms.UntangleWorms()
  
      #
      # A hopeless tangle where all branches connect to all segments
      #
      class Result(object):
          def __init__(self):
              self.incident_branch_areas = [list(range(3))] * 4
              self.incident_segments = [list(range(4))] * 3
              self.segments = [
                  (numpy.zeros((2, 1)), numpy.zeros((2, 1)))
              ] * 4
              self.segment_lengths = [1] * 4
              self.incidence_directions = numpy.ones((3, 4), bool)
  
      paths_list = module.get_all_paths_recur(
          Result(), [0], [[i] for i in range(3)], 1, 0, 1000
      )
      sorted_list = tuple(
          sorted(
              [
                  (tuple(path.segments), tuple(path.branch_areas))
                  for path in paths_list
              ]
          )
      )
      #
      # All possible permutations of 1,2,3 * all possible permutations
      # of 1,2,3
      #
      permutations = (
          (1, 2, 3),
          (1, 3, 2),
          (2, 1, 3),
          (2, 3, 1),
          (3, 1, 2),
          (3, 2, 1),
      )
      #
      # Singles...
      #
      expected = sum(
          [
              [
                  ((0, segment), (branch_area,))
                  for branch_area in range(3)
              ]
              for segment in range(1, 4)
          ],
          [],
      )
      #
      # Doubles
      #
      expected += sum(
          [
              sum(
                  [
                      [
                          (tuple([0] + list(ps[:2])), (b1, b2))
                          for b1 in range(3)
                          if b2 != b1
                      ]
                      for b2 in range(3)
                  ],
                  [],
              )
              for ps in permutations
          ],
          [],
      )
      #
      # Triples
      #
      expected += sum(
          [
              sum(
                  [
                      sum(
                          [
                              [
                                  (tuple([0] + list(ps)), (b1, b2, b3))
                                  for b1 in range(3)
                                  if b2 != b1 and b1 != b3
                              ]
                              for b2 in range(3)
                              if b3 != b2
                          ],
                          [],
                      )
                      for b3 in range(3)
                  ],
                  [],
              )
              for ps in permutations
          ],
          [],
      )
      expected = tuple(sorted(expected))
      assert sorted_list == expected
  
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 19 for calling a global function with example usage: test_get_all_paths_recur_many() without return types