code: def get_ubuntu_ami(
      table: List[List[str]], release: str, region: str
  ) -> Union[None, str]:
      def filters(line: List[str]) -> bool:
          return all(
              [
                  line[0] == release,
                  # Only use EBS, not instance-store.
                  line[4] == "ebs-ssd",
                  line[5] == "amd64",
                  line[6] == region,
                  # Only use HVM virtualization, not paravirtualization.
                  line[10] == "hvm",
              ]
          )
  
      results = [item for item in table if filters(item)]
  
      if len(results) > 1:
          print(f"Found multiple AMIs for {region}!", file=sys.stderr)
      if len(results) == 0:
          print(f"Failed to find AMI for {region}!", file=sys.stderr)
          return None
  
      return results[0][7]
  
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 1 for calling a global function with example usage: get_ubuntu_ami(table, release, region) and returns: results, all, None