code: def format_params(args, *, stack_id, agent_iam_policy):
      default_vpc = get_default_vpc(aws_region=args.aws_region)
      azs = get_availability_zones(aws_region=args.aws_region)
      # For each of the first two availability zones (AZs), choose the default subnet
      subnets = [
          x.id
          for x in default_vpc.subnets.filter(
              Filters=[
                  {"Name": "default-for-az", "Values": ["true"]},
                  {"Name": "availability-zone", "Values": azs[:2]},
              ]
          )
      ]
      assert len(subnets) == 2
  
      params = copy.deepcopy(STACK_PARAMS[stack_id])
      params["ImageId"] = AMI_ID[stack_id][args.aws_region]
      params["BuildkiteQueue"] = stack_id
      params["CostAllocationTagValue"] = f"buildkite-{stack_id}"
      params["BuildkiteAgentToken"] = args.agent_token
      params["VpcId"] = default_vpc.id
      params["Subnets"] = ",".join(subnets)
      params["ManagedPolicyARNs"] = agent_iam_policy
      params.update(COMMON_STACK_PARAMS)
      return [
          {"ParameterKey": k, "ParameterValue": v}
          for k, v in params.items()
      ]
  
file_path: xgboost/tests/buildkite/infrastructure/aws-stack-creator/create_stack.py
imports: import argparse
  import copy
  import os
  import re
  import sys
  import boto3
  import botocore
  from metadata import AMI_ID, COMMON_STACK_PARAMS, STACK_PARAMS
  from common_blocks.utils import create_or_update_stack, wait
label_desc: Use image node_id 3 for calling a global function with example usage: format_params(args) and returns: unknown