code: def update_packer_json(table: List[List[str]], path: str) -> None:
      with open(path) as f:
          packer_conf = json.load(f)
  
      # There are two specific keys we set in the environments-packer.json file.
      new_ami = get_ubuntu_ami(table, "focal", "us-west-2")
      packer_conf["variables"]["aws_base_image"] = new_ami
      new_ami = get_ubuntu_ami(table, "focal", "us-gov-west-1")
      packer_conf["variables"]["gov_aws_base_image"] = new_ami
  
      with open(path, "w") as f:
          json.dump(packer_conf, f, indent="  ")
          # json.dump() leaves off the final newline.
          f.write("\n")
  
file_path: determined/tools/scripts/refresh-ubuntu-amis.py
imports: import argparse
  import json
  import re
  import sys
  from typing import Dict, List, Union
  import requests
  from ruamel import yaml
label_desc: Use image node_id 4 for calling a global function with example usage: update_packer_json(table, path) without return types