code: def test_identity_join_node(tmpdir):
      """Test an IdentityInterface join."""
      global _sum_operands
      _sum_operands = []
      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 IdentityInterface join node
      join = pe.JoinNode(
          IdentityInterface(fields=["vector"]),
          joinsource="inputspec",
          joinfield="vector",
          name="join",
      )
      wf.connect(pre_join1, "output1", join, "vector")
      # an uniterated post-join node
      post_join1 = pe.Node(SumInterface(), name="post_join1")
      wf.connect(join, "vector", post_join1, "input1")
  
      result = wf.run()
  
      # the expanded graph contains 1 * 3 iteration pre-join nodes, 1 join
      # node and 1 post-join node. Nipype factors away the iterable input
      # IdentityInterface but keeps the join IdentityInterface.
      assert (
          len(result.nodes()) == 5
      ), "The number of expanded nodes is incorrect."
      assert _sum_operands[0] == [2, 3, 4], (
          "The join Sum input is incorrect: %s." % _sum_operands[0]
      )
  
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 6 for calling a global function with example usage: test_identity_join_node(tmpdir) without return types