code: def get_cluster_config_to_report(
      cluster_config_file_path: str,
  ) -> ClusterConfigToReport:
      """Get the static cluster (autoscaler) config used to launch this cluster.
  
      Params:
          cluster_config_file_path: The file path to the cluster config file.
  
      Returns:
          The cluster (autoscaler) config or empty if it fails to get that information.
      """
  
      def get_instance_type(node_config):
          if not node_config:
              return None
          if "InstanceType" in node_config:
              # aws
              return node_config["InstanceType"]
          if "machineType" in node_config:
              # gcp
              return node_config["machineType"]
          if (
              "azure_arm_parameters" in node_config
              and "vmSize" in node_config["azure_arm_parameters"]
          ):
              return node_config["azure_arm_parameters"]["vmSize"]
          return None
  
      try:
          with open(cluster_config_file_path) as f:
              config = yaml.safe_load(f)
              result = ClusterConfigToReport()
              if "min_workers" in config:
                  result.min_workers = config["min_workers"]
              if "max_workers" in config:
                  result.max_workers = config["max_workers"]
  
              if "provider" in config and "type" in config["provider"]:
                  result.cloud_provider = config["provider"]["type"]
  
              if "head_node_type" not in config:
                  return result
              if "available_node_types" not in config:
                  return result
              head_node_type = config["head_node_type"]
              available_node_types = config["available_node_types"]
              for available_node_type in available_node_types:
                  if available_node_type == head_node_type:
                      head_node_instance_type = get_instance_type(
                          available_node_types[available_node_type].get(
                              "node_config"
                          )
                      )
                      if head_node_instance_type:
                          result.head_node_instance_type = (
                              head_node_instance_type
                          )
                  else:
                      worker_node_instance_type = get_instance_type(
                          available_node_types[available_node_type].get(
                              "node_config"
                          )
                      )
                      if worker_node_instance_type:
                          result.worker_node_instance_types = (
                              result.worker_node_instance_types or set()
                          )
                          result.worker_node_instance_types.add(
                              worker_node_instance_type
                          )
              if result.worker_node_instance_types:
                  result.worker_node_instance_types = list(
                      result.worker_node_instance_types
                  )
              return result
      except FileNotFoundError:
          # It's a manually started cluster or k8s cluster
          result = ClusterConfigToReport()
          # Check if we're on Kubernetes
          if usage_constant.KUBERNETES_SERVICE_HOST_ENV in os.environ:
              # Check if we're using KubeRay >= 0.4.0.
              if usage_constant.KUBERAY_ENV in os.environ:
                  result.cloud_provider = (
                      usage_constant.PROVIDER_KUBERAY
                  )
              # Else, we're on Kubernetes but not in either of the above categories.
              else:
                  result.cloud_provider = (
                      usage_constant.PROVIDER_KUBERNETES_GENERIC
                  )
          return result
      except Exception as e:
          logger.info(f"Failed to get cluster config to report {e}")
          return ClusterConfigToReport()
  
imports: import json
  import logging
  import threading
  import os
  import platform
  import sys
  import time
  import uuid
  from dataclasses import asdict, dataclass
  from enum import Enum, auto
  from pathlib import Path
  from typing import Dict, List, Optional, Set
  import requests
  import yaml
  import ray
  import ray._private.ray_constants
  import ray._private.usage.usage_constants
  from ray.experimental.internal_kv import _internal_kv_initialized, _internal_kv_put
  from ray.core.generated import usage_pb2, gcs_pb2
label_desc: Use image node_id 32 for calling a global function with example usage: get_cluster_config_to_report(cluster_config_file_path) and returns: None, None, node_config, node_config, node_config, result, result, ClusterConfigToReport, result, result