code: def test_s3datagrabber_communication(tmpdir):
      dg = nio.S3DataGrabber(
          infields=["subj_id", "run_num"], outfields=["func", "struct"]
      )
      dg.inputs.anon = True
      dg.inputs.bucket = "openfmri"
      dg.inputs.bucket_path = "ds001/"
      dg.inputs.local_directory = tmpdir.strpath
      dg.inputs.sort_filelist = True
      dg.inputs.template = "*"
      dg.inputs.field_template = dict(
          func="%s/BOLD/task001_%s/bold.nii.gz",
          struct="%s/anatomy/highres001_brain.nii.gz",
      )
      dg.inputs.subj_id = ["sub001", "sub002"]
      dg.inputs.run_num = ["run001", "run003"]
      dg.inputs.template_args = dict(
          func=[["subj_id", "run_num"]], struct=[["subj_id"]]
      )
      res = dg.run()
      func_outfiles = res.outputs.func
      struct_outfiles = res.outputs.struct
  
      # check for all files
      assert (
          os.path.join(
              dg.inputs.local_directory,
              "/sub001/BOLD/task001_run001/bold.nii.gz",
          )
          in func_outfiles[0]
      )
      assert os.path.exists(func_outfiles[0])
      assert (
          os.path.join(
              dg.inputs.local_directory,
              "/sub001/anatomy/highres001_brain.nii.gz",
          )
          in struct_outfiles[0]
      )
      assert os.path.exists(struct_outfiles[0])
      assert (
          os.path.join(
              dg.inputs.local_directory,
              "/sub002/BOLD/task001_run003/bold.nii.gz",
          )
          in func_outfiles[1]
      )
      assert os.path.exists(func_outfiles[1])
      assert (
          os.path.join(
              dg.inputs.local_directory,
              "/sub002/anatomy/highres001_brain.nii.gz",
          )
          in struct_outfiles[1]
      )
      assert os.path.exists(struct_outfiles[1])
  
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 5 for calling a global function with example usage: test_s3datagrabber_communication(tmpdir) without return types