def inline_functions(dsk, output, fast_functions=None, inline_constants=False, dependencies=None):
 if (not fast_functions):
  return dsk
 output = set(output)
 fast_functions = set(fast_functions)
 if (dependencies is None):
  dependencies = {k: get_dependencies(dsk, k) for k in dsk}
 dependents = reverse_dict(dependencies)
 keys = [k for (k, v) in dsk.items() if (istask(v) and functions_of(v).issubset(fast_functions) and dependents[k] and (k not in output))]
 if keys:
  dsk = inline(dsk, keys, inline_constants=inline_constants, dependencies=dependencies)
  for k in keys:
   del dsk[k]
 return dsk

def inline_functions ( dsk , output , fast_functions = None , inline_constants = False , dependencies = None ) : if ( not fast_functions ) : return dsk output = set ( output ) fast_functions = set ( fast_functions ) if ( dependencies is None ) : dependencies = { k : get_dependencies ( dsk , k ) for k in dsk } dependents = reverse_dict ( dependencies ) keys = [ k for ( k , v ) in dsk . items ( ) if ( istask ( v ) and functions_of ( v ) . issubset ( fast_functions ) and dependents [ k ] and ( k not in output ) ) ] if keys : dsk = inline ( dsk , keys , inline_constants = inline_constants , dependencies = dependencies ) for k in keys : del dsk [ k ] return dsk
inline cheap functions into larger operations examples .