code: def functions_of(task):
      """Set of functions contained within nested task.
  
      Examples
      --------
      >>> from flash.core.serve.dag.utils_test import add, inc, mul
      >>> task = (add, (mul, 1, 2), (inc, 3))
      >>> sorted(functions_of(task), key=str)  # doctest: +ELLIPSIS
      [<function add at ...>, <function inc at ...>, <function mul at ...>]
  
      """
      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.extend(task[1:])
                  else:
                      new_work.extend(task)
          work = new_work
  
      return funcs
  
imports: import math
  import numbers
  from enum import Enum
  from flash.core.serve.dag.task import flatten, get, get_dependencies, ishashable, istask, reverse_dict, subs, toposort
  from flash.core.serve.dag.utils import key_split
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 8 for calling a global function with example usage: functions_of(task) and returns: funcs