class_docstr: Context manager for callbacks.
  
  Takes several callbacks and applies them only in the enclosed context.
  Callbacks can either be represented as a ``Callback`` object, or as a tuple
  of length 4.
  
  Examples
  --------
  >>> def pretask(key, dsk, state):
  ...     print("Now running {0}").format(key)
  >>> callbacks = (None, pretask, None, None)
  >>> with add_callbacks(callbacks):    # doctest: +SKIP
  ...     res.compute()
class_docstr_tok: ["Context","manager","for","callbacks",".","Takes","several","callbacks","and","applies","them","only","in","the","enclosed","context",".","Callbacks","can","either","be","represented","as","a","``","Callback","``","object",",","or","as","a","tuple","of","length","4",".","Examples","--","--","--","--",">",">",">","def","pretask","(","key",",","dsk",",","state",")",":","...","print","(","``","Now","running","{","0","}","''",")",".format","(","key",")",">",">",">","callbacks","=","(","None",",","pretask",",","None",",","None",")",">",">",">","with","add_callbacks","(","callbacks",")",":","#","doctest",":","+SKIP","...","res.compute","(",")"]
code: def __init__(self, *callbacks):
      self.callbacks = [normalize_callback(c) for c in callbacks]
      Callback.active.update(self.callbacks)
  
file_path: dask/dask/callbacks.py
imports: from __future__ import annotations
  from collections.abc import Callable
  from contextlib import contextmanager
  from typing import ClassVar
label_desc: Use image node_id 1 to create a new add_callbacks object  with example: obj = add_callbacks()