code: def _create_docker_build_ctx(work_dir, dockerfile_contents):
      """
      Creates build context tarfile containing Dockerfile and project code, returning path to tarfile
      """
      directory = tempfile.mkdtemp()
      try:
          dst_path = os.path.join(directory, "mlflow-project-contents")
          shutil.copytree(src=work_dir, dst=dst_path)
          with open(
              os.path.join(dst_path, _GENERATED_DOCKERFILE_NAME), "w"
          ) as handle:
              handle.write(dockerfile_contents)
          _, result_path = tempfile.mkstemp()
          file_utils.make_tarfile(
              output_filename=result_path,
              source_dir=dst_path,
              archive_name=_PROJECT_TAR_ARCHIVE_NAME,
          )
      finally:
          shutil.rmtree(directory, onerror=_handle_readonly_on_windows)
      return result_path
  
imports: import logging
  import os
  import posixpath
  import shutil
  import subprocess
  import tempfile
  import urllib.parse
  import urllib.request
  import docker
  from mlflow import tracking
  from mlflow.environment_variables import MLFLOW_TRACKING_URI
  from mlflow.exceptions import ExecutionException
  from mlflow.projects.utils import MLFLOW_DOCKER_WORKDIR_PATH
  from mlflow.utils import file_utils, process
  from mlflow.utils.databricks_utils import get_databricks_env_vars
  from mlflow.utils.file_utils import _handle_readonly_on_windows
  from mlflow.utils.git_utils import get_git_commit
  from mlflow.utils.mlflow_tags import MLFLOW_DOCKER_IMAGE_ID, MLFLOW_DOCKER_IMAGE_URI
label_desc: Use image node_id 5 for calling a global function with example usage: _create_docker_build_ctx(work_dir, dockerfile_contents) and returns: result_path