code: def _copy_jumpstart_artifacts(
      model_data: str, js_id: str, code_dir: Path
  ):
      """Copy the associated JumpStart Resource into the code directory"""
      logger.info("Downloading JumpStart artifacts from S3...")
  
      s3_downloader = S3Downloader()
      invalid_model_data_format = False
      with _tmpdir(directory=str(code_dir)) as js_model_dir:
          if isinstance(model_data, str):
              if model_data.endswith(".tar.gz"):
                  logger.info(
                      "Uncompressing JumpStart artifacts for faster loading..."
                  )
                  s3_downloader.download(model_data, js_model_dir)
                  _extract_js_resource(js_model_dir, js_id)
              else:
                  logger.info(
                      "Copying uncompressed JumpStart artifacts..."
                  )
                  s3_downloader.download(model_data, js_model_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"),
                  js_model_dir,
              )
          else:
              invalid_model_data_format = True
          if not invalid_model_data_format:
              _move_to_code_dir(js_model_dir, code_dir)
  
      if invalid_model_data_format:
          raise ValueError(
              "JumpStart model data compression format is unsupported: %s",
              model_data,
          )
  
      existing_properties = _read_existing_serving_properties(code_dir)
      config_json_file = code_dir.joinpath("config.json")
  
      hf_model_config = None
      if config_json_file.is_file():
          with open(str(config_json_file)) as config_json:
              hf_model_config = json.load(config_json)
  
      return (existing_properties, hf_model_config, True)
  
imports: from __future__ import absolute_import
  import shutil
  import json
  import tarfile
  import logging
  from typing import List
  from pathlib import Path
  from sagemaker.utils import _tmpdir
  from sagemaker.s3 import S3Downloader
  from sagemaker.djl_inference import DJLModel
  from sagemaker.djl_inference.model import _read_existing_serving_properties
  from sagemaker.serve.utils.local_hardware import _check_disk_space, _check_docker_disk_usage
label_desc: Use image node_id 4 for calling a global function with example usage: _copy_jumpstart_artifacts(model_data, js_id, code_dir) and returns: existing_properties,  hf_model_config,  True