class_docstr: A profiler for dask execution at the task level.
  
  Records the following information for each task:
      1. Key
      2. Task
      3. Start time in seconds since the epoch
      4. Finish time in seconds since the epoch
      5. Worker id
  
  Examples
  --------
  
  >>> from operator import add, mul
  >>> from dask.threaded import get
  >>> from dask.diagnostics import Profiler
  >>> dsk = {'x': 1, 'y': (add, 'x', 10), 'z': (mul, 'y', 2)}
  >>> with Profiler() as prof:
  ...     get(dsk, 'z')
  22
  
  >>> prof.results        # doctest: +SKIP
  [TaskData(key='y', task=(add, 'x', 10), start_time=..., end_time=..., worker_id=...),
   TaskData(key='z', task=(mul, 'y', 2), start_time=..., end_time=..., worker_id=...)]
  
  These results can be visualized in a bokeh plot using the ``visualize``
  method. Note that this requires bokeh to be installed.
  
  >>> prof.visualize()    # doctest: +SKIP
  
  You can activate the profiler globally
  
  >>> prof.register()
  
  If you use the profiler globally you will need to clear out old results
  manually.
  
  >>> prof.clear()
  >>> prof.unregister()
class_docstr_tok: ["A","profiler","for","dask","execution","at","the","task","level",".","Records","the","following","information","for","each","task",":","1",".","Key","2",".","Task","3",".","Start","time","in","seconds","since","the","epoch","4",".","Finish","time","in","seconds","since","the","epoch","5",".","Worker","id","Examples","--","--","--","--",">",">",">","from","operator","import","add",",","mul",">",">",">","from","dask.threaded","import","get",">",">",">","from","dask.diagnostics","import","Profiler",">",">",">","dsk","=","{","'","x","'",":","1",",","'","y","'",":","(","add",",","'","x","'",",","10",")",",","'","z","'",":","(","mul",",","'","y","'",",","2",")","}",">",">",">","with","Profiler","(",")","as","prof",":","...","get","(","dsk",",","'","z","'",")","22",">",">",">","prof.results","#","doctest",":","+SKIP","[","TaskData","(","key=","'","y","'",",","task=","(","add",",","'","x","'",",","10",")",",","start_time=","...",",","end_time=","...",",","worker_id=","...",")",",","TaskData","(","key=","'","z","'",",","task=","(","mul",",","'","y","'",",","2",")",",","start_time=","...",",","end_time=","...",",","worker_id=","...",")","]","These","results","can","be","visualized","in","a","bokeh","plot","using","the","``","visualize","``","method",".","Note","that","this","requires","bokeh","to","be","installed",".",">",">",">","prof.visualize","(",")","#","doctest",":","+SKIP","You","can","activate","the","profiler","globally",">",">",">","prof.register","(",")","If","you","use","the","profiler","globally","you","will","need","to","clear","out","old","results","manually",".",">",">",">","prof.clear","(",")",">",">",">","prof.unregister","(",")"]
code: def _start(self, dsk):
      self._dsk.update(dsk)
  
imports: from __future__ import annotations
  from collections import namedtuple
  from itertools import starmap
  from multiprocessing import Pipe, Process, current_process
  from time import sleep
  from timeit import default_timer
  from dask.callbacks import Callback
  from dask.utils import import_required
label_desc: Use image node_id 4 for calling the Profiler obj's underlying member method code with example usage: obj._start(dsk) without return types