code: def __init__(self, worker, height=150, last_count=None, **kwargs):
      self.worker = worker
  
      names = worker.monitor.quantities
      self.last_count = 0
      if last_count is not None:
          names = worker.monitor.range_query(start=last_count)
          self.last_count = last_count
      self.source = ColumnDataSource({name: [] for name in names})
      self.label_source = ColumnDataSource(
          {
              "x": [5] * 3,
              "y": [70, 55, 40],
              "cpu": ["max: 45%", "min: 45%", "mean: 45%"],
              "memory": [
                  "max: 133.5MiB",
                  "min: 23.6MiB",
                  "mean: 115.4MiB",
              ],
          }
      )
      update(self.source, self.get_data())
  
      x_range = DataRange1d(
          follow="end", follow_interval=20000, range_padding=0
      )
  
      tools = "reset,xpan,xwheel_zoom"
  
      self.cpu = figure(
          title="CPU",
          x_axis_type="datetime",
          height=height,
          tools=tools,
          toolbar_location="above",
          x_range=x_range,
          **kwargs,
      )
      self.cpu.line(source=self.source, x="time", y="cpu")
      self.cpu.yaxis.axis_label = "Percentage"
      self.cpu.add_layout(
          LabelSet(
              x="x",
              y="y",
              x_units="screen",
              y_units="screen",
              text="cpu",
              text_font_size="1em",
              source=self.label_source,
          )
      )
      self.mem = figure(
          title="Memory",
          x_axis_type="datetime",
          height=height,
          tools=tools,
          toolbar_location="above",
          x_range=x_range,
          **kwargs,
      )
      self.mem.line(source=self.source, x="time", y="memory")
      self.mem.yaxis.axis_label = "Bytes"
      self.mem.add_layout(
          LabelSet(
              x="x",
              y="y",
              x_units="screen",
              y_units="screen",
              text="memory",
              text_font_size="1em",
              source=self.label_source,
          )
      )
      self.bandwidth = figure(
          title="Bandwidth",
          x_axis_type="datetime",
          height=height,
          x_range=x_range,
          tools=tools,
          toolbar_location="above",
          **kwargs,
      )
      self.bandwidth.line(
          source=self.source,
          x="time",
          y="host_net_io.read_bps",
          color="red",
          legend_label="read",
      )
      self.bandwidth.line(
          source=self.source,
          x="time",
          y="host_net_io.write_bps",
          color="blue",
          legend_label="write",
      )
      self.bandwidth.yaxis.axis_label = "Bytes / second"
  
      # self.cpu.yaxis[0].formatter = NumeralTickFormatter(format='0%')
      self.bandwidth.yaxis[0].formatter = NumeralTickFormatter(
          format="0.0b"
      )
      self.mem.yaxis[0].formatter = NumeralTickFormatter(format="0.0b")
  
      plots = [self.cpu, self.mem, self.bandwidth]
  
      if not WINDOWS:
          self.num_fds = figure(
              title="Number of File Descriptors",
              x_axis_type="datetime",
              height=height,
              x_range=x_range,
              tools=tools,
              toolbar_location="above",
              **kwargs,
          )
  
          self.num_fds.line(source=self.source, x="time", y="num_fds")
          plots.append(self.num_fds)
  
      if "sizing_mode" in kwargs:
          kw = {"sizing_mode": kwargs["sizing_mode"]}
      else:
          kw = {}
  
      if not WINDOWS:
          self.num_fds.y_range.start = 0
      self.mem.y_range.start = 0
      self.cpu.y_range.start = 0
      self.bandwidth.y_range.start = 0
  
      self.root = column(*plots, **kw)
      self.worker.monitor.update()
  
imports: from __future__ import annotations
  import asyncio
  import weakref
  import tlz
  from bokeh.core.properties import without_property_validation
  from bokeh.layouts import column, row
  from bokeh.models import Button, ColumnDataSource, DataRange1d, HoverTool, LabelSet, NumeralTickFormatter, Range1d, Select, Title
  from bokeh.palettes import Spectral9
  from bokeh.plotting import figure
  from tornado import gen
  import dask
  from distributed import profile
  from distributed.compatibility import WINDOWS
  from distributed.dashboard.components import DashboardComponent
  from distributed.dashboard.utils import update
  from distributed.utils import log_errors
label_desc: Use image node_id 1 to create a new SystemMonitor object from inherited base classes: DashboardComponent with example: obj = SystemMonitor(worker, height, last_count)