code: def get_total_num_nodes_to_report(
      gcs_client, timeout=None
  ) -> Optional[int]:
      """Return the total number of alive nodes in the cluster"""
      try:
          result = gcs_client.get_all_node_info(timeout=timeout)
          total_num_nodes = 0
          for node_id, node_info in result.items():
              if (
                  node_info["state"]
                  == gcs_pb2.GcsNodeInfo.GcsNodeState.ALIVE
              ):
                  total_num_nodes += 1
          return total_num_nodes
      except Exception as e:
          logger.info(
              f"Faile to query number of nodes in the cluster: {e}"
          )
          return None
  
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 26 for calling a global function with example usage: get_total_num_nodes_to_report(gcs_client, timeout) and returns: total_num_nodes, None