code: def reverse_dict(d: Mapping[T_, Iterable[T_]]) -> dict[T_, set[T_]]:
      """
  
      >>> a, b, c = 'abc'
      >>> d = {a: [b, c], b: [c]}
      >>> reverse_dict(d)  # doctest: +SKIP
      {'a': set([]), 'b': set(['a']}, 'c': set(['a', 'b'])}
      """
      result: defaultdict[T_, set[T_]] = defaultdict(set)
      _add = set.add
      for k, vals in d.items():
          result[k]
          for val in vals:
              _add(result[val], k)
      return dict(result)
  
imports: from __future__ import annotations
  from collections import defaultdict
  from collections.abc import Collection, Iterable, Mapping
  from typing import Any, Literal, TypeVar, cast, overload
  from dask.typing import Graph, Key, NoDefault, no_default
label_desc: Use image node_id 16 for calling a global function with example usage: reverse_dict(d) and returns: dict