code: def test_multiple_join_nodes(tmpdir):
      """Test two join nodes, one downstream of the other."""
      global _products
      _products = []
      tmpdir.chdir()
  
      # Make the workflow.
      wf = pe.Workflow(name="test")
      # the iterated input node
      inputspec = pe.Node(
          IdentityInterface(fields=["n"]), name="inputspec"
      )
      inputspec.iterables = [("n", [1, 2, 3])]
      # a pre-join node in the iterated path
      pre_join1 = pe.Node(IncrementInterface(), name="pre_join1")
      wf.connect(inputspec, "n", pre_join1, "input1")
      # the first join node
      join1 = pe.JoinNode(
          IdentityInterface(fields=["vector"]),
          joinsource="inputspec",
          joinfield="vector",
          name="join1",
      )
      wf.connect(pre_join1, "output1", join1, "vector")
      # an uniterated post-join node
      post_join1 = pe.Node(SumInterface(), name="post_join1")
      wf.connect(join1, "vector", post_join1, "input1")
      # the downstream join node connected to both an upstream join
      # path output and a separate input in the iterated path
      join2 = pe.JoinNode(
          IdentityInterface(fields=["vector", "scalar"]),
          joinsource="inputspec",
          joinfield="vector",
          name="join2",
      )
      wf.connect(pre_join1, "output1", join2, "vector")
      wf.connect(post_join1, "output1", join2, "scalar")
      # a second post-join node
      post_join2 = pe.Node(SumInterface(), name="post_join2")
      wf.connect(join2, "vector", post_join2, "input1")
      # a third post-join node
      post_join3 = pe.Node(ProductInterface(), name="post_join3")
      wf.connect(post_join2, "output1", post_join3, "input1")
      wf.connect(join2, "scalar", post_join3, "input2")
  
      result = wf.run()
  
      # The expanded graph contains one pre_join1 replicate per inputspec
      # replicate and one of each remaining node = 3 + 5 = 8 nodes.
      # The replicated inputspec nodes are factored out of the expansion.
      assert (
          len(result.nodes()) == 8
      ), "The number of expanded nodes is incorrect."
      # The outputs are:
      # pre_join1: [2, 3, 4]
      # post_join1: 9
      # join2: [2, 3, 4] and 9
      # post_join2: 9
      # post_join3: 9 * 9 = 81
      assert _products == [81], "The post-join product is incorrect"
  
imports: import pytest
  from ....None import config
  from ...None import engine
  from ....interfaces import base
  from ....interfaces.utility import IdentityInterface, Function, Merge
  from ....interfaces.base import traits, File
label_desc: Use image node_id 5 for calling a global function with example usage: test_multiple_join_nodes(tmpdir) without return types