code: def cleanup_cluster(cluster_config):
      """
      Clean up the cluster using the given cluster configuration file.
  
      Args:
          cluster_config: The path of the cluster configuration file.
      """
      print("======================================")
      print("Cleaning up cluster...")
  
      # We do multiple retries here because sometimes the cluster
      # fails to clean up properly, resulting in a non-zero exit code (e.g.
      # when processes have to be killed forcefully).
  
      last_error = None
      num_tries = 3
      for i in range(num_tries):
          try:
              subprocess.run(
                  ["ray", "down", "-v", "-y", str(cluster_config)],
                  check=True,
                  capture_output=True,
              )
              # Final success
              return
          except subprocess.CalledProcessError as e:
              print(f"ray down fails[{i+1}/{num_tries}]: ")
              print(e.output.decode("utf-8"))
  
              # Print full traceback
              traceback.print_exc()
  
              # Print stdout and stderr from ray down
              print(f"stdout:\n{e.stdout.decode('utf-8')}")
              print(f"stderr:\n{e.stderr.decode('utf-8')}")
  
              last_error = e
  
      raise last_error
  
imports: import argparse
  import os
  import re
  import subprocess
  import sys
  import tempfile
  import time
  import traceback
  from pathlib import Path
  import boto3
  import yaml
  from google.cloud import storage
  import ray
label_desc: Use image node_id 8 for calling a global function with example usage: cleanup_cluster(cluster_config) without return types