class_docstr: Scheduler extension for spans support
class_docstr_tok: ["Scheduler","extension","for","spans","support"]
code: def __init__(self, scheduler: Scheduler):
      self.scheduler = scheduler
      self.spans = {}
      self.root_spans = []
      self.spans_search_by_name = defaultdict(list)
      self.spans_search_by_tag = defaultdict(list)
  
imports: from __future__ import annotations
  import uuid
  import weakref
  from collections import defaultdict
  from collections.abc import Hashable, Iterable, Iterator
  from contextlib import contextmanager
  from itertools import islice
  from typing import TYPE_CHECKING, Any
  import dask.config
  from dask.typing import Key
  from distributed.collections import sum_mappings
  from distributed.itertools import ffill
  from distributed.metrics import time
label_desc: Use image node_id 1 to create a new SpansSchedulerExtension object  with example: obj = SpansSchedulerExtension(scheduler)