code: def s3_artifact_repo(s3_artifact_root, request):
      if request.param:
          return OptimizedS3ArtifactRepository(
              posixpath.join(s3_artifact_root, "some/path")
          )
      return S3ArtifactRepository(
          posixpath.join(s3_artifact_root, "some/path")
      )
  
imports: import json
  import os
  import posixpath
  import tarfile
  from datetime import datetime
  from unittest import mock
  from unittest.mock import ANY
  import botocore.exceptions
  import pytest
  import requests
  from mlflow.entities.multipart_upload import MultipartUploadPart
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.optimized_s3_artifact_repo import OptimizedS3ArtifactRepository
  from mlflow.store.artifact.s3_artifact_repo import _MAX_CACHE_SECONDS, S3ArtifactRepository, _cached_get_s3_client
  from tests.helper_functions import set_boto_credentials
label_desc: Use image node_id 2 for calling a global function with example usage: s3_artifact_repo(s3_artifact_root, request) and returns: S3ArtifactRepository, OptimizedS3ArtifactRepository