code: def test_usage_lib_get_cluster_config_to_report(
      monkeypatch, tmp_path, reset_usage_stats
  ):
      cluster_config_file_path = tmp_path / "ray_bootstrap_config.yaml"
      """ Test minimal cluster config"""
      cluster_config_file_path.write_text(
          """
  cluster_name: minimal
  max_workers: 1
  provider:
      type: aws
      region: us-west-2
      availability_zone: us-west-2a
  """
      )
      cluster_config_to_report = (
          ray_usage_lib.get_cluster_config_to_report(
              cluster_config_file_path
          )
      )
      assert cluster_config_to_report.cloud_provider == "aws"
      assert cluster_config_to_report.min_workers is None
      assert cluster_config_to_report.max_workers == 1
      assert cluster_config_to_report.head_node_instance_type is None
      assert cluster_config_to_report.worker_node_instance_types is None
  
      cluster_config_file_path.write_text(
          """
  cluster_name: full
  min_workers: 1
  provider:
      type: gcp
  head_node_type: head_node
  available_node_types:
      head_node:
          node_config:
              InstanceType: m5.large
          min_workers: 0
          max_workers: 0
      aws_worker_node:
          node_config:
              InstanceType: m3.large
          min_workers: 0
          max_workers: 0
      azure_worker_node:
          node_config:
              azure_arm_parameters:
                  vmSize: Standard_D2s_v3
      gcp_worker_node:
          node_config:
              machineType: n1-standard-2
  """
      )
      cluster_config_to_report = (
          ray_usage_lib.get_cluster_config_to_report(
              cluster_config_file_path
          )
      )
      assert cluster_config_to_report.cloud_provider == "gcp"
      assert cluster_config_to_report.min_workers == 1
      assert cluster_config_to_report.max_workers is None
      assert (
          cluster_config_to_report.head_node_instance_type == "m5.large"
      )
      assert set(
          cluster_config_to_report.worker_node_instance_types
      ) == {
          "m3.large",
          "Standard_D2s_v3",
          "n1-standard-2",
      }
  
      cluster_config_file_path.write_text(
          """
  cluster_name: full
  head_node_type: head_node
  available_node_types:
      worker_node_1:
          node_config:
              ImageId: xyz
      worker_node_2:
          resources: {}
      worker_node_3:
          node_config:
              InstanceType: m5.large
  """
      )
      cluster_config_to_report = (
          ray_usage_lib.get_cluster_config_to_report(
              cluster_config_file_path
          )
      )
      assert cluster_config_to_report.cloud_provider is None
      assert cluster_config_to_report.min_workers is None
      assert cluster_config_to_report.max_workers is None
      assert cluster_config_to_report.head_node_instance_type is None
      assert cluster_config_to_report.worker_node_instance_types == [
          "m5.large"
      ]
  
      cluster_config_file_path.write_text("[invalid")
      cluster_config_to_report = (
          ray_usage_lib.get_cluster_config_to_report(
              cluster_config_file_path
          )
      )
      assert cluster_config_to_report == ClusterConfigToReport()
  
      cluster_config_to_report = (
          ray_usage_lib.get_cluster_config_to_report(
              tmp_path / "does_not_exist.yaml"
          )
      )
      assert cluster_config_to_report == ClusterConfigToReport()
  
      monkeypatch.setenv("KUBERNETES_SERVICE_HOST", "localhost")
      cluster_config_to_report = (
          ray_usage_lib.get_cluster_config_to_report(
              tmp_path / "does_not_exist.yaml"
          )
      )
      assert cluster_config_to_report.cloud_provider == "kubernetes"
      assert cluster_config_to_report.min_workers is None
      assert cluster_config_to_report.max_workers is None
      assert cluster_config_to_report.head_node_instance_type is None
      assert cluster_config_to_report.worker_node_instance_types is None
  
      monkeypatch.setenv("RAY_USAGE_STATS_KUBERAY_IN_USE", "1")
      cluster_config_to_report = (
          ray_usage_lib.get_cluster_config_to_report(
              tmp_path / "does_not_exist.yaml"
          )
      )
      assert cluster_config_to_report.cloud_provider == "kuberay"
  
imports: import json
  import os
  import pathlib
  import sys
  import time
  from dataclasses import asdict
  from pathlib import Path
  from unittest.mock import patch
  import requests
  import pytest
  from jsonschema import validate
  from http.server import BaseHTTPRequestHandler, HTTPServer
  import ray
  import ray._private.usage.usage_constants
  import ray._private.usage.usage_lib
  from ray._private.test_utils import format_web_url, run_string_as_driver, wait_for_condition, wait_until_server_available
  from ray._private.usage.usage_lib import ClusterConfigToReport, UsageStatsEnabledness
  from ray.autoscaler._private.cli_logger import cli_logger
  from ray.util.placement_group import placement_group
  from ray._private.accelerators import NvidiaGPUAcceleratorManager
label_desc: Use image node_id 25 for calling a global function with example usage: test_usage_lib_get_cluster_config_to_report(monkeypatch, tmp_path, reset_usage_stats) without return types