code: def __init__(self, scheduler, maxlen=None):
      if maxlen is None:
          maxlen = max(
              dask.config.get(
                  "distributed.scheduler.dashboard.status.task-stream-length"
              ),
              dask.config.get(
                  "distributed.scheduler.dashboard.tasks.task-stream-length"
              ),
          )
      self.buffer = deque(maxlen=maxlen)
      self.scheduler = scheduler
      self.index = 0
  
file_path: distributed/distributed/diagnostics/task_stream.py
imports: from __future__ import annotations
  import logging
  from collections import deque
  import dask
  from dask.utils import format_time, key_split, parse_timedelta
  from distributed.diagnostics.plugin import SchedulerPlugin
  from distributed.diagnostics.progress_stream import color_of
  from distributed.metrics import time
label_desc: Use image node_id 1 to create a new TaskStreamPlugin object from inherited base classes: SchedulerPlugin with example: obj = TaskStreamPlugin(scheduler, maxlen)