code: def test_selectfiles(tmpdir, SF_args, inputs_att, expected):
      tmpdir.chdir()
      base_dir = op.dirname(nipype.__file__)
      dg = nio.SelectFiles(base_directory=base_dir, **SF_args)
      for key, val in inputs_att.items():
          setattr(dg.inputs, key, val)
  
      assert dg._infields == expected["infields"]
      assert sorted(dg._outfields) == expected["outfields"]
      assert sorted(dg._outputs().get()) == expected["node_output"]
  
      res = dg.run()
      for key, val in expected["run_output"].items():
          assert getattr(res.outputs, key) == val
  
imports: import os
  import copy
  import simplejson
  import glob
  import os.path
  from subprocess import Popen
  import hashlib
  from collections import namedtuple
  import pytest
  import nipype
  import nipype.interfaces.io
  from nipype.interfaces.base.traits_extension import isdefined
  from nipype.interfaces.base import Undefined, TraitError
  from nipype.utils.filemanip import dist_is_editable
  from subprocess import check_call, CalledProcessError
label_desc: Use image node_id 3 for calling a global function with example usage: test_selectfiles(tmpdir, SF_args, inputs_att, expected) without return types