code: def __init__(
      self,
      ip: str,
      http_host: str,
      http_port: int,
      http_port_retries: int,
      gcs_address: str,
      gcs_client: GcsClient,
      session_name: str,
      metrics: DashboardPrometheusMetrics,
  ):
      self.ip = ip
      self.http_host = http_host
      self.http_port = http_port
      self.http_port_retries = http_port_retries
      self.gcs_client = gcs_client
      self.head_node_ip = gcs_address.split(":")[0]
      self.metrics = metrics
      self._session_name = session_name
  
      # Below attirubtes are filled after `run` API is invoked.
      self.runner = None
  
      # Setup Dashboard Routes
      try:
          build_dir = setup_static_dir()
          logger.info("Setup static dir for dashboard: %s", build_dir)
      except dashboard_utils.FrontendNotFoundError as ex:
          # Not to raise FrontendNotFoundError due to NPM incompatibilities
          # with Windows.
          # Please refer to ci.sh::build_dashboard_front_end()
          if sys.platform in ["win32", "cygwin"]:
              logger.warning(ex)
          else:
              raise ex
      dashboard_optional_utils.DashboardHeadRouteTable.bind(self)
  
      # Create a http session for all modules.
      # aiohttp<4.0.0 uses a 'loop' variable, aiohttp>=4.0.0 doesn't anymore
      if Version(aiohttp.__version__) < Version("4.0.0"):
          self.http_session = aiohttp.ClientSession(
              loop=get_or_create_event_loop()
          )
      else:
          self.http_session = aiohttp.ClientSession()
  
imports: import asyncio
  import errno
  import ipaddress
  import logging
  import os
  import pathlib
  import sys
  import time
  from math import floor
  from packaging.version import Version
  import ray.dashboard.optional_utils
  import ray.dashboard.utils
  from ray._private.usage.usage_lib import TagKey, record_extra_usage_tag
  from ray._private.utils import get_or_create_event_loop
  from ray._raylet import GcsClient
  from ray.dashboard.dashboard_metrics import DashboardPrometheusMetrics
  from ray.dashboard.optional_deps import aiohttp, hdrs
label_desc: Use image node_id 1 to create a new HttpServerDashboardHead object  with example: obj = HttpServerDashboardHead(ip, http_host, http_port, http_port_retries, gcs_address, gcs_client, session_name, metrics)