code: def format_params(*, stack_id, aws_region, ami_mapping):
      params = copy.deepcopy(IMAGE_PARAMS[stack_id])
      with open(
          os.path.join(current_dir, params["BootstrapScript"]),
          encoding="utf-8",
      ) as f:
          bootstrap_script = f.read()
      params["BaseImageId"] = ami_mapping[aws_region][
          params["BaseImageId"]
      ]
      params["BootstrapScript"] = bootstrap_script
      return [
          {"ParameterKey": k, "ParameterValue": v}
          for k, v in params.items()
      ]
  
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 1 for calling a global function with example usage: format_params() and returns: unknown