def DeepDependencyTargets(target_dicts, roots):
 dependencies = set()
 pending = set(roots)
 while pending:
  r = pending.pop()
  if (r in dependencies):
   continue
  dependencies.add(r)
  spec = target_dicts[r]
  pending.update(set(spec.get('dependencies', [])))
  pending.update(set(spec.get('dependencies_original', [])))
 return list((dependencies - set(roots)))

def DeepDependencyTargets ( target_dicts , roots ) : dependencies = set ( ) pending = set ( roots ) while pending : r = pending . pop ( ) if ( r in dependencies ) : continue dependencies . add ( r ) spec = target_dicts [ r ] pending . update ( set ( spec . get ( 'dependencies' , [ ] ) ) ) pending . update ( set ( spec . get ( 'dependencies_original' , [ ] ) ) ) return list ( ( dependencies - set ( roots ) ) )
returns the recursive list of target dependencies .