def dependency_dict(dsk):
 dep_dict = {}
 for key in dsk:
  deps = tuple(get_dependencies(dsk, key, True))
  dep_dict.setdefault(deps, []).append(key)
 return dep_dict

def dependency_dict ( dsk ) : dep_dict = { } for key in dsk : deps = tuple ( get_dependencies ( dsk , key , True ) ) dep_dict . setdefault ( deps , [ ] ) . append ( key ) return dep_dict
create a dict matching ordered dependencies to keys .