code: def test_upload_download(
      init_mock_client: Annotated[tuple[str, S3Client], pytest.fixture],
      avoid_buf_copy: bool,
  ) -> None:
      bucket_name, s3_client = init_mock_client
      backend = Boto3ArtifactStore(
          bucket_name, avoid_buf_copy=avoid_buf_copy
      )
  
      artifact_id = "dummy-uuid"
      dummy_content = b"Hello World"
      buf = io.BytesIO(dummy_content)
  
      backend.write(artifact_id, buf)
      assert (
          len(s3_client.list_objects(Bucket=bucket_name)["Contents"])
          == 1
      )
  
      obj = s3_client.get_object(Bucket=bucket_name, Key=artifact_id)
      assert obj["Body"].read() == dummy_content
  
      with backend.open_reader(artifact_id) as f:
          actual = f.read()
      assert actual == dummy_content
      if avoid_buf_copy is False:
          assert buf.closed is False
  
file_path: optuna/tests/artifacts_tests/test_boto3.py
imports: from __future__ import annotations
  import io
  from typing import TYPE_CHECKING
  import boto3
  from moto import mock_s3
  import pytest
  from optuna.artifacts import Boto3ArtifactStore
  from optuna.artifacts.exceptions import ArtifactNotFound
label_desc: Use image node_id 2 for calling a global function with example usage: test_upload_download(init_mock_client, avoid_buf_copy) without return types