code: def get_session(creds: AnyAWSCreds, region: str) -> Session:
      if isinstance(creds, AWSAccessKeyCreds):
          return boto3.session.Session(
              region_name=region,
              aws_access_key_id=creds.access_key,
              aws_secret_access_key=creds.secret_key,
          )
      return boto3.session.Session(region_name=region)
  
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 2 for calling a global function with example usage: get_session(creds, region) and returns: boto3, boto3