code: def validate_credentials(session: Session):
      sts = session.client("sts")
      try:
          sts.get_caller_identity()
      except (
          botocore.exceptions.ClientError,
          botocore.exceptions.NoCredentialsError,
      ):
          raise BackendAuthError()
  
file_path: dstack/src/dstack/_internal/core/backends/aws/auth.py
imports: import boto3.session
  import botocore.exceptions
  from boto3.session import Session
  from dstack._internal.core.errors import BackendAuthError
  from dstack._internal.core.models.backends.aws import AnyAWSCreds, AWSAccessKeyCreds
label_desc: Use image node_id 3 for calling a global function with example usage: validate_credentials(session) without return types