code: def run(local):
      start_time = time.time()
      cluster = None
      try:
          if local:
              cluster = setup_cluster()
              run_test()
              cluster.shutdown()
          else:
              run_test()
  
          success = "1"
      except Exception as e:
          logger.error(f"Test failed with {e}")
          success = "0"
      finally:
          if cluster:
              cluster.shutdown()
  
      results = {
          "time": time.time() - start_time,
          "success": success,
      }
      if "TEST_OUTPUT_JSON" in os.environ:
          out_file = open(os.environ["TEST_OUTPUT_JSON"], "w")
          json.dump(results, out_file)
  
      print(json.dumps(results, indent=2))
  
file_path: ray/release/autoscaling_tests/run.py
imports: import subprocess
  import click
  import json
  import os
  import time
  from logger import logger
label_desc: Use image node_id 3 for calling a global function with example usage: run(local) without return types