code: def upload_s3_folder(
      *,
      bucket: str,
      prefix: str,
      folder_to_upload: str,
      dry_run: bool = False,
      verbose: bool = True,
  ):
      """
      Upload a folder to a S3 bucket and maintain its inner structure
      For example, assuming bucket = bar and prefix = foo, and folder_to_upload looks like this:
      .
      └── folder_to_upload/
          └── test.txt/
              └── temp/
                  └── test2.txt
      After uploading to s3, the bucket would look like this:
      .
      └── bar/
          └── foo/
              └── test.txt/
                  └── temp/
                      └── test2.txt
  
      Parameters
      ----------
      bucket: str
          The name of the bucket
      prefix: str
          The prefix to upload to
          To upload to the root of the bucket, specify `prefix=''` (empty string)
      folder_to_upload: str
          The local folder to upload to s3
      dry_run: bool, default = False
          Whether to perform uploading
          If True, will instead log every file that will be uploaded and the s3 path to be uploaded to
      verbose: bool, default = True
          Whether to log detailed loggings
      """
      if prefix.endswith("/"):
          prefix = prefix[:-1]
      files_to_upload = _get_local_objs_to_upload_and_s3_prefix(
          folder_to_upload=folder_to_upload
      )
      if verbose:
          logger.log(
              20,
              f"Will upload {len(files_to_upload)} objects from {folder_to_upload} to s3://{bucket}/{prefix}",
          )
      for file_local_path, file_s3_path in files_to_upload:
          file_prefix = (
              prefix + "/" + file_s3_path
              if len(prefix) > 0
              else file_s3_path
          )
          if dry_run:
              logger.log(
                  20,
                  f"Will upload {file_local_path} to s3://{bucket}/{file_prefix}",
              )
          else:
              file_prefix = os.path.dirname(file_prefix)
              upload_file(
                  file_name=file_local_path,
                  bucket=bucket,
                  prefix=file_prefix if len(file_prefix) > 0 else None,
              )
  
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 6 for calling a global function with example usage: upload_s3_folder() without return types