code: def _fix_docker_images(
      image: str = "ray-ml",
      version: str = "nightly",
      repo: str = DOCKER_HUB_REPO,
  ):
      """Print commands to manually update docker images post-release.
  
      This function prints commands that can be run to add new layers to
      fix docker images post-release, e.g. when dependencies have to be fixed
      or public keys expired.
  
      The commands can be copied/pasted and executed in a shell.
  
      Example:
          FIX_IMAGE=ray-ml FIX_VERSION=2.3.0 python build-docker-images.py
  
      """
      tags = create_image_tags(
          image_name=image,
          py_versions=list(PY_MATRIX.keys()),
          image_types=list(BASE_IMAGES.keys()),
          specific_tag=None,  # Set to `latest` for latest image fixes
          version=version,
          suffix=None,
      )
      print(dict(tags))
  
      # Pull images we want to rebuild
      for base_tag in tags:
          base_image = f"{repo}/{image}:{base_tag}"
  
          print(f"docker pull {base_image}")
  
      # Re-tag these base images as e.g. pinned/ray-ml:tag
      # This is so we can re-run the build command safely.
      pinned_base_image = {}
      for base_tag in tags:
          base_image = f"{repo}/{image}:{base_tag}"
          pinned_image = f"pinned/{image}:{base_tag}"
  
          pinned_base_image[base_image] = pinned_image
  
          print(f"docker tag {base_image} {pinned_image}")
  
      # Create commands to build the new layer for the base images.
      for base_tag in tags:
          base_image = f"{repo}/{image}:{base_tag}"
          pinned_image = pinned_base_image[base_image]
  
          print(
              f"docker build --build-arg BASE_IMAGE={pinned_image} -t {base_image} ."
          )
          for subtag in tags[base_tag]:
              if subtag == base_tag:
                  continue
  
              # This will overwrite the rayproject/ray-ml:tag image
              # - but we still have the pinned/ image if we want to re-run!
              target_image = f"{repo}/{image}:{subtag}"
              print(f"docker tag {base_image} {target_image}")
  
      # Lastly, push new layers
      print(f"docker push --all-tags {repo}/{image}")
  
imports: import datetime
  import io
  import json
  import functools
  import glob
  import itertools
  import os
  import platform
  import shutil
  import subprocess
  import sys
  import tarfile
  from collections import defaultdict
  from pathlib import Path
  from typing import List, Optional, Tuple, Dict
  import click
  import docker
label_desc: Use image node_id 29 for calling a global function with example usage: _fix_docker_images(image, version, repo) without return types