def DisplayAdUnitTree(root_ad_unit, ad_unit_tree, depth=0):
 print ('%s%s (%s)' % (GenerateTab(depth), root_ad_unit['name'], root_ad_unit['id']))
 if (root_ad_unit['id'] in ad_unit_tree):
  for child in ad_unit_tree[root_ad_unit['id']]:
   DisplayAdUnitTree(child, ad_unit_tree, (depth + 1))

def DisplayAdUnitTree ( root_ad_unit , ad_unit_tree , depth = 0 ) : print ( '%s%s (%s)' % ( GenerateTab ( depth ) , root_ad_unit [ 'name' ] , root_ad_unit [ 'id' ] ) ) if ( root_ad_unit [ 'id' ] in ad_unit_tree ) : for child in ad_unit_tree [ root_ad_unit [ 'id' ] ] : DisplayAdUnitTree ( child , ad_unit_tree , ( depth + 1 ) )
helper for displaying ad unit tree .