code: def __init__(self, *args, dask_server=None, **kwargs):
      super().__init__(*args, dask_server=dask_server, **kwargs)
  
      if PrometheusHandler._collector:
          # Especially during testing, multiple workers are started
          # sequentially in the same python process
          PrometheusHandler._collector.server = self.server
          return
  
      PrometheusHandler._collector = WorkerMetricCollector(self.server)
      # Register collector
      prometheus_client.REGISTRY.register(PrometheusHandler._collector)
  
imports: from __future__ import annotations
  import logging
  from collections.abc import Iterator
  from time import time
  from typing import ClassVar
  import prometheus_client
  from prometheus_client.core import CounterMetricFamily, GaugeMetricFamily, Metric
  from distributed.http.prometheus import PrometheusCollector
  from distributed.http.utils import RequestHandler
  from distributed.worker import Worker
label_desc: Use image node_id 1 to create a new PrometheusHandler object from inherited base classes: RequestHandler with example: obj = PrometheusHandler()