class_docstr: An optimized version of the S3 Artifact Repository.
  
  This class is used for uploading and downloading S3 artifacts for UC models. While it largely
  copies the behavior of the S3ArtifactRepository, the `log_artifact`, `log_artifacts`, and
  `_download_file` methods are optimized by replacing boto3 client operations with the use of
  presigned URLs for both uploads and downloads.
class_docstr_tok: ["An","optimized","version","of","the","S3","Artifact","Repository",".","This","class","is","used","for","uploading","and","downloading","S3","artifacts","for","UC","models",".","While","it","largely","copies","the","behavior","of","the","S3ArtifactRepository",",","the","`","log_artifact","`",",","`","log_artifacts","`",",","and","`","_download_file","`","methods","are","optimized","by","replacing","boto3","client","operations","with","the","use","of","presigned","URLs","for","both","uploads","and","downloads","."]
code: def list_artifacts(self, path=None):
      artifact_path = self.bucket_path
      dest_path = self.bucket_path
      if path:
          dest_path = posixpath.join(dest_path, path)
      infos = []
      prefix = dest_path + "/" if dest_path else ""
      s3_client = self._get_s3_client()
      paginator = s3_client.get_paginator("list_objects_v2")
      results = paginator.paginate(
          Bucket=self.bucket, Prefix=prefix, Delimiter="/"
      )
      for result in results:
          # Subdirectories will be listed as "common prefixes" due to the way we made the request
          for obj in result.get("CommonPrefixes", []):
              subdir_path = obj.get("Prefix")
              self._verify_listed_object_contains_artifact_path_prefix(
                  listed_object_path=subdir_path,
                  artifact_path=artifact_path,
              )
              subdir_rel_path = posixpath.relpath(
                  path=subdir_path, start=artifact_path
              )
              if subdir_rel_path.endswith("/"):
                  subdir_rel_path = subdir_rel_path[:-1]
              infos.append(FileInfo(subdir_rel_path, True, None))
          # Objects listed directly will be files
          for obj in result.get("Contents", []):
              file_path = obj.get("Key")
              self._verify_listed_object_contains_artifact_path_prefix(
                  listed_object_path=file_path,
                  artifact_path=artifact_path,
              )
              file_rel_path = posixpath.relpath(
                  path=file_path, start=artifact_path
              )
              file_size = int(obj.get("Size"))
              infos.append(FileInfo(file_rel_path, False, file_size))
      return sorted(infos, key=lambda f: f.path)
  
imports: import json
  import logging
  import math
  import os
  import posixpath
  import urllib.parse
  from mimetypes import guess_type
  from mlflow.entities import FileInfo
  from mlflow.environment_variables import MLFLOW_ENABLE_MULTIPART_UPLOAD, MLFLOW_MULTIPART_UPLOAD_CHUNK_SIZE, MLFLOW_S3_UPLOAD_EXTRA_ARGS
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_artifacts_pb2 import ArtifactCredentialInfo
  from mlflow.store.artifact.cloud_artifact_repo import CloudArtifactRepository, _complete_futures
  from mlflow.store.artifact.s3_artifact_repo import _get_s3_client
  from mlflow.utils.file_utils import read_chunk
  from mlflow.utils.request_utils import cloud_storage_http_request
  from mlflow.utils.rest_utils import augmented_raise_for_status
label_desc: Use image node_id 11 for calling the OptimizedS3ArtifactRepository obj's underlying member method code with example usage: obj.list_artifacts(path) and returns: sorted