code: def test_from_default(mocker) -> None:
      """Test creating an AWS environment from the default credentials."""
      boto3 = MagicMock()
      session = MagicMock()
      credentials = MagicMock()
      credentials.access_key = "access_key"
      credentials.secret_key = "secret_key"
      credentials.token = "token"
      session.get_credentials.return_value = credentials
      boto3.Session.return_value = session
      mocker.patch(
          "wandb.sdk.launch.environment.aws_environment.boto3", boto3
      )
      mocker.patch(
          "wandb.sdk.launch.environment.aws_environment.AwsEnvironment",
          MagicMock(),
      )
      default_environment = AwsEnvironment.from_default(
          region="us-west-2"
      )
      assert default_environment._region == "us-west-2"
      assert default_environment._access_key == "access_key"
      assert default_environment._secret_key == "secret_key"
      assert default_environment._session_token == "token"
  
file_path: wandb/tests/pytest_tests/unit_tests/test_launch/test_environment/test_aws.py
imports: import os
  from unittest.mock import MagicMock
  import pytest
  from botocore.exceptions import ClientError
  from wandb.sdk.launch.environment.aws_environment import AwsEnvironment
  from wandb.sdk.launch.errors import LaunchError
label_desc: Use image node_id 2 for calling a global function with example usage: test_from_default(mocker) without return types