class_docstr: Keep track of high-level timing information for task group progress
class_docstr_tok: ["Keep","track","of","high-level","timing","information","for","task","group","progress"]
docstr: Shared initializatoin code between __init__ and restart
docstr_tok: ["Shared","initializatoin","code","between","__init__","and","restart"]
code: def _init(self) -> None:
      """Shared initializatoin code between __init__ and restart"""
      now = time()
  
      # Timestamps for tracking compute durations by task group.
      # Start with length 2 so that we always can compute a valid dt later.
      self.time = [now] * 2
      # The amount of compute since the last timestamp
      self.compute = {}
      # The number of threads at the time
      self.nthreads = [self.scheduler.total_nthreads] * 2
  
imports: from __future__ import annotations
  import asyncio
  import logging
  import warnings
  from collections import defaultdict
  from timeit import default_timer
  from typing import ClassVar
  from tlz import groupby, valmap
  from dask.base import tokenize
  from dask.utils import key_split
  from distributed.diagnostics.plugin import SchedulerPlugin
  from distributed.metrics import time
label_desc: Use image node_id 2 for calling the GroupTiming obj's underlying member method code with example usage: obj._init() without return types