def inline_singleton_lists(dsk, dependencies=None):
 if (dependencies is None):
  dependencies = {k: get_dependencies(dsk, task=v) for (k, v) in dsk.items()}
 dependents = reverse_dict(dependencies)
 keys = [k for (k, v) in dsk.items() if (istask(v) and v and (v[0] is list) and (len(dependents[k]) == 1))]
 dsk = inline(dsk, keys, inline_constants=False)
 for k in keys:
  del dsk[k]
 return dsk

def inline_singleton_lists ( dsk , dependencies = None ) : if ( dependencies is None ) : dependencies = { k : get_dependencies ( dsk , task = v ) for ( k , v ) in dsk . items ( ) } dependents = reverse_dict ( dependencies ) keys = [ k for ( k , v ) in dsk . items ( ) if ( istask ( v ) and v and ( v [ 0 ] is list ) and ( len ( dependents [ k ] ) == 1 ) ) ] dsk = inline ( dsk , keys , inline_constants = False ) for k in keys : del dsk [ k ] return dsk
inline lists that are only used once .