code: def prep_gcs_test_creds(tmp_path: Path) -> Iterator[None]:
      """
      Check for the environment variable we pass as part of circleci's "storage-unit-tests" context.
  
      Note that the gcs credentials in the "storage-unit-tests" context are the keyid=c07eed131 key
      to the storage-unit-tests@determined-ai.iam.gserviceaccount.com service account.  The contents
      of the key are at github.com/determined-ai/secrets/gcp/service-accounts/storage-unit-tests.json.
  
      The service account should only have permission to view the "storage-unit-tests" bucket.
      """
  
      if "DET_GCS_TEST_CREDS" not in os.environ:
          yield
          return
  
      # Save the text in a temporary file and set GOOGLE_APPLICATION_CREDENTIALS to be the path.
      creds_path = tmp_path.joinpath("gcs-test-creds.json")
      with creds_path.open("w") as f:
          f.write(os.environ["DET_GCS_TEST_CREDS"])
      os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = str(creds_path)
      try:
          yield
      finally:
          del os.environ["GOOGLE_APPLICATION_CREDENTIALS"]
  
file_path: determined/harness/tests/storage/test_gcs.py
imports: import os
  import uuid
  from pathlib import Path
  from typing import Dict, Iterator, List, Optional
  import google.auth.exceptions
  import google.cloud.storage
  import pytest
  from determined import errors
  from determined.common import storage
  from determined.tensorboard.fetchers.gcs import GCSFetcher
  from tests.storage import util
label_desc: Use image node_id 1 for calling a global function with example usage: prep_gcs_test_creds(tmp_path) without return types