code: def __init__(self, dashboard_head):
      super().__init__(dashboard_head)
      self._stubs = {}
      self._ray_config = None
      DataSource.agents.signal.append(self._update_stubs)
      # TODO(fyrestone): Avoid using ray.state in dashboard, it's not
      # asynchronous and will lead to low performance. ray disconnect()
      # will be hang when the ray.state is connected and the GCS is exit.
      # Please refer to: https://github.com/ray-project/ray/issues/16328
      assert dashboard_head.gcs_address or dashboard_head.redis_address
      self._gcs_address = dashboard_head.gcs_address
      temp_dir = dashboard_head.temp_dir
      self.service_discovery = PrometheusServiceDiscoveryWriter(
          self._gcs_address, temp_dir
      )
      self._gcs_aio_client = dashboard_head.gcs_aio_client
      self._state_api = None
  
imports: import json
  import logging
  import asyncio
  import aiohttp.web
  from typing import Optional, Tuple, List
  import ray
  import ray._private.services
  import ray._private.utils
  import ray.dashboard.optional_utils
  from ray.dashboard.consts import GCS_RPC_TIMEOUT_SECONDS
  import ray.dashboard.utils
  from ray._private.gcs_pubsub import GcsAioResourceUsageSubscriber
  from ray._private.metrics_agent import PrometheusServiceDiscoveryWriter
  from ray._private.ray_constants import DEBUG_AUTOSCALING_ERROR, DEBUG_AUTOSCALING_STATUS, DEBUG_AUTOSCALING_STATUS_LEGACY, GLOBAL_GRPC_OPTIONS, KV_NAMESPACE_CLUSTER
  from ray.core.generated import reporter_pb2, reporter_pb2_grpc
  from ray.dashboard.datacenter import DataSource
  from ray._private.usage.usage_constants import CLUSTER_METADATA_KEY
  from ray.autoscaler._private.commands import debug_status
  from ray.util.state.common import ListApiOptions
  from ray.dashboard.state_aggregator import StateAPIManager
  from ray.util.state.state_manager import StateDataSourceClient
label_desc: Use image node_id 1 to create a new ReportHead object from inherited base classes: dashboard_utils with example: obj = ReportHead(dashboard_head)