code: def validate_credentials(credentials: Credentials):
      try:
          storage_client = storage.Client(credentials=credentials)
          storage_client.list_buckets(max_results=1)
      except Exception:
          raise BackendAuthError()
  
file_path: dstack/src/dstack/_internal/core/backends/gcp/auth.py
imports: import json
  from typing import Optional, Tuple
  import google.auth
  from google.auth.credentials import Credentials
  from google.auth.exceptions import DefaultCredentialsError
  from google.cloud import storage
  from google.oauth2 import service_account
  from dstack._internal.core.errors import BackendAuthError
  from dstack._internal.core.models.backends.gcp import AnyGCPCreds, GCPDefaultCreds, GCPServiceAccountCreds
label_desc: Use image node_id 3 for calling a global function with example usage: validate_credentials(credentials) without return types