code: def run_prepare_commands(
      prepare_commands: List[str],
      prepare_commands_timeouts: List[float],
  ) -> Tuple[bool, List[int], float]:
      """Run prepare commands. All commands must pass. Fails fast."""
      prepare_return_codes = []
      prepare_passed = True
      prepare_time_taken = None
  
      if not prepare_commands:
          return (
              prepare_passed,
              prepare_return_codes,
              prepare_time_taken,
          )
  
      logger.info("### Starting prepare commands ###")
      for prepare_command, timeout in zip(
          prepare_commands, prepare_commands_timeouts
      ):
          command_start_time = time.monotonic()
          prepare_return_codes.append(
              run_bash_command(prepare_command, timeout)
          )
          prepare_time_taken = time.monotonic() - command_start_time
          return_code = prepare_return_codes[-1]
  
          if return_code == 0:
              continue
  
          timed_out = return_code == TIMEOUT_RETURN_CODE
          if timed_out:
              logger.error(
                  "Prepare command timed out. "
                  f"Time taken: {prepare_time_taken}"
              )
          else:
              logger.info(
                  f"Prepare command finished with return code {return_code}. "
                  f"Time taken: {prepare_time_taken}"
              )
          logger.error("Prepare command failed.")
          prepare_passed = False
          break
  
      return prepare_passed, prepare_return_codes, prepare_time_taken
  
file_path: ray/release/ray_release/command_runner/_anyscale_job_wrapper.py
imports: import argparse
  import time
  import os
  from pathlib import Path
  import subprocess
  import multiprocessing
  import json
  import sys
  import logging
  from urllib.parse import urlparse
  from typing import Optional, List, Tuple
label_desc: Use image node_id 7 for calling a global function with example usage: run_prepare_commands(prepare_commands, prepare_commands_timeouts) and returns: prepare_passed,  prepare_return_codes,  prepare_time_taken, prepare_passed,  prepare_return_codes,  prepare_time_taken