class_docstr: Contains static methods for downloading directories or files from S3.
class_docstr_tok: ["Contains","static","methods","for","downloading","directories","or","files","from","S3","."]
docstr: Static method that downloads a given S3 uri to the local machine.
  
  Args:
      s3_uri (str): An S3 uri to download from.
      local_path (str): A local path to download the file(s) to.
      kms_key (str): The KMS key to use to decrypt the files.
      sagemaker_session (sagemaker.session.Session): Session object which
          manages interactions with Amazon SageMaker APIs and any other
          AWS services needed. If not specified, one is created
          using the default AWS configuration chain.
  
  Returns:
      list[str]: List of local paths of downloaded files
docstr_tok: ["Static","method","that","downloads","a","given","S3","uri","to","the","local","machine",".","Args",":","s3_uri","(","str",")",":","An","S3","uri","to","download","from",".","local_path","(","str",")",":","A","local","path","to","download","the","file","(","s",")","to",".","kms_key","(","str",")",":","The","KMS","key","to","use","to","decrypt","the","files",".","sagemaker_session","(","sagemaker.session.Session",")",":","Session","object","which","manages","interactions","with","Amazon","SageMaker","APIs","and","any","other","AWS","services","needed",".","If","not","specified",",","one","is","created","using","the","default","AWS","configuration","chain",".","Returns",":","list","[","str","]",":","List","of","local","paths","of","downloaded","files"]
code: def download(
      s3_uri, local_path, kms_key=None, sagemaker_session=None
  ):
      """Static method that downloads a given S3 uri to the local machine.
  
      Args:
          s3_uri (str): An S3 uri to download from.
          local_path (str): A local path to download the file(s) to.
          kms_key (str): The KMS key to use to decrypt the files.
          sagemaker_session (sagemaker.session.Session): Session object which
              manages interactions with Amazon SageMaker APIs and any other
              AWS services needed. If not specified, one is created
              using the default AWS configuration chain.
  
      Returns:
          list[str]: List of local paths of downloaded files
      """
      sagemaker_session = sagemaker_session or Session()
      bucket, key_prefix = parse_s3_url(url=s3_uri)
      if kms_key is not None:
          extra_args = {"SSECustomerKey": kms_key}
      else:
          extra_args = None
  
      return sagemaker_session.download_data(
          path=local_path,
          bucket=bucket,
          key_prefix=key_prefix,
          extra_args=extra_args,
      )
  
file_path: sagemaker-python-sdk/src/sagemaker/s3.py
imports: from __future__ import print_function, absolute_import
  import logging
  import io
  from typing import Union
  from sagemaker.session import Session
  from sagemaker.s3_utils import parse_s3_url, s3_path_join, determine_bucket_and_prefix
label_desc: Use image node_id 1 for calling the S3Downloader obj's underlying member method code with example usage: obj.download(s3_uri, local_path, kms_key, sagemaker_session) and returns: sagemaker_session