code: def test_use_driver_resources(self, autoscale):
      setup_ray_cluster(
          max_worker_nodes=1,
          num_cpus_head_node=3,
          num_gpus_head_node=2,
          object_store_memory_head_node=256 * 1024 * 1024,
          head_node_options={"include_dashboard": False},
          min_worker_nodes=(0 if autoscale else 1),
      )
  
      ray.init()
      head_resources_list = []
      for node in ray.nodes():
          if node["Alive"] and node["Resources"].get("CPU", 0) == 3:
              head_resources_list.append(node["Resources"])
      assert len(head_resources_list) == 1
      head_resources = head_resources_list[0]
      assert head_resources.get("GPU", 0) == 2
  
      shutdown_ray_cluster()
  
imports: import os
  import shutil
  import tempfile
  import socket
  import threading
  import re
  import pytest
  import sys
  from unittest import mock
  from abc import ABC
  import ray
  import ray.util.spark.cluster_init
  from ray.util.spark import setup_ray_cluster, shutdown_ray_cluster, setup_global_ray_cluster, MAX_NUM_WORKER_NODES
  from ray.util.spark.utils import is_port_in_use, _calc_mem_per_ray_worker_node
  from pyspark.sql import SparkSession
  import time
  import logging
  from contextlib import contextmanager
  from ray._private.test_utils import wait_for_condition
label_desc: Use image node_id 4 for calling the TestSparkLocalCluster obj's underlying member method code with example usage: obj.test_use_driver_resources(autoscale) without return types