code: def test_is_autoscaler_v2_enabled(
      shutdown_only, monkeypatch, env_val, enabled
  ):
      def reset_autoscaler_v2_enabled_cache():
          import ray.autoscaler.v2.utils as u
  
          u.cached_is_autoscaler_v2 = None
  
      reset_autoscaler_v2_enabled_cache()
      with monkeypatch.context() as m:
          m.setenv("RAY_enable_autoscaler_v2", env_val)
          ray.init()
  
          def verify():
              assert (
                  ray.autoscaler.v2.utils.is_autoscaler_v2() == enabled
              )
              return True
  
          wait_for_condition(verify)
  
imports: import os
  import sys
  import time
  from dataclasses import dataclass
  from typing import Callable, List, Optional, Tuple
  import pytest
  import ray
  import ray._private.ray_constants
  from ray._private.test_utils import wait_for_condition
  from ray.autoscaler.v2.schema import ClusterStatus, LaunchRequest, NodeInfo, ResourceRequestByCount
  from ray.autoscaler.v2.sdk import get_cluster_status, request_cluster_resources
  from ray.autoscaler.v2.tests.util import get_available_resources, get_cluster_resource_state, get_total_resources, report_autoscaling_state
  from ray.core.generated import autoscaler_pb2, autoscaler_pb2_grpc
  from ray.core.generated.autoscaler_pb2 import ClusterResourceState, NodeStatus
  from ray.util.state.api import list_nodes
label_desc: Use image node_id 17 for calling a global function with example usage: test_is_autoscaler_v2_enabled(shutdown_only, monkeypatch, env_val, enabled) and returns: True