def _task_names(mapping):
 (tasks, collections) = _sift_tasks(mapping)
 for collection in collections:
  module = mapping[collection]
  if hasattr(module, 'default'):
   tasks.append(collection)
  join = (lambda x: '.'.join((collection, x)))
  tasks.extend(map(join, _task_names(module)))
 return tasks

def _task_names ( mapping ) : ( tasks , collections ) = _sift_tasks ( mapping ) for collection in collections : module = mapping [ collection ] if hasattr ( module , 'default' ) : tasks . append ( collection ) join = ( lambda x : '.' . join ( ( collection , x ) ) ) tasks . extend ( map ( join , _task_names ( module ) ) ) return tasks
flatten & sort task names in a breadth-first fashion .