code: def _copy_jumpstart_artifacts(
      model_data: str, js_id: str, code_dir: Path
  ) -> bool:
      """Copy the associated JumpStart Resource into the code directory"""
      logger.info("Downloading JumpStart artifacts from S3...")
  
      s3_downloader = S3Downloader()
      if isinstance(model_data, str):
          if model_data.endswith(".tar.gz"):
              logger.info(
                  "Uncompressing JumpStart artifacts for faster loading..."
              )
              with _tmpdir(directory=str(code_dir)) as js_model_dir:
                  s3_downloader.download(model_data, js_model_dir)
                  _extract_js_resource(js_model_dir, code_dir, js_id)
          else:
              logger.info("Copying uncompressed JumpStart artifacts...")
              s3_downloader.download(model_data, code_dir)
      elif (
          isinstance(model_data, dict)
          and model_data.get("S3DataSource")
          and model_data.get("S3DataSource").get("S3Uri")
      ):
          logger.info("Copying uncompressed JumpStart artifacts...")
          s3_downloader.download(
              model_data.get("S3DataSource").get("S3Uri"), code_dir
          )
      else:
          raise ValueError(
              "JumpStart model data compression format is unsupported: %s",
              model_data,
          )
  
      return True
  
file_path: sagemaker-python-sdk/src/sagemaker/serve/model_server/tgi/prepare.py
imports: from __future__ import absolute_import
  import tarfile
  import logging
  from typing import List
  from pathlib import Path
  from sagemaker.serve.utils.local_hardware import _check_disk_space, _check_docker_disk_usage
  from sagemaker.utils import _tmpdir
  from sagemaker.s3 import S3Downloader
label_desc: Use image node_id 2 for calling a global function with example usage: _copy_jumpstart_artifacts(model_data, js_id, code_dir) and returns: True