#NEWLINE# def dependency_dict( dsk ) : #NEWLINE# #INDENT# "Create a dict matching ordered dependencies to keys.\n\n    Examples\n    --------\n    >>> from operator import add\n    >>> dsk = {'a': 1, 'b': 2, 'c': (add, 'a', 'a'), 'd': (add, 'b', 'a')}\n    >>> dependency_dict(dsk)    # doctest: +SKIP\n    {(): ['a', 'b'], ('a', 'a'): ['c'], ('b', 'a'): ['d']}\n    " #NEWLINE# dep_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for key in dsk : #NEWLINE# #INDENT# deps = tuple ( get_dependencies ( dsk , key , True ) ) #NEWLINE# dep_dict . setdefault ( deps , [ ] ) . append ( dep_dict ) #NEWLINE# #UNINDENT# return dep_dict