code: def init_mock_client() -> Iterator[None]:
      # In case we fail to patch `google.cloud.storage.Client`, we deliberately set an invalid
      # credential path so that we do not accidentally access GCS.
      # Note that this is not a perfect measure; it can become ineffective in future when the
      # mechanism for finding the default credential is changed in the Cloud Storage API.
      os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "/dev/null"
  
      with patch("google.cloud.storage.Client") as MockClient:
          instance = MockClient.return_value
  
          def bucket(name: str) -> MockBucket:
              assert name == "mock-bucket"
              return MockBucket()
  
          instance.bucket.side_effect = bucket
          yield
  
imports: from __future__ import annotations
  import contextlib
  import io
  import os
  from typing import Dict
  from typing import Optional
  from typing import TYPE_CHECKING
  from unittest.mock import patch
  import google.cloud.storage
  import pytest
  from optuna.artifacts import GCSArtifactStore
  from optuna.artifacts.exceptions import ArtifactNotFound
label_desc: Use image node_id 1 for calling a global function with example usage: init_mock_client() and returns: MockBucket