code: def test_unique_join_node(tmpdir):
      """Test join with the ``unique`` flag set to True."""
      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", [3, 1, 2, 1, 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 set join node
      join = pe.JoinNode(
          SumInterface(),
          joinsource="inputspec",
          joinfield="input1",
          unique=True,
          name="join",
      )
      wf.connect(pre_join1, "output1", join, "input1")
  
      wf.run()
  
      assert _sum_operands[0] == [4, 2, 3], (
          "The unique join output value 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 4 for calling a global function with example usage: test_unique_join_node(tmpdir) without return types