def functions_of(task):
 funcs = set()
 work = [task]
 sequence_types = {list, tuple}
 while work:
  new_work = []
  for task in work:
   if (type(task) in sequence_types):
    if istask(task):
     funcs.add(unwrap_partial(task[0]))
     new_work += task[1:]
    else:
     new_work += task
  work = new_work
 return funcs

def functions_of ( task ) : funcs = set ( ) work = [ task ] sequence_types = { list , tuple } while work : new_work = [ ] for task in work : if ( type ( task ) in sequence_types ) : if istask ( task ) : funcs . add ( unwrap_partial ( task [ 0 ] ) ) new_work += task [ 1 : ] else : new_work += task work = new_work return funcs
set of functions contained within nested task examples .