code: def source_dir(request):
      wf = os.path.join(DATA_DIR, "workflow")
      tmp = tempfile.mkdtemp()
      shutil.copy2(
          os.path.join(wf, "inference.py"),
          os.path.join(tmp, "inference.py"),
      )
      shutil.copy2(os.path.join(wf, "foo"), os.path.join(tmp, "foo"))
  
      def fin():
          shutil.rmtree(tmp)
  
      request.addfinalizer(fin)
  
      return tmp
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/workflow/test_utils.py
imports: from __future__ import absolute_import
  import os
  import shutil
  import tempfile
  import pytest
  from sagemaker.estimator import Estimator
  from sagemaker.workflow._utils import _RepackModelStep, _RegisterModelStep, REPACK_SCRIPT, REPACK_SCRIPT_LAUNCHER
  from sagemaker.workflow.properties import Properties
  from tests.unit.test_utils import FakeS3, list_tar_files
  from tests.unit import DATA_DIR
  from tests.unit.sagemaker.workflow.conftest import ROLE, IMAGE_URI, BUCKET
label_desc: Use image node_id 2 for calling a global function with example usage: source_dir(request) and returns: tmp