nodes: 0, module; 1, function_definition; 2, function_name:printNetwork; 3, parameters; 4, block; 5, identifier:network; 6, expression_statement; 7, print_statement; 8, for_statement; 9, comment:"""
    Given a network, print out regions sorted by phase
    """; 10, string:"The network has"; 11, call; 12, string:"regions"; 13, identifier:p; 14, call; 15, block; 16, identifier:len; 17, argument_list; 18, identifier:range; 19, argument_list; 20, print_statement; 21, for_statement; 22, call; 23, call; 24, string:"=== Phase"; 25, identifier:p; 26, identifier:region; 27, call; 28, block; 29, attribute; 30, argument_list; 31, attribute; 32, argument_list; 33, attribute; 34, argument_list; 35, if_statement; 36, attribute; 37, identifier:values; 38, identifier:network; 39, identifier:getMaxPhase; 40, attribute; 41, identifier:values; 42, comparison_operator:network.getPhases(region.name)[0] == p; 43, block; 44, identifier:network; 45, identifier:regions; 46, identifier:network; 47, identifier:regions; 48, subscript; 49, identifier:p; 50, print_statement; 51, call; 52, integer:0; 53, string:"   "; 54, attribute; 55, attribute; 56, argument_list; 57, identifier:region; 58, identifier:name; 59, identifier:network; 60, identifier:getPhases; 61, attribute; 62, identifier:region; 63, identifier:name
code: def printNetwork(network):
    """
    Given a network, print out regions sorted by phase
    """
    print "The network has",len(network.regions.values()),"regions"
    for p in range(network.getMaxPhase()):
      print "=== Phase",p
      for region in network.regions.values():
        if network.getPhases(region.name)[0] == p:
          print "   ",region.name