code: def _generate_sdk_tar_with_public_version(destination_folder):
      """
      This function is used for auto capture integ tests. This test need the sagemaker version
      that is already published to PyPI. So we manipulate the current local dev version to change
      latest released SDK version.
  
      It does the following
      1. Change the dev version of the SDK to the latest published version
      2. Generate SDK tar using that version
      3. Move tar file to the folder when docker file is present
      3. Update the version back to the dev version
      """
      dist_folder_path = "dist"
  
      with open(
          os.path.join(os.getcwd(), "VERSION"), "r+"
      ) as version_file:
          dev_sagemaker_version = version_file.readline().strip()
          public_sagemaker_version = re.sub(
              "1.dev0", "0", dev_sagemaker_version
          )
          version_file.seek(0)
          version_file.write(public_sagemaker_version)
          version_file.truncate()
      if os.path.exists(dist_folder_path):
          shutil.rmtree(dist_folder_path)
  
      source_archive = _generate_sagemaker_sdk_tar(destination_folder)
  
      with open(
          os.path.join(os.getcwd(), "VERSION"), "r+"
      ) as version_file:
          version_file.seek(0)
          version_file.write(dev_sagemaker_version)
          version_file.truncate()
      if os.path.exists(dist_folder_path):
          shutil.rmtree(dist_folder_path)
  
      return source_archive
  
imports: from __future__ import absolute_import
  import base64
  import os
  import subprocess
  import shutil
  import pytest
  import docker
  import re
  import sys
  from docker.errors import BuildError
  from sagemaker.utils import sagemaker_timestamp, _tmpdir, sts_regional_endpoint
label_desc: Use image node_id 16 for calling a global function with example usage: _generate_sdk_tar_with_public_version(destination_folder) and returns: source_archive