class_docstr: Stores artifacts on Amazon S3.
class_docstr_tok: ["Stores","artifacts","on","Amazon","S3","."]
code: def log_artifacts(self, local_dir, artifact_path=None):
      (bucket, dest_path) = self.parse_s3_compliant_uri(
          self.artifact_uri
      )
      if artifact_path:
          dest_path = posixpath.join(dest_path, artifact_path)
      s3_client = self._get_s3_client()
      local_dir = os.path.abspath(local_dir)
      for root, _, filenames in os.walk(local_dir):
          upload_path = dest_path
          if root != local_dir:
              rel_path = os.path.relpath(root, local_dir)
              rel_path = relative_path_to_artifact_path(rel_path)
              upload_path = posixpath.join(dest_path, rel_path)
  
          if not filenames:
              # We're in an empty directory. Create a folder to preserve the directory structure.
              s3_client.put_object(Bucket=bucket, Key=upload_path + "/")
  
          for f in filenames:
              self._upload_file(
                  s3_client=s3_client,
                  local_file=os.path.join(root, f),
                  bucket=bucket,
                  key=posixpath.join(upload_path, f),
              )
  
imports: import json
  import os
  import posixpath
  import urllib.parse
  from datetime import datetime
  from functools import lru_cache
  from mimetypes import guess_type
  from mlflow.entities import FileInfo
  from mlflow.entities.multipart_upload import CreateMultipartUploadResponse, MultipartUploadCredential
  from mlflow.environment_variables import MLFLOW_S3_ENDPOINT_URL, MLFLOW_S3_IGNORE_TLS, MLFLOW_S3_UPLOAD_EXTRA_ARGS
  from mlflow.exceptions import MlflowException
  from mlflow.store.artifact.artifact_repo import ArtifactRepository, MultipartUploadMixin
  from mlflow.utils.file_utils import relative_path_to_artifact_path
label_desc: Use image node_id 7 for calling the S3ArtifactRepository obj's underlying member method code with example usage: obj.log_artifacts(local_dir, artifact_path) without return types