code: def try_s3_download(bucket, s3_key_prefix, destination) -> bool:
      """
      Downloads a list of files to an S3 bucket with a particular S3 key prefix to 'destination'
      :param bucket: The name of the S3 bucket
      :param s3_key_prefix: The key prefix to apply to each of the files
      :param destination the path to which to download the files
      :return False if not artifacts were found, True otherwise
      """
      response = s3.list_objects_v2(Bucket=bucket, Prefix=s3_key_prefix)
      if not response:
          raise RuntimeError("Error listing S3 objects")
  
      if response.get("KeyCount") is None:
          logger.debug("Invalid S3 list objects response format")
          logger.debug(response)
          raise RuntimeError("Invalid response format.")
  
      key_count = response.get("KeyCount")
      if key_count == 0:
          logger.debug("No artifacts found")
          return False
  
      if not response.get("Contents"):
          logger.debug("Invalid S3 list objects response format")
          logger.debug(response)
          raise RuntimeError("Invalid response format.")
  
      for obj in response.get("Contents"):
          key = obj["Key"]
  
          # extract file path with any subdirectories and remove the leading file separator
          output_path = os.path.join(
              destination, key[len(s3_key_prefix) :].lstrip(os.sep)
          )
          os.makedirs(os.path.dirname(output_path), exist_ok=True)
          logger.info("Downloading {}".format(output_path))
          logger.debug(
              "Downloading s3://{}/{} to {}".format(
                  bucket, key, output_path
              )
          )
          with open(output_path, "wb") as fp:
              s3.download_fileobj(Fileobj=fp, Key=key, Bucket=bucket)
  
      return True
  
imports: import argparse
  import ctypes
  import glob
  import logging
  import os
  import re
  import sys
  from itertools import chain
  from subprocess import CalledProcessError, check_output
  from typing import Dict, List, Optional
  import boto3
  import botocore.exceptions
  import yaml
label_desc: Use image node_id 4 for calling a global function with example usage: try_s3_download(bucket, s3_key_prefix, destination) and returns: True, False