code: def test_s3_lifecycle(
      monkeypatch: monkeypatch.MonkeyPatch,
      prefix: Optional[str],
      async_upload: bool,
  ) -> None:
      monkeypatch.setattr("boto3.client", s3.s3_client)
      env = test_util.get_dummy_env()
      conf = copy.deepcopy(default_conf)
      conf["prefix"] = prefix
  
      with tensorboard.build(
          env.det_cluster_id,
          env.det_experiment_id,
          env.det_trial_id,
          conf,
          async_upload=async_upload,
      ) as manager:
          assert isinstance(manager, tensorboard.S3TensorboardManager)
  
          tfevents_path = "uuid-123/tensorboard/experiment/1/trial/1/events.out.tfevents.example"
  
          manager.sync()
      if prefix is not None:
          tfevents_path = os.path.join(
              os.path.normpath(prefix).lstrip("/"), tfevents_path
          )
      expected = (
          "s3_bucket",
          tfevents_path,
      )
      assert expected in manager.client.objects
  
file_path: determined/harness/tests/tensorboard/test_s3.py
imports: import copy
  import os
  import pathlib
  from typing import Optional
  import pytest
  from _pytest import monkeypatch
  from boto3 import exceptions
  from determined import tensorboard
  from tests import s3
  from tests.tensorboard import test_util
label_desc: Use image node_id 3 for calling a global function with example usage: test_s3_lifecycle(monkeypatch, prefix, async_upload) without return types