code: def main(args):
      with open(
          os.path.join(
              current_dir, "ec2-image-builder-pipeline-template.yml"
          ),
          encoding="utf-8",
      ) as f:
          ec2_image_pipeline_template = f.read()
  
      ami_mapping = get_ami_mapping()
  
      client = boto3.client(
          "cloudformation", region_name=args.aws_region
      )
      promises = []
  
      for stack_id in IMAGE_PARAMS:
          stack_id_full = get_full_stack_id(stack_id)
          print(f"Creating EC2 image builder stack {stack_id_full}...")
  
          params = format_params(
              stack_id=stack_id,
              aws_region=args.aws_region,
              ami_mapping=ami_mapping,
          )
  
          promise = replace_stack(
              args,
              client=client,
              stack_name=stack_id_full,
              template_body=ec2_image_pipeline_template,
              params=params,
          )
          promises.append(promise)
          print(
              f"EC2 image builder stack {stack_id_full} is in progress in the background"
          )
  
      for promise in promises:
          wait(promise, client=client)
  
file_path: xgboost/tests/buildkite/infrastructure/worker-image-pipeline/create_worker_image_pipelines.py
imports: import argparse
  import copy
  import json
  import os
  import sys
  from urllib.request import urlopen
  import boto3
  import cfn_flip
  from metadata import IMAGE_PARAMS
  from common_blocks.utils import replace_stack, wait
label_desc: Use image node_id 4 for calling a global function with example usage: main(args) without return types