code: def test_merge(tmpdir, args, kwargs, in_lists, expected):
      tmpdir.chdir()
  
      node = pe.Node(utility.Merge(*args, **kwargs), name="merge")
  
      numinputs = args[0] if args else 0
      if numinputs >= 1:
          for i in range(1, numinputs + 1):
              setattr(node.inputs, f"in{i:d}", in_lists[i - 1])
  
      res = node.run()
      if numinputs < 1:
          assert not isdefined(res.outputs.out)
      else:
          assert res.outputs.out == expected
  
file_path: nipype/nipype/interfaces/utility/tests/test_base.py
imports: import os
  import pytest
  from nipype.interfaces import utility
  from nipype.interfaces.base import isdefined
  import nipype.pipeline.engine
label_desc: Use image node_id 3 for calling a global function with example usage: test_merge(tmpdir, args, kwargs, in_lists, expected) without return types