def METHOD_NAME(
    self,
    role_session_name: str,
    role_arn: str,
    policy: str,
    duration: int,
    external_id: str,
) -> AssumedRole:
    """
    Assume an IAM Role. Note that the role does not need to exist. The ARN can point to another account, providing an opportunity to switch accounts.
    """
    account_id, access_key = self._create_access_key(role=role_arn)
    role = AssumedRole(
        account_id,
        access_key,
        role_session_name,
        role_arn,
        policy,
        duration,
        external_id,
    )
    account_backend = sts_backends[account_id]["global"]
    account_backend.assumed_roles.append(role)
    return role