code: def get_all_builds(
      commit: str, dev: bool, cloud_images: bool
  ) -> Dict[str, Build]:
      # Get all the recent jobs.
      print("fetching recent jobs", file=sys.stderr)
      req = requests.get(
          BASE_URL, params={"limit": "100", "filter": "completed"}
      )
      req.raise_for_status()
  
      # Get all the build numbers matching this commit.
      builds = {}
      for build_meta in req.json():
          if build_meta["vcs_revision"] == commit:
              if build_meta["status"] != "success":
                  print(
                      f"Job: {build_meta['workflows']['job_name']} "
                      f"build: {build_meta['build_num']} did not succeed."
                  )
                  continue
  
              build = Build(build_meta)
              builds[build.job_name] = build
  
      if cloud_images:
          expected = PACKER_JOBS | DOCKER_JOBS
      else:
          expected = DOCKER_JOBS
  
      if dev:
          expected = {s + "-dev" for s in expected}
  
      found = set(builds.keys())
      expected_found = expected.difference(found)
      found_expected = found.difference(expected)
      if expected_found:
          print(f"Expected {expected_found} jobs not found")
      if found_expected:
          print(f"Found {found_expected} jobs not expected")
  
      assert (
          expected == found
      ), "expected jobs\n  {expected_list}\nbut found\n  {found_list}".format(
          expected_list="\n  ".join(sorted(expected)),
          found_list="\n  ".join(sorted(found)),
      )
  
      return builds
  
file_path: determined/tools/scripts/update-bumpenvs-yaml.py
imports: import argparse
  import collections
  import itertools
  import os
  import pathlib
  import sys
  from typing import Any, Dict
  import requests
  from ruamel import yaml
label_desc: Use image node_id 1 for calling a global function with example usage: get_all_builds(commit, dev, cloud_images) and returns: builds