code: def lambda_handler(event, context):
      source_image = event["source_tag"]
      destination_image = event["destination_tag"]
      total_results = []
      python_versions = parse_versions(
          os.path.join(_get_curr_dir(), "python_versions.txt")
      )
      cuda_versions = parse_versions(
          os.path.join(_get_curr_dir(), "cuda_versions.txt")
      )
      for repo in ["ray", "ray-ml"]:
          results = []
          # For example tag ray:1.X-py3.7-cu112 to ray:latest-py3.7-cu112
          for pyversion in python_versions:
              source_tag = f"{source_image}-{pyversion}"
              destination_tag = f"{destination_image}-{pyversion}"
              for cudaversion in cuda_versions:
                  cuda_source_tag = source_tag + f"-{cudaversion}"
                  cuda_destination_tag = (
                      destination_tag + f"-{cudaversion}"
                  )
                  results.append(
                      retag(repo, cuda_source_tag, cuda_destination_tag)
                  )
              # Tag ray:1.X-py3.7 to ray:latest-py3.7
              results.append(retag(repo, source_tag, destination_tag))
              # Tag ray:1.X-py3.7-cpu to ray:latest-py3.7-cpu
              results.append(
                  retag(
                      repo,
                      source_tag + "-cpu",
                      destination_tag + "-cpu",
                  )
              )
              # Tag ray:1.X-py3.7-gpu to ray:latest-py3.7-gpu
              results.append(
                  retag(
                      repo,
                      source_tag + "-gpu",
                      destination_tag + "-gpu",
                  )
              )
          [print(i) for i in results]
          total_results.extend(results)
  
      # Retag images without a python version specified (defaults to py38)
      results = []
      for repo in ["ray", "ray-ml", "ray-deps", "base-deps"]:
          # For example tag ray:1.X-cu112 to ray:latest-cu112
          for cudaversion in cuda_versions:
              source_tag = f"{source_image}-{cudaversion}"
              destination_tag = f"{destination_image}-{cudaversion}"
              results.append(retag(repo, source_tag, destination_tag))
  
          # Tag ray:1.X to ray:latest
          results.append(retag(repo, source_image, destination_image))
          # Tag ray:1.X-cpu to ray:latest-cpu
          results.append(
              retag(
                  repo,
                  source_image + "-cpu",
                  destination_image + "-cpu",
              )
          )
          # Tag ray:1.X-gpu to ray:latest-gpu
          results.append(
              retag(
                  repo,
                  source_image + "-gpu",
                  destination_image + "-gpu",
              )
          )
      [print(i) for i in results]
      total_results.extend(results)
  
      if all(r.returncode == 0 for r in total_results):
          return {
              "statusCode": 200,
              "body": json.dumps("Retagging Complete!"),
          }
      else:
          return {
              "statusCode": 500,
              "body": json.dumps("Retagging Broke!!"),
          }
  
file_path: ray/docker/retag-lambda/lambda_function.py
imports: import json
  import os
  import subprocess
  import boto3
label_desc: Use image node_id 5 for calling a global function with example usage: lambda_handler(event, context) and returns: dict, dict