code: def get_random_node(exclude_current: bool = True):
      nodes = ray.nodes()
      if exclude_current:
          current_node_ip = ray.util.get_node_ip_address()
      else:
          current_node_ip = "DUMMY"
      nodes = [
          node
          for node in nodes
          if node["Alive"]
          and node["NodeManagerAddress"] != current_node_ip
          and not node["Resources"].get("head")
      ]
      if not nodes:
          return None
      random_node = random.choice(nodes)
      return random_node
  
file_path: ray/release/tune_tests/fault_tolerance_tests/workloads/terminate_node_aws.py
imports: import subprocess
  import random
  import requests
  import time
  import logging
  import ray
  from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy
  from ray._private.test_utils import safe_write_to_results_json
label_desc: Use image node_id 3 for calling a global function with example usage: get_random_node(exclude_current) and returns: random_node, None