code: def download_s3_folder(
      *,
      bucket: str,
      prefix: str,
      local_path: str,
      suffix: Optional[Union[str, List[str]]] = None,
      error_if_exists: bool = True,
      delete_if_exists: bool = False,
      dry_run: bool = False,
      verbose: bool = True,
      **kwargs,
  ):
      """
      This util function downloads a s3 folder and maintain its structure.
      Note that empty folders will not be downloaded.
      For example, assuming bucket = bar and prefix = foo, and the bucket structure looks like this
          .
          └── bar/
              ├── test.txt
              └── foo/
                  ├── test2.txt
                  └── temp/
                      └── test3.txt
      This util will download foo to `local_path` and maintain the structure:
          .
          └── local_path/
              └── test2.txt/
                  └── temp/
                      └── test3.txt
  
      Parameters
      ----------
      bucket: str
          The name of the bucket
      prefix: str
          The prefix of the folder to be downloaded
          To check all files in the bucket, specify `prefix=''` (empty string)
      local_path: str
          The local path to download the object/folder into
      suffix: str or List[str], default = None
          If specified, filters files to ensure their paths end with the specified suffix (if str)
          or at least one element of `suffix` (if list) in the post-prefix string path.
      error_if_exists: bool, default = True
          Whether to raise an error if the root folder exists already
      delete_if_exists: bool, default = False
          Whether to delete the local root folder and all contents within if the root folder exists already
          If `error_if_exists=True`, deletion will not occur.
      dry_run: bool, default = False
          Whether to perform the directory creation and file downloading.
          If True, will instead log every file that will be downloaded and every directory that will be created
      verbose: bool, default = True
          Whether to log detailed loggings
      **kwargs
          Optional arguments to `list_bucket_prefix_suffix_contains_s3` that allow
          more control of which objects are considered.
      """
      s3_to_local_tuple_list = (
          get_s3_to_local_tuple_list_from_s3_folder(
              s3_bucket=bucket,
              s3_prefix=prefix,
              local_path=local_path,
              suffix=suffix,
              **kwargs,
          )
      )
      if verbose:
          logger.log(
              20,
              f"Will download {len(s3_to_local_tuple_list)} objects from s3://{bucket}/{prefix} to {local_path}",
          )
      if os.path.isdir(local_path) and not dry_run:
          if error_if_exists:
              raise ValueError(
                  f"Directory {local_path} already exists. Please pass in a different `local_path` or set `error_if_exsits` to `False`"
              )
          if delete_if_exists:
              logger.warning(
                  f"Will delete {local_path} and all its content within because this folder already exists and `delete_if_exists` = `True`"
              )
              shutil.rmtree(local_path)
      download_s3_files(
          s3_to_local_tuple_list=s3_to_local_tuple_list, dry_run=dry_run
      )
  
file_path: autogluon/common/src/autogluon/common/utils/s3_utils.py
imports: import logging
  import os
  import pathlib
  import shutil
  from typing import Dict, List, Optional, Tuple, Union
  from tqdm import tqdm
  from ..loaders.load_s3 import list_bucket_prefix_suffix_contains_s3
label_desc: Use image node_id 7 for calling a global function with example usage: download_s3_folder() without return types