class_docstr: Stores artifacts on Amazon S3.
class_docstr_tok: ["Stores","artifacts","on","Amazon","S3","."]
code: def _upload_file(self, s3_client, local_file, bucket, key):
      extra_args = {}
      guessed_type, guessed_encoding = guess_type(local_file)
      if guessed_type is not None:
          extra_args["ContentType"] = guessed_type
      if guessed_encoding is not None:
          extra_args["ContentEncoding"] = guessed_encoding
      environ_extra_args = self.get_s3_file_upload_extra_args()
      if environ_extra_args is not None:
          extra_args.update(environ_extra_args)
      s3_client.upload_file(
          Filename=local_file,
          Bucket=bucket,
          Key=key,
          ExtraArgs=extra_args,
      )
  
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 5 for calling the S3ArtifactRepository obj's underlying member method code with example usage: obj._upload_file(s3_client, local_file, bucket, key) without return types