def dealias(dsk, keys=None, dependencies=None):
 keys = (keys or set())
 if (not isinstance(keys, set)):
  keys = set(keys)
 if (not dependencies):
  dependencies = {k: get_dependencies(dsk, k) for k in dsk}
 aliases = set((k for (k, task) in dsk.items() if (ishashable(task) and (task in dsk))))
 dsk2 = inline(dsk, aliases, inline_constants=False)
 for k in aliases.difference(keys):
  del dsk2[k]
 return dsk2

def dealias ( dsk , keys = None , dependencies = None ) : keys = ( keys or set ( ) ) if ( not isinstance ( keys , set ) ) : keys = set ( keys ) if ( not dependencies ) : dependencies = { k : get_dependencies ( dsk , k ) for k in dsk } aliases = set ( ( k for ( k , task ) in dsk . items ( ) if ( ishashable ( task ) and ( task in dsk ) ) ) ) dsk2 = inline ( dsk , aliases , inline_constants = False ) for k in aliases . difference ( keys ) : del dsk2 [ k ] return dsk2
remove aliases from dask removes and renames aliases using inline .